Skip to content

Commit

Permalink
Make sure fields with errors are highlighted in the default locale.
Browse files Browse the repository at this point in the history
  • Loading branch information
crowbot committed Mar 5, 2015
1 parent 533e99b commit ac207f7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/views/admin_public_body_categories/_locale_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@
<%= t.hidden_field :locale, :value => locale.to_s %>
<label for="<%= form_tag_id(t.object_name, :title, locale) %>" class="control-label">Title</label>
<div class="controls">
<% if locale == I18n.default_locale && t.object.errors[:title] %>
<span class="fieldWithErrors">
<% end %>
<%= t.text_field :title, :id => form_tag_id(t.object_name, :title, locale), :class => "span4" %>
<% if locale == I18n.default_locale && t.object.errors[:title] %>
</span>
<%end %>
</div>
</div>
<div class="control-group">
<label for="<%= form_tag_id(t.object_name, :description, locale) %>" class="control-label">Description</label>
<div class="controls">
<% if locale == I18n.default_locale && t.object.errors[:description] %>
<span class="fieldWithErrors">
<% end %>
<%= t.text_field :description, :id => form_tag_id(t.object_name, :description, locale), :class => "span4" %>
<% if locale == I18n.default_locale && t.object.errors[:description] %>
</span>
<%end %>
</div>
</div>
</div>

0 comments on commit ac207f7

Please sign in to comment.