diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/blog/categories_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/admin/blog/comments_controller.rb | 15 | ||||
-rw-r--r-- | app/controllers/admin/blog/settings_controller.rb | 11 | ||||
-rw-r--r-- | app/views/admin/blog/_submenu.html.erb | 51 | ||||
-rw-r--r-- | app/views/admin/blog/comments/index.html.erb | 30 | ||||
-rw-r--r-- | app/views/admin/blog/posts/index.html.erb | 15 |
6 files changed, 113 insertions, 14 deletions
diff --git a/app/controllers/admin/blog/categories_controller.rb b/app/controllers/admin/blog/categories_controller.rb new file mode 100644 index 0000000..ddce1c8 --- /dev/null +++ b/app/controllers/admin/blog/categories_controller.rb @@ -0,0 +1,5 @@ +class Admin::Blog::CategoriesController < Admin::BaseController + + crudify :blog_category, :title_attribute => :name, :order => 'created_at DESC' + +end diff --git a/app/controllers/admin/blog/comments_controller.rb b/app/controllers/admin/blog/comments_controller.rb new file mode 100644 index 0000000..4c3487c --- /dev/null +++ b/app/controllers/admin/blog/comments_controller.rb @@ -0,0 +1,15 @@ +class Admin::Blog::CommentsController < Admin::BaseController + + crudify :blog_comment, :title_attribute => :name, :order => 'created_at DESC' + + def approved + @blog_comments = BlogComment.approved + render :action => 'index' + end + + def rejected + @blog_comments = BlogComment.rejected + render :action => 'index' + end + +end diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb new file mode 100644 index 0000000..9ea2997 --- /dev/null +++ b/app/controllers/admin/blog/settings_controller.rb @@ -0,0 +1,11 @@ +class Admin::Blog::SettingsController < Admin::BaseController + + def update_notified + + end + + def moderation + + end + +end diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb new file mode 100644 index 0000000..4c76227 --- /dev/null +++ b/app/views/admin/blog/_submenu.html.erb @@ -0,0 +1,51 @@ +<div id='actions'> + <ul> + <li> + <%= render :partial => "/shared/admin/search", + :locals => { + :url => admin_blog_posts_url + } %> + </li> + <li> + <%= link_to t('.posts.new'), new_admin_blog_post_url, + :class => "add_icon" %> + </li> + </ul> + + <ul> + <li> + <%= link_to t('.comments.new'), admin_blog_comments_url %> + </li> + <li> + <%= link_to t('.comments.approved'), approved_admin_blog_comments_url %> + </li> + <li> + <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_url %> + </li> + </ul> + + <ul> + <li> + <%= link_to t('.categories.title'), admin_blog_categories_url %> + </li> + <li> + <%= link_to t('.categories.manage'), admin_blog_categories_url %> + </li> + <li> + <%= link_to t('.categories.new'), new_admin_blog_category_url(:dialog => true) %> + </li> + </ul> + + <ul> + <li> + <%= link_to t('.settings.title'), admin_blog_settings_url %> + </li> + <li> + <%= link_to t('.settings.moderation'), moderation_admin_blog_settings_url %> + </li> + <li> + <%= link_to t('.settings.update_notified'), update_notified_admin_blog_settings_url(:dialog => true) %> + </li> + </ul> + +</div>
\ No newline at end of file diff --git a/app/views/admin/blog/comments/index.html.erb b/app/views/admin/blog/comments/index.html.erb new file mode 100644 index 0000000..f27bae3 --- /dev/null +++ b/app/views/admin/blog/comments/index.html.erb @@ -0,0 +1,30 @@ +<%= render :partial => '/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('admin.search_results_for', :query => params[:search]) %></h2> + <% if @blog_comments.any? %> + <%= render :partial => "blog_comments", + :collection => @blog_comments %> + <% else %> + <p><%= t('admin.search_no_results') %></p> + <% end %> + <% else %> + <% if @blog_comments.any? %> + <%= will_paginate @blog_comments, + :previous_label => '«', + :next_label => '»' %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_comments, + :previous_label => '«', + :next_label => '»' %> + <% else %> + <p> + <strong> + <%= t('.no_items_yet') %> + </strong> + </p> + <% end %> + <% end %> +</div>
\ No newline at end of file diff --git a/app/views/admin/blog/posts/index.html.erb b/app/views/admin/blog/posts/index.html.erb index 0bc14db..5b65962 100644 --- a/app/views/admin/blog/posts/index.html.erb +++ b/app/views/admin/blog/posts/index.html.erb @@ -1,17 +1,4 @@ -<div id='actions'> - <ul> - <li> - <%= render :partial => "/shared/admin/search", - :locals => { - :url => admin_blog_posts_url - } %> - </li> - <li> - <%= link_to t('.create_new'), new_admin_blog_post_url, - :class => "add_icon" %> - </li> - </ul> -</div> +<%= render :partial => '/admin/blog/submenu' %> <div id='records'> <% if searching? %> <h2><%= t('admin.search_results_for', :query => params[:search]) %></h2> |