diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-11-18 13:55:48 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-11-18 13:55:48 +0000 |
commit | 1ad125dd0d0e446f1c94e6abb988a67e05ca1be2 (patch) | |
tree | 7cd6f64775d97431250d0ba9f99534e813a39883 | |
parent | d5d0ec771afed58e91429cfa626a1ee96faa92fb (diff) | |
parent | 0909d9ed213de885c9a18b759d3ccbcc3e81ce85 (diff) |
Merge branch '1968-disable-category-tag-field' into rails-3-develop
-rw-r--r-- | app/views/admin_public_body_categories/_form.html.erb | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/app/views/admin_public_body_categories/_form.html.erb b/app/views/admin_public_body_categories/_form.html.erb index b0778d371..1f033ac9b 100644 --- a/app/views/admin_public_body_categories/_form.html.erb +++ b/app/views/admin_public_body_categories/_form.html.erb @@ -44,16 +44,23 @@ end </div> </div> -<% if PublicBody.find_by_tag(@category.category_tag).count == 0 or @category.errors.messages.keys.include?(:category_tag) %> - <h3>Common Fields</h3> +<h3>Common Fields</h3> - <div class="control-group"> - <label for="public_body_category_category_tag" class="control-label">Category tag</label> - <div class="controls"> - <%= f.text_field :category_tag, :class => "span4" %> - </div> - </div> -<% end %> +<div class="control-group"> + <label for="public_body_category_category_tag" class="control-label">Category tag</label> + <div class="controls"> + <% if PublicBody.find_by_tag(@category.category_tag).count == 0 or + @category.errors.messages.keys.include?(:category_tag) %> + <%= f.text_field :category_tag, :class => "span4" %> + <% else %> + <%= f.text_field :category_tag, :class => "span4", :disabled => true %> + <span class="help-block"> + This Category already has authorities assigned to it so the tags + cannot be modified. + </span> + <% end %> + </div> +</div> <h3>Headings</h3> <div class="control-group"> |