typo 5.1.1 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/content_controller.rb +10 -12
- data/app/controllers/application.rb +2 -1
- data/app/controllers/comments_controller.rb +4 -0
- data/app/helpers/admin/base_helper.rb +5 -3
- data/app/helpers/admin/content_helper.rb +8 -0
- data/app/views/admin/content/_articles.html.erb +1 -1
- data/app/views/admin/content/_form.html.erb +2 -1
- data/app/views/admin/pages/_pages.html.erb +1 -1
- data/config/environments/development.rb +1 -1
- data/config/initializers/access_rules.rb +1 -1
- data/lib/tasks/release.rake +1 -1
- data/lib/typo_version.rb +1 -1
- data/public/javascripts/lang/en_US.js +21 -0
- data/public/stylesheets/user-styles.css +6 -0
- metadata +3 -2
@@ -142,7 +142,6 @@ class Admin::ContentController < Admin::BaseController
|
|
142
142
|
def real_action_for(action); { 'add' => :<<, 'remove' => :delete}[action]; end
|
143
143
|
|
144
144
|
def new_or_edit
|
145
|
-
@drafts = Article.find(:all, :conditions => "state='draft'")
|
146
145
|
get_or_build_article
|
147
146
|
params[:article] ||= {}
|
148
147
|
params[:bookmarklet_link] && post_from_bookmarklet
|
@@ -152,6 +151,7 @@ class Admin::ContentController < Admin::BaseController
|
|
152
151
|
|
153
152
|
setup_categories
|
154
153
|
@selected = @article.categories.collect { |c| c.id }
|
154
|
+
@drafts = Article.find(:all, :conditions => "state='draft'")
|
155
155
|
if request.post?
|
156
156
|
set_article_author
|
157
157
|
save_attachments
|
@@ -208,18 +208,16 @@ class Admin::ContentController < Admin::BaseController
|
|
208
208
|
end
|
209
209
|
|
210
210
|
def get_or_build_article
|
211
|
-
@article = case params[:
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
end
|
218
|
-
when 'edit'
|
219
|
-
Article.find(params[:id])
|
220
|
-
else
|
221
|
-
raise "Don't know how to get article for action: #{params[:action]}"
|
211
|
+
@article = case params[:id]
|
212
|
+
when nil
|
213
|
+
returning(Article.new) do |art|
|
214
|
+
art.allow_comments = this_blog.default_allow_comments
|
215
|
+
art.allow_pings = this_blog.default_allow_pings
|
216
|
+
art.published = true
|
222
217
|
end
|
218
|
+
else
|
219
|
+
Article.find(params[:id])
|
220
|
+
end
|
223
221
|
end
|
224
222
|
|
225
223
|
def setup_categories
|
@@ -2,7 +2,8 @@
|
|
2
2
|
# Likewise will all the methods added be available for all controllers.
|
3
3
|
class ApplicationController < ActionController::Base
|
4
4
|
include ::LoginSystem
|
5
|
-
protect_from_forgery :secret => '1c8b953667056f1a3c324d6b369f6158', :only => [:
|
5
|
+
protect_from_forgery :secret => '1c8b953667056f1a3c324d6b369f6158', :only => [:edit, :update, :delete]
|
6
|
+
|
6
7
|
before_filter :reset_local_cache, :fire_triggers, :load_lang
|
7
8
|
after_filter :reset_local_cache
|
8
9
|
|
@@ -67,9 +67,11 @@ module Admin::BaseHelper
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def link_to_show(record, controller = @controller.controller_name)
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
if record.published?
|
71
|
+
link_to image_tag('admin/show.png', :alt => "show", :title => "Show content"),
|
72
|
+
{:controller => controller, :action => 'show', :id => record.id},
|
73
|
+
{:class => "lbOn"}
|
74
|
+
end
|
73
75
|
end
|
74
76
|
|
75
77
|
def link_to_edit(record, controller = @controller.controller_name)
|
@@ -12,4 +12,12 @@ module Admin::ContentHelper
|
|
12
12
|
'searched[published]' => @search[:published] }
|
13
13
|
end
|
14
14
|
|
15
|
+
def link_to_destroy_draft(record, controller = @controller.controller_name)
|
16
|
+
if record.state.to_s == "Draft"
|
17
|
+
link_to(_("Destroy this draft"),
|
18
|
+
{ :controller => controller, :action => 'destroy', :id => record.id },
|
19
|
+
:confirm => "Are you sure?", :method => :post )
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
15
23
|
end
|
@@ -38,7 +38,7 @@
|
|
38
38
|
<td><%= article.published_at.strftime("%d/%m/%Y at %H:%M") %></td>
|
39
39
|
<td><%= author_link(article)%></td>
|
40
40
|
<td class="operation"><%= (article.published?) ? image_tag('admin/checked.png', :alt => "online", :title => _("Online")) : image_tag('admin/cancel.png', :alt => "offline", :title => _("Offline")) %></td>
|
41
|
-
<td class="operation"><%= link_to_show article
|
41
|
+
<td class="operation"><%= link_to_show article %></td>
|
42
42
|
<td class="operation"><%= link_to_edit_with_profiles article %></td>
|
43
43
|
<td class="operation"><%= link_to_destroy_with_profiles article %></td>
|
44
44
|
</tr>
|
@@ -79,6 +79,7 @@
|
|
79
79
|
<br />
|
80
80
|
|
81
81
|
<p class="paginate r">
|
82
|
+
<%= link_to_destroy_draft @article %>
|
82
83
|
<input type="submit" name="article[draft]" class="submit" value="<%= _('Save as draft')%> »" />
|
83
84
|
<%= save("Publish" + " »") %>
|
84
85
|
</p>
|
@@ -86,7 +87,7 @@
|
|
86
87
|
<% if this_blog.editor == 0 %>
|
87
88
|
<%= hidden_field_tag 'id', @article.id unless @article.id.nil? %>
|
88
89
|
<%= observe_form "article_form",
|
89
|
-
:frequency =>
|
90
|
+
:frequency => 30,
|
90
91
|
:update => 'autosave',
|
91
92
|
:url => { :action => "autosave" } %>
|
92
93
|
<% end %>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<%= image_tag('admin/cancel.png', :alt => "offline", :title => _("Offline")) %>
|
41
41
|
<% end %>
|
42
42
|
</td>
|
43
|
-
<td class='operation'><%= link_to_show page
|
43
|
+
<td class='operation'><%= link_to_show page %></td>
|
44
44
|
<td class='operation'><%= link_to_edit_with_profiles page %></td>
|
45
45
|
<td class="operation"><%= link_to_destroy_with_profiles page %></td>
|
46
46
|
</tr>
|
@@ -8,7 +8,7 @@ config.whiny_nils = true
|
|
8
8
|
|
9
9
|
# Show full error reports and disable caching
|
10
10
|
config.action_controller.consider_all_requests_local = true
|
11
|
-
config.action_controller.perform_caching =
|
11
|
+
config.action_controller.perform_caching = true
|
12
12
|
|
13
13
|
# Don't care if the mailer can't send
|
14
14
|
config.action_mailer.raise_delivery_errors = false
|
@@ -41,7 +41,7 @@
|
|
41
41
|
#
|
42
42
|
# For example, whe can decide that an Account with role :customers can see only, the module project :store.
|
43
43
|
|
44
|
-
AccessControl.map :require => [ :admin, :publisher ] do |map|
|
44
|
+
AccessControl.map :require => [ :admin, :publisher, :contributor ] do |map|
|
45
45
|
map.permission "admin/base"
|
46
46
|
|
47
47
|
map.project_module :dashboard, "admin/dashboard" do |project|
|
data/lib/tasks/release.rake
CHANGED
data/lib/typo_version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
TYPO_VERSION = '5.1.
|
1
|
+
TYPO_VERSION = '5.1.2'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
window._lang = "en_US" ;
|
2
|
+
window._l10s = window._l10s || { } ;
|
3
|
+
window._l10s["en_US"] = {
|
4
|
+
|
5
|
+
"#{0} from now": "#{0} from now",
|
6
|
+
"#{0} ago": "#{0} ago",
|
7
|
+
"on #{0}": "on #{0}",
|
8
|
+
"less than a minute": "less than a minute",
|
9
|
+
"#{0} minute": "#{0} minute",
|
10
|
+
"#{0} minutes": "#{0} minutes",
|
11
|
+
"about one hour": "about one hour",
|
12
|
+
"#{0} hours": "#{0} hours",
|
13
|
+
"one day": "one day",
|
14
|
+
"about one day": "about one day",
|
15
|
+
"#{0} days": "#{0} days"
|
16
|
+
|
17
|
+
} ;
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Fr\xC3\xA9d\xC3\xA9ric de Villamil"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-07-
|
12
|
+
date: 2008-07-26 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -1074,6 +1074,7 @@ files:
|
|
1074
1074
|
- public/javascripts/fckeditor/license.txt
|
1075
1075
|
- public/javascripts/lang
|
1076
1076
|
- public/javascripts/lang/default.js
|
1077
|
+
- public/javascripts/lang/en_US.js
|
1077
1078
|
- public/javascripts/lang/fr_FR.js
|
1078
1079
|
- public/javascripts/lightbox.js
|
1079
1080
|
- public/javascripts/prototype.js
|