Project: Potion Store
Revision: 69
Author: andykim78
Date: 29 Feb 2008 19:14:51
Changes:* Focus on the username field when loading the login page
* Admin side made a bit more iPhone friendly
Files:modified: /trunk/app/views/layouts/store.rhtml (
try)
modified: /trunk/app/views/admin/login.rhtml (
try)
modified: /trunk/app/controllers/admin_controller.rb (
try)
modified: /trunk/ChangeLog (
try)
modified: /trunk/app/views/layouts/admin.rhtml (
try)
modified: /trunk/app/views/layouts/error.rhtml (
try)
Diff:
| ... | ...@@ -3,7 +3,7 @@ |
| 3 | 3 | <head> |
| 4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 5 | 5 | <title><%=$STORE_PREFS['store_name']%></title> |
| 6 | | <link rel="icon" href="/favicon.png" type="image/png"/> |
| 6 | <link rel="icon" href="/favicon.png" type="image/png"/> |
| 7 | 7 | <style media="all" type="text/css"> |
| 8 | 8 | @import "/stylesheets/store.css"; |
| 9 | 9 | @import "/stylesheets/mytheme.css"; |
| ... | ...@@ -1,33 +1,34 @@ |
| 1 | | <center> |
| 2 | | <h1>Magic Potion Required</h1> |
| 1 | <script type="text/javascript"> |
| 2 | $(window).load(function() { |
| 3 | $('#username').get(0).focus(); |
| 4 | }); |
| 5 | </script> |
| 3 | 6 | |
| 4 | | <br/> |
| 5 | | <br/> |
| 6 | | |
| 7 | | <% form_tag :action => "login" do -%> |
| 8 | | <table> |
| 9 | | <tr> |
| 10 | | <td> |
| 11 | | <label for="username">magic:</label> |
| 12 | | </td> |
| 13 | | <td> |
| 14 | | <%= text_field_tag "username" %> |
| 15 | | </td> |
| 16 | | </tr> |
| 17 | | <tr> |
| 18 | | <td align="right"> |
| 19 | | <label for="password">potion:</label> |
| 20 | | </td> |
| 21 | | <td> |
| 22 | | <%= password_field_tag "password" %> |
| 23 | | </td> |
| 24 | | </tr> |
| 25 | | <tr> |
| 26 | | <td></td> |
| 27 | | <td> |
| 28 | | <%= submit_tag "Abracadabra" %> |
| 29 | | </td> |
| 30 | | </tr> |
| 31 | | </table> |
| 32 | | <% end -%> |
| 33 | | </center> |
| 7 | <h3>Magic Potion Required</h3> |
| 8 | |
| 9 | <% form_tag :action => "login" do -%> |
| 10 | <table> |
| 11 | <tr> |
| 12 | <td> |
| 13 | <label for="username">magic:</label> |
| 14 | </td> |
| 15 | <td> |
| 16 | <%= text_field_tag "username" %> |
| 17 | </td> |
| 18 | </tr> |
| 19 | <tr> |
| 20 | <td align="right"> |
| 21 | <label for="password">potion:</label> |
| 22 | </td> |
| 23 | <td> |
| 24 | <%= password_field_tag "password" %> |
| 25 | </td> |
| 26 | </tr> |
| 27 | <tr> |
| 28 | <td></td> |
| 29 | <td> |
| 30 | <%= submit_tag "Abracadabra" %> |
| 31 | </td> |
| 32 | </tr> |
| 33 | </table> |
| 34 | <% end -%> |
| ... | ...@@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | def login |
| 10 | 10 | unless params[:username] && params[:password] |
| 11 | | render :action => "login", :layout => 'error' and return |
| 11 | render :action => "login" and return |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | if params[:username] == $STORE_PREFS['admin_username'] && |
| ... | ...@@ -21,7 +21,7 @@ |
| 21 | 21 | end |
| 22 | 22 | else |
| 23 | 23 | flash[:notice] = "Go home kid. This ain't for you." |
| 24 | | render :action => "login", :layout => 'error' |
| 24 | render :action => "login" |
| 25 | 25 | end |
| 26 | 26 | end |
| 27 | 27 | |
| ... | ...@@ -1,3 +1,7 @@ |
| 1 | 2008-02-29 Andy Kim <andy@potionfactory.com> |
| 2 | * Focus on the username field when loading the login page |
| 3 | * Admin side made a bit more iPhone friendly |
| 4 | |
| 1 | 5 | 2008-02-14 Andy Kim <andy@potionfactory.com> |
| 2 | 6 | * Clean octal numbers in quantity field |
| 3 | 7 | |
| ... | ...@@ -5,7 +5,8 @@ |
| 5 | 5 | <title>Admin: <%= controller.action_name %></title> |
| 6 | 6 | <%= stylesheet_link_tag "scaffold" %> |
| 7 | 7 | <%= stylesheet_link_tag "admin" %> |
| 8 | | <%= javascript_include_tag "prototype" %> |
| 8 | <%= javascript_include_tag "store" %> |
| 9 | <meta name="viewport" content="width=device-width"/> |
| 9 | 10 | </head> |
| 10 | 11 | <body> |
| 11 | 12 | <% if session[:logged_in] -%> |
| ... | ...@@ -3,7 +3,7 @@ |
| 3 | 3 | <head> |
| 4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 5 | 5 | <title><%=$STORE_PREFS['store_name']%></title> |
| 6 | | <link rel="icon" href="/favicon.png" type="image/png"/> |
| 6 | <link rel="icon" href="/favicon.png" type="image/png"/> |
| 7 | 7 | <style media="all" type="text/css"> |
| 8 | 8 | @import "/stylesheets/store.css"; |
| 9 | 9 | @import "/stylesheets/mytheme.css"; |
To list