Description:
add link to announcement management in main
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r651:23fc3f2d9ad1 - - 2 files changed: 1 inserted, 1 deleted

@@ -64,46 +64,45
64 64 end
65 65
66 66
67 67 def get_latest_submission_status
68 68 @problem = Problem.find(params[:pid])
69 69 @submission = Submission.find_last_by_user_and_problem(params[:uid],params[:pid])
70 70 puts User.find(params[:uid]).login
71 71 puts Problem.find(params[:pid]).name
72 72 puts 'nil' unless @submission
73 73 respond_to do |format|
74 74 format.js
75 75 end
76 76 end
77 77
78 78 # GET /submissions/:id/rejudge
79 79 def rejudge
80 80 @submission = Submission.find(params[:id])
81 81 @task = @submission.task
82 82 @task.status_inqueue! if @task
83 83 respond_to do |format|
84 84 format.js
85 85 end
86 86 end
87 87
88 -
89 88 protected
90 89
91 90 def submission_authorization
92 91 #admin always has privileged
93 92 if @current_user.admin?
94 93 return true
95 94 end
96 95
97 96 sub = Submission.find(params[:id])
98 97 if sub.problem.available?
99 98 puts "sub = #{sub.user.id}, current = #{@current_user.id}"
100 99 return true if GraderConfiguration["right.user_view_submission"] or sub.user == @current_user
101 100 end
102 101
103 102 #default to NO
104 103 unauthorized_redirect
105 104 return false
106 105 end
107 106
108 107
109 108 end
@@ -22,42 +22,43
22 22 %th Task name
23 23 %th Full name
24 24 %th # of sub(s)
25 25 %th Results
26 26 %th
27 27 %tbody
28 28 = render :partial => 'problem', :collection => @problems
29 29 - else
30 30 - @contest_problems.each do |cp|
31 31 - if cp[:problems].length > 0
32 32 %h2{:class =>'contest-title'}
33 33 = "#{cp[:contest] ? cp[:contest].title : 'Public problems'}"
34 34 %table.info
35 35 %tr.info-head
36 36 %th Task name
37 37 %th Full name
38 38 %th # of sub(s)
39 39 %th Results
40 40 %th
41 41 = render :partial => 'problem', :collection => cp[:problems]
42 42 .col-md-5
43 43 .panel.panel-info
44 44 .panel-heading
45 45 Announcement
46 + = link_to 'Manage', announcements_path, class: 'btn btn-xs btn-default'
46 47 %ul.list-group
47 48 = render :partial => 'announcement', :collection => @announcements
48 49
49 50 %script{:type => 'text/javascript'}
50 51 = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';"
51 52 Announcement.registerRefreshEventTimer();
52 53
53 54 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
54 55 .modal-dialog.modal-lg{role:'document'}
55 56 .modal-content
56 57 .modal-header
57 58 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
58 59 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} ×
59 60 %h4 Compiler message
60 61 .modal-body
61 62 %pre#compiler_msg
62 63 .modal-footer
63 64 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
You need to be logged in to leave comments. Login now