Description:
fixed layout problem, for real, using render :layout => ...
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@51 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
r27:e418fd4486af - - 5 files changed: 26 inserted, 26 deleted
@@ -0,0 +1,22 | |||
|
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 | + <%= yield :head %> | |
|
10 | + </head> | |
|
11 | + <body> | |
|
12 | + | |
|
13 | + <div class="userbar"> | |
|
14 | + <%= user_header %> | |
|
15 | + </div> | |
|
16 | + | |
|
17 | + <p style="color: green"><%= flash[:notice] %></p> | |
|
18 | + | |
|
19 | + <%= yield %> | |
|
20 | + | |
|
21 | + </body> | |
|
22 | + </html> |
@@ -2,8 +2,6 | |||
|
2 | 2 | |
|
3 | 3 | before_filter :authenticate, :except => [:index, :login] |
|
4 | 4 | |
|
5 | - layout 'application' | |
|
6 | - | |
|
7 | 5 | verify :method => :post, :only => [:submit], |
|
8 | 6 | :redirect_to => { :action => :index } |
|
9 | 7 | |
@@ -13,8 +11,8 | |||
|
13 | 11 | end |
|
14 | 12 | |
|
15 | 13 | def login |
|
16 | - MainController.layout 'empty' | |
|
17 | 14 | reset_session |
|
15 | + render :action => 'login', :layout => 'empty' | |
|
18 | 16 | end |
|
19 | 17 | |
|
20 | 18 | def list |
@@ -11,7 +11,7 | |||
|
11 | 11 | options += ' ' |
|
12 | 12 | |
|
13 | 13 | # admin menu |
|
14 | - if user.admin? | |
|
14 | + if (user!=nil) and (user.admin?) | |
|
15 | 15 | options += |
|
16 | 16 | (link_to_unless_current '[Problem admin]', |
|
17 | 17 | :controller => 'problems', :action => 'index') + ' ' |
@@ -9,6 +9,8 | |||
|
9 | 9 | <%= link_to 'Main', :controller => 'main', :action => 'list' %> |
|
10 | 10 | </div> |
|
11 | 11 | |
|
12 | + <%= link_to 'New problem', :action => 'new' %><br/> | |
|
13 | + | |
|
12 | 14 | <table> |
|
13 | 15 | <tr> |
|
14 | 16 | <th>Name</th> |
deleted file |
You need to be logged in to leave comments.
Login now