cartoonist 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. data/app/assets/stylesheets/admin.css.scss +2 -0
  2. data/app/controllers/{accounts_controller.rb → admin/accounts_controller.rb} +4 -4
  3. data/app/controllers/{cache_controller.rb → admin/cache_controller.rb} +6 -6
  4. data/app/controllers/{settings_controller.rb → admin/settings_controller.rb} +11 -6
  5. data/app/controllers/{static_cache_controller.rb → admin/static_cache_controller.rb} +3 -3
  6. data/app/controllers/admin_controller.rb +7 -33
  7. data/app/controllers/cartoonist_controller.rb +1 -1
  8. data/app/helpers/{cache_helper.rb → admin/cache_helper.rb} +1 -1
  9. data/app/helpers/admin/settings_helper.rb +17 -0
  10. data/app/models/entity.rb +104 -0
  11. data/app/models/postable.rb +59 -0
  12. data/app/models/setting.rb +70 -26
  13. data/app/models/simple_template.rb +2 -0
  14. data/app/views/{accounts → admin/accounts}/edit.html.erb +1 -1
  15. data/app/views/{accounts → admin/accounts}/index.html.erb +3 -3
  16. data/app/views/{accounts → admin/accounts}/new.html.erb +1 -1
  17. data/app/views/{accounts → admin/accounts}/show.html.erb +1 -1
  18. data/app/views/{cache → admin/cache}/index.html.erb +5 -5
  19. data/app/views/{settings → admin/settings}/initial_setup.html.erb +1 -1
  20. data/app/views/{settings → admin/settings}/show.html.erb +18 -6
  21. data/app/views/{static_cache → admin/static_cache}/index.html.erb +2 -2
  22. data/app/views/layouts/admin.html.erb +2 -2
  23. data/app/views/layouts/admin/accounts.html.erb +8 -0
  24. data/app/views/layouts/{initial_setup.html.erb → admin/initial_setup.html.erb} +0 -0
  25. data/app/views/layouts/general_admin.html.erb +3 -3
  26. data/cartoonist.gemspec +0 -1
  27. data/config/locales/en.yml +0 -11
  28. data/lib/cartoonist.rb +47 -1
  29. data/lib/cartoonist/engine.rb +75 -91
  30. metadata +28 -37
  31. data/app/models/tweetable.rb +0 -17
  32. data/app/views/layouts/accounts.html.erb +0 -8
@@ -11,6 +11,8 @@ class SimpleTemplate
11
11
  value = variables[key]
12
12
  value = value.call if value.respond_to? :call
13
13
  value
14
+ elsif variables.include?(:self) && variables[:self].respond_to?(key)
15
+ variables[:self].send key
14
16
  else
15
17
  ""
16
18
  end
@@ -1,6 +1,6 @@
1
1
  <h2><%= t "accounts.edit.subtitle" %></h2>
2
2
 
3
- <%= form_tag "/accounts/#{@user.id}", :method => :put do %>
3
+ <%= form_tag "/admin/accounts/#{@user.id}", :method => :put do %>
4
4
  <p>
5
5
  <%= t "accounts.edit.email" %> <input type="text" name="email" value="<%= @user.email %>" />
6
6
  </p>
@@ -1,4 +1,4 @@
1
- <a href="/accounts/new"><%= t "accounts.index.new_user" %></a>
1
+ <a href="/admin/accounts/new"><%= t "accounts.index.new_user" %></a>
2
2
 
3
3
  <table>
4
4
  <thead>
@@ -15,10 +15,10 @@
15
15
  <tr>
16
16
  <td><%= user.name %></td>
17
17
  <td><%= user.email %></td>
18
- <td><a href="/accounts/<%= user.id %>/edit"><%= t "accounts.index.edit_button" %></a></td>
18
+ <td><a href="/admin/accounts/<%= user.id %>/edit"><%= t "accounts.index.edit_button" %></a></td>
19
19
  <td>
20
20
  <% if current_user.id != user.id %>
21
- <%= form_tag "/accounts/#{user.id}", :method => :delete do %>
21
+ <%= form_tag "/admin/accounts/#{user.id}", :method => :delete do %>
22
22
  <input type="submit" value="<%= t "accounts.index.delete_button" %>" />
23
23
  <% end %>
24
24
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <h2><%= t "accounts.new.subtitle" %></h2>
2
2
 
3
- <%= form_tag "/accounts", :method => :post do %>
3
+ <%= form_tag "/admin/accounts", :method => :post do %>
4
4
  <p>
