Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

prettied up login page

  • Loading branch information...
Josh Adams
Josh Adams committed Nov 9, 2008
1 parent 0ce30cc commit b5d4810a7436e305c493982b2d774be39169222b
Showing with 10,563 additions and 24 deletions.
  1. +13 −10 app/controllers/admin/account_controller.rb
  2. +10 −10 app/views/admin/account/login.html.erb
  3. +0 −4 app/views/layouts/admin.html.erb
  4. +47 −0 app/views/layouts/mini.html.erb
  5. +3 −0 config/initializers/dependencies.rb
  6. +7 −0 lib/isotope11.rb
  7. +13 −0 lib/isotope11/action_controller_extensions.rb
  8. +33 −0 lib/isotope11/action_view_helper_extensions.rb
  9. +17 −0 lib/isotope11/calendar_date_select_extensions.rb
  10. +2 −0 public/blank_iframe.html
  11. BIN public/images/calendar_date_select/calendar.gif
  12. +442 −0 public/javascripts/calendar_date_select/calendar_date_select.js
  13. +34 −0 public/javascripts/calendar_date_select/format_american.js
  14. +27 −0 public/javascripts/calendar_date_select/format_db.js
  15. +7 −0 public/javascripts/calendar_date_select/format_euro_24hr.js
  16. +7 −0 public/javascripts/calendar_date_select/format_euro_24hr_ymd.js
  17. +32 −0 public/javascripts/calendar_date_select/format_finnish.js
  18. +36 −0 public/javascripts/calendar_date_select/format_hyphen_ampm.js
  19. +46 −0 public/javascripts/calendar_date_select/format_iso_date.js
  20. +24 −0 public/javascripts/calendar_date_select/format_italian.js
  21. +10 −0 public/javascripts/calendar_date_select/locale/de.js
  22. +10 −0 public/javascripts/calendar_date_select/locale/fi.js
  23. +10 −0 public/javascripts/calendar_date_select/locale/fr.js
  24. +10 −0 public/javascripts/calendar_date_select/locale/pl.js
  25. +11 −0 public/javascripts/calendar_date_select/locale/pt.js
  26. +10 −0 public/javascripts/calendar_date_select/locale/ru.js
  27. +2 −0 public/plugin_assets/calendar_date_select/blank_iframe.html
  28. BIN public/plugin_assets/calendar_date_select/images/calendar_date_select/calendar.gif
  29. +442 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/calendar_date_select.js
  30. +34 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_american.js
  31. +27 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_db.js
  32. +7 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_euro_24hr.js
  33. +7 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_euro_24hr_ymd.js
  34. +32 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_finnish.js
  35. +36 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_hyphen_ampm.js
  36. +46 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_iso_date.js
  37. +24 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/format_italian.js
  38. +10 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/locale/de.js
  39. +10 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/locale/fi.js
  40. +10 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/locale/fr.js
  41. +10 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/locale/pl.js
  42. +11 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/locale/pt.js
  43. +10 −0 public/plugin_assets/calendar_date_select/javascripts/calendar_date_select/locale/ru.js
  44. +130 −0 public/plugin_assets/calendar_date_select/stylesheets/calendar_date_select/blue.css
  45. +135 −0 public/plugin_assets/calendar_date_select/stylesheets/calendar_date_select/default.css
  46. +128 −0 public/plugin_assets/calendar_date_select/stylesheets/calendar_date_select/plain.css
  47. +135 −0 public/plugin_assets/calendar_date_select/stylesheets/calendar_date_select/red.css
  48. +133 −0 public/plugin_assets/calendar_date_select/stylesheets/calendar_date_select/silver.css
  49. +18 −0 public/stylesheets/admin.css
  50. +130 −0 public/stylesheets/calendar_date_select/blue.css
  51. +135 −0 public/stylesheets/calendar_date_select/default.css
  52. +128 −0 public/stylesheets/calendar_date_select/plain.css
  53. +135 −0 public/stylesheets/calendar_date_select/red.css
  54. +133 −0 public/stylesheets/calendar_date_select/silver.css
  55. +35 −0 public/stylesheets/mini.css
  56. +200 −0 vendor/plugins/calendar_date_select/CHANGELOG
  57. +20 −0 vendor/plugins/calendar_date_select/MIT-LICENSE
  58. +34 −0 vendor/plugins/calendar_date_select/README.textile
  59. +24 −0 vendor/plugins/calendar_date_select/Rakefile
  60. +17 −0 vendor/plugins/calendar_date_select/init.rb
  61. +306 −0 vendor/plugins/calendar_date_select/js_test/functional/.tmp_cds_test.html
  62. +334 −0 vendor/plugins/calendar_date_select/js_test/functional/cds_test.html
  63. +4,184 −0 vendor/plugins/calendar_date_select/js_test/prototype.js
  64. +40 −0 vendor/plugins/calendar_date_select/js_test/test.css
  65. +46 −0 vendor/plugins/calendar_date_select/js_test/unit/cds_helper_methods.html
  66. +564 −0 vendor/plugins/calendar_date_select/js_test/unittest.js
  67. +222 −0 vendor/plugins/calendar_date_select/lib/calendar_date_select.rb
  68. +3 −0 vendor/plugins/calendar_date_select/lib/gem_init.rb
  69. +38 −0 vendor/plugins/calendar_date_select/lib/includes_helper.rb
  70. +2 −0 vendor/plugins/calendar_date_select/public/blank_iframe.html
  71. BIN vendor/plugins/calendar_date_select/public/images/calendar_date_select/calendar.gif
  72. +442 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/calendar_date_select.js
  73. +34 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_american.js
  74. +27 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_db.js
  75. +7 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr.js
  76. +7 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr_ymd.js
  77. +32 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_finnish.js
  78. +36 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_hyphen_ampm.js
  79. +46 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_iso_date.js
  80. +24 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_italian.js
  81. +10 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/de.js
  82. +10 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fi.js
  83. +10 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fr.js
  84. +10 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/pl.js
  85. +11 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/pt.js
  86. +10 −0 vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/ru.js
  87. +130 −0 vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/blue.css
  88. +135 −0 vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/default.css
  89. +128 −0 vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/plain.css
  90. +135 −0 vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/red.css
  91. +133 −0 vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/silver.css
  92. +157 −0 vendor/plugins/calendar_date_select/test/functional/calendar_date_select_test.rb
  93. +15 −0 vendor/plugins/calendar_date_select/test/functional/helper_methods_test.rb
  94. +26 −0 vendor/plugins/calendar_date_select/test/test_helper.rb
