Description:
allow ta to set model submission
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r857:aa5ee227f493 - - 4 files changed: 13 inserted, 10 deleted

@@ -91,7 +91,7
91 91 end
92 92
93 93 def has_role?(role)
94 - self.roles.where(name: role).count > 0
94 + self.roles.where(name: [role,'admin']).count > 0
95 95 end
96 96
97 97 def email_for_editing
@@ -54,12 +54,14
54 54 %table.table.table-hover
55 55 %thead
56 56 %tr
57 - %th #Sub
57 + %th #Sub (lang)
58 58 %th Author
59 59 %tbody
60 60 - @model_subs.each do |sub|
61 61 %tr
62 - %td= link_to "##{sub.id}", submission_path(sub)
62 + %td
63 + = link_to "##{sub.id}", submission_path(sub)
64 + = "(#{sub.language.pretty_name})"
63 65 %td= sub.user.full_name
64 66 .col-md-8
65 67 - if @best
@@ -22,8 +22,9
22 22 /=render partial: 'all_time_hof'
23 23 Please select a problem.
24 24 - else
25 - %h1 [#{Problem.find(params[:id]).name}] #{Problem.find(params[:id]).full_name}
26 - -# %h2 Submission History
27 - -# =render partial: 'application/bar_graph', locals: { histogram: @histogram }
25 + %h1
26 + [#{Problem.find(params[:id]).name}] #{Problem.find(params[:id]).full_name}
27 + - if @current_user.has_role?('ta')
28 + %a{href:stat_problem_path(@problem)} (stat)
28 29 =render partial: 'task_hof'
29 30
@@ -94,9 +94,9
94 94 %strong Grading Task Status
95 95 %td
96 96 = @task.status_str if @task
97 - - if session[:admin]
97 + - if @current_user.admin?
98 98 = link_to "rejudge", rejudge_submission_path, data: {remote: true}, class: 'btn btn-info btn-xs'
99 - - if session[:admin]
99 + - if @current_user.has_role?('ta')
100 100 %tr
101 101 %td.text-right
102 102 %strong IP
@@ -107,11 +107,11
107 107 %td
108 108 - if @submission.tag_model?
109 109 YES
110 - - if session[:admin]
110 + - if @current_user.has_role?('ta')
111 111 = link_to "remove model status", set_tag_submission_path(@submission, tag: :default), class: 'btn btn-warning btn-xs'
112 112 - else
113 113 No
114 - - if session[:admin]
114 + - if @current_user.has_role?('ta')
115 115 = link_to "set as model solution", set_tag_submission_path(@submission, tag: :model), class: 'btn btn-success btn-xs'
116 116
117 117
You need to be logged in to leave comments. Login now