allow editing of pending aliases/implications

This commit is contained in:
r888888888
2014-07-18 14:48:51 -07:00
parent 5fd6a018cb
commit c1a4bfda55
11 changed files with 173 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
<div id="c-tag-aliases">
<div id="a-new">
<h1>Edit Tag Alias</h1>
<%= error_messages_for :tag_alias %>
<%= simple_form_for(@tag_alias) do |f| %>
<%= f.input :antecedent_name, :as => :string, :label => "From" %>
<%= f.input :consequent_name, :label => "To" %>
<%= f.input :forum_topic_id, :label => "Forum" %>
<%= f.button :submit %>
<% end %>
</div>
</div>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
Edit Tag Alias - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -32,6 +32,11 @@
</td>
<td>
<%= link_to "Show", tag_alias_path(tag_alias) %>
<% if tag_alias.editable_by?(CurrentUser.user) %>
| <%= link_to "Edit", edit_tag_alias_path(tag_alias) %>
<% end %>
<% if tag_alias.deletable_by?(CurrentUser.user) %>
| <%= link_to "Delete", tag_alias_path(tag_alias), :remote => true, :method => :delete, :data => {:confirm => "Are you sure you want to delete this alias?"} %>
<% end %>

View File

@@ -0,0 +1,20 @@
<div id="c-tag-aliases">
<div id="a-new">
<h1>Edit Tag Implication</h1>
<%= error_messages_for :tag_implication %>
<%= simple_form_for(@tag_implication) do |f| %>
<%= f.input :antecedent_name, :label => "From" %>
<%= f.input :consequent_name, :label => "To" %>
<%= f.input :forum_topic_id, :label => "Forum" %>
<%= f.button :submit %>
<% end %>
</div>
</div>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
Edit Tag Implication - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -30,9 +30,15 @@
<td id="tag-implication-status-for-<%= tag_implication.id %>"><%= tag_implication.status %></td>
<td>
<%= link_to "Show", tag_implication_path(tag_implication) %>
<% if tag_implication.editable_by?(CurrentUser.user) %>
| <%= link_to "Edit", edit_tag_implication_path(tag_implication) %>
<% end %>
<% if tag_implication.deletable_by?(CurrentUser.user) %>
| <%= link_to "Delete", tag_implication_path(tag_implication), :remote => true, :method => :delete, :data => {:confirm => "Are you sure you want to delete this implication?"} %>
<% end %>
<% if CurrentUser.user.is_admin? && tag_implication.is_pending? %>
| <%= link_to "Approve", approve_tag_implication_path(tag_implication), :remote => true, :method => :post %>
<% end %>