5
5
  <%= t "accounts.new.email" %> <input type="text" name="email" value="" />
6
6
  </p>
@@ -1,5 +1,5 @@
1
1
  <p>
2
- <a href="/accounts/<%= @user.id %>/edit"><%= t "accounts.show.edit" %></a>
2
+ <a href="/admin/accounts/<%= @user.id %>/edit"><%= t "accounts.show.edit" %></a>
3
3
  </p>
4
4
 
5
5
  <p>
@@ -1,17 +1,17 @@
1
1
  <p>
2
- <%= form_tag "/cache/expire_www", :method => :post, :class => "inline" do %>
2
+ <%= form_tag "/admin/cache/expire_www", :method => :post, :class => "inline" do %>
3
3
  <input type="submit" value="<%= t "cache.index.expire_www" %>" />
4
4
  <% end %>
5
5
 
6
- <%= form_tag "/cache/expire_m", :method => :post, :class => "inline" do %>
6
+ <%= form_tag "/admin/cache/expire_m", :method => :post, :class => "inline" do %>
7
7
  <input type="submit" value="<%= t "cache.index.expire_m" %>" />
8
8
  <% end %>
9
9
 
10
- <%= form_tag "/cache/expire_tmp", :method => :post, :class => "inline" do %>
10
+ <%= form_tag "/admin/cache/expire_tmp", :method => :post, :class => "inline" do %>
11
11
  <input type="submit" value="<%= t "cache.index.expire_tmp" %>" />
12
12
  <% end %>
13
13
 
14
- <%= form_tag "/cache/expire_all", :method => :post, :class => "inline" do %>
14
+ <%= form_tag "/admin/cache/expire_all", :method => :post, :class => "inline" do %>
15
15
  <input type="submit" value="<%= t "cache.index.expire_all" %>" />
16
16
  <% end %>
17
17
  </p>
@@ -50,7 +50,7 @@
50
50
  </td>
51
51
 
52
52
  <td>
53
- <%= form_tag "/cache/#{u cache.delete_name}", :method => :delete do %>
53
+ <%= form_tag "/admin/cache/#{u cache.delete_name}", :method => :delete do %>
54
54
  <input type="submit" value="<%= t "cache.index.expire" %>" />
55
55
  <% end %>
56
56
  </td>
@@ -4,7 +4,7 @@
4
4
  </div>
5
5
  <% end %>
6
6
 
7
- <%= form_tag "/settings/save_initial_setup", :method => :post do %>
7
+ <%= form_tag "/admin/settings/save_initial_setup", :method => :post do %>
8
8
  <p>
9
9
  <%= t "settings.initial_setup.email" %><input type="text" name="admin_email" value="<%= t "settings.initial_setup.default_email" %>" autofocus="autofocus" />
10
10
  </p>
@@ -1,25 +1,33 @@
1
1
  <div class="tabs">
2
2
  <% Setting.tabs.each do |tab| %>
3
- <a href="/settings/<%= tab %>" class="tab <%= "selected_tab" if tab == params[:id].to_sym %>"><%= t tab, :scope => "settings.show.tabs" %></a>
3
+ <a href="/admin/settings/<%= tab %>" class="tab <%= "selected_tab" if tab == params[:id].to_sym %>"><%= Setting::Tab[tab].localized %></a>
4
4
  <% end %>
5
5
  </div>
6
6
 
7
- <%= form_tag "/settings/#{@tab.label}", :method => :put do %>
7
+ <% if flash[:update_errors] %>
8
+ <% flash[:update_errors].each do |message| %>
9
+ <p class="message">
10
+ <%= message %>
11
+ </p>
12
+ <% end %>
13
+ <% end %>
14
+
15
+ <%= form_tag "/admin/settings/#{@tab.label}", :method => :put do %>
8
16
  <% @tab.sections.each do |section| %>
9
17
  <div class="section">
10
- <h2><%= t section, :scope => "settings.show.sections.#{@tab.label}" %></h2>
18
+ <h2><%= @tab[section].localized %></h2>
11
19
 
12
20
  <% @tab[section].settings.each do |setting| %>
13
21
  <%# Other setting types to come later %>
14
22
  <% next unless Setting::Meta[setting].select_from || [:string, :boolean, :int].include?(Setting::Meta[setting].type) %>
15
- <p>
23
+ <p class="setting">
16
24
  <input type="hidden" name="included_settings[]" value="<%= setting %>" />
17
25
  <label>
