Commit 673c506c8bd6e65ff40f51517613f5bc97ac7dd4
Exists in
staging
and in
42 other branches
Merge commit 'refs/merge-requests/358' of git://gitorious.org/noosfero/noosfero …
…into merge-requests/358
Showing
3 changed files
with
11 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
| ... | ... | @@ -205,7 +205,7 @@ class CmsController < MyProfileController |
| 205 | 205 | @article.destroy |
| 206 | 206 | session[:notice] = _("\"#{@article.name}\" was removed.") |
| 207 | 207 | referer = ActionController::Routing::Routes.recognize_path URI.parse(request.referer).path rescue nil |
| 208 | - if referer and referer[:controller] == 'cms' | |
| 208 | + if referer and referer[:controller] == 'cms' and referer[:action] != 'edit' | |
| 209 | 209 | redirect_to referer |
| 210 | 210 | elsif @article.parent |
| 211 | 211 | redirect_to @article.parent.url | ... | ... |
app/views/cms/edit.rhtml
| ... | ... | @@ -41,6 +41,7 @@ |
| 41 | 41 | |
| 42 | 42 | <% button_bar do %> |
| 43 | 43 | <%= submit_button :save, _('Save') %> |
| 44 | + | |
| 44 | 45 | <% if @back_to %> |
| 45 | 46 | <%= button :cancel, _('Cancel'), @back_to %> |
| 46 | 47 | <% elsif @parent_id || @article.parent %> |
| ... | ... | @@ -48,6 +49,11 @@ |
| 48 | 49 | <% else %> |
| 49 | 50 | <%= button :cancel, _('Cancel'), :action => 'index' %> |
| 50 | 51 | <% end %> |
| 52 | + | |
| 53 | + <% unless @article.new_record? %> | |
| 54 | + <%= button :delete, _('Delete'), {:controller => :cms, :action => :destroy, :id => @article}, | |
| 55 | + :method => :post, :confirm => delete_article_message(@article) %> | |
| 56 | + <% end %> | |
| 51 | 57 | <% end %> |
| 52 | 58 | <% end %> |
| 53 | 59 | </div> | ... | ... |
public/stylesheets/application.css
| ... | ... | @@ -3267,6 +3267,10 @@ table.cms-articles .icon:hover { |
| 3267 | 3267 | max-width: 100%; |
| 3268 | 3268 | } |
| 3269 | 3269 | |
| 3270 | +.controller-cms .button-bar .icon-delete { | |
| 3271 | + float: right; | |
| 3272 | +} | |
| 3273 | + | |
| 3270 | 3274 | /************* external blog options *****************/ |
| 3271 | 3275 | |
| 3272 | 3276 | .controller-cms #fetch-external-feed { | ... | ... |