Skip to content

Commit

Permalink
Update template form for improved accessibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trey Terrell committed Aug 14, 2015
1 parent af3b28f commit 8f3c5ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 6 additions & 12 deletions app/views/admin/form_templates/_form.html.erb
Expand Up @@ -3,18 +3,12 @@
<%= f.input :title %>
<%= f.simple_fields_for :properties do |p| %>
<div id="<%= p.object.name %>" class="panel panel-default template-property">
<div class="panel-heading">
<div class="panel-title">
<%= p.object.name %>
</div>
</div>
<div class="panel-body">
<%= p.input :visible, :label => "Show" %>
<%= p.input :required %>
<%= p.input :name, :as => :hidden %>
</div>
</div>
<fieldset id="<%= p.object.name.underscore %>" class="template-property">
<legend><%= p.object.name %></legend>
<%= p.input :visible, :label => "Show" %>
<%= p.input :required %>
<%= p.input :name, :as => :hidden %>
</fieldset>
<% end %>
<%= f.submit "Save Template" %>
Expand Down
2 changes: 1 addition & 1 deletion spec/features/template_management_spec.rb
Expand Up @@ -106,7 +106,7 @@ def navigate_to_template_admin_path
def checkbox_states
checkboxes = HashWithIndifferentAccess.new
all('.template-property').each do |el|
checkboxes[el.find(".panel-title").text] = el.find(".form_template_properties_visible input[type=checkbox]")
checkboxes[el.find("legend").text] = el.find(".form_template_properties_visible input[type=checkbox]")
end

checkboxes
Expand Down

0 comments on commit 8f3c5ba

Please sign in to comment.