GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of bousquet/tableau
Description: Open source photo gallery in Rails
Clone URL: git://github.com/kjohnston/tableau.git
Clean up for open sourcing

git-svn-id: svn://code.creativi.st/gallery/trunk@9 
22c876fd-090a-0410-8685-aeedfd4d70f8
creativistinc (author)
Mon Feb 27 03:59:07 -0800 2006
commit  66bc67238bf34163bc24b04e873ee027905bed18
tree    962475d52d547054e36fc891a95e9ea6f06f45d7
parent  4591507c789d487a84e69522aa4eea54f618fb03
...
23
24
25
 
 
26
27
28
...
23
24
25
26
27
28
29
30
0
@@ -23,6 +23,8 @@ class AccountController < ApplicationController
0
     if current_user
0
       redirect_back_or_default(:controller => 'gallery', :action => 'index')
0
       flash[:notice] = "Logged in successfully"
0
+ else
0
+ flash[:notice] = "Incorrect Login/Password"
0
     end
0
   end
0
 
...
37
38
39
40
 
41
42
43
...
37
38
39
 
40
41
42
43
0
@@ -37,7 +37,7 @@ class User < ActiveRecord::Base
0
   validates_length_of :login, :within => 3..40
0
   validates_length_of :email, :within => 3..100
0
   validates_length_of :password, :within => 4..40, :if => :password_required?
0
- validates_presence_of :login, :email
0
+ validates_presence_of :login, :email, :first, :last
0
   validates_presence_of :password,
0
                             :password_confirmation,
0
                             :if => :password_required?
...
 
1
2
 
 
 
3
4
5
6
7
8
9
 
10
11
...
1
2
3
4
5
6
7
8
9
10
11
 
 
12
13
14
0
@@ -1,11 +1,14 @@
0
+
0
 <%= start_form_tag %>
0
 <div id="login">
0
+ <% if flash[:notice] %>
0
+ <div id="errorExplanation"><h2><%= flash[:notice] %></h2></div>
0
+ <% end %>
0
   <label for="user_login">Login</label>
0
   <%= text_field :user, :login %>
0
   <label for="user_password">Password</label>
0
   <%= password_field :user, :password %>
0
   <label>&nbsp;</label>
0
- <!--p id="signup_link"><%= link_to "Create an account", :controller=>"account", :action=>"signup" %></p-->
0
- <%= submit_tag 'Log in' %>
0
+ <%= submit_tag 'Login' %> <%= link_to "Cancel", :controller=>"gallery", :action=>"list" %>
0
 </div>
0
 <%= end_form_tag %>
...
1
2
3
 
 
4
5
6
...
20
21
22
23
 
24
25
26
...
1
2
3
4
5
6
7
8
...
22
23
24
 
25
26
27
28
0
@@ -1,6 +1,8 @@
0
 <%= start_form_tag %>
0
 <div id="login">
0
 
0
+<%= error_messages_for "user" %>
0
+
0
 <label for="login">First</label>
0
 <%= text_field :user, :first %>
0
 
0
@@ -20,7 +22,7 @@
0
 <%= password_field :user, :password_confirmation %>
0
 
0
 <label>&nbsp;</label>
0
-<%= submit_tag 'Sign up' %>
0
+<%= submit_tag 'Sign up' %> <%= link_to "Cancel", :controller=>"gallery", :action=>"list" %>
0
 </div>
0
 
0
 <%= end_form_tag %>
...
1
2
3
4
5
6
7
8
 
 
 
 
 
 
 
 
 
 
9
...
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
0
@@ -1,7 +1,10 @@
0
-<%= start_form_tag %>
0
-<fieldset>
0
- <label for="album_title">Title</label>
0
- <%= text_field "album", "title" %>
0
- <label>&nbsp;</label>
0
- <%= submit_tag "Save" %>
0
-</fieldset>
0
\ No newline at end of file
0
+<h1>New Album</h1>
0
+<div id="photos">
0
+ <%= error_messages_for "album" %>
0
+ <%= start_form_tag %>
0
+ <label for="album_title">Title</label>
0
+ <%= text_field "album", "title" %>
0
+ <label>&nbsp;</label>
0
+ <%= submit_tag "Save" %> <%= link_to "Cancel", :controller=>"gallery", :action=>"list" %>
0
+ <%= end_form_tag %>
0
+</div>
0
\ No newline at end of file
...
1
 
