add builder
This commit is contained in:
@@ -7,6 +7,7 @@ class User < ActiveRecord::Base
|
||||
module Levels
|
||||
MEMBER = 20
|
||||
PRIVILEGED = 30
|
||||
BUILDER = 32
|
||||
CONTRIBUTOR = 33
|
||||
JANITOR = 35
|
||||
MODERATOR = 40
|
||||
@@ -218,6 +219,7 @@ class User < ActiveRecord::Base
|
||||
return {
|
||||
"Member" => Levels::MEMBER,
|
||||
"Privileged" => Levels::PRIVILEGED,
|
||||
"Builder" => Levels::BUIDLER,
|
||||
"Contributor" => Levels::CONTRIBUTOR,
|
||||
"Janitor" => Levels::JANITOR,
|
||||
"Moderator" => Levels::MODERATOR,
|
||||
@@ -236,7 +238,7 @@ class User < ActiveRecord::Base
|
||||
|
||||
def role
|
||||
case level
|
||||
when Levels::MEMBER, Levels::PRIVILEGED, Levels::CONTRIBUTOR
|
||||
when Levels::MEMBER, Levels::PRIVILEGED, Levels::BUILDER, Levels::CONTRIBUTOR
|
||||
:member
|
||||
|
||||
when Levels::MODERATOR, Levels::JANITOR
|
||||
@@ -252,6 +254,9 @@ class User < ActiveRecord::Base
|
||||
when Levels::MEMBER
|
||||
"Member"
|
||||
|
||||
when Levels::BUILDER
|
||||
"Builder"
|
||||
|
||||
when Levels::PRIVILEGED
|
||||
"Privileged"
|
||||
|
||||
@@ -277,6 +282,10 @@ class User < ActiveRecord::Base
|
||||
true
|
||||
end
|
||||
|
||||
def is_builder?
|
||||
level >= Levels::BUILDER
|
||||
end
|
||||
|
||||
def is_privileged?
|
||||
level >= Levels::PRIVILEGED
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<%= link_to topic.title, forum_topic_path(topic) %>
|
||||
|
||||
<% if topic.response_count > 30 %>
|
||||
<%= link_to "last", forum_topic_path(topic, :page => (topic.response_count / Danbooru.config.posts_per_page.to_f).ceil), :class => "last-page" %>
|
||||
<%= link_to "last", forum_topic_path(topic, :page => topic.last_page, :class => "last-page" %>
|
||||
<% end %>
|
||||
|
||||
<% if topic.is_locked? %>
|
||||
|
||||
Reference in New Issue
Block a user