diff options
author | Philip Arndt <parndt@gmail.com> | 2011-11-10 09:23:02 +1300 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2011-11-10 09:23:02 +1300 |
commit | f9f56c6f1c5ee277f5b0a335ca12a4eea275d42d (patch) | |
tree | 37bccbf5da9e688e5d6c8be5d3f10d03c4c25e75 /app | |
parent | 81475ff3809d83e46ff28f39523abfc5cb1635a4 (diff) | |
parent | 12164fd95a1884a340283554ed5dbeedce916b80 (diff) | |
download | refinerycms-blog-f9f56c6f1c5ee277f5b0a335ca12a4eea275d42d.tar.gz refinerycms-blog-f9f56c6f1c5ee277f5b0a335ca12a4eea275d42d.tar.bz2 refinerycms-blog-f9f56c6f1c5ee277f5b0a335ca12a4eea275d42d.zip |
Merge branch 'master' into rails-3-1
Conflicts:
app/controllers/admin/blog/posts_controller.rb
app/controllers/blog/posts_controller.rb
Diffstat (limited to 'app')
3 files changed, 17 insertions, 22 deletions
diff --git a/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss b/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss index 5854273..f9a1401 100755 --- a/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss +++ b/app/assets/stylesheets/refinery/blog/ui-lightness/jquery-ui-1.8.13.custom.css.scss @@ -56,13 +56,6 @@ /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } -.ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ @@ -274,7 +267,6 @@ .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } @@ -335,3 +327,4 @@ font-weight: normal; margin: -1px; } + diff --git a/app/controllers/refinery/admin/blog/posts_controller.rb b/app/controllers/refinery/admin/blog/posts_controller.rb index aa40c85..8b3816d 100644 --- a/app/controllers/refinery/admin/blog/posts_controller.rb +++ b/app/controllers/refinery/admin/blog/posts_controller.rb @@ -20,18 +20,14 @@ module Refinery end def tags - op = case ActiveRecord::Base.connection.adapter_name.downcase - when 'postgresql' - '~*' - else - 'LIKE' - end - wildcard = case ActiveRecord::Base.connection.adapter_name.downcase - when 'postgresql' - '.*' - else - '%' - end + if ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql' + op = '~*' + wildcard = '.*' + else + op = 'LIKE' + wildcard = '%' + end + @tags = Refinery::Blog::Post.tag_counts_on(:tags).where( ["tags.name #{op} ?", "#{wildcard}#{params[:term].to_s.downcase}#{wildcard}"] ).map { |tag| {:id => tag.id, :value => tag.name}} diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb index d3cd7a1..1c8cffd 100644 --- a/app/controllers/refinery/blog/posts_controller.rb +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -1,7 +1,7 @@ module Refinery module Blog class PostsController < BaseController - + caches_page :index before_filter :find_all_blog_posts, :except => [:archive] @@ -12,7 +12,7 @@ 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? + (@blog_posts = Refinery::Blog::Post.live.includes(:comments, :categories).all) if request.format.rss? respond_with (@blog_posts) do |format| format.html format.rss @@ -22,6 +22,8 @@ module Refinery def show @blog_comment = Refinery::Blog::Comment.new + @canonical = url_for(:locale => ::Refinery::I18n.default_frontend_locale) if canonical? + respond_with (@blog_post) do |format| format.html { present(@blog_post) } format.js { render :partial => 'post', :layout => false } @@ -71,6 +73,10 @@ module Refinery @tag_name = @tag.name @blog_posts = Refinery::Blog::Post.tagged_with(@tag_name).page(params[:page]) end + + def canonical? + ::Refinery.i18n_enabled? && ::Refinery::I18n.default_frontend_locale != ::Refinery::I18n.current_frontend_locale + end end end end |