2
 
3
4
5
6
7
8
9
10
11
12
13
14
 
 
 
15
...
 
1
2
3
4
5
6
 
7
8
9
10
11
 
 
12
13
14
15
16
0
@@ -1,13 +1,14 @@
0
-<h2>New Photo</h2>
0
+<h1>New Photo</h1>
0
 
0
+<div id="photos">
0
 <%= error_messages_for "photo" %>
0
 
0
 <%= start_form_tag nil, :multipart=>true %>
0
-<fieldset>
0
   <label>Title</label>
0
   <%= text_field "photo", "title" %>
0
   <label>Photo</label>
0
   <%= file_field_tag "file" %>
0
   <label>&nbsp;</label>
0
- <%= submit_tag "Upload" %>
0
-</fieldset>
0
\ No newline at end of file
0
+ <%= submit_tag "Upload" %> <%= link_to "Cancel", :controller=>"gallery", :action=>"list" %>
0
+<%= end_form_tag %>
0
+</div>
0
\ No newline at end of file
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@
0
 <html>
0
   <head>
0
     <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
0
- <title>Gallery</title>
0
+ <title>Powered by Tableau - Showcasing frozen moments</title>
0
     <script type="text/javascript" language="javascript" charset="utf-8">
0
     // <![CDATA[
0
       var loadingImage = '<%= image_path "loading.gif" -%>';
...
1
2
3
4
5
6
...
8
9
10
 
11
12
13
...
15
16
17
18
19
20
21
...
35
36
37
 
 
38
39
40
41
42
43
44
45
46
47
48
 
49
50
 
 
 
51
52
53
54
...
1
2
 
3
4
5
...
7
8
9
10
11
12
13
...
15
16
17
 
18
19
20
...
34
35
36
37
38
39
40
 
 
 
 
 
 
 
 
 
41
42
43
44
45
46
47
48
49
50
0
@@ -1,6 +1,5 @@
0
 <%= render :partial=>"layouts/header" %>
0
   
0
- <!--p><%= logged_in? ? @curuser.full_name+" "+link_to("Logout", :controller=>"account", :action=>"logout") : link_to("Login", :controller=>"account", :action=>"login") %></p-->
0
   
0
     <div id="page">
0
       
0
@@ -8,6 +7,7 @@
0
         <div id="admin">
0
           <h2>Admin</h2>
0
           <ul>
0
+ <li><%= link_to image_tag("images")+" New Album", :controller=>"albums", :action=>"new" %></li>
0
      <li><%= link_to image_tag("image_add")+" New Photo", :controller=>"gallery", :action=>"new" %></li>
0
             <li id="image_destroy"><%= link_to image_tag("trash.gif")+" Delete Photo", "#" %></li>
0
      <%= drop_receiving_element "image_destroy",
0
@@ -15,7 +15,6 @@
0
          :accept => "photo", :hoverclass => "image_destroy_active",
0
          :loading => "Element.show('image_destroy_spinner')",
0
          :complete => "Element.hide('image_destroy_spinner')" if logged_in? %>
0
- <li><%= link_to image_tag("images")+" New Album", :controller=>"albums", :action=>"new" %></li>
0
      </ul>
0
           <div id="image_destroy_spinner" style="display:none;clear:both"><%= image_tag "spinner.gif", :style=>"vertical-align:middle" %> Deleting Photo...</div>
0
         </div>
0
@@ -35,19 +34,16 @@
0
          <%= content_tag "li", link_to(image_tag("arrow_left")+" Back to gallery", :controller=>"gallery", :action=>"index") if current_page?(:controller=>"gallery", :action=>"album") %>
0
         </ul>
0
         <div id="album_spinner" style="display:none;clear:both"><%= image_tag "spinner.gif", :style=>"vertical-align:middle" %> Adding photo to album...</div>  
0
+ <p id="login_link"><%= logged_in? ? @curuser.full_name+" "+link_to("Logout", :controller=>"account", :action=>"logout") : link_to("Login", :controller=>"account", :action=>"login") %></p>
0
+
0
       </div>
0
 
