Skip to content

Commit

Permalink
Restructured part of the project to Refinery::Blog::Admin not Refiner…
Browse files Browse the repository at this point in the history
…y::Admin::Blog
  • Loading branch information
parndt committed Jan 17, 2012
1 parent 2a2fcca commit b3a25c1
Show file tree
Hide file tree
Showing 33 changed files with 341 additions and 335 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ end

require "refinerycms-testing"
Refinery::Testing::Railtie.load_tasks
Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
#Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)

load File.expand_path('../tasks/rspec.rake', __FILE__)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Refinery
module Admin
module Blog
module Blog
module Admin
class CategoriesController < ::Refinery::AdminController

crudify :'refinery/blog/category',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Refinery
module Admin
module Blog
module Blog
module Admin
class CommentsController < ::Refinery::AdminController

cache_sweeper Refinery::BlogSweeper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module Refinery
module Admin
module Blog
module Blog
module Admin
class PostsController < ::Refinery::AdminController

cache_sweeper Refinery::BlogSweeper

crudify :'refinery/blog/post',
:title_attribute => :title,
:order => 'published_at DESC',
:redirect_to_url => "main_app.refinery_admin_blog_posts_path"
:redirect_to_url => "main_app.refinery_blog_admin_posts_path"

before_filter :find_all_categories,
:only => [:new, :edit, :create, :update]
Expand Down Expand Up @@ -54,7 +54,7 @@ def create

unless from_dialog?
unless params[:continue_editing] =~ /true|on|1/
redirect_back_or_default(main_app.refinery_admin_blog_posts_path)
redirect_back_or_default(main_app.refinery_blog_admin_posts_path)
else
unless request.xhr?
redirect_to :back
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Refinery
module Admin
module Blog
module Blog
module Admin
class SettingsController < ::Refinery::AdminController

def notification_recipients
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<li class='not_a_link'>
<%= render :partial => "/refinery/admin/search",
:locals => {
:url => main_app.refinery_admin_blog_posts_path
:url => main_app.refinery_blog_admin_posts_path
} %>
</li>
</ul>
Expand All @@ -14,15 +14,15 @@
:class => 'page_copy_icon' %>
</li>
<li>
<%= link_to t('.posts.manage'), main_app.refinery_admin_blog_posts_path,
<%= link_to t('.posts.manage'), main_app.refinery_blog_admin_posts_path,
:class => 'page_icon' %>
</li>
<li>
<%= link_to t('.posts.uncategorized'), main_app.uncategorized_refinery_admin_blog_posts_path,
<%= link_to t('.posts.uncategorized'), main_app.uncategorized_refinery_blog_admin_posts_path,
:class => 'page_icon' %>
</li>
<li>
<%= link_to t('.posts.new'), main_app.new_refinery_admin_blog_post_path,
<%= link_to t('.posts.new'), main_app.new_refinery_blog_admin_post_path,
:class => 'page_add_icon' %>
</li>
</ul>
Expand All @@ -38,15 +38,15 @@
:class => 'comments_icon' %>
</li>
<li>
<%= link_to t('.comments.new'), main_app.refinery_admin_blog_comments_path,
<%= link_to t('.comments.new'), main_app.refinery_blog_admin_comments_path,
:class => 'comment_icon' %>
</li>
<li>
<%= link_to t('.comments.approved'), main_app.approved_refinery_admin_blog_comments_path,
<%= link_to t('.comments.approved'), main_app.approved_refinery_blog_admin_comments_path,
:class => 'comment_tick_icon' %>
</li>
<li>
<%= link_to t('.comments.rejected'), main_app.rejected_refinery_admin_blog_comments_path,
<%= link_to t('.comments.rejected'), main_app.rejected_refinery_blog_admin_comments_path,
:class => 'comment_cross_icon' %>
</li>
</ul>
Expand All @@ -58,36 +58,36 @@
:class => 'folder_icon' %>
</li>
<li>
<%= link_to t('.categories.manage'), main_app.refinery_admin_blog_categories_path,
<%= link_to t('.categories.manage'), main_app.refinery_blog_admin_categories_path,
:class => 'folder_edit_icon' %>
</li>
<li>
<%= link_to t('.categories.new'), main_app.new_refinery_admin_blog_category_path(:dialog => true, :height => 325),
<%= link_to t('.categories.new'), main_app.new_refinery_blog_admin_category_path(:dialog => true, :height => 325),
:class => 'folder_add_icon' %>
</li>
</ul>