@@ -8,17 +8,20 @@ def index
end

def login
return unless request.post?
self.current_user = User.authenticate(params[:login], params[:password])
if logged_in?
if params[:remember_me] == "1"
self.current_user.remember_me
cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
if request.post?
self.current_user = User.authenticate(params[:login], params[:password])
if logged_in?
if params[:remember_me] == "1"
self.current_user.remember_me
cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
end
flash[:message] = "Logged in successfully"
redirect_back_or_default(admin_pages_path)
end
flash[:message] = "Logged in successfully"
redirect_back_or_default(admin_pages_path)
flash.now[:message] = 'Invalid username and password.'
else
render :layout => 'mini'
end
flash.now[:message] = 'Invalid username and password.'
end

def update
@@ -60,6 +63,6 @@ def logout
cookies.delete :auth_token
reset_session
flash[:notice] = "You have been logged out."
redirect_back_or_default("admin/account/login")
redirect_back_or_default("/admin/account/login")
end
end
@@ -1,15 +1,15 @@
<div class="login">
<% form_tag do -%>
<p><label for="login">Login</label><br/>
<%= text_field_tag 'login' %></p>
<% form_tag do -%>
<p><label for="login">Login</label><br/>
<%= text_field_tag 'login' %></p>

<p><label for="password">Password</label><br/>
<%= password_field_tag 'password' %></p>
<p><label for="password">Password</label><br/>
<%= password_field_tag 'password' %></p>

<!-- Uncomment this if you want this functionality
<p><label for="remember_me">Remember me:</label><%= check_box_tag 'remember_me' %></p>
-->
<!-- Uncomment this if you want this functionality
<p><label for="remember_me">Remember me:</label><%= check_box_tag 'remember_me' %></p>
-->

