From 1108f954bac634aad7eb74005ebaf52b19b3250f Mon Sep 17 00:00:00 2001
From: Ralf Teusner
Date: Mon, 19 Dec 2016 18:30:39 +0100
Subject: [PATCH] show admin menu on RFC page for admins
---
app/views/request_for_comments/show.html.erb | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/app/views/request_for_comments/show.html.erb b/app/views/request_for_comments/show.html.erb
index 5ad78b58..9c492070 100644
--- a/app/views/request_for_comments/show.html.erb
+++ b/app/views/request_for_comments/show.html.erb
@@ -6,7 +6,9 @@
submission = @request_for_comment.submission
%>
<%= user.displayname %> | <%= @request_for_comment.created_at.localtime %>
+
+
<%= t('activerecord.attributes.exercise.description') %>: <%= render_markdown(@request_for_comment.exercise.description) %>
@@ -25,6 +27,20 @@
<% else %>
<% end %>
+
+ <% if @current_user.admin? && user.is_a?(ExternalUser) %>
+
+
+ Admin Menu
+
+
+ - <%= raiselink_to "User's current status of this exercise", statistics_external_user_exercise_path(id: @request_for_comment.exercise_id, external_user_id: @request_for_comment.user_id) %>
+ - <%= link_to "All exercises of this user", statistics_external_user_path(id: @request_for_comment.user_id) %>
+ - <%= link_to "Implement the exercise yourself", implement_exercise_path(id: @request_for_comment.exercise_id) %>
+ - <%= link_to "Show the exercise", exercise_path(id: @request_for_comment.exercise_id) %>
+
+
+ <% end %>