5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 02:01:42 +00:00

telefonos

This commit is contained in:
f 2020-08-20 21:08:44 -03:00
parent 0f87a0bef2
commit b3b685232e
4 changed files with 12 additions and 3 deletions

View file

@ -40,8 +40,6 @@ class MetadataSlug < MetadataTemplate
# Devuelve el título a menos que sea privado y no esté vacío
def title
unless post.title.private? && !post.title.try(:value).try(:blank?)
post.title.try(:value).try(:to_s)
end
post.title.try(:value).try(:to_s) unless post.title.private? && !post.title.try(:value).try(:blank?)
end
end

View file

@ -0,0 +1 @@
class MetadataTel < MetadataNumber; end

View file

@ -0,0 +1,4 @@
%tr{ id: attribute }
%th= post_label_t(attribute, post: post)
%td{ dir: dir, lang: locale }
%a{ href: "tel:#{metadata.value}" }= metadata.value

View file

@ -0,0 +1,6 @@
.form-group
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
= telephone_field 'post', attribute, value: metadata.value,
**field_options(attribute, metadata)
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata