diff --git a/app/controllers/ajax/moderation_controller.rb b/app/controllers/ajax/moderation_controller.rb index 7aa86ffe..dda91f54 100644 --- a/app/controllers/ajax/moderation_controller.rb +++ b/app/controllers/ajax/moderation_controller.rb @@ -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! diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 1fd3bb62..387c9f32 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -12,7 +12,7 @@ class StaticController < ApplicationController end def about - @admins = User.where(admin: true).order(:id) + end def faq diff --git a/app/views/static/about.html.haml b/app/views/static/about.html.haml index 8f75c31a..4275d4f5 100644 --- a/app/views/static/about.html.haml +++ b/app/views/static/about.html.haml @@ -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