18
- <%= t setting, :scope => "settings.show.settings" %>
26
+ <%= Setting::Meta[setting].localized %>
19
27
  <% if Setting::Meta[setting].select_from %>
20
28
  <select name="<%= setting %>">
21
29
  <% Setting::Meta[setting].select_from_options.each do |option| %>
22
- <option value="<%= option %>" <%= selected option, Setting[setting] %>><%= option %></option>
30
+ <option value="<%= setting_select_value option %>" <%= selected setting_select_value(option), Setting[setting] %>><%= setting_select_label option %></option>
23
31
  <% end %>
24
32
  <select name="<%= setting %>" value="<%= Setting[setting] %>">
25
33
  <% elsif Setting::Meta[setting].type == :string %>
@@ -30,6 +38,10 @@
30
38
  <input type="checkbox" name="<%= setting %>" value="true" <%= checked Setting[setting] %> />
31
39
  <% end %>
32
40
  </label>
41
+
42
+ <% if Setting::Meta[setting].info_label %>
43
+ <em class="info"><%= t Setting::Meta[setting].info_label %></em>
44
+ <% end %>
33
45
  </p>
34
46
  <% end %>
35
47
  </div>
@@ -1,5 +1,5 @@
1
1
  <p>
2
- <%= form_tag "/static_cache/expire_all", :method => :post, :class => "inline" do %>
2
+ <%= form_tag "/admin/static_cache/expire_all", :method => :post, :class => "inline" do %>
3
3
  <input type="submit" value="<%= t "static_cache.index.expire_all" %>" />
4
4
  <% end %>
5
5
  </p>
@@ -18,7 +18,7 @@
18
18
  <td><%= cache.name %></td>
19
19
 
20
20
  <td>
21
- <%= form_tag "/static_cache/#{u cache.name}", :method => :delete do %>
21
+ <%= form_tag "/admin/static_cache/#{u cache.name}", :method => :delete do %>
22
22
  <input type="submit" value="<%= t "static_cache.index.expire" %>" />
23
23
  <% end %>
24
24
  </td>
@@ -14,7 +14,7 @@
14
14
  <a class="tab" href="<%= Cartoonist::Admin::Tab[tab] %>"><%= t tab, :scope => "admin.layout.tab" %></a>
15
15
  <% end %>
16
16
  | <%= t "admin.layout.user_heading", :user => current_user.name %>
17
- <a href="/accounts/<%= current_user.id %>"><%= t "admin.layout.account" %></a>
17
+ <a href="/admin/accounts/<%= current_user.id %>"><%= t "admin.layout.account" %></a>
18
18
  <input type="submit" value="<%= t "admin.layout.logout" %>" />
19
19
  </p>
20
20
  <% end %>
@@ -36,7 +36,7 @@
36
36
  <% end %>
37
37
 
38
38
  <% if flash[:message] %>
39
- <p style="color: red;">
39
+ <p class="message">
40
40
  <%= flash[:message] %>
41
41
  </p>
42
42
  <% end %>
@@ -0,0 +1,8 @@
1
+ <% content_for :subtabs do %>
2
+ <a class="subtab" href="/admin/accounts/<%= current_user.id %>"><%= t "admin.accounts.layout.my_account" %></a>
3
+ <a class="subtab" href="/admin/accounts"><%= t "admin.accounts.layout.users" %></a>
4
+ <% end %>
5
+
6
+ <% content_for :page_title, t("admin.accounts.layout.section") %>
7
+ <% content_for(:content) { yield } %>
8
+ <%= render :template => "layouts/admin" %>
@@ -1,8 +1,8 @@
1
1
  <% content_for :subtabs do %>
2
2
  <a class="subtab" href="/admin"><%= t "admin.general.layout.actions" %></a>
3
- <a class="subtab" href="/settings"><%= t "admin.general.layout.settings" %></a>
4
- <a class="subtab" href="/cache"><%= t "admin.general.layout.cache" %></a>
5
- <a class="subtab" href="/static_cache"><%= t "admin.general.layout.static_cache" %></a>
3
+ <a class="subtab" href="/admin/settings"><%= t "admin.general.layout.settings" %></a>
4
+ <a class="subtab" href="/admin/cache"><%= t "admin.general.layout.cache" %></a>
5
+ <a class="subtab" href="/admin/static_cache"><%= t "admin.general.layout.static_cache" %></a>
6
6
  <% end %>
7
7
 
8
8
  <% content_for :page_title, t("admin.general.layout.section") %>
