mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:29:54 +01:00
Remove more left-over references to role fields
This commit is contained in:
parent
5db6f90b36
commit
926631eca3
3 changed files with 8 additions and 18 deletions
|
@ -166,7 +166,7 @@ class Ajax::ModerationController < ApplicationController
|
|||
@message = I18n.t('messages.moderation.privilege.nope')
|
||||
return unless %w(moderator admin).include? params[:type].downcase
|
||||
|
||||
if %w(moderator admin).include?(params[:type].downcase) && !current_user.has_role?(:administrator)
|
||||
unless current_user.has_role?(:administrator)
|
||||
@status = :nopriv
|
||||
@message = I18n.t('messages.moderation.privilege.nopriv')
|
||||
@success = false
|
||||
|
@ -177,12 +177,10 @@ class Ajax::ModerationController < ApplicationController
|
|||
type = params[:type].downcase
|
||||
target_role = {"admin" => "administrator"}.fetch(type, type).to_sym
|
||||
|
||||
if %w(moderator admin).include? type
|
||||
if status
|
||||
target_user.add_role target_role
|
||||
else
|
||||
target_user.remove_role target_role
|
||||
end
|
||||
if status
|
||||
target_user.add_role target_role
|
||||
else
|
||||
target_user.remove_role target_role
|
||||
end
|
||||
target_user.save!
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class StaticController < ApplicationController
|
|||
end
|
||||
|
||||
def about
|
||||
@admins = User.where(admin: true).order(:id)
|
||||
|
||||
end
|
||||
|
||||
def faq
|
||||
|
|
|
@ -37,14 +37,6 @@
|
|||
%h4.heading-about.text-center= t 'views.about.repository.title'
|
||||
%p.text-center
|
||||
%em= t 'views.about.repository.desc'
|
||||
.col-md-4
|
||||
%h3= t 'views.about.contributors.title'
|
||||
%p= t('views.about.contributors.desc', app_title: APP_CONFIG['site_name'])
|
||||
%p= raw t('views.about.contributors.howto', fork: link_to(t('views.about.contributors.fork'), "https://github.com/retrospring/retrospring"))
|
||||
%ul.about--moderator
|
||||
- User.where(contributor: true).each do |sup|
|
||||
%a{href: show_user_profile_path(sup.screen_name), title: sup.screen_name, data: { toggle: :tooltip, placement: :top }}
|
||||
%img.img-rounded.answerbox--img-small{src: sup.profile_picture.url(:medium)}
|
||||
.panel.panel-default
|
||||
.panel-body
|
||||
.row
|
||||
|
@ -57,9 +49,9 @@
|
|||
%h2.entry-text#answered-count= Answer.count
|
||||
%h4.entry-subtext= t('views.general.answer').pluralize(Answer.count)
|
||||
.col-md-3.col-sm-6.col-xs-6.statistics
|
||||
%h2.entry-text#asked-count= Comment.count
|
||||
%h2.entry-text#comment-count= Comment.count
|
||||
%h4.entry-subtext= t('views.general.comment').pluralize(Comment.count)
|
||||
%h2.entry-text#answered-count= Smile.count + CommentSmile.count
|
||||
%h2.entry-text#smile-count= Smile.count + CommentSmile.count
|
||||
%h4.entry-subtext= t('views.general.smile').pluralize(Smile.count)
|
||||
.col-md-3.col-sm-12.col-xs-12.users
|
||||
.entry-text#follower-count= User.count
|
||||
|
|
Loading…
Reference in a new issue