Added developer, trainingmod and lead mod as suffixes #3

Closed
ThatSimplex wants to merge 6 commits from master into master
3 changed files with 32 additions and 10 deletions
Showing only changes of commit ccac3fc975 - Show all commits

View File

@@ -35,6 +35,18 @@ class User < ActiveRecord::Base
!!self.donor
end
def developer?
!!self.developer
end
def trainingmod?
!!self.trainingmod
end
def lead_mod?
!!self.lead_mod
end
def confirmed?
!!self.confirmed
end
@@ -61,14 +73,6 @@ class User < ActiveRecord::Base
!!(self.role >= :normal)
end
def trainingmod?
!!(self.role >= :trainingmod)
end
def developer?
!!(self.role >= :developer)
end
def mod?
!!(self.role >= :mod)
end

View File

@@ -40,6 +40,26 @@
</td>
</tr>
<% 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>
<td>Skype username</td>
<td>

View File

@@ -5,8 +5,6 @@ Role.create!([
{name: "disabled", value: 1, color: "#ccc"},
{name: "banned", value: 2, color: "#ccc"},
{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: "admin", value: 200, color: "#d22"},
{name: "superadmin", value: 500, color: "#d22"}