typo 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/app/controllers/accounts_controller.rb +1 -1
  2. data/app/controllers/admin/cache_controller.rb +2 -2
  3. data/app/controllers/admin/general_controller.rb +2 -22
  4. data/app/controllers/admin/settings_controller.rb +58 -0
  5. data/app/controllers/admin/sidebar_controller.rb +3 -1
  6. data/app/controllers/articles_controller.rb +2 -1
  7. data/app/controllers/content_controller.rb +0 -4
  8. data/app/helpers/admin/base_helper.rb +9 -3
  9. data/app/helpers/admin/general_helper.rb +0 -16
  10. data/app/helpers/admin/settings_helper.rb +18 -0
  11. data/app/models/blog.rb +2 -2
  12. data/app/models/blog_sweeper.rb +10 -2
  13. data/app/models/page_cache.rb +8 -2
  14. data/app/views/admin/advanced/index.html.erb +0 -162
  15. data/app/views/admin/general/update_database.html.erb +1 -1
  16. data/app/views/admin/settings/_submit.html.erb +3 -0
  17. data/app/views/admin/settings/feedback.html.erb +77 -0
  18. data/app/views/admin/settings/index.html.erb +81 -0
  19. data/app/views/admin/settings/podcast.html.erb +53 -0
  20. data/app/views/admin/settings/read.html.erb +38 -0
  21. data/app/views/admin/settings/spam.html.erb +51 -0
  22. data/app/views/admin/settings/write.html.erb +71 -0
  23. data/app/views/admin/sidebar/index.html.erb +1 -3
  24. data/app/views/admin/textfilters/list.html.erb +0 -2
  25. data/app/views/admin/themes/editor.html.erb +0 -2
  26. data/app/views/admin/themes/index.html.erb +0 -2
  27. data/app/views/layouts/administration.html.erb +3 -2
  28. data/config/environments/development.rb +1 -1
  29. data/db/schema_version +1 -1
  30. data/lib/tasks/release.rake +3 -2
  31. data/lib/typo_version.rb +1 -1
  32. data/spec/controllers/accounts_controller_spec.rb +2 -2
  33. data/spec/models/configuration_spec.rb +3 -3
  34. data/test/fixtures/blogs.yml +1 -1
  35. data/test/functional/admin/{general_controller_test.rb → settings_controller_test.rb} +6 -6
  36. data/test/functional/articles_controller_test.rb +7 -0
  37. metadata +23 -7
  38. data/app/controllers/admin/advanced_controller.rb +0 -20
  39. data/app/views/admin/general/index.html.erb +0 -141
  40. data/test/functional/admin/advanced_controller_test.rb +0 -21
