diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin_censor_rule/_form.html.erb | 2 | ||||
-rw-r--r-- | app/views/admin_censor_rule/_show.html.erb | 14 | ||||
-rw-r--r-- | app/views/admin_censor_rule/new.html.erb | 6 | ||||
-rw-r--r-- | app/views/admin_general/index.html.erb | 3 | ||||
-rw-r--r-- | app/views/admin_public_body_categories/_form.html.erb | 25 | ||||
-rw-r--r-- | app/views/admin_public_body_categories/_heading_list.html.erb | 9 | ||||
-rw-r--r-- | app/views/admin_public_body_categories/edit.html.erb | 49 | ||||
-rw-r--r-- | app/views/admin_public_body_categories/new.html.erb | 14 | ||||
-rw-r--r-- | app/views/admin_public_body_headings/edit.html.erb | 53 | ||||
-rw-r--r-- | app/views/admin_public_body_headings/new.html.erb | 14 | ||||
-rw-r--r-- | app/views/request/new.html.erb | 2 | ||||
-rw-r--r-- | app/views/request/select_authority.html.erb | 6 |
12 files changed, 107 insertions, 90 deletions
diff --git a/app/views/admin_censor_rule/_form.html.erb b/app/views/admin_censor_rule/_form.html.erb index 5035238d6..3f602d2e4 100644 --- a/app/views/admin_censor_rule/_form.html.erb +++ b/app/views/admin_censor_rule/_form.html.erb @@ -4,11 +4,9 @@ <%=_("Applies to")%> <% unless info_request.nil? %> <%= request_both_links(info_request) %> - <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %> <% end %> <% unless user.nil? %> <%= user_both_links(user) %> - <%= hidden_field 'censor_rule', 'user_id', { :value => user.id } %> <% end %> </div> diff --git a/app/views/admin_censor_rule/_show.html.erb b/app/views/admin_censor_rule/_show.html.erb index 0d4cece93..46904b3b9 100644 --- a/app/views/admin_censor_rule/_show.html.erb +++ b/app/views/admin_censor_rule/_show.html.erb @@ -1,18 +1,17 @@ - <% if censor_rules.size > 0 %> <table class="table table-condensed"> <tr> <th>Id</th> - <% for column in CensorRule.content_columns %> + <% CensorRule.content_columns.each do |column| %> <th><%= column.human_name %></th> <% end %> <th>Actions</th> </tr> - <% for censor_rule in censor_rules %> + <% censor_rules.each do |censor_rule| %> <tr class="<%= cycle('odd', 'even') %>"> <td><%=h censor_rule.id %></td> - <% for column in CensorRule.content_columns.map { |c| c.name } %> + <% CensorRule.content_columns.map { |c| c.name }.each do |column| %> <td><%=h censor_rule.send(column) %></td> <% end %> <td> @@ -26,10 +25,11 @@ <% end %> <% if defined? info_request %> - <%= link_to "New censor rule (for this request only)", admin_rule_new_path(:info_request_id => info_request.id), :class => "btn btn-info" %> + <%= link_to "New censor rule", new_admin_info_request_censor_rule_path(info_request), :class => "btn btn-info" %> + <span class="label label-info">for this request only</span> <% end %> <% if defined? user %> - <%= link_to "New censor rule", admin_rule_new_path(:user_id => user.id), :class => "btn btn-info" %> <span class="label label-info">for all requests by this user</span> + <%= link_to "New censor rule", new_admin_user_censor_rule_path(user), :class => "btn btn-info" %> + <span class="label label-info">for all requests by this user</span> <% end %> - diff --git a/app/views/admin_censor_rule/new.html.erb b/app/views/admin_censor_rule/new.html.erb index 77d22990c..26b3212be 100644 --- a/app/views/admin_censor_rule/new.html.erb +++ b/app/views/admin_censor_rule/new.html.erb @@ -1,11 +1,11 @@ <% @title = _('New censor rule') %> -<h1><%=@title%></h1> +<h1><%= @title %></h1> -<%= form_tag admin_rule_create_path, :class => "form form-horizontal" do %> +<%= form_for @censor_rule, :url => @form_url, :class => "form form-horizontal" do %> <%= render :partial => 'form', :locals => { :info_request => @info_request, :user => @censor_user } %> + <div class="form-actions"> <%= submit_tag "Create", :class => "btn btn-primary" %> </div> <% end %> - diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb index a1f2e1d2d..ba9396ceb 100644 --- a/app/views/admin_general/index.html.erb +++ b/app/views/admin_general/index.html.erb @@ -202,8 +202,11 @@ <div id="update-authorities" class="accordion-body collapse"> <% for @change_request in @body_update_requests %> <%= render :partial => 'change_request_summary' %> + <%= form_tag admin_change_request_update_path(@change_request), :class => "form form-horizontal" do %> + <%= submit_tag 'Close', :class => "btn btn-danger" %> <%= link_to("Close and respond", admin_change_request_edit_path(@change_request), :class => 'btn') %> <%= link_to("Make update", admin_body_edit_path(@change_request.public_body, :change_request_id => @change_request.id), :class => 'btn btn-primary') %> + <% end %> <% end %> </div> </div> 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"> diff --git a/app/views/admin_public_body_categories/_heading_list.html.erb b/app/views/admin_public_body_categories/_heading_list.html.erb index 4bd8bdc90..f92f0c9b0 100644 --- a/app/views/admin_public_body_categories/_heading_list.html.erb +++ b/app/views/admin_public_body_categories/_heading_list.html.erb @@ -1,9 +1,12 @@ <div class="accordion" id="category_list"> - <% for heading in category_headings %> - <div class="accordion-group" data-id="headings_<%=heading.id%>"> + <% category_headings.each do |heading| %> + <div class="accordion-group" data-id="headings_<%= heading.id %>"> <div class="accordion-heading accordion-toggle row"> <span class="item-title span6"> - <a href="#heading_<%=heading.id%>_categories" data-toggle="collapse" data-parent="#categories" ><%= chevron_right %></a> + <a href="#heading_<%= heading.id %>_categories" data-toggle="collapse" data-parent="#categories"> + <span class="badge"><%= heading.public_body_categories.size %></span> + <%= chevron_right %> + </a> <strong><%= link_to(heading.name, edit_admin_heading_path(heading), :title => "view full details") %></strong> </span> </div> diff --git a/app/views/admin_public_body_categories/edit.html.erb b/app/views/admin_public_body_categories/edit.html.erb index 95988d688..f83d0768d 100644 --- a/app/views/admin_public_body_categories/edit.html.erb +++ b/app/views/admin_public_body_categories/edit.html.erb @@ -1,30 +1,35 @@ -<h1><%=@title%></h1> +<h1><%= @title %></h1> <div class="row"> - <div class="span8"> - <div id="public_body_category_form"> - <%= form_for @category, :url => admin_category_path(@category), :html => { :class => "form form-horizontal" } do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> - <div class="form-actions"> - <%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %></p> - </div> - <% end %> - </div> -</div> + <div class="span8"> + <div id="public_body_category_form"> + <%= form_for @category, :url => admin_category_path(@category), :html => { :class => "form form-horizontal" } do |f| %> + <%= render :partial => 'form', :locals => { :f => f } %> -<div class="row"> - <div class="span8 well"> - <%= link_to 'List all', admin_categories_path, :class => "btn" %> + <div class="form-actions"> + <%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %> + <%= link_to 'List all', admin_categories_path, :class => "btn" %> + </div> + <% end %> + </div> </div> </div> -<% if @tagged_public_bodies.empty? %> - <div class="row"> - <div class="span8"> - <%= form_tag(admin_category_path(@category), :method => 'delete', :class => "form form-inline") do %> - <%= hidden_field_tag(:public_body_id, { :value => @category.id } ) %> - <%= submit_tag "Destroy #{@category.title}", :title => @category.title, :class => "btn btn-danger" %> (this is permanent!) - <% end %> +<hr /> + +<div class="row"> + <div class="span12"> + <div class="well"> + <%= form_for @category, :url => admin_category_path(@category), :method => 'delete', :class => "form form-inline" do |f| %> + <%= f.submit "Destroy #{ @category.title }", + :title => @category.title, + :class => "btn btn-danger", + :confirm => 'Are you sure?' %> + <span class="help-block"> + Destroying a category does not destroy the public authorities + associated with the category. + </span> + <% end %> </div> </div> -<% end %> +</div> diff --git a/app/views/admin_public_body_categories/new.html.erb b/app/views/admin_public_body_categories/new.html.erb index 8b1b1103f..ed9f06d7c 100644 --- a/app/views/admin_public_body_categories/new.html.erb +++ b/app/views/admin_public_body_categories/new.html.erb @@ -1,21 +1,17 @@ <% @title = 'New category' %> -<h1><%=@title%></h1> +<h1><%= @title %></h1> <div class="row"> <div class="span8"> <div id="public_category_form"> - <%= form_for @category, :url => admin_categories_path, :html => {:class => "form form-horizontal"} do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> + <%= form_for @category, :url => admin_categories_path, :html => { :class => "form form-horizontal" } do |f| %> + <%= render :partial => 'form', :locals => { :f => f } %> <div class="form-actions"> <%= f.submit "Create", :class => "btn btn-primary" %> + <%= link_to 'List all', admin_categories_path, :class => "btn" %> </div> - <% end %> - <div class="row"> - <div class="span8 well"> - <%= link_to 'List all', admin_categories_path, :class => "btn" %> - </div> - </div> + <% end %> </div> </div> </div> diff --git a/app/views/admin_public_body_headings/edit.html.erb b/app/views/admin_public_body_headings/edit.html.erb index eff89285a..d4bc02562 100644 --- a/app/views/admin_public_body_headings/edit.html.erb +++ b/app/views/admin_public_body_headings/edit.html.erb @@ -1,30 +1,39 @@ -<h1><%=@title%></h1> +<h1><%= @title %></h1> <div class="row"> - <div class="span8"> - <div id="public_body_heading_form"> - <%= form_for @heading, :url => admin_heading_path(@heading), :html => { :class => "form form-horizontal" } do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> - <div class="form-actions"> - <%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %></p> - </div> - <% end %> - </div> -</div> + <div class="span8"> + <div id="public_body_heading_form"> + <%= form_for @heading, :url => admin_heading_path(@heading), :html => { :class => "form form-horizontal" } do |f| %> + <%= render :partial => 'form', :locals => { :f => f } %> -<div class="row"> - <div class="span8 well"> - <%= link_to 'List all', admin_categories_path, :class => "btn" %> - </div> + <div class="form-actions"> + <%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %> + <%= link_to 'List all', admin_categories_path, :class => "btn" %> + </div> + <% end %> + </div> + </div> </div> -<% if @heading.public_body_categories.empty? %> - <div class="row"> - <div class="span8"> - <%= form_tag(admin_heading_path(@heading), :method => 'delete', :class => "form form-inline") do %> - <%= hidden_field_tag(:public_body_heading_id, { :value => @heading.id } ) %> - <%= submit_tag "Destroy #{@heading.name}", :name => @heading.name, :class => "btn btn-danger" %> (this is permanent!) +<hr /> + +<div class="row"> + <div class="span12"> + <div class="well"> + <%= form_for @heading, :url => admin_heading_path(@heading), :method => 'delete', :class => "form form-inline" do |f| %> + <%= f.submit "Destroy #{ @heading.name }", + :name => @heading.name, + :class => "btn btn-danger", + :confirm => 'Are you sure?' %> + <span class="help-block"> + <ul> + <li>Destroying a category heading only destroys the heading itself.</li> + <li>Child categories assigned to another heading remain assigned to the other heading.</li> + <li>Child categories with no other heading become "Categories with no heading".</li> + <li>Public authorities remain assigned to the categories.</li> + </ul> + </span> <% end %> </div> </div> -<% end %> +</div> diff --git a/app/views/admin_public_body_headings/new.html.erb b/app/views/admin_public_body_headings/new.html.erb index 91d5d4a9d..c6fe514b0 100644 --- a/app/views/admin_public_body_headings/new.html.erb +++ b/app/views/admin_public_body_headings/new.html.erb @@ -1,21 +1,17 @@ <% @title = 'New category heading' %> -<h1><%=@title%></h1> +<h1><%= @title %></h1> <div class="row"> <div class="span8"> <div id="public_heading_form"> - <%= form_for @heading, :url => admin_headings_path, :html => {:class => "form form-horizontal"} do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> + <%= form_for @heading, :url => admin_headings_path, :html => { :class => "form form-horizontal" } do |f| %> + <%= render :partial => 'form', :locals => { :f => f } %> <div class="form-actions"> <%= f.submit "Create", :class => "btn btn-primary" %> + <%= link_to 'List all', admin_categories_path, :class => "btn" %> </div> - <% end %> - <div class="row"> - <div class="span8 well"> - <%= link_to 'List all', admin_categories_path, :class => "btn" %> - </div> - </div> + <% end %> </div> </div> </div> diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 178ef7638..51224129e 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -36,7 +36,7 @@ <% else %> <% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name)) %> <% end %> - <h1><%= _('Ask for Information') %></h1> + <h1><%= _('2. Ask for Information') %></h1> <% if @existing_request %> <div class="errorExplanation" id="errorExplanation"><ul> diff --git a/app/views/request/select_authority.html.erb b/app/views/request/select_authority.html.erb index 731049d69..134648264 100644 --- a/app/views/request/select_authority.html.erb +++ b/app/views/request/select_authority.html.erb @@ -12,7 +12,7 @@ <% @title = _("Select the authority to write to") %> -<h1 style="clear: left"><%= _('Select an authority') %></h1> +<h1 style="clear: left"><%= _('1. Select an authority') %></h1> <div id="authority_selection"> <%= form_tag select_authority_path, { :id => 'search_form', :method => 'get' } do %> @@ -49,9 +49,9 @@ </div> <div id="select_authority_help"> - <p class="info"><%= _("Can’t find an authority?") %></p> + <p class="info"><%= _("Can't find the one you want?") %></p> <p class="actions"> - <%= raw _('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>', + <%= raw _('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.', :browse_url => list_public_bodies_default_path.html_safe, :add_url => help_requesting_path(:anchor => 'missing_body') ).html_safe %> |