<ul class='collapsible_menu'>
<li class='not_a_link'>
<%= link_to t('.settings.title'), main_app.refinery_admin_blog_settings_path,
<%= link_to t('.settings.title'), main_app.refinery_blog_admin_settings_path,
:class => 'settings_icon' %>
</li>
<li>
<%= link_to t('.settings.comments'), main_app.comments_refinery_admin_blog_settings_path,
<%= link_to t('.settings.comments'), main_app.comments_refinery_blog_admin_settings_path,
:class => "#{Refinery::Blog::Post.comments_allowed? ? 'success' : 'failure'}_icon" %>
</li>
<li>
<%= link_to t('.settings.moderation'), main_app.moderation_refinery_admin_blog_settings_path,
<%= link_to t('.settings.moderation'), main_app.moderation_refinery_blog_admin_settings_path,
:class => "#{Refinery::Blog::Comment::Moderation.enabled? ? 'success' : 'failure'}_icon" %>
</li>
<li>
<%= link_to t('.settings.update_notified'),
main_app.notification_recipients_refinery_admin_blog_settings_path(:dialog => true, :height => 400),
main_app.notification_recipients_refinery_blog_admin_settings_path(:dialog => true, :height => 400),
:class => 'user_comment_icon' %>
</li>
<li>
<%= link_to t('.settings.teasers'),
main_app.teasers_refinery_admin_blog_settings_path, :class => "#{Refinery::Blog::Post.teasers_enabled? ? 'success' : 'failure'}_icon" %>
main_app.teasers_refinery_blog_admin_settings_path, :class => "#{Refinery::Blog::Post.teasers_enabled? ? 'success' : 'failure'}_icon" %>
</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</span>
<span class='actions'>
<%= link_to refinery_icon_tag("application_edit.png"),
main_app.edit_refinery_admin_blog_category_path(category,
main_app.edit_refinery_blog_admin_category_path(category,
:dialog => true,
:height => 325),
:title => t('.edit') %>
<%= link_to refinery_icon_tag("delete.png"), main_app.refinery_admin_blog_category_path(category),
<%= link_to refinery_icon_tag("delete.png"), main_app.refinery_blog_admin_category_path(category),
:class => "cancel confirm-delete",
:title => t('.delete'),
:method => :delete,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
main_app.blog_post_path(comment.post, :anchor => "comment-#{comment.to_param}"),
:title => t('.view_live_html'),
:target => "_blank" unless comment.unmoderated? %>
<%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_admin_blog_comment_path(comment),
<%= link_to refinery_icon_tag('zoom.png'), main_app.refinery_blog_admin_comment_path(comment),
:title => t('.read') %>
<%= link_to refinery_icon_tag("cross.png"),
main_app.rejected_refinery_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
main_app.rejected_refinery_blog_admin_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
:title => t('.reject') unless comment.rejected? %>
<%= link_to refinery_icon_tag("tick.png"),
main_app.approved_refinery_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
main_app.approved_refinery_blog_admin_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')),
:title => t('.approve') unless comment.approved? %>
</span>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<h2><%= t('.actions') %></h2>
<ul>
<li>
<%= link_to t('.back'), main_app.refinery_admin_blog_comments_path, :class => "back_icon" %>
<%= link_to t('.back'), main_app.refinery_blog_admin_comments_path, :class => "back_icon" %>
</li>
<li>
<%= link_to t('.reject'), main_app.rejected_refinery_admin_blog_comment_path(@blog_comment, :return_to => 'rejected'),
<%= link_to t('.reject'), main_app.rejected_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'rejected'),
:class => 'comment_cross_icon' unless @blog_comment.rejected? %>
</li>
<li>
<%= link_to t('.approve'), main_app.approved_refinery_admin_blog_comment_path(@blog_comment, :return_to => 'approved'),
<%= link_to t('.approve'), main_app.approved_refinery_blog_admin_comment_path(@blog_comment, :return_to => 'approved'),
:class => 'comment_tick_icon' unless @blog_comment.approved? %>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@
<% content_for :stylesheets, stylesheet_link_tag('refinery/blog/backend') %>
<% content_for :javascripts, javascript_include_tag('refinery/blog/backend') %>
<%= render 'refinery/shared/admin/autocomplete', :dom_id => '#blog_post_tag_list', :url => main_app.tags_refinery_admin_blog_posts_url %>
<%= render 'refinery/shared/admin/autocomplete', :dom_id => '#blog_post_tag_list', :url => main_app.tags_refinery_blog_admin_posts_url %>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<%= link_to refinery_icon_tag("application_go.png"), main_app.blog_post_path(post),
:title => t('.view_live_html'),
:target => "_blank" %>
<%= link_to refinery_icon_tag("application_edit.png"), main_app.edit_refinery_admin_blog_post_path(post),
<%= link_to refinery_icon_tag("application_edit.png"), main_app.edit_refinery_blog_admin_post_path(post),
:title => t('.edit') %>
<%= link_to refinery_icon_tag("delete.png"), main_app.refinery_admin_blog_post_path(post),
<%= link_to refinery_icon_tag("delete.png"), main_app.refinery_blog_admin_post_path(post),
:class => "cancel confirm-delete",
:title => t('.delete'),
:method => :delete,
Expand Down
4 changes: 1 addition & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments'
get 'archive/:year(/:month)', :to => 'posts#archive', :as => 'archive_blog_posts'
get 'tagged/:tag_id(/:tag_name)' => 'posts#tagged', :as => 'tagged_posts'
end

scope(:path => 'refinery', :as => 'refinery_admin', :module => 'admin') do
scope(:path => 'blog', :as => 'blog', :module => 'blog') do
scope(:path => 'refinery', :as => 'refinery_admin', :module => 'admin') do
root :to => 'posts#index'
resources :posts do
collection do
Expand Down
2 changes: 1 addition & 1 deletion lib/refinery/blog/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Engine < Rails::Engine
Refinery::Plugin.register do |plugin|
plugin.pathname = root
plugin.name = "refinerycms_blog"
plugin.url = app.routes.url_helpers.refinery_admin_blog_posts_path
plugin.url = app.routes.url_helpers.refinery_blog_admin_posts_path
plugin.menu_match = /refinery\/blog\/?(posts|comments|categories)?/
plugin.activity = {
:class_name => :'refinery/blog/post'
Expand Down
124 changes: 0 additions & 124 deletions spec/requests/refinery/admin/blog/comments_spec.rb

This file was deleted.

Loading

0 comments on commit b3a25c1

Please sign in to comment.