Permalink
Browse files

change admin/feedback routes

show collection that perhaps need to be move to another controller
  • Loading branch information...
1 parent c9a7b52 commit 79d8919aa0ac80c1b2322807e77a9c4081837c74 Yannick Francois committed Jan 8, 2013
@@ -97,9 +97,9 @@ def update
comment.attributes = params[:comment]
if request.post? and comment.save
flash[:notice] = _('Comment was successfully updated.')
- redirect_to :action => 'article', :id => comment.article.id
+ redirect_to action: 'article', id: comment.article.id
else
- redirect_to :action => 'edit', :id => comment.id
+ redirect_to action: 'edit', id: comment.id
end
end
@@ -9,11 +9,10 @@ def comment_class state
def show_feedback_actions(item, context='listing')
html = <<-HTML
<small>
-
#{published_or_not item} |
#{change_status(item, context)} |
- #{link_to _("Edit"), :controller => 'admin/feedback', :action => 'edit', :id => item.id} |
- #{link_to _("Delete"), :controller => 'admin/feedback', :action => 'destroy', :id => item.id }|
+ #{link_to _("Edit"), edit_admin_feedback_path(item.id)} |
+ #{link_to _("Delete"), admin_feedback_path(item.id), method: :delete }
#{link_to _("Show conversation"), :controller => 'admin/feedback', :action => 'article', :id => item.article_id}
</small>
HTML
@@ -13,8 +13,8 @@
<p><strong><%= _("Feedback") %></strong></p>
<ul>
- <li> <%= sprintf("%s %d", link_to(_("Total comments:"), :controller => 'admin/feedback') , @statcomments) %></li>
- <li> <%= sprintf("%s %d", link_to(_("Spam comments:"), :controller => 'admin/feedback', :published => 'f'), @statspam) %></li>
- <li> <%= sprintf("%s %d", link_to(_("In your spam queue:"), :controller => 'admin/feedback', :presumed_spam => 'f'), @presumedspam) %></li>
+ <li> <%= sprintf("%s %d", link_to(_("Total comments:"), admin_feedback_index_path) , @statcomments) %></li>
+ <li> <%= sprintf("%s %d", link_to(_("Spam comments:"), admin_feedback_index_path(published: 'f')), @statspam) %></li>
+ <li> <%= sprintf("%s %d", link_to(_("In your spam queue:"), admin_feedback_index_path(presumed_spam: 'f')), @presumedspam) %></li>
</ul>
</div>
@@ -4,22 +4,22 @@
<div class='row'>
<div class='span10'>
<span class='badge badge-inverse'>
- <%= link_to(_("All"), :controller => 'admin/feedback', :action => 'index') %>
+ <%= link_to(_("All"), admin_feedback_index_path) %>
</span>&nbsp;
<span class='badge'>
- <%= link_to(_("Unapproved comments"), :controller => 'admin/feedback', :action => 'index', :confirmed => 'f') %>
+ <%= link_to(_("Unapproved comments"), admin_feedback_index_path(confirmed: 'f')) %>
</span>&nbsp;
<span class='badge badge-success'>
- <%= link_to(_("Ham"), :controller => 'admin/feedback', :action => 'index', :ham => 'f') %>
+ <%= link_to(_("Ham"), admin_feedback_index_path(ham: 'f')) %>
</span>&nbsp;
<span class='badge badge-important'>
- <%= link_to(_("Spam"), :controller => 'admin/feedback', :action => 'index', :spam => 'f') %>
+ <%= link_to(_("Spam"), admin_feedback_index_path(spam: 'f')) %>
</span>&nbsp;
<span class='badge badge-info'>
- <%= link_to(_("Presumed ham"), :controller => 'admin/feedback', :action => 'index', :presumed_ham => 'f') %>
+ <%= link_to(_("Presumed ham"), admin_feedback_index_path(presumed_ham: 'f')) %>
</span>&nbsp;
<span class='badge badge-warning'>
- <%= link_to(_("Presumed spam"), :controller => 'admin/feedback', :action => 'index', :published => 'f') %>
+ <%= link_to(_("Presumed spam"), admin_feedback_index_path(published: 'f')) %>
</span>&nbsp;
</div>
<div class='pull-right'>
View
@@ -107,12 +107,22 @@
end
# Admin/XController
- %w{advanced cache categories comments content profiles feedback general pages
+ %w{advanced cache categories comments content profiles general pages
resources sidebar textfilters themes trackbacks users settings tags redirects seo post_types }.each do |i|
match "/admin/#{i}", :to => "admin/#{i}#index", :format => false
match "/admin/#{i}(/:action(/:id))", :to => "admin/#{i}", :action => nil, :id => nil, :format => false
end
+ namespace :admin do
+ resources :feedback do
+ collection do
+ post 'bulkops'
+ get 'article'
+ get 'change_state'
+ end
+ end
+ end
+
# default
root :to => 'articles#index', :format => false

0 comments on commit 79d8919

Please sign in to comment.