diff options
-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 | ||||
-rw-r--r-- | config/locales/en.yml | 19 | ||||
-rw-r--r-- | config/locales/nb.yml | 11 | ||||
-rw-r--r-- | config/locales/nl.yml | 11 | ||||
-rw-r--r-- | config/routes.rb | 5 |
10 files changed, 146 insertions, 27 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> 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 <br/><em>(opens in a new window)</em> 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 <br/><em>(åpner i et nytt vindu)</em> 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 <br/><em>(opent een nieuw venster)</em> 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 |