made contributor badge changable via web interface

This commit is contained in:
Georg G 2015-04-19 22:25:04 +02:00
parent e671990a36
commit ced880fe34
2 changed files with 3 additions and 2 deletions

View File

@ -118,7 +118,7 @@ class Ajax::ModerationController < ApplicationController
target_user = User.find_by_screen_name(params[:user])
@message = "nope!"
return unless %w(banned blogger supporter moderator admin).include? params[:type].downcase
return unless %w(banned blogger supporter moderator admin contributor).include? params[:type].downcase
if (%w(supporter moderator admin).include?(params[:type].downcase) and !current_user.admin?) or
(params[:type].downcase == 'banned' and target_user.admin?)

View File

@ -14,9 +14,10 @@
- unless @user.admin?
= render 'user/modal_privileges_item', privilege: 'banned', description: 'Hit the user with ye olde banhammer', user: @user
= render 'user/modal_privileges_item', privilege: 'blogger', description: 'The user gets that privilege if they blogged something (nice) about Retrospring.', user: @user
= render 'user/modal_privileges_item', privilege: 'contributor', description: "This user has contributed to justask#{" (the software behind #{APP_CONFIG['site_name']})" unless APP_CONFIG['site_name'] == 'justask'}.", user: @user
- if current_user.admin?
= render 'user/modal_privileges_item', privilege: 'supporter', description: 'This user monetarily supports the site', user: @user
= render 'user/modal_privileges_item', privilege: 'moderator', description: 'Someone trustworthy enough to help managing reports',user: @user
= render 'user/modal_privileges_item', privilege: 'admin', description: 'This user is part of the core team', user: @user
.modal-footer
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }} Done
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }} Done