typo 5.1.1 → 5.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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[:action]
212
- when 'new'
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
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 => [:create, :edit, :update]
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
 
@@ -24,6 +24,10 @@ class CommentsController < FeedbackController
24
24
  end
25
25
 
26
26
  def preview
27
+ if !session
28
+ session :session => new
29
+ end
30
+
27
31
  if (params[:comment][:body].blank? rescue true)
28
32
  render :nothing => true
29
33
  return
@@ -67,9 +67,11 @@ module Admin::BaseHelper
67
67
  end
68
68
 
69
69
  def link_to_show(record, controller = @controller.controller_name)
70
- link_to image_tag('admin/show.png', :alt => "show", :title => "Show content"),
71
- {:controller => controller, :action => 'show', :id => record.id},
72
- {:class => "lbOn"}
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 if article.published? %></td>
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')%> &raquo;" />
83
84
  <%= save("Publish" + " &raquo;") %>
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 => 5,
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 if page.published? %></td>
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 = false
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|
@@ -1,7 +1,7 @@
1
1
  require 'rake/gempackagetask'
2
2
  require 'rake/contrib/rubyforgepublisher'
3
3
 
4
- PKG_VERSION = "5.1.1"
4
+ PKG_VERSION = "5.1.2"
5
5
  PKG_NAME = "typo"
6
6
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
7
7
  RUBY_FORGE_PROJECT = 'typo'
@@ -1 +1 @@
1
- TYPO_VERSION = '5.1.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
+
@@ -14,3 +14,9 @@
14
14
  display: block;
15
15
  padding: 8px;
16
16
  }
17
+
18
+ .gravatar {
19
+ float: left;
20
+ margin-right: 3px;
21
+ margin-bottom: 3px;
22
+ }
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.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-21 00:00:00 +02:00
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