Description:
clean up layouts
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@49 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
r25:e58005f0efd2 - - 11 files changed: 51 inserted, 67 deleted
@@ -0,0 +1,15 | |||
|
1 | + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
|
2 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
|
3 | + | |
|
4 | + <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
|
5 | + <head> | |
|
6 | + <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | |
|
7 | + <title>Grader!</title> | |
|
8 | + <%= stylesheet_link_tag 'application' %> | |
|
9 | + </head> | |
|
10 | + <body> | |
|
11 | + | |
|
12 | + <%= yield %> | |
|
13 | + | |
|
14 | + </body> | |
|
15 | + </html> |
@@ -11,12 +11,11 | |||
|
11 | 11 | end |
|
12 | 12 | |
|
13 | 13 | def login |
|
14 |
- MainController.layout ' |
|
|
14 | + MainController.layout 'empty' | |
|
15 | 15 | reset_session |
|
16 | 16 | end |
|
17 | 17 | |
|
18 | 18 | def list |
|
19 | - MainController.layout 'application' | |
|
20 | 19 | @problems = Problem.find_available_problems |
|
21 | 20 | @prob_submissions = Array.new |
|
22 | 21 | @user = User.find(session[:user_id]) |
@@ -4,19 +4,30 | |||
|
4 | 4 | def user_header |
|
5 | 5 | options = '' |
|
6 | 6 | user = User.find(session[:user_id]) |
|
7 | - if user.admin? | |
|
8 | - options = options + ' ' + | |
|
9 | - (link_to_unless_current '[Problem admin]', | |
|
10 | - :controller => 'problems', :action => 'index') | |
|
11 | - options = options + ' ' + | |
|
12 | - (link_to_unless_current '[User admin]', | |
|
13 | - :controller => 'user_admin', :action => 'index') | |
|
14 | - end | |
|
7 | + | |
|
8 | + # main page | |
|
15 | 9 | options += link_to_unless_current '[Main]', |
|
16 | 10 | :controller => 'main', :action => 'list' |
|
11 | + options += ' ' | |
|
12 | + | |
|
13 | + # admin menu | |
|
14 | + if user.admin? | |
|
15 | + options += | |
|
16 | + (link_to_unless_current '[Problem admin]', | |
|
17 | + :controller => 'problems', :action => 'index') + ' ' | |
|
18 | + options += | |
|
19 | + (link_to_unless_current '[User admin]', | |
|
20 | + :controller => 'user_admin', :action => 'index') + ' ' | |
|
21 | + options += | |
|
22 | + (link_to_unless_current '[User stat]', | |
|
23 | + :controller => 'user_admin', :action => 'user_stat') + ' ' | |
|
24 | + end | |
|
25 | + | |
|
26 | + # general options | |
|
17 | 27 | options += link_to_unless_current '[Settings]', |
|
18 | 28 | :controller => 'users', :action => 'index' |
|
19 |
- options = |
|
|
29 | + options += ' ' | |
|
30 | + options += | |
|
20 | 31 | link_to('[Log out]', {:controller => 'main', :action => 'login'}) |
|
21 | 32 | options |
|
22 | 33 | end |
@@ -6,7 +6,7 | |||
|
6 | 6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> |
|
7 | 7 | <title>Grader!</title> |
|
8 | 8 | <%= stylesheet_link_tag 'application' %> |
|
9 | - <%= javascript_include_tag :defaults %> | |
|
9 | + <%= yield :head %> | |
|
10 | 10 | </head> |
|
11 | 11 | <body> |
|
12 | 12 |
@@ -1,3 +1,8 | |||
|
1 | + <% content_for :head do %> | |
|
2 | + <%= stylesheet_link_tag 'scaffold' %> | |
|
3 | + <%= javascript_include_tag :defaults %> | |
|
4 | + <% end %> | |
|
5 | + | |
|
1 | 6 | <h1>Listing problems</h1> |
|
2 | 7 | |
|
3 | 8 | <div class="usermenu"> |
@@ -1,9 +1,8 | |||
|
1 | - <h1>Listing users</h1> | |
|
1 | + <% content_for :head do %> | |
|
2 | + <%= stylesheet_link_tag 'scaffold' %> | |
|
3 | + <% end %> | |
|
2 | 4 | |
|
3 | - <div class="usermenu"> | |
|
4 | - <%= link_to 'Stat', :action => 'user_stat' %> | |
|
5 | - <%= link_to 'Main', :controller => 'main', :action => 'list' %> | |
|
6 | - </div> | |
|
5 | + <h1>Listing users</h1> | |
|
7 | 6 | |
|
8 | 7 | <div style="border: solid 1px; margin: 2px"> |
|
9 | 8 | <b>Quick add</b> |
@@ -1,3 +1,5 | |||
|
1 | + <h1>User information</h1> | |
|
2 | + | |
|
1 | 3 | <% for column in User.content_columns %> |
|
2 | 4 | <p> |
|
3 | 5 | <b><%= column.human_name %>:</b> <%=h @user.send(column.name) %> |
@@ -1,3 +1,6 | |||
|
1 | + | |
|
2 | + - content_for :head do | |
|
3 | + = javascript_include_tag :defaults | |
|
1 | 4 | |
|
2 | 5 | %h1 Your account settings |
|
3 | 6 |
deleted file |
deleted file |
deleted file |
You need to be logged in to leave comments.
Login now