@@ -14,5 +14,4 @@ Gem::Specification.new do |s|
14
14
  s.add_dependency "jquery-rails", "~> 2.0.0"
15
15
  s.add_dependency "railties", "~> 3.2.0"
16
16
  s.add_dependency "redcarpet", "~> 2.1.0"
17
- s.add_dependency "twitter", "~> 2.2.0"
18
17
  end
@@ -57,9 +57,6 @@ en:
57
57
  noscript_link: Disqus comments.
58
58
  noscript_post_link:
59
59
  logo: Logo
60
- navigation:
61
- follow_on_twitter: Follow us on Twitter
62
- follow_on_twitter_title: Follow us on Twitter
63
60
  cache:
64
61
  index:
65
62
  cached: cached
@@ -97,7 +94,6 @@ en:
97
94
  social_and_analytics:
98
95
  disqus: Disqus
99
96
  google_analytics: Google Analytics
100
- twitter: Twitter
101
97
  settings:
102
98
  domain: "Domain: "
103
99
  site_name: "Site Name: "
@@ -109,13 +105,6 @@ en:
109
105
  copyright_starting_year: "Copyright Starting Year: "
110
106
  copyright_owners: "Copyright Owners: "
111
107
  default_title: "Default Title: "
112
- default_tweet: "Default Tweet: "
113
- twitter_enabled: "Twitter Enabled: "
114
- twitter_handle: "Twitter Handle: "
115
- twitter_consumer_key: "Twitter Consumer Key: "
116
- twitter_consumer_secret: "Twitter Consumer Secret: "
117
- twitter_oauth_token: "Twitter Oauth Token: "
118
- twitter_oauth_token_secret: "Twitter Oauth Token Secret: "
119
108
  google_analytics_enabled: "Google Analytics Enabled: "
120
109
  google_analytics_account: "Google Analytics Account: "
121
110
  disqus_enabled: "Disqus Enabled: "
@@ -1,7 +1,6 @@
1
1
  require "devise"
2
2
  require "jquery-rails"
3
3
  require "redcarpet"
4
- require "twitter"
5
4
 
6
5
  module Cartoonist
7
6
  module Admin
@@ -90,6 +89,53 @@ module Cartoonist
90
89
  end
91
90
  end
92
91
 
92
+ class Cron
93
+ @@all = []
94
+
95
+ class << self
96
+ def all
97
+ @@all
98
+ end
99
+
100
+ def add(&block)
101
+ @@all << block
102
+ end
103
+ end
104
+ end
105
+
106
+ class Entity
107
+ @@all = {}
108
+ @@cached_order = []
109
+ @@hooks = []
110
+
111
+ class << self
112
+ def all
113
+ @@cached_order.map &:constantize
114
+ end
115
+
116
+ def [](key)
117
+ @@all[key].constantize
118
+ end
119
+
120
+ def add(key, model_name)
121
+ @@all[key] = model_name
122
+ @@cached_order = @@all.keys.sort.map { |key| @@all[key] }
123
+ end
124
+
125
+ def register_hooks(hooks)
126
+ @@hooks << hooks unless @@hooks.include? hooks
127
+ end
128
+
129
+ def hooks
130
+ @@hooks
131
+ end
132
+
133
+ def hooks_with(method)
134
+ @@hooks.select { |x| x.respond_to? method }
135
+ end
136
+ end
137
+ end
138
+
93
139
  class Migration
94
140
  @@all = []
95
141
 
@@ -243,81 +243,58 @@ module Cartoonist
243
243
  config.to_prepare do
244
244
  Devise::SessionsController.layout "users"
245
245
 
246
- if Setting.table_exists?
247
- secret_token_changed = lambda do
248
- # Your secret key for verifying the integrity of signed cookies.
249
- # If you change this key, all old signed cookies will become invalid!
250
- # Make sure the secret is at least 30 characters and all random,
251
- # no regular words or you'll be exposed to dictionary attacks.
252
- Rails.application.config.secret_token = Setting[:secret_token]
253
- end
254
-
255
- twitter_auth_changed = lambda do
256
- Twitter.configure do |twitter_config|
257
- twitter_config.consumer_key = Setting[:twitter_consumer_key]
258
- twitter_config.consumer_secret = Setting[:twitter_consumer_secret]
259
- twitter_config.oauth_token = Setting[:twitter_oauth_token]
260
- twitter_config.oauth_token_secret = Setting[:twitter_oauth_token_secret]
261
- end
262
- end
246
+ secret_token_changed = lambda do
247
+ # Your secret key for verifying the integrity of signed cookies.
248
+ # If you change this key, all old signed cookies will become invalid!
249
+ # Make sure the secret is at least 30 characters and all random,
250
+ # no regular words or you'll be exposed to dictionary attacks.
251
+ Rails.application.config.secret_token = Setting[:secret_token]
252
+ end
263
253
 
