Description:
[web] small styling, split out admin's menu, put config into table.info
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@157 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r77:0d98996d26c3 - - 3 files changed: 15 inserted, 16 deleted
@@ -2,31 +2,28 | |||
|
2 | 2 | module ApplicationHelper |
|
3 | 3 | |
|
4 | 4 | def user_header |
|
5 | 5 | menu_items = '' |
|
6 | 6 | user = User.find(session[:user_id]) |
|
7 | 7 | |
|
8 | + if (user!=nil) and (user.admin?) | |
|
9 | + # admin menu | |
|
10 | + menu_items << "<b>Administrative task:</b> " | |
|
11 | + append_to menu_items, '[Problem admin]', 'problems', 'index' | |
|
12 | + append_to menu_items, '[User admin]', 'user_admin', 'index' | |
|
13 | + append_to menu_items, '[User stat]', 'user_admin', 'user_stat' | |
|
14 | + #append_to menu_items, '[Graders]', 'graders', 'list' | |
|
15 | + append_to menu_items, '[Site config]', 'configurations', 'index' | |
|
16 | + menu_items << "<br/>" | |
|
17 | + end | |
|
18 | + | |
|
8 | 19 | # main page |
|
9 | 20 | append_to menu_items, '[Main]', 'main', 'list' |
|
10 | 21 | append_to menu_items, '[Submissions]', 'main', 'submission' |
|
11 | 22 | append_to menu_items, '[Test]', 'test', 'index' |
|
12 | - | |
|
13 | - # admin menu | |
|
14 | - if (user!=nil) and (user.admin?) | |
|
15 | - append_to menu_items, '[Problem admin]', 'problems', 'index' | |
|
16 | - append_to menu_items, '[User admin]', 'user_admin', 'index' | |
|
17 | - append_to menu_items, '[User stat]', 'user_admin', 'user_stat' | |
|
18 | - end | |
|
19 | - | |
|
20 | - # general options | |
|
21 | 23 | append_to menu_items, '[Settings]', 'users', 'index' |
|
22 | - | |
|
23 | - if (user!=nil) and (user.admin?) | |
|
24 | - append_to menu_items, '[Site config]', 'configurations', 'index' | |
|
25 | - end | |
|
26 | - | |
|
27 | 24 | append_to menu_items, '[Log out]', 'main', 'login' |
|
28 | 25 | |
|
29 | 26 | menu_items |
|
30 | 27 | end |
|
31 | 28 | |
|
32 | 29 | def append_to(option,label, controller, action) |
You need to be logged in to leave comments.
Login now