Merge branch 'master' of https://github.com/r888888888/danbooru
is reverts commit 62a3391c04.
This commit is contained in:
@@ -28,7 +28,7 @@ class TagsController < ApplicationController
|
|||||||
def update
|
def update
|
||||||
@tag = Tag.find(params[:id])
|
@tag = Tag.find(params[:id])
|
||||||
check_privilege(@tag)
|
check_privilege(@tag)
|
||||||
@tag.update_attributes(params[:tag])
|
@tag.update_attributes(params[:tag], :as => CurrentUser.role)
|
||||||
@tag.update_category_cache_for_all
|
@tag.update_category_cache_for_all
|
||||||
respond_with(@tag)
|
respond_with(@tag)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -450,7 +450,9 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
when /^rating:([qse])/i
|
when /^rating:([qse])/i
|
||||||
self.rating = $1.downcase
|
unless is_rating_locked?
|
||||||
|
self.rating = $1.downcase
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
|
<li><%= link_to "Edit", edit_artist_path(@artist) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if CurrentUser.is_builder? %>
|
<% if CurrentUser.is_builder? %>
|
||||||
<li><%= link_to "Edit name", edit_name_artist_path(@artist) %></li>
|
<li><%= link_to "Rename", edit_name_artist_path(@artist) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %></li>
|
<li><%= link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %></li>
|
||||||
<% if @artist.deletable_by?(CurrentUser.user) %>
|
<% if @artist.deletable_by?(CurrentUser.user) %>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div id="c-artists">
|
<div id="c-artists">
|
||||||
<div id="a-edit">
|
<div id="a-edit">
|
||||||
<h1>Edit Artist Name</h1>
|
<h1>Rename Artist</h1>
|
||||||
<%= form_tag(update_name_artist_path(@artist), :method => :put) do %>
|
<%= form_tag(update_name_artist_path(@artist), :class => "simple_form", :method => :put) do %>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<label for="artist_name">Name</label>
|
<label for="artist_name">Name</label>
|
||||||
<%= text_field :artist, :name %>
|
<%= text_field :artist, :name %>
|
||||||
@@ -16,5 +16,5 @@
|
|||||||
<%= render "secondary_links" %>
|
<%= render "secondary_links" %>
|
||||||
|
|
||||||
<% content_for(:page_title) do %>
|
<% content_for(:page_title) do %>
|
||||||
Edit Artist Name - <%= Danbooru.config.app_name %>
|
Rename Artist - <%= Danbooru.config.app_name %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div id="a-edit">
|
<div id="a-edit">
|
||||||
<h1>Edit Forum Post</h1>
|
<h1>Edit Forum Post</h1>
|
||||||
|
|
||||||
<%= render "form", :forum_post => @forum_post %>
|
<%= render "forum_posts/partials/edit/form", :forum_post => @forum_post %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<h1>New Forum Post</h1>
|
<h1>New Forum Post</h1>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render "form", :forum_post => @forum_post %>
|
<%= render "forum_posts/partials/new/form", :forum_post => @forum_post %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ class PostsControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|
||||||
should "fail for password mismatches" do
|
# should "fail for password mismatches" do
|
||||||
@basic_auth_string = "Basic #{::Base64.encode64("#{@user.name}:badpassword")}"
|
# @basic_auth_string = "Basic #{::Base64.encode64("#{@user.name}:badpassword")}"
|
||||||
@request.env['HTTP_AUTHORIZATION'] = @basic_auth_string
|
# @request.env['HTTP_AUTHORIZATION'] = @basic_auth_string
|
||||||
get :index, {:format => "json"}
|
# get :index, {:format => "json"}
|
||||||
assert_response 403
|
# assert_response 403
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "using the api_key parameter" do
|
context "using the api_key parameter" do
|
||||||
@@ -54,10 +54,10 @@ class PostsControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|
||||||
should "fail for password mismatches" do
|
# should "fail for password mismatches" do
|
||||||
get :index, {:format => "json", :login => @user.name, :api_key => "bad"}
|
# get :index, {:format => "json", :login => @user.name, :api_key => "bad"}
|
||||||
assert_response 403
|
# assert_response 403
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "using the password_hash parameter" do
|
context "using the password_hash parameter" do
|
||||||
@@ -66,10 +66,10 @@ class PostsControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|
||||||
should "fail for password mismatches" do
|
# should "fail for password mismatches" do
|
||||||
get :index, {:format => "json", :login => @user.name, :password_hash => "bad"}
|
# get :index, {:format => "json", :login => @user.name, :password_hash => "bad"}
|
||||||
assert_response 403
|
# assert_response 403
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user