264
- devise_pepper_changed = lambda do
265
- Devise.setup do |devise_config|
266
- devise_config.mailer_sender = "no-reply@#{Setting[:domain]}"
267
- devise_config.pepper = Setting[:devise_pepper]
268
- end
254
+ devise_pepper_changed = lambda do
255
+ Devise.setup do |devise_config|
256
+ devise_config.mailer_sender = "no-reply@#{Setting[:domain]}"
257
+ devise_config.pepper = Setting[:devise_pepper]
269
258
  end
259
+ end
270
260
 
271
- Setting.define :domain, :order => 1
272
- Setting.define :site_name, :order => 2
273
- Setting.define :site_heading, :order => 3
274
- Setting.define :site_update_description, :order => 4
275
- Setting.define :root_path, :type => :symbol, :default => Cartoonist::RootPath.all.first, :order => 5, :select_from => lambda { Cartoonist::RootPath.all }, :onchange => lambda { Rails.application.reload_routes! }
276
- Setting.define :theme, :type => :symbol, :default => :cartoonist_default_theme, :order => 6, :select_from => lambda { Cartoonist::Theme.all }
277
- Setting.define :schedule, :type => :array, :default => [:monday, :wednesday, :friday], :order => 7
278
- Setting.define :copyright_starting_year, :type => :int, :order => 8
279
- Setting.define :copyright_owners, :order => 9
280
- Setting.define :default_title, :order => 10
281
-
282
- Setting::Tab.define :social_and_analytics, :order => 1 do
283
- Setting::Section.define :google_analytics, :order => 1 do
284
- Setting.define :google_analytics_enabled, :type => :boolean, :order => 1
285
- Setting.define :google_analytics_account, :order => 2
286
- end
287
-
288
- Setting::Section.define :twitter, :order => 2 do
289
- Setting.define :twitter_enabled, :type => :boolean, :order => 1
290
- Setting.define :default_tweet, :order => 2
291
- Setting.define :twitter_handle, :order => 3
292
- Setting.define :twitter_consumer_key, :onchange => twitter_auth_changed, :order => 4
293
- Setting.define :twitter_consumer_secret, :onchange => twitter_auth_changed, :order => 5
294
- Setting.define :twitter_oauth_token, :onchange => twitter_auth_changed, :order => 6
295
- Setting.define :twitter_oauth_token_secret, :onchange => twitter_auth_changed, :order => 7
296
- end
297
-
298
- Setting::Section.define :disqus, :order => 3 do
299
- Setting.define :disqus_enabled, :type => :boolean, :order => 1
300
- Setting.define :disqus_shortname, :order => 2
301
- Setting.define :disqus_comic_category, :order => 3
302
- Setting.define :disqus_blog_post_category, :order => 4
303
- Setting.define :disqus_page_category, :order => 5
304
- end
261
+ Setting.define :domain, :order => 1
262
+ Setting.define :site_name, :order => 2
263
+ Setting.define :site_heading, :order => 3
264
+ Setting.define :site_update_description, :order => 4
265
+ Setting.define :root_path, :type => :symbol, :default => Cartoonist::RootPath.all.first, :order => 5, :select_from => lambda { Cartoonist::RootPath.all }, :onchange => lambda { Rails.application.reload_routes! }
266
+ Setting.define :theme, :type => :symbol, :default => :cartoonist_default_theme, :order => 6, :select_from => lambda { Cartoonist::Theme.all }
267
+ Setting.define :schedule, :type => :array, :default => [:monday, :wednesday, :friday], :order => 7
268
+ Setting.define :copyright_starting_year, :type => :int, :order => 8
269
+ Setting.define :copyright_owners, :order => 9
270
+ Setting.define :default_title, :order => 10
271
+
272
+ Setting::Tab.define :social_and_analytics, :order => 1 do
273
+ Setting::Section.define :google_analytics, :order => 1 do
274
+ Setting.define :google_analytics_enabled, :type => :boolean, :order => 1
275
+ Setting.define :google_analytics_account, :order => 2
305
276
  end
306
277
 
