diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-03-05 17:14:46 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-03-18 12:38:00 +0000 |
commit | d748691956dc082ec5b2b520397e7702eaf7a488 (patch) | |
tree | 6cc4e1aa34bb056d5b630a7a8844b49a32f64ad3 | |
parent | f8a30c73ca68f4b9f8595b7ea3065df1d7a673dc (diff) |
Make sure fields with errors are highlighted in the default locale.
-rw-r--r-- | app/views/admin_public_body_categories/_locale_fields.html.erb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/views/admin_public_body_categories/_locale_fields.html.erb b/app/views/admin_public_body_categories/_locale_fields.html.erb index 0d9a2f207..aff001098 100644 --- a/app/views/admin_public_body_categories/_locale_fields.html.erb +++ b/app/views/admin_public_body_categories/_locale_fields.html.erb @@ -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].any? %> + <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].any? %> + </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].any? %> + <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].any? %> + </span> + <%end %> </div> </div> </div> |