public
Fork of caffo/colorplan
Description: Managing projects using colors.
Homepage: http://colorplanit.com/
Clone URL: git://github.com/tiefox/colorplan.git
More work on 2.0 code port
caffo (author)
Wed Mar 19 20:22:32 -0700 2008
commit  4cd2696f07a6d651b4534ddcb40b37ffbbe45606
tree    575b22daaf09b0d8cf2fb1452de83bc2e4dab869
parent  a216ed7d354dec1fa5adbb722f4b70e7a8378610
...
1
2
3
4
5
6
7
8
9
 
10
11
12
13
14
15
16
...
31
32
33
34
 
35
36
37
...
1
 
 
 
 
2
3
4
 
5
6
7
8
 
9
10
11
...
26
27
28
 
29
30
31
32
0
@@ -1,16 +1,11 @@
0
 class AccountController < ApplicationController
0
- # Be sure to include AuthenticationSystem in Application Controller instead
0
- include AuthenticatedSystem
0
- # If you want "remember me" functionality, add this before_filter to Application Controller
0
- before_filter :login_from_cookie
0
   
0
   # say something nice, you goof! something sweet.
0
   def index
0
- redirect_to(:controller => 'main', :action => 'index')
0
+ render :action => 'login'
0
   end
0
 
0
   def login
0
- return unless request.post?
0
     self.current_user = User.authenticate(params[:login], params[:password])
0
     if current_user
0
       if params[:remember_me] == "1"
0
@@ -31,7 +26,7 @@ class AccountController < ApplicationController
0
     redirect_back_or_default(:controller => '/account', :action => 'index')
0
     flash[:notice] = "Thanks for signing up!"
0
   rescue ActiveRecord::RecordInvalid
0
- render :action => 'signup'
0
+ render :action => 'new'
0
   end
0
   
0
   def logout
...
5
6
7
8
 
9
10
11
...
22
23
24
25
 
 
 
26
27
28
...
5
6
7
 
8
9
10
11
...
22
23
24
 
25
26
27
28
29
30
0
@@ -5,7 +5,7 @@
0
   <li class="<%= current_style(project) %>">
0
     <table border="0" width="290">
0
       <tr>
0
- <% if @params[:id] == 'debug' %>
0
+ <% if params[:id] == 'debug' %>
0
           <td width="40"><%= project.age %></td>
0
         <% end %>
0
         <td style="text-align: left">
0
@@ -22,7 +22,9 @@
0
 </ul>
0
 </div>
0
 <% if params[:id] == 'create' %>
0
-<%= start_form_tag %><input type="text" name="project[name]" style="width: 250px; margin-left:50px;"><%= submit_tag 'Add new project' %></form>
0
+ <% form_tag '' do -%>
0
+ <input type="text" name="project[name]" style="width: 250px; margin-left:50px;"><%= submit_tag 'Add new project' %>
0
+ <% end %>
0
 <% end %>
0
 <p style="color: #444; font-size: 18px; margin-left: 20px;">last update: <%= Time.now.strftime('%m/%d/%y - %H:%M')%><br/><a href="/main/index/create" style="color: #444; text-decoration: underline">add new project </a></p>
0
 </center>
...
56
57
58
 
 
 
 
 
59
60
...
56
57
58
59
60
61
62
63
64
65
0
@@ -56,4 +56,9 @@ Rails::Initializer.run do |config|
0
 
0
   # Make Active Record use UTC-base instead of local time
0
   # config.active_record.default_timezone = :utc
0
+
0
+ def appconf
0
+ YAML::load(File.open("#{RAILS_ROOT}/config/config.yml"))
0
+ end
0
+
0
 end
0
\ No newline at end of file
...
3
4
5
6
 
7
...
3
4
5
 
6
7
0
@@ -3,5 +3,5 @@ ActionController::Routing::Routes.draw do |map|
0
   map.login '', :controller => 'account', :action => 'login'
0
   map.connect '/about', :controller => 'main', :action => 'about'
0
   map.connect '/status', :controller => 'main', :action => 'status'
0
- map.connect ':controller/:action/:id'
0
+ map.connect ':controller/:action/:id'
0
 end
...
65
66
67
68
 
69
70
71
...
86
87
88
89
 
90
91
92
...
65
66
67
 
68
69
70
71
...
86
87
88
 
89
90
91
92
0
@@ -65,7 +65,7 @@ module AuthenticatedSystem
0
       respond_to do |accepts|
0
         accepts.html do
0
           store_location
0
- redirect_to :controller => '/account', :action => 'login'
0
+ redirect_to :controller => 'account', :action => 'index'
0
         end
0
         accepts.xml do
0
           headers["Status"] = "Unauthorized"
0
@@ -86,7 +86,7 @@ module AuthenticatedSystem
0
     # Redirect to the URI stored by the most recent store_location call or
0
     # to the passed default.
0
     def redirect_back_or_default(default)
0
- session[:return_to] ? redirect_to_url(session[:return_to]) : redirect_to(default)
0
+ session[:return_to] ? redirect_to(session[:return_to]) : redirect_to(default)
0
       session[:return_to] = nil
0
     end
0
     

Comments

    No one has commented yet.