From 54a0f6ebff34213422d7a5d6ac39c9b7b8dbbe45 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Mon, 9 Aug 2010 21:06:54 +1200 Subject: Set up menu and what is to come. --- .../admin/blog/categories_controller.rb | 5 +++ app/controllers/admin/blog/comments_controller.rb | 15 +++++++ app/controllers/admin/blog/settings_controller.rb | 11 +++++ app/views/admin/blog/_submenu.html.erb | 51 ++++++++++++++++++++++ app/views/admin/blog/comments/index.html.erb | 30 +++++++++++++ app/views/admin/blog/posts/index.html.erb | 15 +------ config/locales/en.yml | 19 ++++++-- config/locales/nb.yml | 11 +++-- config/locales/nl.yml | 11 +++-- config/routes.rb | 5 ++- 10 files changed, 146 insertions(+), 27 deletions(-) create mode 100644 app/controllers/admin/blog/categories_controller.rb create mode 100644 app/controllers/admin/blog/comments_controller.rb create mode 100644 app/controllers/admin/blog/settings_controller.rb create mode 100644 app/views/admin/blog/_submenu.html.erb create mode 100644 app/views/admin/blog/comments/index.html.erb 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 @@ +
+ + + + + + + + +
\ 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' %> +
+ <% if searching? %> +

<%= t('admin.search_results_for', :query => params[:search]) %>

+ <% if @blog_comments.any? %> + <%= render :partial => "blog_comments", + :collection => @blog_comments %> + <% else %> +

<%= t('admin.search_no_results') %>

+ <% 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 %> +

+ + <%= t('.no_items_yet') %> + +

+ <% end %> + <% end %> +
\ 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 @@ -
- -
+<%= render :partial => '/admin/blog/submenu' %>
<% if searching? %>

<%= t('admin.search_results_for', :query => params[:search]) %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 4489389..1398720 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -6,15 +6,26 @@ en: blog: posts: index: - create_new: Create new post - reorder: Reorder Blog Posts - reorder_done: Done Reordering Blog Posts - sorry_no_results: Sorry! There are no results found. no_items_yet: There are no Blog Posts yet. Click "Create a new Blog Posts" to add your first blog posts. post: view_live: View this blog post live
(opens in a new window) edit: Edit this blog post delete: Remove this blog post forever + submenu: + categories: + title: Categories + manage: Manage + new: Create new category + comments: + new: New + approved: Approved + rejected: Rejected + posts: + new: Create new post + settings: + title: Settings + moderation: Moderation + update_notified: Update who gets notified blog_posts: show: other: Other Blog Posts \ No newline at end of file diff --git a/config/locales/nb.yml b/config/locales/nb.yml index 0c7f237..de79479 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -6,15 +6,18 @@ nb: blog: posts: index: - create_new: Lag en ny post - reorder: Endre rekkefølgen på Blog Posts - reorder_done: Ferdig å endre rekkefølgen Blog Posts - sorry_no_results: Beklager! Vi fant ikke noen resultater. no_items_yet: Det er ingen Blog Posts enda. Klikk på "Lag en ny Blog Posts" for å legge til din første blog posts. post: view_live: Vis hvordan denne blog post ser ut offentlig
(åpner i et nytt vindu) edit: Rediger denne blog post delete: Fjern denne blog post permanent + submenu: + comments: + new: ny + posts: + new: Lag en ny post + settings: + update_notified: Oppdater hvem som blir informert blog_posts: show: other: Andre Blog Posts \ No newline at end of file diff --git a/config/locales/nl.yml b/config/locales/nl.yml index e1f7eca..41077ac 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -6,15 +6,18 @@ nl: blog: posts: index: - create_new: Maak een nieuwe post - reorder: Wijzig de volgorde van de Blog Post - reorder_done: Klaar met het wijzingen van de volgorde van de Blog Post - sorry_no_results: Helaas! Er zijn geen resultaten gevonden. no_items_yet: Er zijn nog geen Blog Post. Druk op 'Maak een nieuwe Blog Post' om de eerste aan te maken. post: view_live: Bekijk deze blog posts op de website
(opent een nieuw venster) edit: Bewerk deze blog post delete: Verwijder deze blog post voor eeuwig + submenu: + comments: + new: Nieuwe + posts: + new: Maak een nieuwe post + settings: + update_notified: Wijzig wie een notificatie ontvangt blog_posts: show: other: Andere Blog Post \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 4722ce3..7f1bf18 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,10 @@ ActionController::Routing::Routes.draw do |map| map.namespace(:admin, :path_prefix => 'refinery') do |admin| admin.namespace :blog do |blog| - blog.resources :posts, :collection => {:update_positions => :post} + blog.resources :posts + blog.resources :categories + blog.resources :comments, :collection => {:approved => :get, :rejected => :get} + blog.resources :settings, :collection => {:update_notified => [:get, :post], :moderation => :get} end end end -- cgit v1.2.3