Commit 673c506c8bd6e65ff40f51517613f5bc97ac7dd4

Authored by Rodrigo Souto
2 parents 3d1e7050 64b41e23

Merge commit 'refs/merge-requests/358' of git://gitorious.org/noosfero/noosfero …

…into merge-requests/358
app/controllers/my_profile/cms_controller.rb
@@ -205,7 +205,7 @@ class CmsController < MyProfileController @@ -205,7 +205,7 @@ class CmsController < MyProfileController
205 @article.destroy 205 @article.destroy
206 session[:notice] = _("\"#{@article.name}\" was removed.") 206 session[:notice] = _("\"#{@article.name}\" was removed.")
207 referer = ActionController::Routing::Routes.recognize_path URI.parse(request.referer).path rescue nil 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 redirect_to referer 209 redirect_to referer
210 elsif @article.parent 210 elsif @article.parent
211 redirect_to @article.parent.url 211 redirect_to @article.parent.url
app/views/cms/edit.rhtml
@@ -41,6 +41,7 @@ @@ -41,6 +41,7 @@
41 41
42 <% button_bar do %> 42 <% button_bar do %>
43 <%= submit_button :save, _('Save') %> 43 <%= submit_button :save, _('Save') %>
  44 +
44 <% if @back_to %> 45 <% if @back_to %>
45 <%= button :cancel, _('Cancel'), @back_to %> 46 <%= button :cancel, _('Cancel'), @back_to %>
46 <% elsif @parent_id || @article.parent %> 47 <% elsif @parent_id || @article.parent %>
@@ -48,6 +49,11 @@ @@ -48,6 +49,11 @@
48 <% else %> 49 <% else %>
49 <%= button :cancel, _('Cancel'), :action => 'index' %> 50 <%= button :cancel, _('Cancel'), :action => 'index' %>
50 <% end %> 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 <% end %> 57 <% end %>
52 <% end %> 58 <% end %>
53 </div> 59 </div>
public/stylesheets/application.css
@@ -3267,6 +3267,10 @@ table.cms-articles .icon:hover { @@ -3267,6 +3267,10 @@ table.cms-articles .icon:hover {
3267 max-width: 100%; 3267 max-width: 100%;
3268 } 3268 }
3269 3269
  3270 +.controller-cms .button-bar .icon-delete {
  3271 + float: right;
  3272 +}
  3273 +
3270 /************* external blog options *****************/ 3274 /************* external blog options *****************/
3271 3275
3272 .controller-cms #fetch-external-feed { 3276 .controller-cms #fetch-external-feed {