<p><%= submit_tag 'Log in' %></p>
<% end -%>
<p><%= submit_tag 'Log in' %></p>
<% end -%>
</div>
@@ -38,10 +38,6 @@
<div id="doc2" class="yui-t7">
<div id="bd">
<div class="yui-g">
<%# TODO: I need to use the helper I use to print all flash messages here, way more stylable / useful -ja -%>
<% if flash[:message] -%>
<div id="message"><%= flash[:message] %></div> <!-- end .message -->
<% end -%>
<%= @content_for_layout %>
</div>
</div>
@@ -0,0 +1,47 @@
<!-- Generated Using Ansuz CMS -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title><%= title_for "Ansuz CMS: Admin" -%></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="description" content="Ansuz Content Management System" />
<meta name="keywords" content="Ansuz Content Management System" />
<%= stylesheet_link_tag 'reset-fonts-grids' %>
<%= stylesheet_link_tag 'sprite' %>
<%= stylesheet_link_tag 'admin' %>
<%= stylesheet_link_tag 'mini' %>
<%= stylesheet_link_tag 'tables' %>
<%= stylesheet_link_tag 'tree' %>
<%= stylesheet_link_tag 'flashes' %>
<%= stylesheet_link_tag 'acts_as_taggable_stylesheet' %>
<%= stylesheet_link_tag 'clickmenu' %>
<%= stylesheet_link_tag 'ui.tabs.css' %>
<%= javascript_include_tag :defaults -%>
<%= javascript_include_tag 'jquery' -%>
<%= javascript_tag "jQuery.noConflict();" -%>
<%= javascript_include_tag 'jquery.growl.js', 'ansuz/growls' %>
<%= javascript_include_tag 'jquery-ui-personalized-1.6rc2.min.js' %>
<%= javascript_include_tag 'show_and_hide' %>
<%= javascript_include_tag 'fckeditor/fckeditor' %>
<%= javascript_include_tag 'ansuz/tree' %>
<%= javascript_include_tag 'jquery.clickmenu.pack.js' %>
<!--[if lt IE 7.]><%= javascript_include_tag 'pngfix.js' %><![endif]-->
</head>
<body class='mini'>
<%= display_standard_flashes -%>
<div id='wrapper'>
<div id='content'>
<h1 id='logo'><span></span>Ansuz CMS</h1>
<div id="doc2" class="yui-t7">
<div id="bd">
<div class="yui-g">
<%= @content_for_layout %>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
@@ -1 +1,4 @@
require 'will_paginate'

# various custom extensions we've grown to use
require 'isotope11'
@@ -0,0 +1,7 @@
load_files = %W{
action_controller_extensions
action_view_helper_extensions
calendar_date_select_extensions
}.each do |load_file|
require File.join('isotope11', load_file)
end
@@ -0,0 +1,13 @@
module ActionController
class AbstractRequest
def query_parameters_array
pairs = query_string.split('&').collect do |chunk|
next if chunk.empty?
key, value = chunk.split('=', 2)
next if key.empty?
value = value.nil? ? nil : CGI.unescape(value)
[ CGI.unescape(key), value ]
end.compact
end
end
end
@@ -0,0 +1,33 @@
# override some default rails behaviour for easier styling
module ActionView
module Helpers
module FormHelper
alias_method :orig_text_field, :text_field
alias_method :orig_password_field, :password_field
def text_field(object_name, method, options = {})
orig_text_field(object_name, method, {:class => 'text'}.merge(options))
end
def password_field(object_name, method, options = {})
orig_password_field(object_name, method, {:class => 'text'}.merge(options))
end
end
module FormTagHelper
alias_method :orig_submit_tag, :submit_tag
alias_method :orig_text_field_tag, :text_field_tag
alias_method :orig_password_field_tag, :password_field_tag
alias_method :orig_check_box_tag, :check_box_tag
def submit_tag(value = "Save changes", options = {})
orig_submit_tag(value, {:class => 'button'}.merge(options))
end
def text_field_tag(name, value = nil, options = {})
orig_text_field_tag(name, value, {:class => 'text'}.merge(options))
end
def password_field_tag(name, value = nil, options = {})
orig_password_field_tag(name, value, {:class => 'text'}.merge(options))
end
def check_box_tag(name, value = "1", checked = false, options = {})
orig_check_box_tag(name, value, checked, {:class => 'crirHiddenJS'}.merge(options))
end
end
end
end
@@ -0,0 +1,17 @@
class CalendarDateSelect
module FormHelper
alias_method :orig_calendar_date_select_tag, :calendar_date_select_tag
alias_method :orig_calendar_date_select, :calendar_date_select
def calendar_date_select_tag( name, value = nil, options = {})
options[:class] ||= ""
options[:class] << "text"
orig_calendar_date_select_tag(name, value, options)
end

def calendar_date_select(object, method, options={})
options[:class] ||= ""
options[:class] << "text"
orig_calendar_date_select(object, method, options)
end
end
end
@@ -0,0 +1,2 @@
<!-- Nothing here; part of the calendar_date_select plugin -->
<html><head></head><body></body></html>
Binary file not shown.

0 comments on commit b5d4810

Please sign in to comment.
You can’t perform that action at this time.