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 @@
+
+

Admins

+ + + + + + + + + <% Group.contributors.each do |grouper| %> + + + + <% if grouper.user.public_email %> + + <% else %> + + <% end %> + + + + <% end %> +
UsernameEmailTaskAge
<%= flag grouper.user.country %><%= namelink grouper.user %><%= h grouper.user.email_s %> + <% if grouper.task %> + <%= h grouper.task %> + <% else %> + <%= h grouper.group.name.singularize %> + <% end %> + <%= h grouper.user.age %>
+

Referees

diff --git a/config/environments/production.rb b/config/environments/production.rb index 39197c9..37abb4c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -33,8 +33,8 @@ Ensl::Application.configure do # See everything in the log (default is :info) config.log_level = :error - # Use a different logger for distrwt ibuted setups - # config.logger = SyslogLogger.new + # Use a different logger for distributed setups + config.logger = Logger.new(Rails.root.join("log", Rails.env + ".log" ), 5 , 10 * 1024 * 1024) # Use a different cache store in production config.cache_store = :dalli_store, 'memcached:11211', 'localhost' diff --git a/db/seeds.rb b/db/seeds.rb index 39d2b36..1b8beb5 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -14,6 +14,8 @@ Group.create!(id: Group::CASTERS, name: "Streamers", founder: User.first) Group.create!(id: Group::CHAMPIONS, name: "Champions", founder: User.first) Group.create!(id: Group::PREDICTORS, name: "Predictors", founder: User.first) Group.create!(id: Group::STAFF, name: "Staff", founder: User.first) +Group.create!(id: Group::GATHER_MODERATORS, name: 'Gather Moderators', founder: User.first) +Group.create!(id: Group::CONTRIBUTORS, name: 'Contributors', founder: User.first) # Group Association Grouper.create!(group_id: Group::ADMINS, user_id: User.first.id)