Archived
Added developer, trainingmod and lead mod as suffixes #3
+12
-8
@@ -35,6 +35,18 @@ class User < ActiveRecord::Base
|
|||||||
!!self.donor
|
!!self.donor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def developer?
|
||||||
|
!!self.developer
|
||||||
|
end
|
||||||
|
|
||||||
|
def trainingmod?
|
||||||
|
!!self.trainingmod
|
||||||
|
end
|
||||||
|
|
||||||
|
def lead_mod?
|
||||||
|
!!self.lead_mod
|
||||||
|
end
|
||||||
|
|
||||||
def confirmed?
|
def confirmed?
|
||||||
!!self.confirmed
|
!!self.confirmed
|
||||||
end
|
end
|
||||||
@@ -61,14 +73,6 @@ class User < ActiveRecord::Base
|
|||||||
!!(self.role >= :normal)
|
!!(self.role >= :normal)
|
||||||
end
|
end
|
||||||
|
|
||||||
def trainingmod?
|
|
||||||
!!(self.role >= :trainingmod)
|
|
||||||
end
|
|
||||||
|
|
||||||
def developer?
|
|
||||||
!!(self.role >= :developer)
|
|
||||||
end
|
|
||||||
|
|
||||||
def mod?
|
def mod?
|
||||||
!!(self.role >= :mod)
|
!!(self.role >= :mod)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,6 +40,26 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if admin? %>
|
||||||
|
<tr>
|
||||||
|
<td>Developer</td>
|
||||||
|
<td>
|
||||||
|
<%= f.select :developer, [["No", false], ["Yes", true]], {}, { disabled: !can_edit? } %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>TrainingMod</td>
|
||||||
|
<td>
|
||||||
|
<%= f.select :trainingmod, [["No", false], ["Yes", true]], {}, { disabled: !can_edit? } %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Lead Mod</td>
|
||||||
|
<td>
|
||||||
|
<%= f.select :lead_mod, [["No", false], ["Yes", true]], {}, { disabled: !can_edit? } %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Skype username</td>
|
<td>Skype username</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ Role.create!([
|
|||||||
{name: "disabled", value: 1, color: "#ccc"},
|
{name: "disabled", value: 1, color: "#ccc"},
|
||||||
{name: "banned", value: 2, color: "#ccc"},
|
{name: "banned", value: 2, color: "#ccc"},
|
||||||
{name: "normal", value: 10, color: "#282"},
|
{name: "normal", value: 10, color: "#282"},
|
||||||
{name: "trainingmod", value: 40, color: "#fa5"},
|
|
||||||
{name: "developer", value: 70, color: "#a0a"},
|
|
||||||
{name: "mod", value: 100, color: "#6af"},
|
{name: "mod", value: 100, color: "#6af"},
|
||||||
{name: "admin", value: 200, color: "#d22"},
|
{name: "admin", value: 200, color: "#d22"},
|
||||||
{name: "superadmin", value: 500, color: "#d22"}
|
{name: "superadmin", value: 500, color: "#d22"}
|
||||||
|
|||||||
Reference in New Issue
Block a user