Description:
added codejom admin menu
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r264:dd1c5a266e4f - - 1 file changed: 1 inserted, 0 deleted
@@ -1,34 +1,35 | |||||
|
1 | # Methods added to this helper will be available to all templates in the application. |
|
1 | # Methods added to this helper will be available to all templates in the application. |
|
2 | module ApplicationHelper |
|
2 | module ApplicationHelper |
|
3 |
|
3 | ||
|
4 | def user_header |
|
4 | def user_header |
|
5 | menu_items = '' |
|
5 | menu_items = '' |
|
6 | user = User.find(session[:user_id]) |
|
6 | user = User.find(session[:user_id]) |
|
7 |
|
7 | ||
|
8 | if (user!=nil) and (session[:admin]) |
|
8 | if (user!=nil) and (session[:admin]) |
|
9 | # admin menu |
|
9 | # admin menu |
|
10 | menu_items << "<b>Administrative task:</b> " |
|
10 | menu_items << "<b>Administrative task:</b> " |
|
|
11 | + append_to menu_items, '[CODEJOM]', 'codejom', 'index' | ||
|
11 | append_to menu_items, '[Announcements]', 'announcements', 'index' |
|
12 | append_to menu_items, '[Announcements]', 'announcements', 'index' |
|
12 | append_to menu_items, '[Msg console]', 'messages', 'console' |
|
13 | append_to menu_items, '[Msg console]', 'messages', 'console' |
|
13 | append_to menu_items, '[Problems]', 'problems', 'index' |
|
14 | append_to menu_items, '[Problems]', 'problems', 'index' |
|
14 | append_to menu_items, '[Users]', 'user_admin', 'index' |
|
15 | append_to menu_items, '[Users]', 'user_admin', 'index' |
|
15 | append_to menu_items, '[Results]', 'user_admin', 'user_stat' |
|
16 | append_to menu_items, '[Results]', 'user_admin', 'user_stat' |
|
16 | append_to menu_items, '[Graders]', 'graders', 'list' |
|
17 | append_to menu_items, '[Graders]', 'graders', 'list' |
|
17 | append_to menu_items, '[Contests]', 'contests', 'index' |
|
18 | append_to menu_items, '[Contests]', 'contests', 'index' |
|
18 | append_to menu_items, '[Sites]', 'sites', 'index' |
|
19 | append_to menu_items, '[Sites]', 'sites', 'index' |
|
19 | append_to menu_items, '[System config]', 'configurations', 'index' |
|
20 | append_to menu_items, '[System config]', 'configurations', 'index' |
|
20 | menu_items << "<br/>" |
|
21 | menu_items << "<br/>" |
|
21 | end |
|
22 | end |
|
22 |
|
23 | ||
|
23 | # main page |
|
24 | # main page |
|
24 | append_to menu_items, "[#{I18n.t 'menu.main'}]", 'main', 'list' |
|
25 | append_to menu_items, "[#{I18n.t 'menu.main'}]", 'main', 'list' |
|
25 | append_to menu_items, "[#{I18n.t 'menu.messages'}]", 'messages', 'list' |
|
26 | append_to menu_items, "[#{I18n.t 'menu.messages'}]", 'messages', 'list' |
|
26 |
|
27 | ||
|
27 | if (user!=nil) and (Configuration.show_tasks_to?(user)) |
|
28 | if (user!=nil) and (Configuration.show_tasks_to?(user)) |
|
28 | append_to menu_items, "[#{I18n.t 'menu.tasks'}]", 'tasks', 'list' |
|
29 | append_to menu_items, "[#{I18n.t 'menu.tasks'}]", 'tasks', 'list' |
|
29 | #append_to menu_items, "[#{I18n.t 'menu.submissions'}]", 'main', 'submission' |
|
30 | #append_to menu_items, "[#{I18n.t 'menu.submissions'}]", 'main', 'submission' |
|
30 | #append_to menu_items, "[#{I18n.t 'menu.test'}]", 'test', 'index' |
|
31 | #append_to menu_items, "[#{I18n.t 'menu.test'}]", 'test', 'index' |
|
31 | end |
|
32 | end |
|
32 | #append_to menu_items, "[#{I18n.t 'menu.help'}]", 'main', 'help' |
|
33 | #append_to menu_items, "[#{I18n.t 'menu.help'}]", 'main', 'help' |
|
33 |
|
34 | ||
|
34 | if Configuration['system.user_setting_enabled'] |
|
35 | if Configuration['system.user_setting_enabled'] |
You need to be logged in to leave comments.
Login now