added link to moderation panel in navbar
This commit is contained in:
parent
755bbac2d7
commit
cb003ce36d
|
@ -116,4 +116,10 @@ class User < ActiveRecord::Base
|
||||||
increment! :commented_count
|
increment! :commented_count
|
||||||
answer.increment! :comment_count
|
answer.increment! :comment_count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @return [Boolean] is the user a moderator?
|
||||||
|
def mod?
|
||||||
|
return true if self.moderator? or self.admin?
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
- if current_user.admin?
|
- if current_user.admin?
|
||||||
%li= link_to "Kontrollzentrum", rails_admin_path
|
%li= link_to "Kontrollzentrum", rails_admin_path
|
||||||
%li= link_to "Sidekiq", sidekiq_web_path
|
%li= link_to "Sidekiq", sidekiq_web_path
|
||||||
|
- if current_user.mod?
|
||||||
|
%li= link_to "Moderation panel", moderation_path
|
||||||
%li.divider
|
%li.divider
|
||||||
%li= link_to "Logout", destroy_user_session_path, method: :delete
|
%li= link_to "Logout", destroy_user_session_path, method: :delete
|
||||||
- else
|
- else
|
||||||
|
|
Loading…
Reference in New Issue