added link to moderation panel in navbar

This commit is contained in:
nilsding 2014-12-26 14:09:07 +01:00
parent 755bbac2d7
commit cb003ce36d
2 changed files with 8 additions and 0 deletions

View File

@ -116,4 +116,10 @@ class User < ActiveRecord::Base
increment! :commented_count
answer.increment! :comment_count
end
# @return [Boolean] is the user a moderator?
def mod?
return true if self.moderator? or self.admin?
false
end
end

View File

@ -38,6 +38,8 @@
- if current_user.admin?
%li= link_to "Kontrollzentrum", rails_admin_path
%li= link_to "Sidekiq", sidekiq_web_path
- if current_user.mod?
%li= link_to "Moderation panel", moderation_path
%li.divider
%li= link_to "Logout", destroy_user_session_path, method: :delete
- else