Merge branch 'master' of https://github.com/r888888888/danbooru
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class Tag < ActiveRecord::Base
|
||||
METATAGS = "-user|user|-approver|approver|commenter|comm|noter|-pool|pool|-fav|fav|sub|md5|-rating|rating|-locked|locked|width|height|mpixels|score|favcount|filesize|source|-source|id|-id|date|age|order|-status|status|tagcount|gentags|arttags|chartags|copytags|parent|-parent|pixiv_id|pixiv"
|
||||
attr_accessible :category
|
||||
attr_accessible :category, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin]
|
||||
attr_accessible :is_locked, :as => [:moderator, :janitor, :admin]
|
||||
has_one :wiki_page, :foreign_key => "name", :primary_key => "title"
|
||||
|
||||
module ApiMethods
|
||||
@@ -141,7 +142,7 @@ class Tag < ActiveRecord::Base
|
||||
if category
|
||||
category_id = categories.value_for(category)
|
||||
|
||||
if category_id != tag.category && (CurrentUser.is_builder? || tag.post_count <= 50)
|
||||
if category_id != tag.category && !tag.is_locked? && (CurrentUser.is_builder? || tag.post_count <= 50)
|
||||
tag.update_column(:category, category_id)
|
||||
tag.update_category_cache_for_all
|
||||
end
|
||||
|
||||
@@ -3,7 +3,14 @@
|
||||
<h1>Tag: <%= @tag.name %></h1>
|
||||
|
||||
<%= simple_form_for(@tag) do |f| %>
|
||||
<%= f.input :category, :collection => Danbooru.config.canonical_tag_category_mapping.to_a, :include_blank => false %>
|
||||
<% unless @tag.is_locked? %>
|
||||
<%= f.input :category, :collection => Danbooru.config.canonical_tag_category_mapping.to_a, :include_blank => false %>
|
||||
<% end %>
|
||||
|
||||
<% if CurrentUser.user.is_janitor? %>
|
||||
<%= f.input :is_locked, :collection => [["No", "false"], ["Yes", "true"]] %>
|
||||
<% end %>
|
||||
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user