rename references of privileged to gold
This commit is contained in:
@@ -86,7 +86,7 @@ protected
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
%w(member banned builder privileged platinum contributor janitor moderator admin).each do |level|
|
%w(member banned builder gold platinum contributor janitor moderator admin).each do |level|
|
||||||
define_method("#{level}_only") do
|
define_method("#{level}_only") do
|
||||||
if !CurrentUser.user.is_banned? && CurrentUser.user.__send__("is_#{level}?")
|
if !CurrentUser.user.is_banned? && CurrentUser.user.__send__("is_#{level}?")
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class PostVotesController < ApplicationController
|
class PostVotesController < ApplicationController
|
||||||
before_filter :privileged_only
|
before_filter :gold_only
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@post = Post.find(params[:post_id])
|
@post = Post.find(params[:post_id])
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class UserFeedbacksController < ApplicationController
|
class UserFeedbacksController < ApplicationController
|
||||||
before_filter :privileged_only, :only => [:new, :edit, :create, :update, :destroy]
|
before_filter :gold_only, :only => [:new, :edit, :create, :update, :destroy]
|
||||||
respond_to :html, :xml, :json
|
respond_to :html, :xml, :json
|
||||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class UserNameChangeRequestsController < ApplicationController
|
class UserNameChangeRequestsController < ApplicationController
|
||||||
before_filter :privileged_only, :only => [:new, :create, :show]
|
before_filter :gold_only, :only => [:new, :create, :show]
|
||||||
before_filter :admin_only, :only => [:index, :approve, :reject, :destroy]
|
before_filter :admin_only, :only => [:index, :approve, :reject, :destroy]
|
||||||
rescue_from User::PrivilegeError, :with => :access_denied
|
rescue_from User::PrivilegeError, :with => :access_denied
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module Admin::UsersHelper
|
|||||||
def user_level_select(object, field)
|
def user_level_select(object, field)
|
||||||
options = [
|
options = [
|
||||||
["Member", User::Levels::MEMBER],
|
["Member", User::Levels::MEMBER],
|
||||||
["Gold", User::Levels::PRIVILEGED],
|
["Gold", User::Levels::GOLD],
|
||||||
["Platinum", User::Levels::PLATINUM],
|
["Platinum", User::Levels::PLATINUM],
|
||||||
["Builder", User::Levels::BUILDER],
|
["Builder", User::Levels::BUILDER],
|
||||||
["Contributor", User::Levels::CONTRIBUTOR],
|
["Contributor", User::Levels::CONTRIBUTOR],
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ module ApplicationHelper
|
|||||||
if positive_or_negative == :positive
|
if positive_or_negative == :positive
|
||||||
html << " [" + link_to("+", new_user_feedback_path(:user_feedback => {:category => "positive", :user_id => user.id})) + "]"
|
html << " [" + link_to("+", new_user_feedback_path(:user_feedback => {:category => "positive", :user_id => user.id})) + "]"
|
||||||
|
|
||||||
unless user.is_privileged?
|
unless user.is_gold?
|
||||||
html << " [" + link_to("invite", new_moderator_invitation_path(:invitation => {:name => user.name, :level => User::Levels::CONTRIBUTOR})) + "]"
|
html << " [" + link_to("invite", new_moderator_invitation_path(:invitation => {:name => user.name, :level => User::Levels::CONTRIBUTOR})) + "]"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module Moderator
|
|||||||
choices = [
|
choices = [
|
||||||
["", ""],
|
["", ""],
|
||||||
["Member", 20],
|
["Member", 20],
|
||||||
["Privileged", 30],
|
["Gold", 30],
|
||||||
["Contributor", 33],
|
["Contributor", 33],
|
||||||
["Janitor", 35],
|
["Janitor", 35],
|
||||||
["Moderator", 40],
|
["Moderator", 40],
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module Moderator
|
|||||||
module InvitationsHelper
|
module InvitationsHelper
|
||||||
def level_select
|
def level_select
|
||||||
choices = []
|
choices = []
|
||||||
choices << ["Privileged", User::Levels::PRIVILEGED]
|
choices << ["Gold", User::Levels::GOLD]
|
||||||
choices << ["Contributor", User::Levels::CONTRIBUTOR]
|
choices << ["Contributor", User::Levels::CONTRIBUTOR]
|
||||||
select(:invitation, :level, choices)
|
select(:invitation, :level, choices)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ module PostAppealsHelper
|
|||||||
html << '</ul>'
|
html << '</ul>'
|
||||||
html.join("\n").html_safe
|
html.join("\n").html_safe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ class AnonymousUser
|
|||||||
""
|
""
|
||||||
end
|
end
|
||||||
|
|
||||||
%w(member banned privileged builder platinum contributor janitor moderator admin).each do |name|
|
%w(member banned gold builder platinum contributor janitor moderator admin).each do |name|
|
||||||
define_method("is_#{name}?") do
|
define_method("is_#{name}?") do
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ module PostSets
|
|||||||
end
|
end
|
||||||
|
|
||||||
def has_deleted?
|
def has_deleted?
|
||||||
CurrentUser.is_privileged? && tag_string !~ /status/ && ::Post.tag_match("#{tag_string} status:deleted").exists?
|
CurrentUser.is_gold? && tag_string !~ /status/ && ::Post.tag_match("#{tag_string} status:deleted").exists?
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_explicit?
|
def has_explicit?
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module PostSets
|
module PostSets
|
||||||
class SearchError < Exception
|
class SearchError < Exception
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Artist < ActiveRecord::Base
|
|||||||
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
has_one :wiki_page, :foreign_key => "title", :primary_key => "name"
|
||||||
has_one :tag_alias, :foreign_key => "antecedent_name", :primary_key => "name"
|
has_one :tag_alias, :foreign_key => "antecedent_name", :primary_key => "name"
|
||||||
accepts_nested_attributes_for :wiki_page
|
accepts_nested_attributes_for :wiki_page
|
||||||
attr_accessible :body, :name, :url_string, :other_names, :other_names_comma, :group_name, :wiki_page_attributes, :notes, :as => [:member, :privileged, :builder, :platinum, :contributor, :janitor, :moderator, :default, :admin]
|
attr_accessible :body, :name, :url_string, :other_names, :other_names_comma, :group_name, :wiki_page_attributes, :notes, :as => [:member, :gold, :builder, :platinum, :contributor, :janitor, :moderator, :default, :admin]
|
||||||
attr_accessible :is_active, :as => [:builder, :contributor, :janitor, :moderator, :default, :admin]
|
attr_accessible :is_active, :as => [:builder, :contributor, :janitor, :moderator, :default, :admin]
|
||||||
attr_accessible :is_banned, :as => :admin
|
attr_accessible :is_banned, :as => :admin
|
||||||
|
|
||||||
@@ -116,8 +116,8 @@ class Artist < ActiveRecord::Base
|
|||||||
Artist.new.tap do |artist|
|
Artist.new.tap do |artist|
|
||||||
if params[:name]
|
if params[:name]
|
||||||
artist.name = params[:name]
|
artist.name = params[:name]
|
||||||
if CurrentUser.user.is_privileged?
|
if CurrentUser.user.is_gold?
|
||||||
# below privileged users are limited to two tags
|
# below gold users are limited to two tags
|
||||||
post = Post.tag_match("source:http #{artist.name} status:any").first
|
post = Post.tag_match("source:http #{artist.name} status:any").first
|
||||||
else
|
else
|
||||||
post = Post.tag_match("source:http #{artist.name}").first
|
post = Post.tag_match("source:http #{artist.name}").first
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Favorite < ActiveRecord::Base
|
|||||||
return if Favorite.for_user(user.id).exists?(:user_id => user.id, :post_id => post.id)
|
return if Favorite.for_user(user.id).exists?(:user_id => user.id, :post_id => post.id)
|
||||||
Favorite.create(:user_id => user.id, :post_id => post.id)
|
Favorite.create(:user_id => user.id, :post_id => post.id)
|
||||||
Post.update_all("fav_count = fav_count + 1", "id = #{post.id}")
|
Post.update_all("fav_count = fav_count + 1", "id = #{post.id}")
|
||||||
Post.update_all("score = score + 1", "id = #{post.id}") if user.is_privileged?
|
Post.update_all("score = score + 1", "id = #{post.id}") if user.is_gold?
|
||||||
post.append_user_to_fav_string(user.id)
|
post.append_user_to_fav_string(user.id)
|
||||||
user.add_favorite!(post)
|
user.add_favorite!(post)
|
||||||
user.increment!(:favorite_count)
|
user.increment!(:favorite_count)
|
||||||
@@ -22,7 +22,7 @@ class Favorite < ActiveRecord::Base
|
|||||||
return unless Favorite.for_user(user.id).exists?(:user_id => user.id, :post_id => post.id)
|
return unless Favorite.for_user(user.id).exists?(:user_id => user.id, :post_id => post.id)
|
||||||
Favorite.destroy_all(:user_id => user.id, :post_id => post.id)
|
Favorite.destroy_all(:user_id => user.id, :post_id => post.id)
|
||||||
Post.update_all("fav_count = fav_count - 1", "id = #{post.id}")
|
Post.update_all("fav_count = fav_count - 1", "id = #{post.id}")
|
||||||
Post.update_all("score = score - 1", "id = #{post.id}") if user.is_privileged?
|
Post.update_all("score = score - 1", "id = #{post.id}") if user.is_gold?
|
||||||
post.delete_user_from_fav_string(user.id)
|
post.delete_user_from_fav_string(user.id)
|
||||||
user.remove_favorite!(post)
|
user.remove_favorite!(post)
|
||||||
user.decrement!(:favorite_count)
|
user.decrement!(:favorite_count)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class ForumPost < ActiveRecord::Base
|
class ForumPost < ActiveRecord::Base
|
||||||
attr_accessible :body, :topic_id, :as => [:member, :builder, :janitor, :privileged, :platinum, :contributor, :admin, :moderator, :default]
|
attr_accessible :body, :topic_id, :as => [:member, :builder, :janitor, :gold, :platinum, :contributor, :admin, :moderator, :default]
|
||||||
attr_accessible :is_locked, :is_sticky, :is_deleted, :as => [:admin, :moderator, :janitor]
|
attr_accessible :is_locked, :is_sticky, :is_deleted, :as => [:admin, :moderator, :janitor]
|
||||||
belongs_to :creator, :class_name => "User"
|
belongs_to :creator, :class_name => "User"
|
||||||
belongs_to :updater, :class_name => "User"
|
belongs_to :updater, :class_name => "User"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class ForumTopic < ActiveRecord::Base
|
class ForumTopic < ActiveRecord::Base
|
||||||
attr_accessible :title, :original_post_attributes, :as => [:member, :builder, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
attr_accessible :title, :original_post_attributes, :as => [:member, :builder, :gold, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
||||||
attr_accessible :is_sticky, :is_locked, :is_deleted, :as => [:janitor, :admin, :moderator]
|
attr_accessible :is_sticky, :is_locked, :is_deleted, :as => [:janitor, :admin, :moderator]
|
||||||
belongs_to :creator, :class_name => "User"
|
belongs_to :creator, :class_name => "User"
|
||||||
belongs_to :updater, :class_name => "User"
|
belongs_to :updater, :class_name => "User"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Pool < ActiveRecord::Base
|
|||||||
before_validation :initialize_creator, :on => :create
|
before_validation :initialize_creator, :on => :create
|
||||||
after_save :create_version
|
after_save :create_version
|
||||||
before_destroy :create_mod_action_for_destroy
|
before_destroy :create_mod_action_for_destroy
|
||||||
attr_accessible :name, :description, :post_ids, :post_id_array, :post_count, :is_active, :as => [:member, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
attr_accessible :name, :description, :post_ids, :post_id_array, :post_count, :is_active, :as => [:member, :gold, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
||||||
attr_accessible :is_deleted, :as => [:janitor, :moderator, :admin]
|
attr_accessible :is_deleted, :as => [:janitor, :moderator, :admin]
|
||||||
|
|
||||||
module SearchMethods
|
module SearchMethods
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Post < ActiveRecord::Base
|
|||||||
has_many :disapprovals, :class_name => "PostDisapproval", :dependent => :destroy
|
has_many :disapprovals, :class_name => "PostDisapproval", :dependent => :destroy
|
||||||
validates_uniqueness_of :md5
|
validates_uniqueness_of :md5
|
||||||
validates_presence_of :parent, :if => lambda {|rec| !rec.parent_id.nil?}
|
validates_presence_of :parent, :if => lambda {|rec| !rec.parent_id.nil?}
|
||||||
attr_accessible :source, :rating, :tag_string, :old_tag_string, :last_noted_at, :parent_id, :as => [:member, :builder, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
attr_accessible :source, :rating, :tag_string, :old_tag_string, :last_noted_at, :parent_id, :as => [:member, :builder, :gold, :platinum, :contributor, :janitor, :moderator, :admin, :default]
|
||||||
attr_accessible :is_rating_locked, :is_note_locked, :as => [:builder, :contributor, :janitor, :moderator, :admin]
|
attr_accessible :is_rating_locked, :is_note_locked, :as => [:builder, :contributor, :janitor, :moderator, :admin]
|
||||||
attr_accessible :is_status_locked, :as => [:admin]
|
attr_accessible :is_status_locked, :as => [:admin]
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class TagSubscription < ActiveRecord::Base
|
|||||||
def self.process_all
|
def self.process_all
|
||||||
CurrentUser.scoped(User.admins.first, "127.0.0.1") do
|
CurrentUser.scoped(User.admins.first, "127.0.0.1") do
|
||||||
find_each do |tag_subscription|
|
find_each do |tag_subscription|
|
||||||
if $job_task_daemon_active != false && tag_subscription.creator.is_privileged? && tag_subscription.is_active?
|
if $job_task_daemon_active != false && tag_subscription.creator.is_gold? && tag_subscription.is_active?
|
||||||
begin
|
begin
|
||||||
tag_subscription.process
|
tag_subscription.process
|
||||||
tag_subscription.save
|
tag_subscription.save
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class User < ActiveRecord::Base
|
|||||||
module Levels
|
module Levels
|
||||||
BLOCKED = 10
|
BLOCKED = 10
|
||||||
MEMBER = 20
|
MEMBER = 20
|
||||||
PRIVILEGED = 30
|
GOLD = 30
|
||||||
PLATINUM = 31
|
PLATINUM = 31
|
||||||
BUILDER = 32
|
BUILDER = 32
|
||||||
CONTRIBUTOR = 33
|
CONTRIBUTOR = 33
|
||||||
@@ -17,7 +17,7 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
attr_accessor :password, :old_password
|
attr_accessor :password, :old_password
|
||||||
attr_accessible :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :enable_sequential_post_navigation, :per_page, :hide_deleted_posts, :style_usernames, :as => [:moderator, :janitor, :contributor, :privileged, :member, :anonymous, :default, :builder, :admin]
|
attr_accessible :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :enable_sequential_post_navigation, :per_page, :hide_deleted_posts, :style_usernames, :as => [:moderator, :janitor, :contributor, :gold, :member, :anonymous, :default, :builder, :admin]
|
||||||
attr_accessible :level, :as => :admin
|
attr_accessible :level, :as => :admin
|
||||||
validates_length_of :name, :within => 2..100, :on => :create
|
validates_length_of :name, :within => 2..100, :on => :create
|
||||||
validates_format_of :name, :with => /\A[^\s:]+\Z/, :on => :create, :message => "cannot have whitespace or colons"
|
validates_format_of :name, :with => /\A[^\s:]+\Z/, :on => :create, :message => "cannot have whitespace or colons"
|
||||||
@@ -229,7 +229,7 @@ class User < ActiveRecord::Base
|
|||||||
def level_hash
|
def level_hash
|
||||||
return {
|
return {
|
||||||
"Member" => Levels::MEMBER,
|
"Member" => Levels::MEMBER,
|
||||||
"Gold" => Levels::PRIVILEGED,
|
"Gold" => Levels::GOLD,
|
||||||
"Platinum" => Levels::PLATINUM,
|
"Platinum" => Levels::PLATINUM,
|
||||||
"Builder" => Levels::BUILDER,
|
"Builder" => Levels::BUILDER,
|
||||||
"Contributor" => Levels::CONTRIBUTOR,
|
"Contributor" => Levels::CONTRIBUTOR,
|
||||||
@@ -255,8 +255,8 @@ class User < ActiveRecord::Base
|
|||||||
when Levels::MEMBER
|
when Levels::MEMBER
|
||||||
:member
|
:member
|
||||||
|
|
||||||
when Levels::PRIVILEGED
|
when Levels::GOLD
|
||||||
:privileged
|
:gold
|
||||||
|
|
||||||
when Levels::BUILDER
|
when Levels::BUILDER
|
||||||
:builder
|
:builder
|
||||||
@@ -286,7 +286,7 @@ class User < ActiveRecord::Base
|
|||||||
when Levels::BUILDER
|
when Levels::BUILDER
|
||||||
"Builder"
|
"Builder"
|
||||||
|
|
||||||
when Levels::PRIVILEGED
|
when Levels::GOLD
|
||||||
"Gold"
|
"Gold"
|
||||||
|
|
||||||
when Levels::PLATINUM
|
when Levels::PLATINUM
|
||||||
@@ -321,8 +321,8 @@ class User < ActiveRecord::Base
|
|||||||
level >= Levels::BUILDER
|
level >= Levels::BUILDER
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_privileged?
|
def is_gold?
|
||||||
level >= Levels::PRIVILEGED
|
level >= Levels::GOLD
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_platinum?
|
def is_platinum?
|
||||||
@@ -356,7 +356,7 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_per_page
|
def set_per_page
|
||||||
if per_page.nil? || !is_privileged?
|
if per_page.nil? || !is_gold?
|
||||||
self.per_page = Danbooru.config.posts_per_page
|
self.per_page = Danbooru.config.posts_per_page
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ class User < ActiveRecord::Base
|
|||||||
|
|
||||||
module ForumMethods
|
module ForumMethods
|
||||||
def has_forum_been_updated?
|
def has_forum_been_updated?
|
||||||
return false unless is_privileged?
|
return false unless is_gold?
|
||||||
newest_topic = ForumTopic.order("updated_at desc").first
|
newest_topic = ForumTopic.order("updated_at desc").first
|
||||||
return false if newest_topic.nil?
|
return false if newest_topic.nil?
|
||||||
return true if last_forum_read_at.nil?
|
return true if last_forum_read_at.nil?
|
||||||
@@ -426,7 +426,7 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def can_comment?
|
def can_comment?
|
||||||
if is_privileged?
|
if is_gold?
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
created_at <= Danbooru.config.member_comment_time_threshold
|
created_at <= Danbooru.config.member_comment_time_threshold
|
||||||
@@ -434,7 +434,7 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def is_comment_limited?
|
def is_comment_limited?
|
||||||
if is_privileged?
|
if is_gold?
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
Comment.where("creator_id = ? and created_at > ?", id, 1.hour.ago).count >= Danbooru.config.member_comment_limit
|
Comment.where("creator_id = ? and created_at > ?", id, 1.hour.ago).count >= Danbooru.config.member_comment_limit
|
||||||
@@ -470,7 +470,7 @@ class User < ActiveRecord::Base
|
|||||||
def tag_query_limit
|
def tag_query_limit
|
||||||
if is_platinum?
|
if is_platinum?
|
||||||
Danbooru.config.base_tag_query_limit * 2
|
Danbooru.config.base_tag_query_limit * 2
|
||||||
elsif is_privileged?
|
elsif is_gold?
|
||||||
Danbooru.config.base_tag_query_limit
|
Danbooru.config.base_tag_query_limit
|
||||||
else
|
else
|
||||||
2
|
2
|
||||||
@@ -480,7 +480,7 @@ class User < ActiveRecord::Base
|
|||||||
def favorite_limit
|
def favorite_limit
|
||||||
if is_platinum?
|
if is_platinum?
|
||||||
nil
|
nil
|
||||||
elsif is_privileged?
|
elsif is_gold?
|
||||||
20_000
|
20_000
|
||||||
else
|
else
|
||||||
10_000
|
10_000
|
||||||
@@ -490,7 +490,7 @@ class User < ActiveRecord::Base
|
|||||||
def api_hourly_limit
|
def api_hourly_limit
|
||||||
if is_platinum?
|
if is_platinum?
|
||||||
20_000
|
20_000
|
||||||
elsif is_privileged?
|
elsif is_gold?
|
||||||
10_000
|
10_000
|
||||||
else
|
else
|
||||||
3_000
|
3_000
|
||||||
@@ -500,7 +500,7 @@ class User < ActiveRecord::Base
|
|||||||
def statement_timeout
|
def statement_timeout
|
||||||
if is_platinum?
|
if is_platinum?
|
||||||
9_000
|
9_000
|
||||||
elsif is_privileged?
|
elsif is_gold?
|
||||||
6_000
|
6_000
|
||||||
else
|
else
|
||||||
3_000
|
3_000
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class UserFeedback < ActiveRecord::Base
|
|||||||
before_validation :initialize_creator, :on => :create
|
before_validation :initialize_creator, :on => :create
|
||||||
attr_accessible :body, :user_id, :category, :user_name
|
attr_accessible :body, :user_id, :category, :user_name
|
||||||
validates_presence_of :user, :creator, :body, :category
|
validates_presence_of :user, :creator, :body, :category
|
||||||
validate :creator_is_privileged
|
validate :creator_is_gold
|
||||||
validate :user_is_not_creator
|
validate :user_is_not_creator
|
||||||
after_create :create_dmail
|
after_create :create_dmail
|
||||||
|
|
||||||
@@ -73,9 +73,9 @@ class UserFeedback < ActiveRecord::Base
|
|||||||
Dmail.create_split(:to_id => user_id, :title => "Your user record has been updated", :body => body)
|
Dmail.create_split(:to_id => user_id, :title => "Your user record has been updated", :body => body)
|
||||||
end
|
end
|
||||||
|
|
||||||
def creator_is_privileged
|
def creator_is_gold
|
||||||
if !creator.is_privileged?
|
if !creator.is_gold?
|
||||||
errors[:creator] << "must be privileged"
|
errors[:creator] << "must be gold"
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class PostPresenter < Presenter
|
|||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
if post.is_banned? && !CurrentUser.is_privileged?
|
if post.is_banned? && !CurrentUser.is_gold?
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -113,8 +113,8 @@ class PostPresenter < Presenter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def image_html(template)
|
def image_html(template)
|
||||||
return template.content_tag("p", "The artist requested removal of this image") if @post.is_banned? && !CurrentUser.user.is_privileged?
|
return template.content_tag("p", "The artist requested removal of this image") if @post.is_banned? && !CurrentUser.user.is_gold?
|
||||||
return template.content_tag("p", template.link_to("You need a privileged account to see this image.", template.upgrade_information_users_path)) if !Danbooru.config.can_user_see_post?(CurrentUser.user, @post)
|
return template.content_tag("p", template.link_to("You need a gold account to see this image.", template.upgrade_information_users_path)) if !Danbooru.config.can_user_see_post?(CurrentUser.user, @post)
|
||||||
|
|
||||||
if @post.is_flash?
|
if @post.is_flash?
|
||||||
template.render("posts/partials/show/flash", :post => @post)
|
template.render("posts/partials/show/flash", :post => @post)
|
||||||
@@ -127,12 +127,12 @@ class PostPresenter < Presenter
|
|||||||
|
|
||||||
def tag_list_html(template, options = {})
|
def tag_list_html(template, options = {})
|
||||||
@tag_set_presenter ||= TagSetPresenter.new(@post.tag_array)
|
@tag_set_presenter ||= TagSetPresenter.new(@post.tag_array)
|
||||||
@tag_set_presenter.tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_privileged?))
|
@tag_set_presenter.tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_gold?))
|
||||||
end
|
end
|
||||||
|
|
||||||
def split_tag_list_html(template, options = {})
|
def split_tag_list_html(template, options = {})
|
||||||
@tag_set_presenter ||= TagSetPresenter.new(@post.tag_array)
|
@tag_set_presenter ||= TagSetPresenter.new(@post.tag_array)
|
||||||
@tag_set_presenter.split_tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_privileged?))
|
@tag_set_presenter.split_tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_gold?))
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_nav_links?(template)
|
def has_nav_links?(template)
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ private
|
|||||||
html << %{<a class="wiki-link" href="/wiki_pages/show_or_new?title=#{u(tag)}">?</a> }
|
html << %{<a class="wiki-link" href="/wiki_pages/show_or_new?title=#{u(tag)}">?</a> }
|
||||||
end
|
end
|
||||||
|
|
||||||
if CurrentUser.user.is_privileged? && is_index?(template) && current_query.present?
|
if CurrentUser.user.is_gold? && is_index?(template) && current_query.present?
|
||||||
html << %{<a href="/posts?tags=#{u(current_query)}+#{u(tag)}" class="search-inc-tag">+</a> }
|
html << %{<a href="/posts?tags=#{u(current_query)}+#{u(tag)}" class="search-inc-tag">+</a> }
|
||||||
html << %{<a href="/posts?tags=#{u(current_query)}+-#{u(tag)}" class="search-exl-tag">–</a> }
|
html << %{<a href="/posts?tags=#{u(current_query)}+-#{u(tag)}" class="search-exl-tag">–</a> }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
<%= f.input :referral_url, :as => :string %>
|
<%= f.input :referral_url, :as => :string %>
|
||||||
<%= f.input :status, :collection => %w(active inactive) %>
|
<%= f.input :status, :collection => %w(active inactive) %>
|
||||||
<%= f.button :submit, "Submit" %>
|
<%= f.button :submit, "Submit" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -67,4 +67,4 @@
|
|||||||
</script>
|
</script>
|
||||||
<!-- End J-List Product Feed -->
|
<!-- End J-List Product Feed -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -67,4 +67,4 @@
|
|||||||
</script>
|
</script>
|
||||||
<!-- End J-List Product Feed -->
|
<!-- End J-List Product Feed -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -60,4 +60,4 @@
|
|||||||
</script>
|
</script>
|
||||||
<!-- End J-List Product Feed -->
|
<!-- End J-List Product Feed -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -60,4 +60,4 @@
|
|||||||
</script>
|
</script>
|
||||||
<!-- End J-List Product Feed -->
|
<!-- End J-List Product Feed -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,4 +15,4 @@
|
|||||||
<%= dtext_field "artist", "notes" %>
|
<%= dtext_field "artist", "notes" %>
|
||||||
<%= f.button :submit, "Submit" %>
|
<%= f.button :submit, "Submit" %>
|
||||||
<%= dtext_preview_button "artist", "notes" %>
|
<%= dtext_preview_button "artist", "notes" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -25,4 +25,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
$("div.comments-for-post[data-post-id=<%= @comment.post_id %>] div.list-of-comments").append("<%= escape_javascript(render('comments/partials/show/comment', :comment => @comment)) %>");
|
$("div.comments-for-post[data-post-id=<%= @comment.post_id %>] div.list-of-comments").append("<%= escape_javascript(render('comments/partials/show/comment', :comment => @comment)) %>");
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<strong>Score</strong>
|
<strong>Score</strong>
|
||||||
<span>
|
<span>
|
||||||
<span id="score-for-post-<%= post.id %>"><%= post.score %></span>
|
<span id="score-for-post-<%= post.id %>"><%= post.score %></span>
|
||||||
<% if CurrentUser.is_privileged? %>
|
<% if CurrentUser.is_gold? %>
|
||||||
(vote <%= link_to("up", post_votes_path(:score => "up", :post_id => post.id), :remote => true, :method => :post) %>/<%= link_to("down", post_votes_path(:score => "down", :post_id => post.id), :remote => true, :method => :post) %>)
|
(vote <%= link_to("up", post_votes_path(:score => "up", :post_id => post.id), :remote => true, :method => :post) %>/<%= link_to("down", post_votes_path(:score => "down", :post_id => post.id), :remote => true, :method => :post) %>)
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -13,4 +13,4 @@
|
|||||||
<div id="<%= preview_id %>" class="dtext-preview prose"></div>
|
<div id="<%= preview_id %>" class="dtext-preview prose"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="hint">All text is formatted using <%= link_to "DText", wiki_pages_path(:title => "help:dtext") %></span>
|
<span class="hint">All text is formatted using <%= link_to "DText", wiki_pages_path(:title => "help:dtext") %></span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<%= post.favorited_users.reverse_each.map{|user| link_to_user(user)}.join(", ").html_safe %>
|
<%= post.favorited_users.reverse_each.map{|user| link_to_user(user)}.join(", ").html_safe %>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<aside id="sidebar">
|
<aside id="sidebar">
|
||||||
<%= render "posts/partials/common/search", :path => favorites_path, :tags => @favorite_set.tag_string %>
|
<%= render "posts/partials/common/search", :path => favorites_path, :tags => @favorite_set.tag_string %>
|
||||||
|
|
||||||
<% if CurrentUser.is_privileged? %>
|
<% if CurrentUser.is_gold? %>
|
||||||
<section id="mode-box">
|
<section id="mode-box">
|
||||||
<%= render "posts/partials/index/mode_menu" %>
|
<%= render "posts/partials/index/mode_menu" %>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -43,4 +43,4 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</article>
|
</article>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ $("#topic-response").show();
|
|||||||
$('html, body').animate({
|
$('html, body').animate({
|
||||||
scrollTop: $("#forum_post_body").offset().top - 100
|
scrollTop: $("#forum_post_body").offset().top - 100
|
||||||
}, 500);
|
}, 500);
|
||||||
$("#forum_post_body").selectEnd();
|
$("#forum_post_body").selectEnd();
|
||||||
|
|||||||
@@ -47,4 +47,4 @@
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
location.reload();
|
location.reload();
|
||||||
|
|||||||
@@ -20,4 +20,4 @@
|
|||||||
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
|
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= nav_link_to("More »".html_safe, site_map_path, :id => "site-map-link") %>
|
<%= nav_link_to("More »".html_safe, site_map_path, :id => "site-map-link") %>
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<%= nav_link_to("More »".html_safe, site_map_path) %>
|
<%= nav_link_to("More »".html_safe, site_map_path) %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<%= render "users/sign_up_notice" %>
|
<%= render "users/sign_up_notice" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !CurrentUser.is_anonymous? && !CurrentUser.is_privileged? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
|
<% if !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
|
||||||
<%= render "users/upgrade_notice" %>
|
<%= render "users/upgrade_notice" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<%= render "users/dmail_notice" %>
|
<%= render "users/dmail_notice" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_privileged? %>
|
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_gold? %>
|
||||||
<%= render "users/tos" %>
|
<%= render "users/tos" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<p>Your username is <%= @user.name %>.</p>
|
<p>Your username is <%= @user.name %>.</p>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -18,4 +18,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -16,4 +16,4 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p><%= link_to "View all actions", mod_actions_path %></p>
|
<p><%= link_to "View all actions", mod_actions_path %></p>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -16,4 +16,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -10,4 +10,4 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= submit_tag "Search" %>
|
<%= submit_tag "Search" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ $("#pending-approval-notice").hide();
|
|||||||
$("#c-moderator-post-queues #post-<%= @post.id %>").hide();
|
$("#c-moderator-post-queues #post-<%= @post.id %>").hide();
|
||||||
Danbooru.notice("Post was approved");
|
Danbooru.notice("Post was approved");
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"success": <%= @post.errors.empty? %>, "reason": <%= raw @post.errors.full_messages.join("; ").to_json %>}
|
{"success": <%= @post.errors.empty? %>, "reason": <%= raw @post.errors.full_messages.join("; ").to_json %>}
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ $("#pending-approval-notice").hide();
|
|||||||
$("#c-moderator-post-queues #post-<%= @post.id %>").hide();
|
$("#c-moderator-post-queues #post-<%= @post.id %>").hide();
|
||||||
Danbooru.notice("Post was hidden");
|
Danbooru.notice("Post was hidden");
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
<%= submit_tag "Ban" %>
|
<%= submit_tag "Ban" %>
|
||||||
<%= submit_tag "Cancel" %>
|
<%= submit_tag "Cancel" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -12,4 +12,4 @@
|
|||||||
|
|
||||||
<%= submit_tag "Delete" %>
|
<%= submit_tag "Delete" %>
|
||||||
<%= submit_tag "Cancel" %>
|
<%= submit_tag "Cancel" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Danbooru.notice("Post was permanently deleted");
|
Danbooru.notice("Post was permanently deleted");
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
$("#c-posts #delete").show();
|
$("#c-posts #delete").show();
|
||||||
$("#c-posts #undelete").hide();
|
$("#c-posts #undelete").hide();
|
||||||
Danbooru.notice("Post was undeleted");
|
Danbooru.notice("Post was undeleted");
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<article data-width="<%= note.width %>" data-height="<%= note.height %>" data-x="<%= note.x %>" data-y="<%= note.y %>" data-id="<%= note.id %>"><%= raw DText.sanitize(note.body) %></article>
|
<article data-width="<%= note.width %>" data-height="<%= note.height %>" data-x="<%= note.x %>" data-y="<%= note.y %>" data-id="<%= note.id %>"><%= raw DText.sanitize(note.body) %></article>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<%= render "pool_elements/new" %>
|
<%= render "pool_elements/new" %>
|
||||||
|
|||||||
@@ -42,4 +42,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<%= render "post_appeals/new" %>
|
<%= render "post_appeals/new" %>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<%= render "post_flags/new" %>
|
<%= render "post_flags/new" %>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<p>Nobody here but us chickens!</p>
|
<p>Nobody here but us chickens!</p>
|
||||||
|
|
||||||
<p class="paginator"><%= link_to "Go back", :back, :rel => "prev" %></p>
|
<p class="paginator"><%= link_to "Go back", :back, :rel => "prev" %></p>
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
<%= submit_tag "Submit" %>
|
<%= submit_tag "Submit" %>
|
||||||
<%= submit_tag "Cancel" %>
|
<%= submit_tag "Cancel" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<% if CurrentUser.is_privileged? %>
|
<% if CurrentUser.is_gold? %>
|
||||||
<section id="mode-box">
|
<section id="mode-box">
|
||||||
<h1>Mode</h1>
|
<h1>Mode</h1>
|
||||||
<form action="/">
|
<form action="/">
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>Source: <%= post_source_tag(post) %></li>
|
<li>Source: <%= post_source_tag(post) %></li>
|
||||||
<li>Rating: <%= post.pretty_rating %></li>
|
<li>Rating: <%= post.pretty_rating %></li>
|
||||||
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% if CurrentUser.is_privileged? %>(vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)<% end %></li>
|
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% if CurrentUser.is_gold? %>(vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)<% end %></li>
|
||||||
<li>Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
|
<li>Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
|
||||||
<% if CurrentUser.is_privileged? && post.fav_count > 0 %>
|
<% if CurrentUser.is_gold? && post.fav_count > 0 %>
|
||||||
<%= link_to "»".html_safe, favorites_path(:post_id => post.id), :remote => true, :id => "show-favlist-link" %>
|
<%= link_to "»".html_safe, favorites_path(:post_id => post.id), :remote => true, :id => "show-favlist-link" %>
|
||||||
<%= link_to "«".html_safe, "#", :id => "hide-favlist-link" %>
|
<%= link_to "«".html_safe, "#", :id => "hide-favlist-link" %>
|
||||||
<div id="favlist"></div>
|
<div id="favlist"></div>
|
||||||
@@ -42,4 +42,4 @@
|
|||||||
Active
|
Active
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -46,4 +46,4 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
location.reload();
|
location.reload();
|
||||||
|
|||||||
@@ -32,4 +32,4 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -30,4 +30,4 @@
|
|||||||
Sign in - <%= Danbooru.config.app_name %>
|
Sign in - <%= Danbooru.config.app_name %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render "secondary_links" %>
|
<%= render "secondary_links" %>
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
<p><%= @error_message %></p>
|
<p><%= @error_message %></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>Error: <%= @exception.to_s %></p>
|
<p>Error: <%= @exception.to_s %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
<result success="false"><%= @error_message %></result>
|
<result success="false"><%= @error_message %></result>
|
||||||
<% else %>
|
<% else %>
|
||||||
<result success="false"><%= @exception.to_s %></result>
|
<result success="false"><%= @exception.to_s %></result>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -21,4 +21,4 @@
|
|||||||
<%= submit_tag "Cancel" %>
|
<%= submit_tag "Cancel" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render "tag_aliases/secondary_links" %>
|
<%= render "tag_aliases/secondary_links" %>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
$("#tag-alias-status-for-<%= @tag_alias.id %>").html("queued");
|
$("#tag-alias-status-for-<%= @tag_alias.id %>").html("queued");
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
$("#tag-implication-status-for-<%= @tag_implication.id %>").html("queued");
|
$("#tag-implication-status-for-<%= @tag_implication.id %>").html("queued");
|
||||||
|
|||||||
@@ -43,4 +43,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% content_for(:secondary_links) do %>
|
<% content_for(:secondary_links) do %>
|
||||||
<menu>
|
<menu>
|
||||||
<% if CurrentUser.is_privileged? %>
|
<% if CurrentUser.is_gold? %>
|
||||||
<% if @user_feedback %>
|
<% if @user_feedback %>
|
||||||
<li><%= link_to "New", new_user_feedback_path(:user_feedback => {:user_id => @user_feedback.user_id}) %></li>
|
<li><%= link_to "New", new_user_feedback_path(:user_feedback => {:user_id => @user_feedback.user_id}) %></li>
|
||||||
<% elsif params[:search] && params[:search][:user_id] %>
|
<% elsif params[:search] && params[:search][:user_id] %>
|
||||||
|
|||||||
@@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
<p><%= link_to "View message", dmail_path(@dmail, :host => Danbooru.config.hostname, :only_path => false) %></p>
|
<p><%= link_to "View message", dmail_path(@dmail, :host => Danbooru.config.hostname, :only_path => false) %></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
<body>
|
<body>
|
||||||
<p>You can upgrade your account by sending $20 USD via Paypal to <%= mail_to Danbooru.config.upgrade_account_email %>. Be sure to include your username.</p>
|
<p>You can upgrade your account by sending $20 USD via Paypal to <%= mail_to Danbooru.config.upgrade_account_email %>. Be sure to include your username.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
<body>
|
<body>
|
||||||
<p>Account upgrades are currently disabled.</p>
|
<p>Account upgrades are currently disabled.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -21,4 +21,4 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<%= numbered_paginator(@change_requests) %>
|
<%= numbered_paginator(@change_requests) %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,4 +18,4 @@
|
|||||||
<div class="input">
|
<div class="input">
|
||||||
<%= submit_tag "Submit" %>
|
<%= submit_tag "Submit" %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<li>|</li>
|
<li>|</li>
|
||||||
<% if @user.id == CurrentUser.id %>
|
<% if @user.id == CurrentUser.id %>
|
||||||
<li><%= link_to "Settings", edit_user_path(CurrentUser.user) %></li>
|
<li><%= link_to "Settings", edit_user_path(CurrentUser.user) %></li>
|
||||||
<% if @user.is_privileged? %>
|
<% if @user.is_gold? %>
|
||||||
<li><%= link_to "Edit subscriptions", tag_subscriptions_path %></li>
|
<li><%= link_to "Edit subscriptions", tag_subscriptions_path %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to "Profile", user_path(CurrentUser.user) %></li>
|
<li><%= link_to "Profile", user_path(CurrentUser.user) %></li>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<li><%= link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %></li>
|
<li><%= link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if !CurrentUser.is_privileged? %>
|
<% if !CurrentUser.is_gold? %>
|
||||||
<li><%= link_to "Upgrade", upgrade_information_users_path %></li>
|
<li><%= link_to "Upgrade", upgrade_information_users_path %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -124,4 +124,4 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<div class="input">
|
<div class="input">
|
||||||
<label>Name</label>
|
<label>Name</label>
|
||||||
|
|
||||||
<% if CurrentUser.user.is_privileged? %>
|
<% if CurrentUser.user.is_gold? %>
|
||||||
<p><%= link_to "Request a name change", new_user_name_change_request_path %></p>
|
<p><%= link_to "Request a name change", new_user_name_change_request_path %></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>You must <%= link_to "upgrade your account", upgrade_information_users_path %> to request a name change</p>
|
<p>You must <%= link_to "upgrade your account", upgrade_information_users_path %> to request a name change</p>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<%= f.input :comment_threshold, :hint => "Comments below this score will be hidden by default" %>
|
<%= f.input :comment_threshold, :hint => "Comments below this score will be hidden by default" %>
|
||||||
<%= f.input :default_image_size, :hint => "Show original image or show resampled #{Danbooru.config.large_image_width} pixel version", :label => "Default image width", :collection => [["850px", "large"], ["original", "original"]], :include_blank => false %>
|
<%= f.input :default_image_size, :hint => "Show original image or show resampled #{Danbooru.config.large_image_width} pixel version", :label => "Default image width", :collection => [["850px", "large"], ["original", "original"]], :include_blank => false %>
|
||||||
|
|
||||||
<% if CurrentUser.user.is_privileged? %>
|
<% if CurrentUser.user.is_gold? %>
|
||||||
<%= f.input :per_page, :label => "Posts per page", :as => :select, :collection => (1..100), :include_blank => false %>
|
<%= f.input :per_page, :label => "Posts per page", :as => :select, :collection => (1..100), :include_blank => false %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render "wiki_pages/secondary_links" %>
|
<%= render "wiki_pages/secondary_links" %>
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ module Danbooru
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
# Set to true to give all new users privileged access.
|
# Set to true to give all new users gold access.
|
||||||
def start_as_privileged?
|
def start_as_gold?
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ module Danbooru
|
|||||||
|
|
||||||
# Determines who can see ads.
|
# Determines who can see ads.
|
||||||
def can_see_ads?(user)
|
def can_see_ads?(user)
|
||||||
!user.is_privileged?
|
!user.is_gold?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Users cannot search for more than X regular tags at a time.
|
# Users cannot search for more than X regular tags at a time.
|
||||||
@@ -231,7 +231,7 @@ module Danbooru
|
|||||||
end
|
end
|
||||||
|
|
||||||
def is_user_restricted?(user)
|
def is_user_restricted?(user)
|
||||||
!user.is_privileged?
|
!user.is_gold?
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_user_advertiser?(user)
|
def is_user_advertiser?(user)
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
server "sonohara.donmai.us", :web, :app, :db, :primary => true
|
server "sonohara.donmai.us", :web, :app, :db, :primary => true
|
||||||
server "hijiribe.donmai.us", :web, :app
|
server "hijiribe.donmai.us", :web, :app
|
||||||
|
|||||||
@@ -4,4 +4,4 @@
|
|||||||
if defined? Unicorn
|
if defined? Unicorn
|
||||||
::NewRelic::Agent.manual_start()
|
::NewRelic::Agent.manual_start()
|
||||||
::NewRelic::Agent.after_fork(:force_reconnect => true)
|
::NewRelic::Agent.after_fork(:force_reconnect => true)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -39,4 +39,4 @@ pid "#{app_path}/tmp/pids/unicorn.pid"
|
|||||||
|
|
||||||
# after_fork do |server, worker|
|
# after_fork do |server, worker|
|
||||||
# ActiveRecord::Base.establish_connection
|
# ActiveRecord::Base.establish_connection
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="text-align: center; margin-top: 5em;">
|
<div style="text-align: center; margin-top: 5em;">
|
||||||
<p style="width: 40em; margin: auto;">The server is currently overloaded. You can purchase a <a href="/503-redirect.html">privileged account</a> for $20 to view this page anyway.</p>
|
<p style="width: 40em; margin: auto;">The server is currently overloaded. You can purchase a <a href="/503-redirect.html">gold account</a> for $20 to view this page anyway.</p>
|
||||||
<p style="width: 40em; margin: auto;"> This page will automatically refresh in one minute.</p>
|
<p style="width: 40em; margin: auto;"> This page will automatically refresh in one minute.</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ Note.find_each do |note|
|
|||||||
note.update_column(:version, i)
|
note.update_column(:version, i)
|
||||||
end
|
end
|
||||||
|
|
||||||
UserFeedback.delete_all("creator_id = user_id")
|
UserFeedback.delete_all("creator_id = user_id")
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ FactoryGirl.define do
|
|||||||
artist
|
artist
|
||||||
url {Faker::Internet.domain_name}
|
url {Faker::Internet.domain_name}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ FactoryGirl.define do
|
|||||||
reason {Faker::Lorem.words.join(" ")}
|
reason {Faker::Lorem.words.join(" ")}
|
||||||
duration 60
|
duration 60
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ FactoryGirl.define do
|
|||||||
post
|
post
|
||||||
body {Faker::Lorem.sentences.join(" ")}
|
body {Faker::Lorem.sentences.join(" ")}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ FactoryGirl.define do
|
|||||||
factory(:comment_vote) do
|
factory(:comment_vote) do
|
||||||
score 1
|
score 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ FactoryGirl.define do
|
|||||||
factory(:forum_post) do
|
factory(:forum_post) do
|
||||||
body {Faker::Lorem.sentences.join(" ")}
|
body {Faker::Lorem.sentences.join(" ")}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ FactoryGirl.define do
|
|||||||
is_sticky false
|
is_sticky false
|
||||||
is_locked false
|
is_locked false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ FactoryGirl.define do
|
|||||||
reason {Faker::Lorem.words.join(" ")}
|
reason {Faker::Lorem.words.join(" ")}
|
||||||
ip_addr "127.0.0.1"
|
ip_addr "127.0.0.1"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user