@@ -1,141 +0,0 @@
1
- <% @page_heading = _('Basic settings') %>
2
-
3
- <% content_for('tasks') do -%>
4
- <%= subtab _("Basic settings"), "current", {:controller => "general"} %>
5
- <%= subtab _("Advanced settings"), "", {:controller => "advanced"} if (this_blog.display_advanced == 1) %>
6
- <%= subtab _("Empty Fragment Cache"), "", {:controller => '/admin/cache', :action => 'sweep'} if this_blog.cache_option == 'caches_action_with_params' %>
7
- <%= subtab _("Rebuild cached HTML"), "", {:controller => '/admin/cache', :action => 'sweep_html'} if this_blog.cache_option == 'caches_page' %>
8
- <% end -%>
9
-
10
- <% form_tag :action => 'update' do %>
11
-
12
- <div class="admin">
13
- <fieldset id="gensettings" class="set" style="margin-top:10px;">
14
- <legend><%= _("General settings")%></legend>
15
- <ul>
16
- <li>
17
- <label for="blog_name" class="float"><%= _("Blog name")%>:</label>
18
- <input name="setting[blog_name]" id="blog_name" type="text" value="<%=h this_blog.blog_name %>" size="<%= this_blog.blog_name.length %>" />
19
- </li>
20
- <li>
21
- <label class="float" for="blog_subtitle"><%= _("Blog subtitle")%>:</label>
22
- <input name="setting[blog_subtitle]" id="blog_subtitle" type="text" value="<%=h this_blog.blog_subtitle %>" size="<%= this_blog.blog_subtitle.length%>" />
23
- </li>
24
- <li>
25
- <label class="float" for="base_url"><%= _("Blog URL")%>:</label>
26
- <input name="setting[base_url]" id="base_url" type="text" value="<%=h this_blog.base_url %>" size="<%= this_blog.base_url.length %> " />
27
- </li>
28
- <li>
29
- <label class="float" for="lang"><%= _("Language")%>:</label>
30
- <select name="setting[lang]">
31
- <%= fetch_langs %>
32
- </select>
33
- </li>
34
- <li><%= _("This option let you choose between the simple admin interface or the complete one, displaying much more options and therefore more complicated to use. For advanced users only!") %></li>
35
- <li>
36
- <label class="float" for="display_advanced">Choose interface:</label>
37
- <input type="radio" name="setting[display_advanced]" value="0" id="display_advanced_0" <%= 'checked="checked"' if this_blog.display_advanced == 0 %>/>
38
- <label for="display_advanced_0"><%= _("Use simple interface (default)")%></label>
39
- <span class="float">
40
- <input type="radio" name="setting[display_advanced]" value="1" id="display_advanced_1" <%= 'checked="checked"' if this_blog.display_advanced == 1 %>/>
41
- <label for="display_advanced_1"><%= _("Use complete admin")%></label>
42
- </span>
43
- </li>
44
- <li><%= _("By default, Typo generates static HTML pages for your posts. However, if you plan to publish posts in the futur, you may want to use semi dynamic caching") %>.</li>
45
- <li>
46
- <label class="float" for="caches_page">Choose caching methode:</label>
47
- <input type="radio" name="setting[cache_option]" value="caches_page" id="cache_option_0" <%= 'checked="checked"' if this_blog.cache_option == 'caches_page' %>/>
48
- <label for="cache_option_0"><%= _("Use static HTML page caching ")%></label>
49
- <span class="float">
50
- <input type="radio" name="setting[cache_option]" value="caches_action_with_params" id="cache_option_1" <%= 'checked="checked"' if this_blog.cache_option == 'caches_action_with_params' %>/>
51
- <label for="cache_option_1"><%= _("Use semi static caching (default)")%></label>
52
- </span>
53
- </li>
54
- </ul>
55
- </fieldset>
56
-
57
- <fieldset id="read" class="set">
58
- <legend><%= _("Read")%></legend>
59
-
60
- <ul>
61
- <li>
62
- <label for="limit_article_display" class="float"><%= _("Display")%> </label>
63
- <input name="setting[limit_article_display]" size="4" id="limit_article_display" type="text" value="<%= this_blog.limit_article_display %>" />
64
- <%= _("articles on my homepage by default")%>
65
- </li>
66
- <li>
67
- <label for="limit_rss_display" class="float"><%= _("Display")%> </label>
68
- <input name="setting[limit_rss_display]" size="4" id="limit_rss_display" type="text" value="<%= this_blog.limit_rss_display %>" />
69
- <%= _("articles in my news feed by default")%>.
70
- </li>
71
- <li class="checkbox">
72
- <label class="float" for="show_extended_on_rss"><%= _("Show full article on feed")%>:</label>
73
- <input name="setting[show_extended_on_rss]" id="show_extended_on_rss" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.show_extended_on_rss%> />
74
- <input name="setting[show_extended_on_rss]" type="hidden" value="0" />
75
- </li>
76
- </ul>
77
- </fieldset>
78
-
79
- <fieldset id="write" class="set">
80
- <legend><%= _("Write")%></legend>
81
- <ul>
82
- <li>
83
- <label class="float"><%= _("Editor")%>:</label>
84
- <input type="radio" name="setting[editor]" value="2" id="editor_2" <%= 'checked="checked"' if this_blog.editor == 2 %>/>
85
- <label for="editor_2"><%= _("Use visual rich editor")%></label>
86
- <span class="float">
87
- <input type="radio" name="setting[editor]" value="1" id="editor_1" <%= 'checked="checked"' if this_blog.editor == 1 %>/>
88
- <label for="editor_1"><%= _("Use simple editor with live preview (default)")%></label>
89
- </span>
90
- <span class="float">
91
- <input type="radio" name="setting[editor]" value="0" id="editor_0" <%= 'checked="checked"' if this_blog.editor == 0 %>/>
92
- <label for="editor_0"><%= _("Use simple editor without live preview")%></label>
93
- </span>
94
- </li>
95
- </ul>
96
- </fieldset>
97
-
98
- <fieldset id="discuss" class="set">
99
- <legend><%= _("Feedback")%></legend>
100
- <ul>
101
- <li class="checkbox">
102
- <label class="float" for="default_allow_pings"><%= _("Enable Trackbacks by default")%>:</label>
103
- <input name="setting[default_allow_pings]" id="default_allow_pings" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_allow_pings%> />
104
- <input name="setting[default_allow_pings]" type="hidden" value="0" />
105
- </li>
106
- <li class="checkbox">
107
- <label class="float" for="default_allow_comments"><%= _("Enable comments by default")%>:</label>
108
- <input name="setting[default_allow_comments]" id="default_allow_comments" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.default_allow_comments%> />
109
- <input name="setting[default_allow_comments]" type="hidden" value="0" />
110
- </li>
111
- <li class="checkbox">
112
- <label class="float" for="use_gravatar"><%= _("Enable gravatars")%>:</label>
113
- <input name="setting[use_gravatar]" id="use_gravatar" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.use_gravatar %> />
114
- <input name="setting[use_gravatar]" type="hidden" value="0" />
115
- </li>
116
- </ul>
117
- </fieldset>
118
-
119
- <fieldset id="spam" class="set">
120
- <legend><%= _("Spam protection")%></legend>
121
-
122
- <ul>
123
- <li><%= _("Enabling spam protection will make typo compare the IP address of posters as well as the contents of their posts against local and remote blacklists. Good defense against spam bots")%>.</li>
124
- <li class="checkbox">
125
- <label for="sp_global" class="float"><%= _("Enable spam protection")%>:</label>
126
- <input name="setting[sp_global]" id="sp_global" type="checkbox" value="1" <%= 'checked="checked"' if this_blog.sp_global%> /><input name="setting[sp_global]" type="hidden" value="0" />
127
- </li>
128
- <li><%= _("Typo can (optionally) use the %s spam-filtering service. You need to register with Akismet and receive an API key before you can use their service. If you have an Akismet key, enter it here", '<a href="http://akismet.com">Akismet</a>')%> .
129
- </li>
130
- <li>
131
- <label class="float" for="sp_akismet_key"><%= _("Akismet Key")%>:</label>
132
- <input name="setting[sp_akismet_key]" id="sp_akismet_key" type="text" value="<%=h this_blog.sp_akismet_key %>" />
133
- </li>
134
- </ul>
135
- </fieldset>
136
-
137
- <div id="operations" class="paginate r">
138
- <%= save(_("Save Settings")) %>
139
- </div>
140
- </div>
141
- <% end %>
@@ -1,21 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../test_helper'
2
- require 'admin/advanced_controller'
3
-
4
- # Re-raise errors caught by the controller.
5
- class Admin::AdvancedController; def rescue_action(e) raise e end; end
6
-
7
- class Admin::AdvancedControllerTest < Test::Unit::TestCase
8
- fixtures :users
9
-
10
- def setup
11
- @controller = Admin::AdvancedController.new
12
- @request = ActionController::TestRequest.new
13
- @response = ActionController::TestResponse.new
14
- @request.session = { :user_id => users(:tobi).id }
15
- end
16
-
17
- def test_index
18
- get :index
19
- assert_template 'index'
20
- end
21
- end