0
- <div id="recent_posts">
0
- <h2>Recent Posts</h2>
0
- <ul>
0
- <li><%= link_to "Aquarium 2006", "#" %></li>
0
- <li><%= link_to "New Job 2006", "#" %></li>
0
- <li><%= link_to "Christmas 2005", "#" %></li>
0
- <li><%= link_to "Birthday 2005", "#" %></li>
0
- </ul>
0
- </div>
0
+
0
       <%= @content_for_layout %>
0
       <div style="clear:both"></div>
0
+ <div id="footer">
0
+ <p>Powered by <%= link_to "Tableau", "http://creativi.st/tableau" %></p>
0
+ </div>
0
     </div>
0
   </body>
0
 </html>
0
\ No newline at end of file
...
1
2
 
3
4
5
...
58
59
60
61
 
62
63
64
...
90
91
92
93
 
94
95
96
...
105
106
107
108
109
110
111
 
 
112
113
114
115
116
 
 
117
118
119
120
121
122
123
124
125
...
161
162
163
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
166
...
1
 
2
3
4
5
...
58
59
60
 
61
62
63
64
...
90
91
92
 
93
94
95
96
...
105
106
107
 
 
 
 
108
109
110
111
 
 
 
112
113
114
115
 
 
 
 
116
117
118
...
154
155
156
 
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
0
@@ -1,5 +1,5 @@
0
 body {
0
- background:#CCC url(../images/logo.gif) no-repeat top right;
0
+ background:#CCC;
0
   font-family: 'Lucida Grande';
0
   font-size: 11px;
0
   margin:25px;
0
@@ -58,7 +58,7 @@ label {
0
 
0
 
0
 
0
-#photos {
0
+#photos, h1 {
0
   margin-left:230px;
0
 }
0
 
0
@@ -90,7 +90,7 @@ label {
0
   vertical-align:middle;
0
 }
0
 
0
-#albums a, #admin a {
0
+#albums a, #admin a, #image_destroy a {
0
   color:#FFF;
0
   padding:5px;
0
   text-decoration:none;
0
@@ -105,21 +105,14 @@ label {
0
   background:#000 !important;
0
 }
0
 
0
-#recent_posts {
0
- float:left;
0
- clear:left;
0
- width:200px;
0
+#image_destroy a:hover {
0
+ background-color: #900;
0
 }
0
 
0
-#recent_posts ul {
0
- margin:0;
0
- padding:0;
0
+.image_destroy_active {
0
+ background:#900 !important;
0
 }
0
 
0
-#recent_posts ul li {
0
- list-style-type:none;
0
- margin:2px 0;
0
-}
0
 
0
 
0
 
0
@@ -161,5 +154,60 @@ label {
0
 }
0
 
0
 #signup_link {
0
- float:right;
0
+ text-align:right;
0
+}
0
+
0
+#footer {
0
+ margin-top:100px;
0
+ text-align:center;
0
+}
0
+
0
+#login_link a {
0
+ color:#333;
0
+}
0
+
0
+#login_link a:hover {
0
+ background:none;
0
+}
0
+
0
+.fieldWithErrors {
0
+ border-left:6px solid #900;
0
+ padding-left:2px;
0
+}
0
+
0
+
0
+.fieldWithErrors+label {
0
+ margin-top:0;
0
+}
0
+
0
+
0
+#errorExplanation {
0
+ width:100%;
0
+ margin:10px 0 20px;
0
+ background:#FCC;
0
+}
0
+
0
+#errorExplanation h2 {
0
+ text-align: left;
0
+ font-weight: bold;
0
+ padding: .25em .25em .25em 35px;
0
+ font-size: 12px;
0
+ background:#C66 url(../images/alert.gif) no-repeat 10px 50%;
0
+ color: #fff;
0
+ border-top:3px solid #900;
0
+ border-bottom:3px solid #900;
0
+ margin-top:0;
0
+}
0
+
0
+#errorExplanation p {
0
+ color: #333;
0
+ margin-bottom: 0;
0
+ padding: .5em 1em;
0
+ font-size:11px;
0
+ font-weight:bold;
0
+}
0
+
0
+#errorExplanation ul {
0
+ margin-left:30px;
0
+ padding:0 0 20px;
0
 }
0
\ No newline at end of file

Comments

    No one has commented yet.