Description:
front page OK
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r747:c37b8f654c0b - - 2 files changed: 58 inserted, 15 deleted
@@ -1,95 +1,95 | |||
|
1 | 1 | %header.navbar.navbar-default.navbar-fixed-top |
|
2 | 2 | %nav |
|
3 | 3 | .container-fluid |
|
4 | 4 | .navbar-header |
|
5 | 5 | %button.navbar-toggle.collapsed{ data: {toggle: 'collapse', target: '#navbar-collapse'} } |
|
6 | 6 | %span.sr-only Togggle Navigation |
|
7 | 7 | %span.icon-bar |
|
8 | 8 | %span.icon-bar |
|
9 | 9 | %span.icon-bar |
|
10 |
- %a.navbar-brand{href: |
|
|
10 | + %a.navbar-brand{href: list_main_path} | |
|
11 | 11 | %span.glyphicon.glyphicon-home |
|
12 | 12 | MAIN |
|
13 | 13 | .collapse.navbar-collapse#navbar-collapse |
|
14 | 14 | %ul.nav.navbar-nav |
|
15 | 15 | / submission |
|
16 | 16 | - if (@current_user!=nil) and (GraderConfiguration.show_tasks_to?(@current_user)) |
|
17 | 17 | %li.dropdown |
|
18 | 18 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
19 | 19 | = "#{I18n.t 'menu.submissions'}" |
|
20 | 20 | %span.caret |
|
21 | 21 | %ul.dropdown-menu |
|
22 | 22 | = add_menu("View", 'submissions', 'index') |
|
23 | 23 | = add_menu("Self Test", 'test', 'index') |
|
24 | 24 | / hall of fame |
|
25 | 25 | - if GraderConfiguration['right.user_hall_of_fame'] |
|
26 | 26 | = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof') |
|
27 | 27 | / display MODE button (with countdown in contest mode) |
|
28 | 28 | - if GraderConfiguration.analysis_mode? |
|
29 | 29 | %div.navbar-btn.btn.btn-success#countdown= "ANALYSIS MODE" |
|
30 | 30 | - elsif GraderConfiguration.time_limit_mode? |
|
31 | 31 | - if @current_user.contest_finished? |
|
32 | 32 | %div.navbar-btn.btn.btn-danger#countdown= "Contest is over" |
|
33 | 33 | - elsif !@current_user.contest_started? |
|
34 | 34 | %div.navbar-btn.btn.btn-primary#countdown= (t 'title_bar.contest_not_started') |
|
35 | 35 | - else |
|
36 | 36 | %div.navbar-btn.btn.btn-primary#countdown asdf |
|
37 | 37 | :javascript |
|
38 | 38 | $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'}); |
|
39 | 39 | / admin section |
|
40 | 40 | - if (@current_user!=nil) and (session[:admin]) |
|
41 | 41 | / management |
|
42 | 42 | %li.dropdown |
|
43 | 43 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
44 | 44 | Manage |
|
45 | 45 | %span.caret |
|
46 | 46 | %ul.dropdown-menu |
|
47 | 47 | = add_menu( 'Announcements', 'announcements', 'index') |
|
48 | 48 | = add_menu( 'Problems', 'problems', 'index') |
|
49 | 49 | = add_menu( 'Tags', 'tags', 'index') |
|
50 | 50 | = add_menu( 'Users', 'user_admin', 'index') |
|
51 | 51 | = add_menu( 'User Groups', 'groups', 'index') |
|
52 | 52 | = add_menu( 'Graders', 'graders', 'list') |
|
53 | 53 | = add_menu( 'Message ', 'messages', 'console') |
|
54 | 54 | %li.divider{role: 'separator'} |
|
55 | 55 | = add_menu( 'System config', 'configurations', 'index') |
|
56 | 56 | %li.divider{role: 'separator'} |
|
57 | 57 | = add_menu( 'Sites', 'sites', 'index') |
|
58 | 58 | = add_menu( 'Contests', 'contest_management', 'index') |
|
59 | 59 | / report |
|
60 | 60 | %li.dropdown |
|
61 | 61 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
62 | 62 | Report |
|
63 | 63 | %span.caret |
|
64 | 64 | %ul.dropdown-menu |
|
65 | 65 | = add_menu( 'Current Score', 'report', 'current_score') |
|
66 | 66 | = add_menu( 'Score Report', 'report', 'max_score') |
|
67 | 67 | = add_menu( 'Report', 'report', 'multiple_login') |
|
68 | 68 | - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 |
|
69 | 69 | =link_to "#{ungraded} backlogs!", |
|
70 | 70 | grader_list_path, |
|
71 | 71 | class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission' |
|
72 | 72 | |
|
73 | 73 | %ul.nav.navbar-nav.navbar-right |
|
74 | 74 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
75 |
- = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', ' |
|
|
75 | + = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'index', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) | |
|
76 | 76 | - if GraderConfiguration['system.user_setting_enabled'] |
|
77 | 77 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) |
|
78 | 78 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{@current_user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) |
|
79 | 79 | |
|
80 | 80 | / |
|
81 | 81 | - if (@current_user!=nil) and (session[:admin]) |
|
82 | 82 | %nav.navbar.navbar-fixed-top.navbar-inverse.secondnavbar |
|
83 | 83 | .container-fluid |
|
84 | 84 | .collapse.navbar-collapse |
|
85 | 85 | %ul.nav.navbar-nav |
|
86 | 86 | = add_menu( '[Announcements]', 'announcements', 'index') |
|
87 | 87 | = add_menu( '[Msg console]', 'messages', 'console') |
|
88 | 88 | = add_menu( '[Problems]', 'problems', 'index') |
|
89 | 89 | = add_menu( '[Users]', 'user_admin', 'index') |
|
90 | 90 | = add_menu( '[Results]', 'user_admin', 'user_stat') |
|
91 | 91 | = add_menu( '[Report]', 'report', 'multiple_login') |
|
92 | 92 | = add_menu( '[Graders]', 'graders', 'list') |
|
93 | 93 | = add_menu( '[Contests]', 'contest_management', 'index') |
|
94 | 94 | = add_menu( '[Sites]', 'sites', 'index') |
|
95 | 95 | = add_menu( '[System config]', 'configurations', 'index') |
@@ -1,115 +1,158 | |||
|
1 | 1 | CafeGrader::Application.routes.draw do |
|
2 | 2 | resources :tags |
|
3 | 3 | get "sources/direct_edit" |
|
4 | 4 | |
|
5 | 5 | root :to => 'main#login' |
|
6 | 6 | |
|
7 | 7 | #logins |
|
8 | 8 | match 'login/login', to: 'login#login', via: [:get,:post] |
|
9 | 9 | |
|
10 | 10 | |
|
11 | 11 | resources :contests |
|
12 | 12 | |
|
13 | 13 | resources :sites |
|
14 | 14 | |
|
15 | + resources :test | |
|
16 | + | |
|
17 | + resources :messages do | |
|
18 | + collection do | |
|
19 | + get 'console' | |
|
20 | + end | |
|
21 | + end | |
|
22 | + | |
|
15 | 23 | resources :announcements do |
|
16 | 24 | member do |
|
17 | 25 | get 'toggle','toggle_front' |
|
18 | 26 | end |
|
19 | 27 | end |
|
20 | 28 | |
|
21 | 29 | resources :problems do |
|
22 | 30 | member do |
|
23 | 31 | get 'toggle' |
|
24 | 32 | get 'toggle_test' |
|
25 | 33 | get 'toggle_view_testcase' |
|
26 | 34 | get 'stat' |
|
27 | 35 | end |
|
28 | 36 | collection do |
|
29 | 37 | get 'turn_all_off' |
|
30 | 38 | get 'turn_all_on' |
|
31 | 39 | get 'import' |
|
32 | 40 | get 'manage' |
|
33 | 41 | end |
|
34 | 42 | end |
|
35 | 43 | |
|
36 | 44 | resources :groups do |
|
37 | 45 | member do |
|
38 | 46 | post 'add_user', to: 'groups#add_user', as: 'add_user' |
|
39 | 47 | delete 'remove_user/:user_id', to: 'groups#remove_user', as: 'remove_user' |
|
40 | 48 | delete 'remove_all_user', to: 'groups#remove_all_user', as: 'remove_all_user' |
|
41 | 49 | post 'add_problem', to: 'groups#add_problem', as: 'add_problem' |
|
42 | 50 | delete 'remove_problem/:problem_id', to: 'groups#remove_problem', as: 'remove_problem' |
|
43 | 51 | delete 'remove_all_problem', to: 'groups#remove_all_problem', as: 'remove_all_problem' |
|
44 | 52 | end |
|
45 | 53 | collection do |
|
46 | 54 | |
|
47 | 55 | end |
|
48 | 56 | end |
|
49 | 57 | |
|
50 | 58 | resources :testcases, only: [] do |
|
51 | 59 | member do |
|
52 | 60 | get 'download_input' |
|
53 | 61 | get 'download_sol' |
|
54 | 62 | end |
|
55 | 63 | collection do |
|
56 | 64 | get 'show_problem/:problem_id(/:test_num)' => 'testcases#show_problem', as: 'show_problem' |
|
57 | 65 | end |
|
58 | 66 | end |
|
59 | 67 | |
|
60 | 68 | resources :grader_configuration, controller: 'configurations' |
|
61 | 69 | |
|
62 | 70 | resources :users do |
|
63 | 71 | member do |
|
64 | 72 | get 'toggle_activate', 'toggle_enable' |
|
65 | 73 | get 'stat' |
|
66 | 74 | end |
|
67 | 75 | end |
|
68 | 76 | |
|
69 | 77 | resources :submissions do |
|
70 | 78 | member do |
|
71 | 79 | get 'download' |
|
72 | 80 | get 'compiler_msg' |
|
73 | 81 | get 'rejudge' |
|
74 | 82 | end |
|
75 | 83 | collection do |
|
76 | 84 | get 'prob/:problem_id', to: 'submissions#index', as: 'problem' |
|
77 | 85 | get 'direct_edit_problem/:problem_id(/:user_id)', to: 'submissions#direct_edit_problem', as: 'direct_edit_problem' |
|
78 | 86 | get 'get_latest_submission_status/:uid/:pid', to: 'submissions#get_latest_submission_status', as: 'get_latest_submission_status' |
|
79 | 87 | end |
|
80 | 88 | end |
|
81 | 89 | |
|
82 | 90 | |
|
91 | + #user admin | |
|
92 | + resources :user_admin do | |
|
93 | + collection do | |
|
94 | + get 'bulk_manage', as: 'bulk_manage_user_admin' | |
|
95 | + delete ':id', to: 'user_admin#destroy', as: 'user_admin_destroy' | |
|
96 | + get 'user_stat' | |
|
97 | + end | |
|
98 | + end | |
|
83 | 99 | |
|
84 | - #main | |
|
85 | - get "main/list" | |
|
86 | - get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission' | |
|
100 | + resources :contest_management, only: [:index] do | |
|
101 | + collection do | |
|
102 | + get 'user_stat' | |
|
103 | + get 'clear_stat' | |
|
104 | + get 'clear_all_stat' | |
|
105 | + end | |
|
106 | + end | |
|
107 | + | |
|
108 | + #get 'user_admin', to: 'user_admin#index' | |
|
109 | + #get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin' | |
|
110 | + #post 'user_admin', to: 'user_admin#create' | |
|
111 | + #delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy' | |
|
87 | 112 | |
|
88 | - #user admin | |
|
89 | - get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin' | |
|
90 | - post 'user_admin', to: 'user_admin#create' | |
|
91 | - delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy' | |
|
92 | - | |
|
113 | + #singular resource | |
|
114 | + #---- BEWARE ---- singular resource maps to plural controller by default, we can override by provide controller name directly | |
|
93 | 115 | #report |
|
94 | - get 'report/current_score', to: 'report#current_score', as: 'report_current_score' | |
|
95 | - get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' | |
|
96 | - get "report/login" | |
|
97 | - get 'report/max_score', to: 'report#max_score', as: 'report_max_score' | |
|
98 | - post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score' | |
|
116 | + resource :report, only: [], controller: 'report' do | |
|
117 | + get 'login' | |
|
118 | + get 'multiple_login' | |
|
119 | + get 'problem_hof/:id', action: 'problem_hof' | |
|
120 | + get 'current_score' | |
|
121 | + get 'max_score' | |
|
122 | + post 'show_max_score' | |
|
123 | + end | |
|
124 | + #get 'report/current_score', to: 'report#current_score', as: 'report_current_score' | |
|
125 | + #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' | |
|
126 | + #get "report/login" | |
|
127 | + #get 'report/max_score', to: 'report#max_score', as: 'report_max_score' | |
|
128 | + #post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score' | |
|
129 | + | |
|
130 | + resource :main, only: [], controller: 'main' do | |
|
131 | + get 'list' | |
|
132 | + get 'submission(/:id)', action: 'submission', as: 'main_submission' | |
|
133 | + post 'submit' | |
|
134 | + get 'announcements' | |
|
135 | + get 'help' | |
|
136 | + end | |
|
137 | + #main | |
|
138 | + #get "main/list" | |
|
139 | + #get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission' | |
|
140 | + #post 'main/submit', to: 'main#submit' | |
|
141 | + #get 'main/announcements', to: 'main#announcements' | |
|
99 | 142 | |
|
100 | 143 | |
|
101 | 144 | # |
|
102 | 145 | get 'tasks/view/:file.:ext' => 'tasks#view' |
|
103 | 146 | get 'tasks/download/:id/:file.:ext' => 'tasks#download' |
|
104 | 147 | get 'heartbeat/:id/edit' => 'heartbeat#edit' |
|
105 | 148 | |
|
106 | 149 | #grader |
|
107 | 150 | get 'graders/list', to: 'graders#list', as: 'grader_list' |
|
108 | 151 | |
|
109 | 152 | |
|
110 | 153 | # See how all your routes lay out with "rake routes" |
|
111 | 154 | |
|
112 | 155 | # This is a legacy wild controller route that's not recommended for RESTful applications. |
|
113 | 156 | # Note: This route will make all actions in every controller accessible via GET requests. |
|
114 | 157 | # match ':controller(/:action(/:id))(.:format)', via: [:get, :post] |
|
115 | 158 | end |
You need to be logged in to leave comments.
Login now