From 52abcfe22262e4fc7488f42fd6f6d24efe6f8091 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Mon, 2 May 2011 16:55:05 -0300 Subject: [PATCH] More flexibility to themes --- app/helpers/content_viewer_helper.rb | 9 +++++++-- app/views/layouts/application-ng.rhtml | 6 ++++-- test/unit/content_viewer_helper_test.rb | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/helpers/content_viewer_helper.rb b/app/helpers/content_viewer_helper.rb index 3b31b3f..f7945d1 100644 --- a/app/helpers/content_viewer_helper.rb +++ b/app/helpers/content_viewer_helper.rb @@ -22,9 +22,14 @@ module ContentViewerHelper end comments = '' unless args[:no_comments] || !article.accept_comments - comments = ("- %s") % link_to_comments(article) + comments = (" - %s") % link_to_comments(article) end - title << content_tag('span', _("%s, by %s %s") % [show_date(article.published_at), link_to(article.author_name, article.author.url), comments], :class => 'created-at') + title << content_tag('span', + content_tag('span', show_date(article.published_at), :class => 'date') + + content_tag('span', [_(", by %s") % link_to(article.author_name, article.author.url)], :class => 'author') + + content_tag('span', comments, :class => 'comments'), + :class => 'created-at' + ) end title end diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index abb36a3..a4e0e39 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -66,8 +66,10 @@
- <%= insert_boxes(yield) %> -
+
+ <%= insert_boxes(yield) %> +
+
diff --git a/test/unit/content_viewer_helper_test.rb b/test/unit/content_viewer_helper_test.rb index f4e89f9..84b1eb6 100644 --- a/test/unit/content_viewer_helper_test.rb +++ b/test/unit/content_viewer_helper_test.rb @@ -16,13 +16,13 @@ class ContentViewerHelperTest < Test::Unit::TestCase blog = fast_create(Blog, :name => 'Blog test', :profile_id => profile.id) post = TextileArticle.create!(:name => 'post test', :profile => profile, :parent => blog) result = article_title(post) - assert_match /#{show_date(post.published_at)}, by .*#{profile.identifier}/, result + assert_match /#{show_date(post.published_at)}<\/span>, by .*#{profile.identifier}/, result end should 'not display published-at for non-blog posts' do article = TextileArticle.create!(:name => 'article for test', :profile => profile) result = article_title(article) - assert_no_match /#{show_date(article.published_at)}, by .*#{profile.identifier}/, result + assert_no_match /#{show_date(article.published_at)}<\/span>, by .*#{profile.identifier}/, result end should 'create link on title of blog posts' do -- libgit2 0.21.2