diff options
author | Philip Arndt <parndt@gmail.com> | 2010-08-09 19:31:22 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2010-08-09 19:31:22 +1200 |
commit | a5fe9225fac33f15e972599132c7f569cc5cf397 (patch) | |
tree | f58e7405a03546a37e26f2f1c2694ee12e93fc7d | |
parent | 30df46503cf3176a37ad08ff50da7fa25b43e662 (diff) | |
download | refinerycms-blog-a5fe9225fac33f15e972599132c7f569cc5cf397.tar.gz refinerycms-blog-a5fe9225fac33f15e972599132c7f569cc5cf397.tar.bz2 refinerycms-blog-a5fe9225fac33f15e972599132c7f569cc5cf397.zip |
Namespaced blog posts under blog/posts to allow for blog/comments and blog/categories
-rw-r--r-- | app/controllers/admin/blog/posts_controller.rb (renamed from app/controllers/admin/blog_posts_controller.rb) | 2 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_form.html.erb (renamed from app/views/admin/blog_posts/_form.html.erb) | 0 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_post.html.erb (renamed from app/views/admin/blog_posts/_blog_post.html.erb) | 10 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_sortable_list.html.erb (renamed from app/views/admin/blog_posts/_sortable_list.html.erb) | 2 | ||||
-rw-r--r-- | app/views/admin/blog/posts/edit.html.erb (renamed from app/views/admin/blog_posts/edit.html.erb) | 0 | ||||
-rw-r--r-- | app/views/admin/blog/posts/index.html.erb (renamed from app/views/admin/blog_posts/index.html.erb) | 0 | ||||
-rw-r--r-- | app/views/admin/blog/posts/new.html.erb (renamed from app/views/admin/blog_posts/new.html.erb) | 0 | ||||
-rw-r--r-- | config/locales/en.yml | 23 | ||||
-rw-r--r-- | config/locales/nb.yml | 23 | ||||
-rw-r--r-- | config/locales/nl.yml | 23 | ||||
-rw-r--r-- | config/routes.rb | 4 | ||||
-rw-r--r-- | rails/init.rb | 4 |
12 files changed, 48 insertions, 43 deletions
diff --git a/app/controllers/admin/blog_posts_controller.rb b/app/controllers/admin/blog/posts_controller.rb index 0fd5a93..291571c 100644 --- a/app/controllers/admin/blog_posts_controller.rb +++ b/app/controllers/admin/blog/posts_controller.rb @@ -1,4 +1,4 @@ -class Admin::BlogPostsController < Admin::BaseController +class Admin::Blog::PostsController < Admin::BaseController crudify :blog_post, :title_attribute => :title, :order => 'created_at DESC' diff --git a/app/views/admin/blog_posts/_form.html.erb b/app/views/admin/blog/posts/_form.html.erb index 5d9f347..5d9f347 100644 --- a/app/views/admin/blog_posts/_form.html.erb +++ b/app/views/admin/blog/posts/_form.html.erb diff --git a/app/views/admin/blog_posts/_blog_post.html.erb b/app/views/admin/blog/posts/_post.html.erb index b56a050..3e15543 100644 --- a/app/views/admin/blog_posts/_blog_post.html.erb +++ b/app/views/admin/blog/posts/_post.html.erb @@ -1,15 +1,15 @@ -<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(blog_post) -%>"> +<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(post) -%>"> <span class='title'> - <%=h blog_post.title %> + <%=h post.title %> <span class="preview"> </span> </span> <span class='actions'> - <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(blog_post), + <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post), :title => t('.view_live'), :target => "_blank" %> - <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_blog_post_path(blog_post), + <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_blog_post_path(post), :title => t('.edit') %> - <%= link_to refinery_icon_tag("delete.png"), admin_blog_post_path(blog_post), + <%= link_to refinery_icon_tag("delete.png"), admin_blog_post_path(post), :class => "cancel confirm-delete", :title => t('.delete') %> </span> diff --git a/app/views/admin/blog_posts/_sortable_list.html.erb b/app/views/admin/blog/posts/_sortable_list.html.erb index 3529b23..7ae0ad3 100644 --- a/app/views/admin/blog_posts/_sortable_list.html.erb +++ b/app/views/admin/blog/posts/_sortable_list.html.erb @@ -1,5 +1,5 @@ <ul id='sortable_list'> - <%= render :partial => 'blog_post', :collection => @blog_posts %> + <%= render :partial => 'post', :collection => @blog_posts %> </ul> <%= render :partial => "/shared/admin/sortable_list", :locals => { diff --git a/app/views/admin/blog_posts/edit.html.erb b/app/views/admin/blog/posts/edit.html.erb index 2872e82..2872e82 100644 --- a/app/views/admin/blog_posts/edit.html.erb +++ b/app/views/admin/blog/posts/edit.html.erb diff --git a/app/views/admin/blog_posts/index.html.erb b/app/views/admin/blog/posts/index.html.erb index 0bc14db..0bc14db 100644 --- a/app/views/admin/blog_posts/index.html.erb +++ b/app/views/admin/blog/posts/index.html.erb diff --git a/app/views/admin/blog_posts/new.html.erb b/app/views/admin/blog/posts/new.html.erb index 2872e82..2872e82 100644 --- a/app/views/admin/blog_posts/new.html.erb +++ b/app/views/admin/blog/posts/new.html.erb diff --git a/config/locales/en.yml b/config/locales/en.yml index 0b1e15d..4489389 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3,17 +3,18 @@ en: refinerycms_blog: title: Blog admin: - 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. - blog_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 + 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 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 8ff239f..0c7f237 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -3,17 +3,18 @@ nb: refinerycms_blog: title: Blog admin: - 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. - blog_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 + 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 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 c5daaf8..e1f7eca 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -3,17 +3,18 @@ nl: refinerycms_blog: title: Blog admin: - 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. - blog_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 + 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 blog_posts: show: other: Andere Blog Post
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index e47fa00..4722ce3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,6 +2,8 @@ ActionController::Routing::Routes.draw do |map| map.resources :blog_posts, :as => :blog map.namespace(:admin, :path_prefix => 'refinery') do |admin| - admin.resources :blog_posts, :collection => {:update_positions => :post} + admin.namespace :blog do |blog| + blog.resources :posts, :collection => {:update_positions => :post} + end end end diff --git a/rails/init.rb b/rails/init.rb index 1877664..13abf82 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -1,7 +1,7 @@ Refinery::Plugin.register do |plugin| plugin.name = "refinerycms_blog" - plugin.url = {:controller => '/admin/blog_posts', :action => 'index'} - plugin.menu_match = /^\/?(admin|refinery)\/blog_(posts|comments|categories)/ + plugin.url = {:controller => '/admin/blog/posts', :action => 'index'} + plugin.menu_match = /^\/?(admin|refinery)\/blog\/?(posts|comments|categories)?/ plugin.activity = { :class => BlogPost } |