diff options
22 files changed, 156 insertions, 174 deletions
diff --git a/app/views/admin_censor_rule/_show.rhtml b/app/views/admin_censor_rule/_show.rhtml index baa93e832..0d4cece93 100644 --- a/app/views/admin_censor_rule/_show.rhtml +++ b/app/views/admin_censor_rule/_show.rhtml @@ -16,7 +16,7 @@ <td><%=h censor_rule.send(column) %></td> <% end %> <td> - <%= link_to "Edit", '../../censor/edit/' + censor_rule.id.to_s %> + <%= link_to "Edit", admin_rule_edit_path(censor_rule) %> </td> </tr> <% end %> @@ -26,10 +26,10 @@ <% end %> <% if defined? info_request %> - <%= link_to "New censor rule (for this request only)", "../../censor/new?info_request_id=#{info_request.id}", :class => "btn btn-info" %> + <%= link_to "New censor rule (for this request only)", admin_rule_new_path(:info_request_id => info_request.id), :class => "btn btn-info" %> <% end %> <% if defined? user %> - <%= link_to "New censor rule", "../../censor/new?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", admin_rule_new_path(:user_id => user.id), :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/edit.rhtml b/app/views/admin_censor_rule/edit.rhtml index e34e022a0..4eb99ce57 100644 --- a/app/views/admin_censor_rule/edit.rhtml +++ b/app/views/admin_censor_rule/edit.rhtml @@ -2,15 +2,17 @@ <h1><%=@title%></h1> -<% form_tag '../update/' + @censor_rule.id.to_s do %> +<% form_tag admin_rule_update_path(@censor_rule), :class => "form form-horizontal" do %> <%= render :partial => 'form', :locals => { :info_request => @censor_rule.info_request, :user => @censor_rule.user } %> - <p><%= submit_tag 'Save', :accesskey => 's' %></p> + <div class="form-actions"> + <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %> + </div> <% end %> -<% form_tag('../destroy/' + @censor_rule.id.to_s) do %> - <p> - <%= hidden_field_tag(:censor_rule_id, @censor_rule.id) %> - Permanent! --> <%= submit_tag "Destroy rule" %> - </p> +<% form_tag admin_rule_destroy_path(@censor_rule), :class => "form form-horizontal" do %> + <%= hidden_field_tag(:censor_rule_id, @censor_rule.id) %> + <div class="form-actions"> + Permanent! --> <%= submit_tag "Destroy rule", :class => "btn btn-primary" %> + </div> <% end %> diff --git a/app/views/admin_censor_rule/new.rhtml b/app/views/admin_censor_rule/new.rhtml index 6cac58b3b..efa96700a 100644 --- a/app/views/admin_censor_rule/new.rhtml +++ b/app/views/admin_censor_rule/new.rhtml @@ -2,7 +2,7 @@ <h1><%=@title%></h1> -<% form_tag 'create', :class => "form form-horizontal" do %> +<% form_tag admin_rule_create_path, :class => "form form-horizontal" do %> <%= render :partial => 'form', :locals => { :info_request => @info_request, :user => @user } %> <div class="form-actions"> <%= submit_tag "Create", :class => "btn btn-primary" %> diff --git a/app/views/admin_general/index.rhtml b/app/views/admin_general/index.rhtml index 74d0f92f8..db1146302 100644 --- a/app/views/admin_general/index.rhtml +++ b/app/views/admin_general/index.rhtml @@ -37,9 +37,9 @@ <tr> <td> <% if message.get_body_for_quoting.strip.size == 0 %> - <%= link_to "(no body)", "request/show_raw_email/" + message.raw_email_id.to_s %> + <%= link_to "(no body)", admin_request_show_raw_email_path(message.raw_email_id) %> <% else %> - <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %> + <%= link_to excerpt(message.get_body_for_quoting, "", 60), admin_request_show_raw_email_path(message.raw_email_id) %> <% end %> </td> <td class="span2"> diff --git a/app/views/admin_general/timeline.rhtml b/app/views/admin_general/timeline.rhtml index 0c5f24279..6f153504e 100644 --- a/app/views/admin_general/timeline.rhtml +++ b/app/views/admin_general/timeline.rhtml @@ -1,12 +1,12 @@ <% @title = "Timeline" %> <div class="btn-toolbar"> <div class="btn-group"> - <a class="btn" href="?hour=1">Hour</a> - <a class="btn" href="?day=1">Day</a> - <a class="btn" href="?">2 days</a> - <a class="btn" href="?week=1">Week</a> - <a class="btn" href="?month=1">Month</a> - <a class="btn" href="?all=1">All time</a> + <%= link_to "Hour", admin_timeline_path(:hour => 1), :class => "btn" %> + <%= link_to "Day", admin_timeline_path(:day => 1), :class => "btn" %> + <%= link_to "2 days", admin_timeline_path, :class => "btn" %> + <%= link_to "Week", admin_timeline_path(:week => 1), :class => "btn" %> + <%= link_to "Month", admin_timeline_path(:month => 1), :class => "btn" %> + <%= link_to "All time", admin_timeline_path(:all => 1), :class => "btn" %> </div> </div> <div class="row"> diff --git a/app/views/admin_public_body/_locale_selector.rhtml b/app/views/admin_public_body/_locale_selector.rhtml deleted file mode 100644 index 5ef79f2df..000000000 --- a/app/views/admin_public_body/_locale_selector.rhtml +++ /dev/null @@ -1,10 +0,0 @@ -<div id="locale_switcher"> -<%= _('Edit language version:') %> -<% for possible_locale in @locales %> - <% if possible_locale == @locale %> - <%= possible_locale %> - <% else %> - <a href="?show_locale=<%=possible_locale%>"><%= possible_locale %></a> - <% end %> -<% end %> -</div> diff --git a/app/views/admin_public_body/edit.rhtml b/app/views/admin_public_body/edit.rhtml index 629f64257..eb0c45f19 100644 --- a/app/views/admin_public_body/edit.rhtml +++ b/app/views/admin_public_body/edit.rhtml @@ -3,7 +3,7 @@ <div class="row"> <div class="span8"> <div id="public_body_form"> - <% form_for @public_body, :url => "../update/#{@public_body.id}", :html => { :class => "form form-horizontal" } do |f| %> + <% form_for @public_body, :url => admin_body_update_path(@public_body), :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> @@ -13,14 +13,14 @@ <div class="row"> <div class="span8"> <div class="well"> - <%= link_to 'Show', "../show/#{@public_body.id}", :class => "btn" %> - <%= link_to 'List all', '../list', :class => "btn" %> + <%= link_to 'Show', admin_body_show_path(@public_body), :class => "btn" %> + <%= link_to 'List all', admin_body_list_path, :class => "btn" %> </div> </div> </div> <% if @public_body.info_requests.empty? %> - <% form_tag("../destroy/#{@public_body.id}", :class => "form form-inline") do %> + <% form_tag(admin_body_destroy_path(@public_body), :class => "form form-inline") do %> <%= hidden_field_tag(:public_body_id, { :value => @public_body.id } ) %> <%= submit_tag _("Destroy {{name}}", :name => @public_body.name), :class => "btn btn-danger" %> (this is permanent!) <% end %> diff --git a/app/views/admin_public_body/list.rhtml b/app/views/admin_public_body/list.rhtml index b4328bcad..acc05f50d 100644 --- a/app/views/admin_public_body/list.rhtml +++ b/app/views/admin_public_body/list.rhtml @@ -8,10 +8,10 @@ <div class="btn-toolbar"> <div class="btn-group"> - <%= link_to 'New public authority', 'new', :class => "btn btn-primary" %> + <%= link_to 'New public authority', admin_body_new_path, :class => "btn btn-primary" %> </div> <div class="btn-group"> - <%= link_to 'Import from CSV file', 'import_csv', :class => "btn btn-warning" %> + <%= link_to 'Import from CSV file', admin_body_import_csv_path, :class => "btn btn-warning" %> </div> </div> @@ -19,7 +19,7 @@ <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %> <%= submit_tag "Search", :class => "btn" %> <% if !@query.nil? %> - <%= link_to 'Show all', 'list', :class => "btn" %> + <%= link_to 'Show all', admin_body_list_path, :class => "btn" %> <% end %><br> (substring search in names and emails; exact match of tags) <% end %> diff --git a/app/views/admin_public_body/new.rhtml b/app/views/admin_public_body/new.rhtml index e03ebab00..6ead1810c 100644 --- a/app/views/admin_public_body/new.rhtml +++ b/app/views/admin_public_body/new.rhtml @@ -4,7 +4,7 @@ <div class="row"> <div class="span8"> <div id="public_body_form"> - <% form_for :public_body, @public_body, :url => "create", :html => {:class => "form form-horizontal"} do |f| %> + <% form_for :public_body, @public_body, :url => admin_body_create_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" %> diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml index c59b90697..cfb10b24e 100644 --- a/app/views/admin_public_body/show.rhtml +++ b/app/views/admin_public_body/show.rhtml @@ -45,7 +45,7 @@ </tr> </tbody> </table> -<%= link_to _("Edit"), "../edit/#{@public_body.id}", :class => "btn btn-primary" %> +<%= link_to _("Edit"), admin_body_edit_path(@public_body), :class => "btn btn-primary" %> <% unless @public_body.url_name.nil? %> <%=link_to _("Public page"), public_body_path(@public_body), :class => "btn" %> <% else %> diff --git a/app/views/admin_request/_incoming_message_actions.rhtml b/app/views/admin_request/_incoming_message_actions.rhtml index 0ebeb5f9b..84c29dcc3 100644 --- a/app/views/admin_request/_incoming_message_actions.rhtml +++ b/app/views/admin_request/_incoming_message_actions.rhtml @@ -1,6 +1,6 @@ <fieldset class="form-horizontal"> <legend>Actions</legend> - <% form_tag '../redeliver_incoming', :class => "form form-inline" do %> + <% form_tag admin_request_redeliver_incoming_path, :class => "form form-inline" do %> <div class="control-group"> <label class="control-label" for="url_title_<%= incoming_message.id %>">Redeliver message to one or more other requests</label> <div class="controls"> @@ -18,11 +18,11 @@ <div class="control-group"> <label class="control-label">Generate FOI officer upload URL</label> <div class="controls"> - <%= link_to 'Generate and take me there', "../generate_upload_url/#{incoming_message.info_request.id}?incoming_message_id=#{incoming_message.id}", :class => "btn" %> + <%= link_to 'Generate and take me there', admin_request_generate_upload_url_path(incoming_message.info_request, :incoming_message_id => incoming_message.id), :class => "btn" %> </div> </div> - <% form_tag '../destroy_incoming', :class => "form form-inline" do %> + <% form_tag admin_request_destroy_incoming_path, :class => "form form-inline" do %> <div class="control-group"> <label class="control-label" for="destroy_message_<%= incoming_message.id %>">Destroy message</label> <div class="controls"> @@ -37,7 +37,7 @@ <div class="control-group"> <label class="control-label">Inspect email</label> <div class="controls"> - <%= link_to "View raw email", "../show_raw_email/#{incoming_message.raw_email_id}", :class => "btn" %> + <%= link_to "View raw email", admin_request_show_raw_email_path(incoming_message.raw_email_id), :class => "btn" %> </div> </div> <% end %> diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.rhtml index 11c017aab..1cf5d4f12 100644 --- a/app/views/admin_request/edit.rhtml +++ b/app/views/admin_request/edit.rhtml @@ -2,7 +2,7 @@ <%= error_messages_for 'info_request' %> -<% form_tag '../update/' + @info_request.id.to_s do %> +<% form_tag admin_request_update_path(@info_request) do %> <p><label for="info_request_title"><strong>Title</strong></label> (warning: editing this will break URLs right now)<br/> <%= text_field 'info_request', 'title', :size => 50 %></p> @@ -43,13 +43,13 @@ <% end %> <p> -<%= link_to 'Show', '../show/' + @info_request.id.to_s %> | -<%= link_to 'List all', '../list' %> +<%= link_to 'Show', admin_request_show_path(@info_request) %> | +<%= link_to 'List all', admin_request_list_path %> </p> <hr> -<% form_tag '../destroy/' + @info_request.id.to_s do %> +<% form_tag admin_request_destroy_path(@info_request) do %> <p> <strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destroy request entirely' %> <br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It diff --git a/app/views/admin_request/edit_comment.rhtml b/app/views/admin_request/edit_comment.rhtml index a79c096e3..07031f5f2 100644 --- a/app/views/admin_request/edit_comment.rhtml +++ b/app/views/admin_request/edit_comment.rhtml @@ -2,7 +2,7 @@ <%= error_messages_for 'comment' %> -<% form_tag '../update_comment/' + @comment.id.to_s do %> +<% form_tag admin_request_update_comment_path(@comment) do %> <p><label for="comment_body">Body of annotation</label><br/> <%= text_area 'comment', 'body', :rows => 10, :cols => 60 %></p> @@ -16,7 +16,7 @@ <% end %> <p> -<%= link_to 'Show', '../show/' + @comment.info_request.id.to_s %> | -<%= link_to 'List all', '../list' %> +<%= link_to 'Show', admin_request_show_path(@comment.info_request) %> | +<%= link_to 'List all', admin_request_list_path %> </p> diff --git a/app/views/admin_request/edit_outgoing.rhtml b/app/views/admin_request/edit_outgoing.rhtml index 4932cb52f..ab209be0d 100644 --- a/app/views/admin_request/edit_outgoing.rhtml +++ b/app/views/admin_request/edit_outgoing.rhtml @@ -2,7 +2,7 @@ <%= error_messages_for 'outgoing_message' %> -<% form_tag '../update_outgoing/' + @outgoing_message.id.to_s do %> +<% form_tag admin_request_update_outgoing_path(@outgoing_message) do %> <p><label for="outgoing_message_body">Body of message</label><br/> <%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %></p> @@ -18,11 +18,11 @@ <% end %> <p> -<%= link_to 'Show', '../show/' + @outgoing_message.info_request.id.to_s %> | -<%= link_to 'List all', '../list' %> +<%= link_to 'Show', admin_request_show_path(@outgoing_message.info_request) %> | +<%= link_to 'List all', admin_request_list_path %> </p> -<% form_tag '../destroy_outgoing' do %> +<% form_tag admin_request_destroy_outgoing_path do %> <div> <%= hidden_field_tag 'outgoing_message_id', @outgoing_message.id %> Warning, this is permanent! ---> diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml index 72552a588..04695a761 100644 --- a/app/views/admin_request/show.rhtml +++ b/app/views/admin_request/show.rhtml @@ -2,52 +2,52 @@ <h1><%=@title%></h1> -<% form_tag '../move_request', { :class => "form form-horizontal" } do %> +<% form_tag admin_request_move_request_path, { :class => "form form-horizontal" } do %> <%= hidden_field_tag 'info_request_id', @info_request.id %> - <div class="accordion" id="info_request"> - <div class="accordion-group"> - <div class="accordion-heading"> - <span class="item-title"> - <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request"><i class="icon-chevron-down"></i></a>Request metadata - </span> - </div> - <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in"> - <table class="table table-striped table-condensed"> - <thead> - <tr> - <td colspan="2"> - <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %> - </td> - </tr> - </thead> - <tbody> - <tr> - <th>Public page:</th> - <td><%= link_to request_url(@info_request), request_path(@info_request) %></td> - </tr> - <% @info_request.for_admin_column do |name, value, type, column_name|%> - <tr> - <td> - <b><%= name %>:</b> - </td> - <td> - <% if type == 'datetime' %> - <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %> - (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>) - <% else %> - <%= h value %> - <% end %> - <% if column_name == 'described_state' %> - <ul> - <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %></li> - <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %></li> - <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %></li> - <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %></li> - </ul> - <% end %> - </td> - </tr> +<div class="accordion" id="info_request"> + <div class="accordion-group"> + <div class="accordion-heading"> + <span class="item-title"> + <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request"><i class="icon-chevron-down"></i></a>Request metadata + </span> + </div> + <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in"> + <table class="table table-striped table-condensed"> + <thead> + <tr> + <td colspan="2"> + <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %> + </td> + </tr> + </thead> + <tbody> + <tr> + <th>Public page:</th> + <td><%= link_to request_url(@info_request), request_path(@info_request) %></td> + </tr> + <% @info_request.for_admin_column do |name, value, type, column_name|%> + <tr> + <td> + <b><%= name %>:</b> + </td> + <td> + <% if type == 'datetime' %> + <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %> + (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>) + <% else %> + <%= h value %> <% end %> + <% if column_name == 'described_state' %> + <ul> + <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %></li> + <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %></li> + <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %></li> + <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %></li> + </ul> + <% end %> + </td> + </tr> + <% end %> <tr> <td> <b>Created by</b> @@ -65,50 +65,50 @@ <%= text_field_tag 'user_url_name', "", { :size => 20 } %> <%= submit_tag "Move request to user", :class => "btn btn-info" %> </div> - <% end %> - </td> - </tr> - <tr> - <td> - <b>Public authority:</b> - </td> - <td> - <%= link_to("<i class='icon-eye-open'></i>".html_safe, public_body_path(@info_request.public_body), :title => "view authority on public website") %> - <%= link_to(@info_request.public_body.name, admin_body_show_path(@info_request.public_body)) %> - <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %> - <div style="display:none;"> - <strong>url_name of new authority:</strong> - <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %> - <%= submit_tag "Move request to authority", :class => "btn btn-info" %> - </div> - </td> - </tr> - <tr> - <td> - <b><%=_("Incoming email address")%></b> - </td> - <td> - <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %> - </td> - </tr> - <tr> - <td> - <b><%=_("Tags")%></b> - </td> - <td> - <%= render :partial => 'tags', :locals => { :info_request => @info_request} %> - </td> - </tr> - </tbody> - <tfoot> - <tr> - <td colspan="2"> - <%= link_to 'Edit metadata', '../edit/' + @info_request.id.to_s, :class => "btn" %> - </td> - </tr> - </tfoot> - </table> - </div> + <% end %> + + </td> + </tr> + <tr> + <td> + <b>Public authority:</b> + </td> + <td> + <%= link_to("<i class='icon-eye-open'></i>".html_safe, public_body_path(@info_request.public_body), :title => "view authority on public website") %> + <%= link_to(@info_request.public_body.name, admin_body_show_path(@info_request.public_body)) %> + <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %> + <div style="display:none;"> + <strong>url_name of new authority:</strong> + <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %> + <%= submit_tag "Move request to authority", :class => "btn btn-info" %> + </div> + </td> + </tr> + <tr> + <td> + <b><%=_("Incoming email address")%></b> + </td> + <td> + <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %> + </td> + </tr> + <tr> + <td> + <b><%=_("Tags")%></b> + </td> + <td> + <%= render :partial => 'tags', :locals => { :info_request => @info_request} %> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td colspan="2"> + <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %> + </td> + </tr> + </tfoot> + </table> </div> </div> <% end %> @@ -119,11 +119,11 @@ FOI officer upload URL </label> <div class="controls"> - <%= link_to 'Generate URL', '../generate_upload_url/' + @info_request.id.to_s, :class => "btn" %> + <%= link_to 'Generate URL', admin_request_generate_upload_url_path(@info_request), :class => "btn" %> <p class="help-block">(see also option to general URLs for individual incoming messages below)</p> </div> </div> - <% form_tag '../hide/' + @info_request.id.to_s, :class => "form form-inline", :id => "hide_request_form" do %> + <% form_tag admin_request_hide_path(@info_request), :class => "form form-inline", :id => "hide_request_form" do %> <div class="control-group"> <% if @info_request.is_external? %> <label class="control-label">Hide the request:</label> @@ -193,7 +193,7 @@ <tr> <td> <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %> - <% form_tag '../mark_event_as_clarification', :class => "form form-inline admin-table-form admin-inline-form" do %> + <% form_tag admin_request_clarification_path, :class => "form form-inline admin-table-form admin-inline-form" do %> <%= hidden_field_tag 'info_request_event_id', info_request_event.id, :id => nil %> <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %> <% end %> @@ -235,9 +235,9 @@ <div class="accordion-group"> <div class="accordion-heading"> <a href="#outgoing_<%=outgoing_message.id%>" data-toggle="collapse" data-parent="#outgoing_messages"><i class="icon-chevron-right"></i></a> - <a href="../edit_outgoing/<%= outgoing_message.id %>"> + <% link_to admin_request_edit_outgoing_path(outgoing_message) do %> #<%= outgoing_message.id %> -- <%= outgoing_message.status.humanize %> <%= outgoing_message.message_type.humanize %> - </a> + <% end %> <blockquote> <%= truncate(outgoing_message.body, :length => 400) %> </blockquote> @@ -247,7 +247,7 @@ <tbody> <tr> <td colspan="2"> - <% form_tag '../resend', :class => "admin-table-form" do %> + <% form_tag admin_request_resend_path, :class => "admin-table-form" do %> <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %> <%= submit_tag "Resend", :class => "btn" %> <% end %> @@ -328,12 +328,12 @@ <div class="accordion-group"> <div class="accordion-heading"> <a href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="#comments"><i class="icon-chevron-right"></i></a> - <a href="../edit_comment/<%= comment.id %>"> + <% link_to admin_request_edit_comment_path(comment) do %> #<%=comment.id%> -- <%=h(comment.user.name)%> <%=admin_value(comment.created_at)%> - </a> + <% end %> <blockquote class="incoming-message"> <%= truncate(comment.body, :length => 400) %> </blockquote> diff --git a/app/views/admin_track/_some_tracks.rhtml b/app/views/admin_track/_some_tracks.rhtml index 8ae7bd5c1..68ebf7dd6 100644 --- a/app/views/admin_track/_some_tracks.rhtml +++ b/app/views/admin_track/_some_tracks.rhtml @@ -32,7 +32,7 @@ <% if include_destroy %> <tr> <td colspan="2"> - <% form_tag '../../user/destroy_track', :class => "form form-inline admin-table-form" do %> + <% form_tag admin_user_destroy_track_path, :class => "form form-inline admin-table-form" do %> <div> <%= hidden_field_tag 'track_id', track_thing.id %> <%= submit_tag "Destroy track", :class => "btn btn-warning" %> diff --git a/app/views/admin_user/_form.rhtml b/app/views/admin_user/_form.rhtml index 756806d2a..e7175d09c 100644 --- a/app/views/admin_user/_form.rhtml +++ b/app/views/admin_user/_form.rhtml @@ -41,7 +41,7 @@ user from filing new requests, making annotations or messaging other users; the text is shown in public on the user's page and when they try to do a forbidden action; write in the second person (you); see - <%= link_to 'banned users', '../banned' %> for examples</small> + <%= link_to 'banned users', admin_user_list_banned_path %> for examples</small> </div> </div> </div> diff --git a/app/views/admin_user/edit.rhtml b/app/views/admin_user/edit.rhtml index c3ee3012b..3333a1e48 100644 --- a/app/views/admin_user/edit.rhtml +++ b/app/views/admin_user/edit.rhtml @@ -1,21 +1,11 @@ <h1><%=@title%></h1> -<% form_tag "../update/#{@admin_user.id}", :class => "form form-horizontal" do %> +<% form_tag admin_user_update_path(@admin_user), :class => "form form-horizontal" do %> <%= render :partial => 'form' %> <div class="form-actions"> <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %> </div> <% end %> -<%= link_to 'Show', "../show/#{@admin_user.id}", :class => "btn" %> -<%= link_to 'List all', '../list', :class => "btn" %> - -<% if false #@admin_user.info_requests.size == 0 %> - <% form_tag('../destroy/' + @admin_user.id.to_s) do %> - <p> - <%= hidden_field_tag(:admin_user_id, { :value => @admin_user.id } ) %> - <%= submit_tag "Destroy " + @admin_user.name %> (this is permanent!) - </p> - <% end %> -<% end %> - +<%= link_to 'Show', admin_user_show_path(@admin_user), :class => "btn" %> +<%= link_to 'List all', admin_user_list_path, :class => "btn" %> diff --git a/app/views/admin_user/list.rhtml b/app/views/admin_user/list.rhtml index afe166f1f..23f75c159 100644 --- a/app/views/admin_user/list.rhtml +++ b/app/views/admin_user/list.rhtml @@ -5,7 +5,7 @@ <% form_tag({}, :method => "get", :class => "form form-search") do %> <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query"} %> <%= submit_tag "Search", :class => "btn" %> (substring search, names and emails) - <%= link_to 'Banned users', 'banned', :class => "btn btn-info" %> + <%= link_to 'Banned users', admin_user_list_banned_path, :class => "btn btn-info" %> <% end %> <%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %> diff --git a/app/views/admin_user/list_banned.rhtml b/app/views/admin_user/list_banned.rhtml index be2d45399..e535415e6 100644 --- a/app/views/admin_user/list_banned.rhtml +++ b/app/views/admin_user/list_banned.rhtml @@ -2,7 +2,7 @@ <h1><%=@title%></h1> -<p><%= link_to 'List all', 'list' %></p> +<p><%= link_to 'List all', admin_user_list_path %></p> <%= render :partial => 'user_table', :locals => { :users => @banned_users, :banned_column => true } %> diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml index ccf2694b9..279758f03 100644 --- a/app/views/admin_user/show.rhtml +++ b/app/views/admin_user/show.rhtml @@ -4,7 +4,7 @@ <% if @admin_user.profile_photo %> <div class="user_photo_on_admin"> - <% form_tag "../clear_profile_photo/#{@admin_user.id}", :multipart => true, :class => "form" do %> + <% form_tag admin_clear_profile_photo_path(@admin_user), :multipart => true, :class => "form" do %> <img src="<%= get_profile_photo_url(:url_name => @admin_user.url_name) %>"> <br> <%= submit_tag "Clear photo", :class => "btn btn-info" %> @@ -38,7 +38,7 @@ <%=h admin_value(value)%> <% end %> <% if column_name == 'email_bounced_at' && !@admin_user.email_bounced_at.nil? %> - <% form_tag "../clear_bounce/#{@admin_user.id}", :class => "form form-inline" do %> + <% form_tag admin_user_clear_bounce_path(@admin_user), :class => "form form-inline" do %> <input type="submit" name="action" value="Clear bounce" class="btn btn-info"> <% end %> <% end %> @@ -49,9 +49,9 @@ </table> -<%= link_to 'Edit', '../edit/' + @admin_user.id.to_s, :class => "btn btn-primary" %> +<%= link_to 'Edit', admin_user_edit_path(@admin_user), :class => "btn btn-primary" %> <%= link_to 'Public page', user_path(@admin_user), :class => "btn" %> -<%= link_to "Log in as #{@admin_user.name} (also confirms their email)", "../login_as/#{@admin_user.id}", :class => "btn btn-info" %> +<%= link_to "Log in as #{@admin_user.name} (also confirms their email)", admin_user_login_as_path(@admin_user), :class => "btn btn-info" %> <hr> diff --git a/config/routes.rb b/config/routes.rb index adc8663c5..86d60c0ae 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -171,10 +171,10 @@ ActionController::Routing::Routes.draw do |map| body.admin_body_index '/admin/body', :action => 'index' body.admin_body_list '/admin/body/list', :action => 'list' body.admin_body_show '/admin/body/show/:id', :action => 'show' - body.admin_body_new '/admin/body/new/:id', :action => 'new' + body.admin_body_new '/admin/body/new', :action => 'new' body.admin_body_edit '/admin/body/edit/:id', :action => 'edit' body.admin_body_update '/admin/body/update/:id', :action => 'update' - body.admin_body_create '/admin/body/create/:id', :action => 'create' + body.admin_body_create '/admin/body/create', :action => 'create' body.admin_body_destroy '/admin/body/destroy/:id', :action => 'destroy' body.admin_body_import_csv '/admin/body/import_csv', :action => 'import_csv' body.admin_body_mass_tag_add '/admin/body/mass_tag_add', :action => 'mass_tag_add' @@ -198,11 +198,11 @@ ActionController::Routing::Routes.draw do |map| admin.admin_request_update '/admin/request/update/:id', :action => 'update' admin.admin_request_destroy '/admin/request/destroy/:id', :action => 'fully_destroy' admin.admin_request_edit_outgoing '/admin/request/edit_outgoing/:id', :action => 'edit_outgoing' - admin.admin_request_destroy_outgoing '/admin/request/destroy_outgoing/:id', :action => 'destroy_outgoing' + admin.admin_request_destroy_outgoing '/admin/request/destroy_outgoing', :action => 'destroy_outgoing' admin.admin_request_update_outgoing '/admin/request/update_outgoing/:id', :action => 'update_outgoing' admin.admin_request_edit_comment '/admin/request/edit_comment/:id', :action => 'edit_comment' admin.admin_request_update_comment '/admin/request/update_comment/:id', :action => 'update_comment' - admin.admin_request_destroy_incoming '/admin/request/destroy_incoming/:id', :action => 'destroy_incoming' + admin.admin_request_destroy_incoming '/admin/request/destroy_incoming', :action => 'destroy_incoming' admin.admin_request_redeliver_incoming '/admin/request/redeliver_incoming', :action => 'redeliver_incoming' admin.admin_request_move_request '/admin/request/move_request', :action => 'move_request' admin.admin_request_generate_upload_url '/admin/request/generate_upload_url/:id', :action => 'generate_upload_url' |