307
- Setting::Tab.define :advanced, :order => 2 do
308
- Setting.define :secret_token, :default => "ThisTokenMustBeRegenerated....", :onchange => secret_token_changed
309
- Setting.define :devise_pepper, :default => "ThisTokenMustBeRegenerated....", :onchange => devise_pepper_changed
278
+ Setting::Section.define :disqus, :order => 3 do
279
+ Setting.define :disqus_enabled, :type => :boolean, :order => 1
280
+ Setting.define :disqus_shortname, :order => 2
281
+ Setting.define :disqus_comic_category, :order => 3
282
+ Setting.define :disqus_blog_post_category, :order => 4
283
+ Setting.define :disqus_page_category, :order => 5
310
284
  end
285
+ end
311
286
 
312
- secret_token_changed.call
313
- twitter_auth_changed.call
314
- devise_pepper_changed.call
287
+ Setting::Tab.define :advanced, :order => 2 do
288
+ Setting.define :secret_token, :default => "ThisTokenMustBeRegenerated....", :onchange => secret_token_changed
289
+ Setting.define :devise_pepper, :default => "ThisTokenMustBeRegenerated....", :onchange => devise_pepper_changed
315
290
  end
291
+
292
+ secret_token_changed.call
293
+ devise_pepper_changed.call
316
294
  end
317
295
 
318
296
  Mime::Type.register "image/x-icon", :ico
319
297
  Cartoonist::Admin::Tab.add :general, :url => "/admin", :order => 3
320
- Cartoonist::Navigation::Link.add :url => (lambda { "https://twitter.com/#{Setting[:twitter_handle]}" }), :class => "follow-us", :label => "cartoonist.layout.navigation.follow_on_twitter", :title => "cartoonist.layout.navigation.follow_on_twitter_title", :order => 2
321
298
  Cartoonist::Migration.add_for self
322
299
 
323
300
  Cartoonist::Backup.for :files do
@@ -332,50 +309,57 @@ module Cartoonist
332
309
  User.order(:id).all
333
310
  end
334
311
 
335
- Cartoonist::Routes.add_begin do
336
- if Setting.table_exists?
337
- root :to => Cartoonist::RootPath.current
312
+ Cartoonist::Cron.add do
313
+ Dir.glob(File.join(Rails.root, "public/cache/**/*.tmp.html*"), File::FNM_DOTMATCH).each do |file|
314
+ if 2.hours.ago > File.mtime(file)
315
+ File.delete file
316
+ end
338
317
  end
339
318
  end
340
319
 
320
+ Cartoonist::Routes.add_begin do
321
+ root :to => Cartoonist::RootPath.current
322
+ end
323
+
341
324
  Cartoonist::Routes.add do
342
325
  match "favicon" => "site#favicon", :defaults => { :format => "ico" }
343
326
  match "sitemap" => "site#sitemap", :defaults => { :format => "xml" }
344
327
  match "robots" => "site#robots", :defaults => { :format => "text" }
345
328
 
346
- devise_for :users
347
-
348
- resources :cache do
329
+ resource :admin, :controller => :admin do
349
330
  collection do
350
- post "expire_www"
351
- post "expire_m"
352
- post "expire_tmp"
353
- post "expire_all"
331
+ get "cron"
332
+ get "backup"
333
+ get "main"
334
+ get "reload"
354
335
  end
355
336
  end
356
337
 
357
- resources :static_cache, :constraints => { :id => /.*/ } do
358
- collection do
359
- post "expire_all"
360
- end
361
- end
338
+ devise_for :users
362
339
 
363
- resources :accounts
340
+ namespace :admin do
341
+ resources :accounts
364
342
 
365
- resources :admin do
366
- collection do
367
- get "cache_cron"
368
- get "backup"
369
- get "main"
370
- get "reload"
371
- get "tweet_cron"
343
+ resources :cache, :constraints => { :id => /.*/ } do
344
+ collection do
345
+ post "expire_www"
346
+ post "expire_m"
347
+ post "expire_tmp"
348
+ post "expire_all"
349
+ end
372
350
  end
373
- end
374
351
 
375
- resources :settings do
376
- collection do
377
- get "initial_setup"
378
- post "save_initial_setup"
352
+ resources :static_cache, :constraints => { :id => /.*/ } do
353
+ collection do
354
+ post "expire_all"
355
+ end
356
+ end
357
+
358
+ resources :settings do
359
+ collection do
360
+ get "initial_setup"
361
+ post "save_initial_setup"
362
+ end
379
363
  end
380
364
  end
381
365
  end