diff options
author | Philip Arndt <parndt@gmail.com> | 2012-01-17 16:56:03 +1300 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2012-01-17 16:56:24 +1300 |
commit | b1e4fd00943a160f3eb6ce242463c0cc07a406fc (patch) | |
tree | 07fb750aa580b63d39c23589997956bf3a03594d /app | |
parent | b3a25c1b686d205fc6b8b409a8f90059ae6b934d (diff) | |
download | refinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.tar.gz refinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.tar.bz2 refinerycms-blog-b1e4fd00943a160f3eb6ce242463c0cc07a406fc.zip |
Fixed namespacing for Refinery conventions.
Diffstat (limited to 'app')
36 files changed, 162 insertions, 171 deletions
diff --git a/app/controllers/refinery/blog/admin/comments_controller.rb b/app/controllers/refinery/blog/admin/comments_controller.rb index 3128e97..f9addaa 100644 --- a/app/controllers/refinery/blog/admin/comments_controller.rb +++ b/app/controllers/refinery/blog/admin/comments_controller.rb @@ -10,20 +10,20 @@ module Refinery :order => 'published_at DESC' def index - @blog_comments = Refinery::Blog::Comment.unmoderated.page(params[:page]) + @comments = Refinery::Blog::Comment.unmoderated.page(params[:page]) render :action => 'index' end def approved unless params[:id].present? - @blog_comments = Refinery::Blog::Comment.approved.page(params[:page]) + @comments = Refinery::Blog::Comment.approved.page(params[:page]) render :action => 'index' else - @blog_comment = Refinery::Blog::Comment.find(params[:id]) - @blog_comment.approve! - flash[:notice] = t('approved', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name) + @comment = Refinery::Blog::Comment.find(params[:id]) + @comment.approve! + flash[:notice] = t('approved', :scope => 'refinery.blog.admin.comments', :author => @comment.name) redirect_to main_app.url_for(:action => params[:return_to] || 'index') end @@ -31,13 +31,13 @@ module Refinery def rejected unless params[:id].present? - @blog_comments = Refinery::Blog::Comment.rejected.page(params[:page]) + @comments = Refinery::Blog::Comment.rejected.page(params[:page]) render :action => 'index' else - @blog_comment = Refinery::Blog::Comment.find(params[:id]) - @blog_comment.reject! - flash[:notice] = t('rejected', :scope => 'refinery.admin.blog.comments', :author => @blog_comment.name) + @comment = Refinery::Blog::Comment.find(params[:id]) + @comment.reject! + flash[:notice] = t('rejected', :scope => 'refinery.blog.admin.comments', :author => @comment.name) redirect_to main_app.url_for(:action => params[:return_to] || 'index') end diff --git a/app/controllers/refinery/blog/admin/posts_controller.rb b/app/controllers/refinery/blog/admin/posts_controller.rb index 04ee663..2ed2b98 100644 --- a/app/controllers/refinery/blog/admin/posts_controller.rb +++ b/app/controllers/refinery/blog/admin/posts_controller.rb @@ -16,7 +16,7 @@ module Refinery before_filter :check_category_ids, :only => :update def uncategorized - @blog_posts = Refinery::Blog::Post.uncategorized.page(params[:page]) + @posts = Refinery::Blog::Post.uncategorized.page(params[:page]) end def tags @@ -35,21 +35,21 @@ module Refinery end def new - @blog_post = ::Refinery::Blog::Post.new(:author => current_refinery_user) + @post = ::Refinery::Blog::Post.new(:author => current_refinery_user) end def create # if the position field exists, set this object as last object, given the conditions of this class. if Refinery::Blog::Post.column_names.include?("position") - params[:blog_post].merge!({ + params[:post].merge!({ :position => ((Refinery::Blog::Post.maximum(:position, :conditions => "")||-1) + 1) }) end - if (@blog_post = Refinery::Blog::Post.create(params[:blog_post])).valid? + if (@post = Refinery::Blog::Post.create(params[:post])).valid? (request.xhr? ? flash.now : flash).notice = t( 'refinery.crudify.created', - :what => "'#{@blog_post.title}'" + :what => "'#{@post.title}'" ) unless from_dialog? @@ -63,7 +63,7 @@ module Refinery end end else - render :text => "<script>parent.window.location = '#{admin_blog_posts_url}';</script>" + render :text => "<script>parent.window.location = '#{refinery_blog_admin_posts_url}';</script>" end else unless request.xhr? @@ -71,7 +71,7 @@ module Refinery else render :partial => "/refinery/admin/error_messages", :locals => { - :object => @blog_post, + :object => @post, :include_object_name => true } end @@ -80,11 +80,11 @@ module Refinery protected def find_all_categories - @blog_categories = Refinery::Blog::Category.find(:all) + @categories = Refinery::Blog::Category.find(:all) end def check_category_ids - params[:blog_post][:category_ids] ||= [] + params[:post][:category_ids] ||= [] end end end diff --git a/app/controllers/refinery/blog/admin/settings_controller.rb b/app/controllers/refinery/blog/admin/settings_controller.rb index afa6b2b..34a8d00 100644 --- a/app/controllers/refinery/blog/admin/settings_controller.rb +++ b/app/controllers/refinery/blog/admin/settings_controller.rb @@ -11,9 +11,9 @@ module Refinery flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients', :recipients => Refinery::Blog::Comment::Notification.recipients) unless request.xhr? or from_dialog? - redirect_back_or_default(admin_blog_posts_path) + redirect_back_or_default(refinery_blog_admin_posts_path) else - render :text => "<script type='text/javascript'>parent.window.location = '#{admin_blog_posts_path}';</script>", + render :text => "<script type='text/javascript'>parent.window.location = '#{refinery_blog_admin_posts_path}';</script>", :layout => false end end @@ -22,7 +22,7 @@ module Refinery def moderation enabled = Refinery::Blog::Comment::Moderation.toggle! unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) + redirect_back_or_default(refinery_blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false @@ -32,7 +32,7 @@ module Refinery def comments enabled = Refinery::Blog::Comment.toggle! unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) + redirect_back_or_default(refinery_blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false @@ -42,7 +42,7 @@ module Refinery def teasers enabled = Refinery::Blog::Post.teaser_enabled_toggle! unless request.xhr? - redirect_back_or_default(admin_blog_posts_path) + redirect_back_or_default(refinery_blog_admin_posts_path) else render :json => {:enabled => enabled}, :layout => false diff --git a/app/controllers/refinery/blog/base_controller.rb b/app/controllers/refinery/blog/blog_controller.rb index 919c180..54a8b03 100644 --- a/app/controllers/refinery/blog/base_controller.rb +++ b/app/controllers/refinery/blog/blog_controller.rb @@ -1,7 +1,7 @@ module Refinery module Blog - class BaseController < ::ApplicationController - + class BlogController < ::ApplicationController + include ControllerHelper helper :'refinery/blog/posts' diff --git a/app/controllers/refinery/blog/categories_controller.rb b/app/controllers/refinery/blog/categories_controller.rb index 60c8346..467726e 100644 --- a/app/controllers/refinery/blog/categories_controller.rb +++ b/app/controllers/refinery/blog/categories_controller.rb @@ -1,10 +1,10 @@ module Refinery module Blog - class CategoriesController < BaseController + class CategoriesController < BlogController def show - @blog_category = Refinery::Blog::Category.find(params[:id]) - @blog_posts = @blog_category.posts.live.includes(:comments, :categories).page(params[:page]) + @category = Refinery::Blog::Category.find(params[:id]) + @posts = @category.posts.live.includes(:comments, :categories).page(params[:page]) end end diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb index 1c8cffd..d680150 100644 --- a/app/controllers/refinery/blog/posts_controller.rb +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -1,6 +1,6 @@ module Refinery module Blog - class PostsController < BaseController + class PostsController < BlogController caches_page :index @@ -12,41 +12,41 @@ module Refinery def index # Rss feeders are greedy. Let's give them every blog post instead of paginating. - (@blog_posts = Refinery::Blog::Post.live.includes(:comments, :categories).all) if request.format.rss? - respond_with (@blog_posts) do |format| + (@posts = Post.live.includes(:comments, :categories).all) if request.format.rss? + respond_with (@posts) do |format| format.html format.rss end end def show - @blog_comment = Refinery::Blog::Comment.new + @comment = Comment.new @canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical? - respond_with (@blog_post) do |format| - format.html { present(@blog_post) } + respond_with (@post) do |format| + format.html { present(@post) } format.js { render :partial => 'post', :layout => false } end end def comment - if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid? - if Refinery::Blog::Comment::Moderation.enabled? or @blog_comment.ham? + if (@comment = @post.comments.create(params[comment])).valid? + if Comment::Moderation.enabled? or @comment.ham? begin - Refinery::Blog::CommentMailer.notification(@blog_comment, request).deliver + CommentMailer.notification(@comment, request).deliver rescue logger.warn "There was an error delivering a blog comment notification.\n#{$!}\n" end end - if Refinery::Blog::Comment::Moderation.enabled? + if Comment::Moderation.enabled? flash[:notice] = t('thank_you_moderated', :scope => 'refinery.blog.posts.comments') - redirect_to main_app.blog_post_url(params[:id]) + redirect_to main_app.refinery_blog_post_url(params[:id]) else flash[:notice] = t('thank_you', :scope => 'refinery.blog.posts.comments') - redirect_to main_app.blog_post_url(params[:id], - :anchor => "comment-#{@blog_comment.to_param}") + redirect_to main_app.refinery_blog_post_url(params[:id], + :anchor => "comment-#{@comment.to_param}") end else render :action => 'show' @@ -58,20 +58,20 @@ module Refinery date = "#{params[:month]}/#{params[:year]}" @archive_date = Time.parse(date) @date_title = @archive_date.strftime('%B %Y') - @blog_posts = Refinery::Blog::Post.live.by_archive(@archive_date).page(params[:page]) + @posts = Post.live.by_archive(@archive_date).page(params[:page]) else date = "01/#{params[:year]}" @archive_date = Time.parse(date) @date_title = @archive_date.strftime('%Y') - @blog_posts = Refinery::Blog::Post.live.by_year(@archive_date).page(params[:page]) + @posts = Post.live.by_year(@archive_date).page(params[:page]) end - respond_with (@blog_posts) + respond_with (@posts) end def tagged @tag = ActsAsTaggableOn::Tag.find(params[:tag_id]) @tag_name = @tag.name - @blog_posts = Refinery::Blog::Post.tagged_with(@tag_name).page(params[:page]) + @posts = Post.tagged_with(@tag_name).page(params[:page]) end def canonical? diff --git a/app/helpers/refinery/blog/controller_helper.rb b/app/helpers/refinery/blog/controller_helper.rb index 035275c..bf4926b 100644 --- a/app/helpers/refinery/blog/controller_helper.rb +++ b/app/helpers/refinery/blog/controller_helper.rb @@ -5,9 +5,9 @@ module Refinery protected def find_blog_post - unless (@blog_post = Refinery::Blog::Post.find(params[:id])).try(:live?) + unless (@post = Refinery::Blog::Post.find(params[:id])).try(:live?) if refinery_user? and current_refinery_user.authorized_plugins.include?("refinerycms_blog") - @blog_post = Refinery::Blog::Post.find(params[:id]) + @post = Refinery::Blog::Post.find(params[:id]) else error_404 end @@ -15,15 +15,14 @@ module Refinery end def find_all_blog_posts - @blog_posts = Refinery::Blog::Post.live.includes(:comments, :categories).page(params[:page]) + @posts = Refinery::Blog::Post.live.includes(:comments, :categories).page(params[:page]) end def find_tags @tags = Refinery::Blog::Post.tag_counts_on(:tags) end - def find_all_blog_categories - @blog_categories = Refinery::Blog::Category.all + @categories = Refinery::Blog::Category.all end end end diff --git a/app/mailers/refinery/blog/comment_mailer.rb b/app/mailers/refinery/blog/comment_mailer.rb index 6f17f81..5b0ce7a 100644 --- a/app/mailers/refinery/blog/comment_mailer.rb +++ b/app/mailers/refinery/blog/comment_mailer.rb @@ -3,7 +3,7 @@ module Refinery class CommentMailer < ActionMailer::Base def notification(comment, request) - @blog_comment = comment + @comment = comment mail :subject => Blog::Comment::Notification.subject, :recipients => Blog::Comment::Notification.recipients, :from => "\"#{Refinery::Core.config.site_name}\" <no-reply@#{request.domain}>" diff --git a/app/views/refinery/blog/admin/categories/_form.html.erb b/app/views/refinery/blog/admin/categories/_form.html.erb index a5d3de3..90eed5d 100644 --- a/app/views/refinery/blog/admin/categories/_form.html.erb +++ b/app/views/refinery/blog/admin/categories/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_for [main_app, :refinery_admin, @blog_category] do |f| -%> +<%= form_for [main_app, :refinery_admin, @category] do |f| -%> <%= render :partial => "/refinery/admin/error_messages", :locals => { :object => f.object, @@ -14,6 +14,6 @@ :locals => { :f => f, :continue_editing => false, - :delete_title => t('delete', :scope => 'refinery.admin.blog.categories.category') + :delete_title => t('delete', :scope => 'refinery.blog.admin.categories.category') } %> <% end %> diff --git a/app/views/refinery/blog/admin/categories/_sortable_list.html.erb b/app/views/refinery/blog/admin/categories/_sortable_list.html.erb index f4e8641..8040dc0 100644 --- a/app/views/refinery/blog/admin/categories/_sortable_list.html.erb +++ b/app/views/refinery/blog/admin/categories/_sortable_list.html.erb @@ -1,5 +1,5 @@ <ul id='sortable_list'> - <%= render :partial => 'category', :collection => @blog_categories %> + <%= render :partial => 'category', :collection => @categories %> </ul> <%= render :partial => "/refinery/admin/sortable_list", :locals => { diff --git a/app/views/refinery/blog/admin/categories/index.html.erb b/app/views/refinery/blog/admin/categories/index.html.erb index 4ad59ab..2e4313e 100644 --- a/app/views/refinery/blog/admin/categories/index.html.erb +++ b/app/views/refinery/blog/admin/categories/index.html.erb @@ -1,25 +1,25 @@ -<%= render :partial => '/refinery/admin/blog/submenu' %> +<%= render :partial => '/refinery/blog/admin/submenu' %> <div id='records'> <% if searching? %> <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2> - <% if @blog_categories.any? %> + <% if @categories.any? %> <%= render :partial => "blog_categories", - :collection => @blog_categories %> + :collection => @categories %> <% else %> <p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <% end %> <% else %> - <% if @blog_categories.any? %> - <%= will_paginate @blog_categories %> + <% if @categories.any? %> + <%= will_paginate @categories %> <%= render :partial => "sortable_list" %> - <%= will_paginate @blog_categories %> + <%= will_paginate @categories %> <% else %> <p> <strong> - <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.admin.blog.submenu.categories')) %> + <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.blog.admin.submenu.categories')) %> </strong> </p> <% end %> diff --git a/app/views/refinery/blog/admin/comments/_comment.html.erb b/app/views/refinery/blog/admin/comments/_comment.html.erb index 51f2996..f4a7a16 100644 --- a/app/views/refinery/blog/admin/comments/_comment.html.erb +++ b/app/views/refinery/blog/admin/comments/_comment.html.erb @@ -5,7 +5,7 @@ </span> <span class='actions'> <%= link_to refinery_icon_tag("application_go.png"), - main_app.blog_post_path(comment.post, :anchor => "comment-#{comment.to_param}"), + main_app.refinery_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_blog_admin_comment_path(comment), diff --git a/app/views/refinery/blog/admin/comments/_sortable_list.html.erb b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb index f781ba1..9f8bbbc 100644 --- a/app/views/refinery/blog/admin/comments/_sortable_list.html.erb +++ b/app/views/refinery/blog/admin/comments/_sortable_list.html.erb @@ -1,5 +1,5 @@ <ul id='sortable_list'> - <%= render :partial => 'comment', :collection => @blog_comments %> + <%= render :partial => 'comment', :collection => @comments %> </ul> <%= render :partial => "/refinery/admin/sortable_list", :locals => { diff --git a/app/views/refinery/blog/admin/comments/index.html.erb b/app/views/refinery/blog/admin/comments/index.html.erb index 059ef59..991980d 100644 --- a/app/views/refinery/blog/admin/comments/index.html.erb +++ b/app/views/refinery/blog/admin/comments/index.html.erb @@ -1,26 +1,26 @@ -<%= render :partial => '/refinery/admin/blog/submenu' %> +<%= render :partial => '/refinery/blog/admin/submenu' %> <div id='records'> <% if searching? %> <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> - <% if @blog_comments.any? %> - <%= will_paginate @blog_comments %> + <% if @comments.any? %> + <%= will_paginate @comments %> <ul> <%= render :partial => "blog_comments", - :collection => @blog_comments %> + :collection => @comments %> </ul> - <%= will_paginate @blog_comments %> + <%= will_paginate @comments %> <% else %> <p><%= t('search_no_results', :scope => 'admin') %></p> <% end %> <% else %> - <% if @blog_comments.any? %> - <%= will_paginate @blog_comments %> + <% if @comments.any? %> + <%= will_paginate @comments %> <%= render :partial => "sortable_list" %> - <%= will_paginate @blog_comments %> + <%= will_paginate @comments %> <% else %> <h3> <%= t('.no_items_yet', diff --git a/app/views/refinery/blog/admin/comments/show.html.erb b/app/views/refinery/blog/admin/comments/show.html.erb index 2aa75f1..df04b3e 100644 --- a/app/views/refinery/blog/admin/comments/show.html.erb +++ b/app/views/refinery/blog/admin/comments/show.html.erb @@ -1,7 +1,7 @@ <div id='actions'> <h2><%= t('.details')%></h2> <p> - <strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@blog_comment.created_at) %> + <strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@comment.created_at) %> </p> <h2><%= t('.actions') %></h2> <ul> @@ -9,12 +9,12 @@ <%= link_to t('.back'), main_app.refinery_blog_admin_comments_path, :class => "back_icon" %> </li> <li> - <%= 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? %> + <%= link_to t('.reject'), main_app.rejected_refinery_blog_admin_comment_path(@comment, :return_to => 'rejected'), + :class => 'comment_cross_icon' unless @comment.rejected? %> </li> <li> - <%= 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? %> + <%= link_to t('.approve'), main_app.approved_refinery_blog_admin_comment_path(@comment, :return_to => 'approved'), + :class => 'comment_tick_icon' unless @comment.approved? %> </li> </ul> </div> @@ -26,8 +26,8 @@ <strong><%= t('.blog_post') %></strong> </td> <td> - <%= link_to @blog_comment.post.title, - main_app.blog_post_path(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), + <%= link_to @comment.post.title, + main_app.refinery_blog_post_path(@comment.post, :anchor => "comment-#{@comment.to_param}"), :target => '_blank' %> </td> </tr> @@ -36,7 +36,7 @@ <strong><%= t('.from') %></strong> </td> <td> - <%= @blog_comment.name %> [<%= mail_to @blog_comment.email, @blog_comment.email, {:title => t('.click_to_email')} %>] + <%= @comment.name %> [<%= mail_to @comment.email, @comment.email, {:title => t('.click_to_email')} %>] </td> </tr> <tr> @@ -44,7 +44,7 @@ <strong><%= t('.date') %></strong> </td> <td> - <%= l(Date.parse(@blog_comment.created_at.to_s), :format => :long) %> + <%= l(Date.parse(@comment.created_at.to_s), :format => :long) %> </td> </tr> <tr> @@ -53,7 +53,7 @@ </td> <td> <p style='margin-top: 0px'> - <%= @blog_comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "</p><p>") %> + <%= @comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "</p><p>") %> </p> </td> </tr> diff --git a/app/views/refinery/blog/admin/posts/_form.html.erb b/app/views/refinery/blog/admin/posts/_form.html.erb index 656c9c6..a33baeb 100644 --- a/app/views/refinery/blog/admin/posts/_form.html.erb +++ b/app/views/refinery/blog/admin/posts/_form.html.erb @@ -1,4 +1,4 @@ -<%= form_for [main_app, :refinery_admin, @blog_post] do |f| -%> +<%= form_for [main_app, :refinery_blog_admin, @post] do |f| -%> <%= render :partial => "/refinery/admin/error_messages", :locals => { :object => f.object, @@ -25,33 +25,25 @@ </li> <% end %> </ul> - + <div id='page_part_editors'> <% part_index = -1 %> - <%= render :partial => 'form_part', - :locals => { - :f => f, - :part_index => (part_index += 1), - } -%> - <%= render :partial => 'teaser_part', - :locals => { - :f => f, - :part_index => (part_index += 1), - } if f.object.respond_to?(:custom_teaser) -%> + <%= render 'form_part', :f => f, :part_index => (part_index += 1) -%> + <%= render 'teaser_part', :f => f, :part_index => (part_index += 1) if f.object.respond_to?(:custom_teaser) -%> <% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %> <div class='page_part' id='<%= "custom_tab_#{tab_index}" %>'> - <%= render :partial => tab.partial, :locals => {:f => f} %> + <%= render tab.partial, :f => f %> </div> <% end %> </div> </div> </div> - + <div class='field'> <%= f.label :tag_list, t('refinery.blog.shared.tags.title') -%> <%= f.text_field :tag_list, :class => 'larger' -%> </div> - + <div id='more_options_field'> <p> <%= link_to t('.advanced_options'), "#", @@ -65,14 +57,14 @@ </div> <div id='more_options' style="display:none;"> <div class="hemisquare"> - <h3><%= t('title', :scope => 'refinery.admin.blog.submenu.categories') %></h3> + <h3><%= t('title', :scope => 'refinery.blog.admin.submenu.categories') %></h3> <ul class='blog_categories'> - <% @blog_categories.each do |category| %> + <% @categories.each do |category| %> <li> - <%= check_box_tag 'blog_post[category_ids][]', category.id, - @blog_post.categories.include?(category), - :id => (id="blog_post_category_ids_#{category.id}") %> - <%= label_tag 'blog_post[category_ids][]', category.title, + <%= check_box_tag 'post[category_ids][]', category.id, + @post.categories.include?(category), + :id => (id="post_category_ids_#{category.id}") %> + <%= label_tag 'post[category_ids][]', category.title, :class => 'stripped', :for => id %> </li> @@ -100,14 +92,14 @@ </div> <div class='hemisquare right_side'> - <%= render :partial => '/seo_meta/form', :locals => {:form => f} %> + <%= render '/seo_meta/form', :form => f %> </div> </div> <%= render :partial => "/refinery/admin/form_actions", :locals => { :f => f, :continue_editing => true, - :delete_title => t('delete', :scope => 'refinery.admin.blog.posts.post') + :delete_title => t('delete', :scope => 'refinery.blog.admin.posts.post') } %> <% end -%> diff --git a/app/views/refinery/blog/admin/posts/_post.html.erb b/app/views/refinery/blog/admin/posts/_post.html.erb index c8baa80..887c830 100644 --- a/app/views/refinery/blog/admin/posts/_post.html.erb +++ b/app/views/refinery/blog/admin/posts/_post.html.erb @@ -7,7 +7,7 @@ </span> </span> <span class='actions'> - <%= link_to refinery_icon_tag("application_go.png"), main_app.blog_post_path(post), + <%= link_to refinery_icon_tag("application_go.png"), main_app.refinery_blog_post_path(post), :title => t('.view_live_html'), :target => "_blank" %> <%= link_to refinery_icon_tag("application_edit.png"), main_app.edit_refinery_blog_admin_post_path(post), diff --git a/app/views/refinery/blog/admin/posts/_sortable_list.html.erb b/app/views/refinery/blog/admin/posts/_sortable_list.html.erb index 18d12cc..471d4f0 100644 --- a/app/views/refinery/blog/admin/posts/_sortable_list.html.erb +++ b/app/views/refinery/blog/admin/posts/_sortable_list.html.erb @@ -1,5 +1,5 @@ <ul id='sortable_list'> - <%= render :partial => 'post', :collection => @blog_posts %> + <%= render :partial => 'post', :collection => @posts %> </ul> <%= render :partial => "/refinery/admin/sortable_list", :locals => { diff --git a/app/views/refinery/blog/admin/posts/_teaser_part.html.erb b/app/views/refinery/blog/admin/posts/_teaser_part.html.erb index dc9186a..461a10c 100644 --- a/app/views/refinery/blog/admin/posts/_teaser_part.html.erb +++ b/app/views/refinery/blog/admin/posts/_teaser_part.html.erb @@ -2,9 +2,9 @@ <%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%> <p> <span class='clearfix label_inline_with_link'> - <%= link_to t('copy_body', :scope => 'refinery.admin.blog.posts.form'), "#", + <%= link_to t('copy_body', :scope => 'refinery.blog.admin.posts.form'), "#", :id => 'copy_body_link', - :title => t('copy_body_help', :scope => 'refinery.admin.blog.posts.form') %> + :title => t('copy_body_help', :scope => 'refinery.blog.admin.posts.form') %> </span> </p> </div> diff --git a/app/views/refinery/blog/admin/posts/index.html.erb b/app/views/refinery/blog/admin/posts/index.html.erb index 922353c..8db926a 100644 --- a/app/views/refinery/blog/admin/posts/index.html.erb +++ b/app/views/refinery/blog/admin/posts/index.html.erb @@ -1,26 +1,26 @@ -<%= render :partial => '/refinery/admin/blog/submenu' %> +<%= render :partial => '/refinery/blog/admin/submenu' %> <div id='records'> <% if searching? %> <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2> - <% if @blog_posts.any? %> + <% if @posts.any? %> <ul> <%= render :partial => "post", - :collection => @blog_posts %> + :collection => @posts %> </ul> <% else %> <p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <% end %> <% else %> - <% if @blog_posts.any? %> - <%= will_paginate @blog_posts %> + <% if @posts.any? %> + <%= will_paginate @posts %> <%= render :partial => "sortable_list" %> - <%= will_paginate @blog_posts %> + <%= will_paginate @posts %> <% else %> <p> <strong> - <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.admin.blog.submenu.posts')) %> + <%= t('.no_items_yet', :create => t('new', :scope => 'refinery.blog.admin.submenu.posts')) %> </strong> </p> <% end %> diff --git a/app/views/refinery/blog/admin/posts/uncategorized.html.erb b/app/views/refinery/blog/admin/posts/uncategorized.html.erb index 030e789..1b3a512 100644 --- a/app/views/refinery/blog/admin/posts/uncategorized.html.erb +++ b/app/views/refinery/blog/admin/posts/uncategorized.html.erb @@ -1,21 +1,21 @@ -<%= render :partial => '/refinery/admin/blog/submenu' %> +<%= render :partial => '/refinery/blog/admin/submenu' %> <div id='records'> <% if searching? %> <h2><%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %></h2> - <% if @blog_posts.any? %> + <% if @posts.any? %> <%= render :partial => "blog_posts", - :collection => @blog_posts %> + :collection => @posts %> <% else %> <p><%= t('no_results', :scope => 'refinery.admin.search') %></p> <% end %> <% else %> - <% if @blog_posts.any? %> - <%= will_paginate @blog_posts %> + <% if @posts.any? %> + <%= will_paginate @posts %> <%= render :partial => "sortable_list" %> - <%= will_paginate @blog_posts %> + <%= will_paginate @posts %> <% else %> <p> <strong> diff --git a/app/views/refinery/blog/admin/settings/notification_recipients.html.erb b/app/views/refinery/blog/admin/settings/notification_recipients.html.erb index d321ded..af2650d 100644 --- a/app/views/refinery/blog/admin/settings/notification_recipients.html.erb +++ b/app/views/refinery/blog/admin/settings/notification_recipients.html.erb @@ -18,7 +18,7 @@ :locals => { :f => nil, :continue_editing => false, - :cancel_url => admin_blog_posts_url, + :cancel_url => refinery_blog_admin_posts_url, :hide_delete => true } %> <% end %> diff --git a/app/views/refinery/blog/categories/show.html.erb b/app/views/refinery/blog/categories/show.html.erb index 00d9596..aa4abaf 100644 --- a/app/views/refinery/blog/categories/show.html.erb +++ b/app/views/refinery/blog/categories/show.html.erb @@ -1,10 +1,10 @@ -<% content_for :body_content_title, @blog_category.title %> +<% content_for :body_content_title, @category.title %> <% content_for :body_content_left do %> - <% if @blog_posts.any? %> + <% if @posts.any? %> <section id="blog_posts"> - <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> + <%= will_paginate @posts %> </section> <% else %> <p> diff --git a/app/views/refinery/blog/comment_mailer/notification.html.erb b/app/views/refinery/blog/comment_mailer/notification.html.erb index cfadb67..a129d34 100644 --- a/app/views/refinery/blog/comment_mailer/notification.html.erb +++ b/app/views/refinery/blog/comment_mailer/notification.html.erb @@ -4,10 +4,10 @@ <%=raw t('.comment_starts') %> -<%=raw t('.from') %>: <%= @blog_comment.name %> -<%=raw t('.email') %>: <%= @blog_comment.email %> +<%=raw t('.from') %>: <%= @comment.name %> +<%=raw t('.email') %>: <%= @comment.email %> <%=raw t('.message') %>: -<%=simple_format strip_tags(@blog_comment.body) %> +<%=simple_format strip_tags(@comment.body) %> <%=raw t('.comment_ends') %> diff --git a/app/views/refinery/blog/posts/_comments.html.erb b/app/views/refinery/blog/posts/_comments.html.erb index 9bc0a13..a34d106 100644 --- a/app/views/refinery/blog/posts/_comments.html.erb +++ b/app/views/refinery/blog/posts/_comments.html.erb @@ -1,6 +1,6 @@ <aside id="comments"> <h2><%= t('title', :scope => 'refinery.blog.posts.show.comments') %></h2> - <% if (comments = @blog_post.comments.approved).any? %> + <% if (comments = @post.comments.approved).any? %> <%= render :partial => "comment", :collection => comments %> <% else %> <p> @@ -15,7 +15,7 @@ <% end %> <h2><%= t('add', :scope => 'refinery.blog.posts.show.comments') %></h2> - <%= form_for [main_app, :blog_post, @blog_comment] do |f| %> + <%= form_for [main_app, :refinery_blog, @comment] do |f| %> <%= render :partial => "/refinery/admin/error_messages", :locals => { :object => f.object, diff --git a/app/views/refinery/blog/posts/_nav.html.erb b/app/views/refinery/blog/posts/_nav.html.erb index 67aed14..8734638 100644 --- a/app/views/refinery/blog/posts/_nav.html.erb +++ b/app/views/refinery/blog/posts/_nav.html.erb @@ -1,17 +1,17 @@ <nav id="next_prev_article"> - <% if @blog_post.next.present? -%> - <%= link_to (truncate(@blog_post.next.title) + " »").html_safe, - main_app.url_for(@blog_post.next), + <% if @post.next.present? -%> + <%= link_to (truncate(@post.next.title) + " »").html_safe, + main_app.url_for(@post.next), :class => 'next' %> <% end -%> <%= link_to t('blog_home', :scope => 'refinery.blog.posts.show'), - main_app.blog_root_path, + main_app.refinery_blog_root_path, :class => 'home' %> - <% if @blog_post.prev.present? -%> - <%= link_to ("« " + truncate(@blog_post.prev.title)).html_safe, - main_app.url_for(@blog_post.prev), + <% if @post.prev.present? -%> + <%= link_to ("« " + truncate(@post.prev.title)).html_safe, + main_app.url_for(@post.prev), :class => 'prev' %> <% end -%> </nav><!-- /next_prev_article --> diff --git a/app/views/refinery/blog/posts/_post.html.erb b/app/views/refinery/blog/posts/_post.html.erb index cbecc5f..020ba41 100644 --- a/app/views/refinery/blog/posts/_post.html.erb +++ b/app/views/refinery/blog/posts/_post.html.erb @@ -5,27 +5,27 @@ <% end %> <article id="blog_post"> <header> - <h1><%= @blog_post.title %></h1> + <h1><%= @post.title %></h1> <section class='details'> - <time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'> - <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %> + <time datetime="<%=l @post.published_at.to_date, :format => :default %>" class='posted_at'> + <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(@post.published_at.to_date, :format => :short)) %> </time> - <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>. - <% if (categories = @blog_post.categories).any? %> + <%= "#{t('by', :scope => 'refinery.blog.posts.show')} #{@post.author.username}" if @post.author.present? %>. + <% if (categories = @post.categories).any? %> <aside class='filed_in'> <%= t('filed_in', :scope => 'refinery.blog.posts.show') %> <% categories.each_with_index do |category, index| %> - <%= link_to category.title, main_app.blog_category_path(category) -%><%= ',' if index < ((categories.length) - 1) %> + <%= link_to category.title, main_app.refinery_blog_category_path(category) -%><%= ',' if index < ((categories.length) - 1) %> <% end %> </aside> <% end %> </section> </header> - <%= @blog_post.body.html_safe %> + <%= @post.body.html_safe %> <% if Refinery::Blog::Post::ShareThis.enabled? %> <span class="st_sharethis" displayText="ShareThis"></span> <% end %> </article> -<%= render :partial => '/refinery/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%> -<%= render 'nav' if next_or_previous?(@blog_post) %> +<%= render :partial => '/refinery/draft_page_message' unless @post.nil? or @post.live? -%> +<%= render 'nav' if next_or_previous?(@post) %> diff --git a/app/views/refinery/blog/posts/archive.html.erb b/app/views/refinery/blog/posts/archive.html.erb index 01e3748..bda6c45 100644 --- a/app/views/refinery/blog/posts/archive.html.erb +++ b/app/views/refinery/blog/posts/archive.html.erb @@ -2,9 +2,9 @@ <% content_for :body_content_left do %> <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1> - <% if @blog_posts.any? %> + <% if @posts.any? %> <section id="blog_posts"> - <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> </section> <% else %> <p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p> diff --git a/app/views/refinery/blog/posts/index.html.erb b/app/views/refinery/blog/posts/index.html.erb index f5f12b8..36c007b 100644 --- a/app/views/refinery/blog/posts/index.html.erb +++ b/app/views/refinery/blog/posts/index.html.erb @@ -1,10 +1,10 @@ <% content_for :body_content_left do %> <%= raw @page.content_for(::Refinery::Pages.config.default_parts.first.to_sym) if ::Refinery::Pages.config.default_parts.any? %> - <% if @blog_posts.any? %> + <% if @posts.any? %> <section id="blog_posts"> - <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> + <%= will_paginate @posts %> </section> <% else %> <p><%= t('.no_blog_articles_yet') %></p> diff --git a/app/views/refinery/blog/posts/index.rss.builder b/app/views/refinery/blog/posts/index.rss.builder index 609816a..99ae0eb 100644 --- a/app/views/refinery/blog/posts/index.rss.builder +++ b/app/views/refinery/blog/posts/index.rss.builder @@ -3,14 +3,14 @@ xml.rss :version => "2.0" do xml.channel do xml.title Refinery::Core.config.site_name xml.description Refinery::Core.config.site_name + " Blog Posts" - xml.link main_app.blog_root_url + xml.link main_app.refinery_blog_root_url - @blog_posts.each do |post| + @posts.each do |post| xml.item do xml.title post.title xml.description post.body xml.pubDate post.published_at.to_s(:rfc822) - xml.link main_app.blog_post_url(post) + xml.link main_app.refinery_blog_post_url(post) end end end diff --git a/app/views/refinery/blog/posts/tagged.html.erb b/app/views/refinery/blog/posts/tagged.html.erb index 468401a..3a3ee75 100644 --- a/app/views/refinery/blog/posts/tagged.html.erb +++ b/app/views/refinery/blog/posts/tagged.html.erb @@ -3,10 +3,10 @@ <% content_for :body_content_title, "#{t('.posts_tagged')} “#{@tag_name.titleize}”".html_safe -%> <% content_for :body_content_left do %> - <% if @blog_posts.any? %> + <% if @posts.any? %> <section id="blog_posts"> - <%= render :partial => "/refinery/blog/shared/post", :collection => @blog_posts %> - <%= will_paginate @blog_posts %> + <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> + <%= will_paginate @posts %> </section> <% else %> <p><%= t('.no_blog_articles_yet') %></p> diff --git a/app/views/refinery/blog/shared/_categories.html.erb b/app/views/refinery/blog/shared/_categories.html.erb index 1280cd2..d7524ef 100644 --- a/app/views/refinery/blog/shared/_categories.html.erb +++ b/app/views/refinery/blog/shared/_categories.html.erb @@ -1,9 +1,9 @@ -<% if @blog_categories.any? %> +<% if @categories.any? %> <h2><%= t('.title') %></h2> <ul id='categories'> - <% @blog_categories.each do |category| %> - <li<%= " class='selected'" if @blog_category.present? and @blog_category.id == category.id %>> - <%= link_to "#{category.title} (#{category.post_count})", main_app.blog_category_path(category) %> + <% @categories.each do |category| %> + <li<%= " class='selected'" if @category.present? and @category.id == category.id %>> + <%= link_to "#{category.title} (#{category.post_count})", main_app.refinery_blog_category_path(category) %> </li> <% end %> </ul> diff --git a/app/views/refinery/blog/shared/_post.html.erb b/app/views/refinery/blog/shared/_post.html.erb index c384bcb..279de92 100644 --- a/app/views/refinery/blog/shared/_post.html.erb +++ b/app/views/refinery/blog/shared/_post.html.erb @@ -1,7 +1,7 @@ <% if post.live? %> <article class="blog_post" id="<%= dom_id(post) %>"> <header> - <h1><%= link_to post.title, main_app.blog_post_path(post) %></h1> + <h1><%= link_to post.title, main_app.refinery_blog_post_path(post) %></h1> <section class='details'> <time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'> <%= t('created_at', :scope => 'refinery.blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %> @@ -10,13 +10,13 @@ <% if (categories = post.categories).any? %> <aside class='filed_in'> <%= t('filed_in', :scope => 'refinery.blog.posts.show') %> - <%=raw categories.collect { |category| link_to category.title, main_app.blog_category_path(category) }.to_sentence %> + <%=raw categories.collect { |category| link_to category.title, main_app.refinery_blog_category_path(category) }.to_sentence %> </aside> <% end %> <% if (tags = post.tags).any? %> <aside class='tagged'> <%= t('tagged', :scope => 'refinery.blog.posts.show') %> - <%=raw tags.collect { |tag| link_to tag, main_app.tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %> + <%=raw tags.collect { |tag| link_to tag, main_app.refinery_blog_tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %> </aside> <% end %> </section> @@ -30,7 +30,7 @@ </section> <footer> <p> - <%= link_to t('read_more', :scope => 'refinery.blog.shared.posts'), main_app.blog_post_path(post) if blog_post_teaser_enabled? %> + <%= link_to t('read_more', :scope => 'refinery.blog.shared.posts'), main_app.refinery_blog_post_path(post) if blog_post_teaser_enabled? %> </p> <aside class='comment_count'> <% if Refinery::Blog::Post.comments_allowed? %> diff --git a/app/views/refinery/blog/shared/_posts.html.erb b/app/views/refinery/blog/shared/_posts.html.erb index 7dc570b..f71cd2a 100644 --- a/app/views/refinery/blog/shared/_posts.html.erb +++ b/app/views/refinery/blog/shared/_posts.html.erb @@ -1,9 +1,9 @@ -<% if @blog_posts.many? %> +<% if @posts.many? %> <h2><%= t('.other') %></h2> <ul id="blog_posts"> - <% @blog_posts.each do |blog_post| %> + <% @posts.each do |blog_post| %> <li class='clearfix'> - <%= link_to blog_post.title, main_app.blog_post_path(blog_post) %> + <%= link_to blog_post.title, main_app.refinery_blog_post_path(blog_post) %> </li> <% end %> </ul> diff --git a/app/views/refinery/blog/shared/_rss_feed.html.erb b/app/views/refinery/blog/shared/_rss_feed.html.erb index 5ece5ae..5620f85 100644 --- a/app/views/refinery/blog/shared/_rss_feed.html.erb +++ b/app/views/refinery/blog/shared/_rss_feed.html.erb @@ -1,2 +1,2 @@ <h2><%= t('.title') %></h2> -<%= link_to t('.subscribe'), main_app.blog_rss_feed_path, :id => "rss_feed_subscribe"%> +<%= link_to t('.subscribe'), main_app.refinery_blog_rss_feed_path, :id => "rss_feed_subscribe"%> diff --git a/app/views/refinery/blog/shared/_tags.html.erb b/app/views/refinery/blog/shared/_tags.html.erb index 5a72b81..f35900c 100644 --- a/app/views/refinery/blog/shared/_tags.html.erb +++ b/app/views/refinery/blog/shared/_tags.html.erb @@ -2,7 +2,7 @@ <h2><%= t('.title') %></h2> <nav id='tags'> <% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %> - <%= link_to tag.name, main_app.tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %> + <%= link_to tag.name, main_app.refinery_blog_tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %> <% end %> </nav> <% end %>
\ No newline at end of file |