5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 10:16:22 +00:00

autofocus

This commit is contained in:
f 2019-09-12 15:11:39 -03:00
parent 55a3978a40
commit 6434d1c896
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
3 changed files with 5 additions and 2 deletions

View file

@ -65,6 +65,7 @@ module ApplicationHelper
{
class: "form-control #{invalid(metadata.post, attribute)}",
required: metadata.required,
autofocus: (metadata.post.attributes.first == attribute),
aria: {
describedby: id_for_help(attribute),
required: metadata.required

View file

@ -29,7 +29,8 @@
= render("posts/attributes/#{type}",
post: post, attribute: attribute,
metadata: metadata, site: site)
metadata: metadata, site: site,
autofocus: (post.attributes.first == attribute))
-# Botones de guardado
= render 'posts/submit', site: site, post: post

View file

@ -1,7 +1,8 @@
.form-check
= check_box_tag "post[#{attribute}", metadata.value, metadata.value,
class: "form-check-input #{invalid(post, attribute)}",
aria: { describedby: id_for_help(attribute) }
aria: { describedby: id_for_help(attribute) },
autofocus: autofocus
= label_tag "post_#{attribute}", post_label_t(attribute, post: post),
class: 'form-check-label'