diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index 7f7b78c..3848d10 100755 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -32,6 +32,7 @@ class Api::V1::UsersController < Api::V1::BaseController referee: @user.ref?, caster: @user.caster?, moderator: @user.gather_moderator?, + contributor: @user.contributor?, steam: @user.steamid.nil? ? nil : { id: @user.steamid, url: @steam.nil? ? nil : @steam.base_url, diff --git a/app/models/group.rb b/app/models/group.rb index ca22b60..714ec27 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -22,6 +22,7 @@ class Group < ActiveRecord::Base PREDICTORS = 8 STAFF = 10 GATHER_MODERATORS = 14 + CONTRIBUTORS = 16 attr_protected :id, :updated_at, :created_at, :founder_id validates_length_of :name, :maximum => 20 @@ -113,4 +114,15 @@ class Group < ActiveRecord::Base end gathermods end + + def self.contributors + contributors = [] + group_contrib = where(id:CONTRIBUTORS).first + return contributors unless group_contrib + + (group_contrib.groupers).each do |g| + contributors << g unless contributors.include? g + end + contributors + end end diff --git a/app/models/user.rb b/app/models/user.rb index f3c85c8..e3886d9 100755 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -27,7 +27,7 @@ require File.join(Rails.root, 'vendor', 'plugins', 'acts_as_versioned', 'lib', ' class User < ActiveRecord::Base include Extra - + VERIFICATION_TIME = 604800 attr_protected :id, :created_at, :updated_at, :lastvisit, :lastip, :password, :version @@ -211,6 +211,10 @@ class User < ActiveRecord::Base groups.exists? id: Group::GATHER_MODERATORS end + def contributor? + groups.exists? id: Group::CONTRIBUTORS + end + def allowed_to_ban? admin? or moderator? end diff --git a/app/views/about/staff.html.erb b/app/views/about/staff.html.erb index e34be6e..2b3ccc9 100644 --- a/app/views/about/staff.html.erb +++ b/app/views/about/staff.html.erb @@ -16,6 +16,7 @@
+ | Username | +Task | +Age | +||
---|---|---|---|---|---|
<%= flag grouper.user.country %> | +<%= namelink grouper.user %> | + <% if grouper.user.public_email %> +<%= h grouper.user.email_s %> | + <% else %> ++ <% end %> + | + <% if grouper.task %> + <%= h grouper.task %> + <% else %> + <%= h grouper.group.name.singularize %> + <% end %> + | +<%= h grouper.user.age %> | +