public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
merge new admin layout

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1234 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Tue Jun 13 21:59:32 -0700 2006
commit  ccfed39b1d60348e83ba4cc1694c896e819adab1
tree    bff2145be8f67e040d6de499338d3cb5382efa51
parent  abbf5f783ace4360e26abf34d1d9d4de3d8ba340
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
 
 
 
 
 
137
138
139
140
141
 
 
142
143
144
145
146
147
148
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
...
119
120
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
123
124
125
126
127
128
 
 
 
129
130
131
 
 
 
 
 
 
 
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
0
@@ -119,33 +119,33 @@
0
   end
0
 
0
   protected
0
- def create_permalink
0
- self.permalink = title.strip.downcase \
0
- .gsub(/['"]/, '') \
0
- .gsub(/(\W|\ )+/, '-') \
0
- .chomp('-').reverse.chomp('-').reverse
0
- end
0
-
0
- def set_filter_from_user
0
- self.filters = user.filters if filters.nil?
0
- end
0
-
0
- def save_assigned_sections
0
- return if @new_sections.nil?
0
- assigned_sections.each do |assigned_section|
0
- @new_sections.delete(assigned_section.section_id.to_s) || assigned_section.destroy
0
+ def create_permalink
0
+ self.permalink = title.strip.downcase \
0
+ .gsub(/['"]/, '') \
0
+ .gsub(/(\W|\ )+/, '-') \
0
+ .chomp('-').reverse.chomp('-').reverse
0
     end
0
     
0
- if !@new_sections.blank?
0
- Section.find(:all, :conditions => ['id in (?)', @new_sections]).each { |section| assigned_sections.create :section => section }
0
- sections.reset
0
+ def set_filter_from_user
0
+ self.filters = user.filters if filters.nil?
0
     end
0
-
0
- @new_sections = nil
0
- end
0
-
0
- def body_for_mode(mode = :list)
0
- (mode == :single ? excerpt_html.to_s + "\n\n" + body_html.to_s : (excerpt_html || body_html)).strip
0
- end
0
+
0
+ def save_assigned_sections
0
+ return if @new_sections.nil?
0
+ assigned_sections.each do |assigned_section|
0
+ @new_sections.delete(assigned_section.section_id.to_s) || assigned_section.destroy
0
+ end
0
+
0
+ if !@new_sections.blank?
0
+ Section.find(:all, :conditions => ['id in (?)', @new_sections]).each { |section| assigned_sections.create :section => section }
0
+ sections.reset
0
+ end
0
+
0
+ @new_sections = nil
0
+ end
0
+
0
+ def body_for_mode(mode = :list)
0
+ (mode == :single ? excerpt_html.to_s + "\n\n" + body_html.to_s : (excerpt_html || body_html)).strip
0
+ end
0
 end
...
1
2
3
4
 
5
6
7
 
 
 
 
 
8
 
9
...
1
2
 
 
3
4
 
 
5
6
7
8
9
10
11
12
0
@@ -1,10 +1,13 @@
0
 <tr class="<%= article.status %><%= " draft" if article.draft %>" id="article_<%= article.id %>">
0
   <td><%= image_tag "icons/#{status_icon[article.status][1]}", :class => "#{status_icon[article.status][0]} icon", :title => "This article is #{article.status}", :alt => "#{article.status}" %></td>
0
- <td class="article_title"><%= link_to_article article %></td>
0
- <td><span class="date"><%= published_at_for article %></span></td>
0
+ <td class="article_title"><%= link_to(article.title, {:action => 'edit', :id => article}) %></td>
0
   <td>
0
- <%= link_to 'Comments', { :action => 'comments', :id => article } %>
0
- <%= link_to_image('page_edit', { :action => 'edit', :id => article }, { :size => '16x16' }) %>
0
+ <% if article.comments.size == 0 %>
0
+ none
0
+ <% else %>
0
+ <%= link_to pluralize(article.comments.size, 'comment'), { :action => 'comments', :id => article } %>
0
+ <% end %>
0
   </td>
0
+ <td><span class="date"><%= published_at_for article %></span></td>
0
 </tr>
...
1
2
 
3
4
5
 
 
6
7
8
9
 
10
11
12
13
...
22
23
24
 
25
26
27
28
29
...
 
 
1
2
 
 
3
4
5
6
7
8
9
10
11
12
13
...
22
23
24
25
26
 
27
28
29
0
@@ -1,12 +1,12 @@
0
-<h2>Your Articles</h2>
0
-
0
+<% content_for :action_nav do %>
0
 <!-- begin action nav -->
0
-<div class="round" id="page-nav">
0
- <ul id="act-nav">
0
+<div id="page-nav">
0
+ <ul id="act-nav" class="clear">
0
     <li><%= link_to "Create new article", :action => "new" %></li>
0
   </ul>
0
 </div>
0
 <!-- /end action nav -->
0
+<% end %>
0
 
0
 <% if @drafts.any? -%>
0
 <ul id="drafts">
0
0
@@ -22,8 +22,8 @@
0
     <tr>
0
       <th scope="col" class="small-col">Status</th>
0
       <th scope="col">Article</th>
0
+ <th scope="col">Comments</th>
0
       <th scope="col">Published</th>
0
- <th scope="col" class="small-col">Edit</th>
0
     </tr>
0
   </thead>
0
   <tbody id="articles">
...
1
2
3
4
...
 
1
2
3
0
@@ -1,4 +1,3 @@
0
-<h2>Manage your Assets and Resources</h2>
0
 <% form_for :resource, @resource, :url => { :action => 'create' } do |f| -%>
0
 <%= render :partial => 'form', :object => @resource, :locals => {
0
   :title => 'Create a new template',
...
1
2
 
 
3
4
5
 
6
7
8
9
10
11
12
13
14
...
1
2
3
4
5
 
 
6
7
 
 
 
 
 
8
9
10
0
@@ -1,14 +1,10 @@
0
 <% with_options :controller => 'articles', :id => event.article_id do |article| -%>
0
 <li id="event-<%= event.id %>" class="event-comment<%= " shade" if shaded %>">
0
+ <%= link_to_article event.article %> received a comment.
0
+
0
   <span class="event-time"><%= event_time_for event, later %></span>
0
- <blockquote><p><%= truncate strip_tags(event.body), 100 %></p></blockquote>
0
- <%= link_to_article event.article %> was commented on.
0
+ <blockquote><p>&quot;<%= truncate strip_tags(event.body), 100 %>&quot;</p></blockquote>
0
   <span class="meta">
0
- <strong>Article:</strong>
0
- <%= article.link_to 'Comments', :action => 'comments' %> |
0
- <%= article.link_to 'Preview', :action => 'show' %> |
0
- <%= link_to_image('page_edit', { :controller => 'articles', :action => 'edit', :id => event.article_id }, { :size => '16x16' }) %><br />
0
- <strong>Event:</strong> <%= link_to_remote 'Delete', :url => { :action => 'delete', :id => event } %><br />
0
     by <%=h event.author %>
0
   </span>
0
 </li>
...
1
 
2
3
4
 
 
5
6
7
8
9
10
 
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
25
26
27
...
39
40
41
42
 
43
44
45
...
52
53
54
55
 
56
57
58
...
 
1
2
 
 
3
4
5
6
7
8
9
10
11
12
 
 
 
 
 
 
 
13
 
14
15
 
 
16
17
18
19
...
31
32
33
 
34
35
36
37
...
44
45
46
 
47
48
49
50
0
@@ -1,27 +1,19 @@
0
-
0
+<% content_for :action_nav do %>
0
 <!-- begin action nav -->
0
-<div class="round" id="page-nav">
0
- <ul id="act-nav">
0
+<div id="page-nav">
0
+ <ul id="act-nav" class="clear">
0
     <li><%= link_to "Create new article", :controller => 'articles', :action => "new" %></li>
0
     <li><%= link_to "Create new section", :controller => 'sections' %></li>
0
     <li><%= link_to "Update your account", :controller => 'users', :action => 'show', :id => current_user %></li>
0
   </ul>
0
 </div>
0
 <!-- /end action nav -->
0
+<% end %>
0
 
0
-<!-- begin quickstats
0
-<div id="stats">
0
- <ul id="quick-stats" class="clear">
0
- <li id="stat-comments" class="round"><div>23</div></li>
0
- </ul>
0
-</div>
0
- /end quickstats -->
0
 
0
-
0
 <!-- begin overview -->
0
 <div id="overview">
0
- <%= link_to 'Subscribe via RSS', overview_url, :class => 'feed right' %>
0
- <h3>Whats happening around <%= site.title %></h3>
0
+ <%= link_to 'Subscribe', overview_url, :class => 'feed right' %>
0
   
0
   <h4>Today <%= todays_short_date %></h4>
0
   <%= render_events @todays_events %>
0
@@ -39,7 +31,7 @@
0
 <% content_for :sidebar do %>
0
   <% if @articles.any? -%>
0
   <div class="sgroup">
0
- <h3>Comments Needing Moderation</h3>
0
+ <h3>Comments awaiting your approval</h3>
0
     <ul class="slist">
0
     <% @articles.each do |article| -%>
0
       <li><%= link_to "<strong>(#{article.unapproved_comments.size})</strong> #{h(article.title)}", :controller => 'articles', :action => 'comments', :id => article.id, :filter => :unapproved %></li>
0
@@ -52,7 +44,7 @@
0
     <h3>Who done it</h3>
0
     <ul class="slist" id="activity">
0
       <% for user in @users %>
0
- <li><%= link_to user.login, :controller => 'users', :action => 'show', :id => user.login %> showed up about <%= distance_of_time_in_words_to_now(user.updated_at) %> ago</li>
0
+ <li><%= link_to user.login, :controller => 'users', :action => 'show', :id => user.login %> showed up <%= distance_of_time_in_words_to_now(user.updated_at) %> ago</li>
0
       <% end %>
0
     </ul>
0
   </div>
...
1
 
 
 
 
 
 
 
 
 
 
2
3
4
...
 
1
2
3
4
5
6
7
8
9
10
11
12
13
0
@@ -1,4 +1,13 @@
0
-<h2>Edit Section</h2>
0
+<% content_for :action_nav do %>
0
+<!-- begin action nav -->
0
+<div id="page-nav">
0
+ <ul id="act-nav" class="clear">
0
+ <li><%= link_to 'New Section', :action => 'index' %></li>
0
+ </ul>
0
+</div>
0
+<!-- /end action nav -->
0
+<% end %>
0
+
0
 <%= render :partial => 'form' %>
0
 
0
 <% content_for :sidebar do %>
...
1
 
 
 
 
 
 
 
 
 
 
2
3
4
...
 
1
2
3
4
5
6
7
8
9
10
11
12
13
0
@@ -1,4 +1,13 @@
0
-<h2>Sections</h2>
0
+<% content_for :action_nav do %>
0
+<!-- begin action nav -->
0
+<div id="page-nav">
0
+ <ul id="act-nav" class="clear">
0
+ <li><%= link_to 'New Section', :action => 'index' %></li>
0
+ </ul>
0
+</div>
0
+<!-- /end action nav -->
0
+<% end %>
0
+
0
 <%= render :partial => 'form' %>
0
 
0
 <% content_for :sidebar do %>
...
1
2
3
4
...
 
1
2
3
0
@@ -1,4 +1,3 @@
0
-<h2>Control different parts of your website</h2>
0
 <%= form_tag :action => "update" %>
0
 <div id="general" class="setgroup">
0
   <h3>General site settings</h3>
...
1
2
3
4
...
 
1
2
3
0
@@ -1,4 +1,3 @@
0
-<h2>Update your template</h2>
0
 <div id="flash-notice" style="display:none"></div>
0
 <div id="template-container">
0
 <% form_remote_for :template, @tmpl, :url => { :action => 'update', :id => @tmpl },
...
1
 
2
3
4
 
 
5
6
7
8
 
9
10
11
...
 
1
2
 
 
3
4
5
6
7
8
9
10
11
12
0
@@ -1,11 +1,12 @@
0
-<h2>People on the inside</h2>
0
+<% content_for :action_nav do %>
0
 <!-- begin action nav -->
0
-<div id="page-nav" class="round">
0
- <ul id="act-nav">
0
+<div id="page-nav">
0
+ <ul id="act-nav" class="clear">
0
     <li><%= link_to "Add new user", :action => "new" %></li>
0
   </ul>
0
 </div>
0
 <!-- /end action nav -->
0
+<% end %>
0
 
0
 <ul id="users">
0
 <% @users.each do |user| -%>
...
1
2
3
4
...
 
1
2
3
0
@@ -1,4 +1,3 @@
0
-<h2>Creating a new User</h2>
0
 <% form_for :user, @user, :url => { :action => 'create' }, :html => { :multipart => true } do |f| -%>
0
 <%= render :partial => 'form', :locals => { :f => f, :create => true } %>
0
 <% end -%>
...
14
15
16
17
 
18
19
20
...
14
15
16
 
17
18
19
20
0
@@ -14,7 +14,7 @@
0
   end
0
 end
0
 
0
-require 'vendor/RedCloth-3.0.4/lib/redcloth'
0
+require 'RedCloth-3.0.4/lib/redcloth'
0
 Rails::Initializer.run do |config|
0
   # Settings in config/environments/* take precedence those specified here
0
   
...
3
4
5
6
 
7
8
9
...
13
14
15
16
 
17
18
19
...
3
4
5
 
6
7
8
9
...
13
14
15
 
16
17
18
19
0
@@ -3,7 +3,7 @@
0
 # In the development environment your application's code is reloaded on
0
 # every request. This slows down response time but is perfect for development
0
 # since you don't have to restart the webserver when you make code changes.
0
-config.cache_classes = false
0
+config.cache_classes = true
0
 
0
 # Log error messages when you accidentally call methods on nil.
0
 config.whiny_nils = true
0
@@ -13,7 +13,7 @@
0
 
0
 # Show full error reports and disable caching
0
 config.action_controller.consider_all_requests_local = true
0
-config.action_controller.perform_caching = false
0
+config.action_controller.perform_caching = true
0
 
0
 # Don't care if the mailer can't send
0
 config.action_mailer.raise_delivery_errors = false
...
4
5
6
7
8
 
 
9
10
11
 
 
12
13
14
...
19
20
21
22
23
24
 
 
 
25
26
27
...
38
39
40
 
 
 
 
 
 
...
4
5
6
 
 
7
8
9
 
 
10
11
12
13
14
...
19
20
21
 
 
 
22
23
24
25
26
27
...
38
39
40
41
42
43
44
45
46
0
@@ -4,11 +4,11 @@
0
 server.port = 3000
0
 
0
 server.modules = ( "mod_rewrite", "mod_accesslog", "mod_fastcgi" )
0
-server.error-handler-404 = "/Users/rick/p/mephisto/trunk/dispatch.fcgi"
0
-server.document-root = "/Users/rick/p/mephisto/trunk/public/"
0
+server.error-handler-404 = "/dispatch.fcgi"
0
+server.document-root = CWD + "/public/"
0
 
0
-server.errorlog = "/Users/rick/p/mephisto/trunk/log/lighttpd.error.log"
0
-accesslog.filename = "/Users/rick/p/mephisto/trunk/log/lighttpd.access.log"
0
+server.errorlog = CWD + "/log/lighttpd.error.log"
0
+accesslog.filename = CWD + "/log/lighttpd.access.log"
0
 
0
 url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
0
 
0
@@ -19,9 +19,9 @@
0
       (
0
         "min-procs" => 1,
0
         "max-procs" => 1,
0
- "socket" => "/Users/rick/p/mephisto/trunk/log/fcgi.socket",
0
- "bin-path" => "/Users/rick/p/mephisto/trunk/public/dispatch.fcgi",
0
- "bin-environment" => ( "RAILS_ENV" => "development" )
0
+ "socket" => CWD + "/tmp/sockets/fcgi.socket",
0
+ "bin-path" => CWD + "/public/dispatch.fcgi",
0
+ "bin-environment" => ( "RAILS_ENV" => "production" )
0
       )
0
   )
0
 )
0
@@ -38,4 +38,10 @@
0
   ".swf" => "application/x-shockwave-flash",
0
   ".txt" => "text/plain"
0
 )
0
+
0
+# Making sure file uploads above 64k always work when using IE or Safari
0
+# For more information, see http://trac.lighttpd.net/trac/ticket/360
0
+$HTTP["useragent"] =~ "^(.*MSIE.*)|(.*AppleWebKit.*)$" {
0
+ server.max-keep-alive-requests = 0
0
+}
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-#!/opt/local/bin/ruby
0
+#!/usr/bin/env ruby
0
 #
0
 # You may specify the path to the FastCGI crash log (a log of unhandled
0
 # exceptions which forced the FastCGI instance to exit, great for debugging)
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
 
 
15
16
17
 
 
18
19
20
21
22
23
24
25
26
 
 
27
28
29
 
30
31
32
33
34
35
36
37
38
39
 
40
 
 
 
 
 
41
42
 
43
44
 
 
 
 
45
46
47
48
49
 
 
50
51
52
53
...
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
76
77
78
79
80
81
82
 
83
84
85
86
87
88
89
90
...
145
146
147
 
148
149
150
151
152
153
154
 
 
 
155
156
157
158
159
160
161
162
163
 
164
165
 
 
 
 
166
167
 
168
169
170
171
172
173
174
175
176
...
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
...
205
206
207
 
208
209
210
 
 
 
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
...
216
217
218
219
220
221
 
 
222
223
224
225
226
227
 
228
229
 
230
231
232
 
 
233
 
 
234
235
236
237
238
 
 
239
240
241
242
243
244
245
 
 
246
 
 
 
 
247
248
249
250
251
 
 
 
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
 
 
 
277
278
 
 
 
 
 
 
 
 
 
 
 
 
 
279
280
281
282
283
284
285
286
287
288
...
296
297
298
299
300
301
 
302
303
304
 
 
 
 
 
305
306
307
308
309
...
314
315
316
317
 
318
319
 
320
321
 
 
 
 
322
323
324
325
326
...
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
...
355
356
357
358
 
359
360
361
362
363
364
 
365
 
366
367
368
369
370
371
372
373
374
375
376
377
378
379
...
381
382
383
384
 
385
386
387
...
401
402
403
404
405
406
 
 
407
408
409
...
438
439
440
441
 
442
443
444
445
...
448
449
450
451
452
453
454
455
456
457
 
458
459
460
...
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
...
510
511
512
513
514
 
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
...
745
746
747
748
 
749
750
751
752
753
 
754
755
756
757
...
758
759
760
 
761
762
763
764
765
766
767
768
769
770
...
769
770
771
772
773
 
 
774
775
776
777
 
 
778
779
 
780
 
781
782
783
784
785
786
787
788
...
797
798
799
800
 
801
802
803
804
805
806
807
808
809
810
811
 
 
812
813
 
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
...
930
931
932
933
934
 
935
936
937
 
 
938
939
940
941
942
943
944
945
946
 
 
947
948
949
...
1
2
3
 
4
5
6
7
8
9
 
 
 
 
10
11
12
13
14
 
15
16
17
18
19
20
21
 
 
 
 
22
23
24
 
25
26
27
28
29
30
31
 
32
33
34
 
35
36
37
38
39
40
41
42
 
43
44
45
46
47
48
49
50
51
52
 
 
53
54
55
56
57
58
...
64
65
66
 
67
68
69
70
71
 
72
73
74
75
...
79
80
81
 
 
 
82
83
84
85
86
87
88
89
90
91
...
146
147
148
149
150
151
152
153
 
 
 
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
...
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
215
216
217
218
219
220
 
221
222
223
224
225
...
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
...
242
243
244
 
 
 
245
246
247
248
249
250
 
 
251
252
253
254
255
 
 
256
257
258
259
260
261
262
263
264
 
265
266
267
268
269
 
 
 
 
270
271
272
273
274
275
276
277
278
279
 
 
280
281
282
283
284
 
 
 
 
 
 
 
285
 
 
286
 
 
 
 
 
 
287
288
289
290
 
 
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
 
 
313
314
315
316
...
324
325
326
 
 
 
327
328
329