aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/views/admin_censor_rule/_show.html.erb14
-rw-r--r--app/views/admin_censor_rule/new.html.erb6
2 files changed, 10 insertions, 10 deletions
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 %>
-