Commit 52abcfe22262e4fc7488f42fd6f6d24efe6f8091
Committed by
Daniela Feitosa
1 parent
fcd1069b
Exists in
master
and in
29 other branches
More flexibility to themes
- separating the fields date, author and comment link - adding new div inner main content div (ActionItem1997)
Showing
3 changed files
with
13 additions
and
6 deletions
Show diff stats
app/helpers/content_viewer_helper.rb
... | ... | @@ -22,9 +22,14 @@ module ContentViewerHelper |
22 | 22 | end |
23 | 23 | comments = '' |
24 | 24 | unless args[:no_comments] || !article.accept_comments |
25 | - comments = ("- %s") % link_to_comments(article) | |
25 | + comments = (" - %s") % link_to_comments(article) | |
26 | 26 | end |
27 | - 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') | |
27 | + title << content_tag('span', | |
28 | + content_tag('span', show_date(article.published_at), :class => 'date') + | |
29 | + content_tag('span', [_(", by %s") % link_to(article.author_name, article.author.url)], :class => 'author') + | |
30 | + content_tag('span', comments, :class => 'comments'), | |
31 | + :class => 'created-at' | |
32 | + ) | |
28 | 33 | end |
29 | 34 | title |
30 | 35 | end | ... | ... |
app/views/layouts/application-ng.rhtml
... | ... | @@ -66,8 +66,10 @@ |
66 | 66 | <div id="navigation-end"></div> |
67 | 67 | </div><!-- end id="navigation" --> |
68 | 68 | <div id="content"> |
69 | - <%= insert_boxes(yield) %> | |
70 | - <br style='clear: both'/> | |
69 | + <div id="content-inner"> | |
70 | + <%= insert_boxes(yield) %> | |
71 | + <br style='clear: both'/> | |
72 | + </div><!-- end id="content-inner" --> | |
71 | 73 | </div><!-- end id="content" --> |
72 | 74 | </div><!-- end id="wrap-2" --> |
73 | 75 | </div><!-- end id="wrap-1" --> | ... | ... |
test/unit/content_viewer_helper_test.rb
... | ... | @@ -16,13 +16,13 @@ class ContentViewerHelperTest < Test::Unit::TestCase |
16 | 16 | blog = fast_create(Blog, :name => 'Blog test', :profile_id => profile.id) |
17 | 17 | post = TextileArticle.create!(:name => 'post test', :profile => profile, :parent => blog) |
18 | 18 | result = article_title(post) |
19 | - assert_match /#{show_date(post.published_at)}, by .*#{profile.identifier}/, result | |
19 | + assert_match /<span class="date">#{show_date(post.published_at)}<\/span><span class="author">, by .*#{profile.identifier}/, result | |
20 | 20 | end |
21 | 21 | |
22 | 22 | should 'not display published-at for non-blog posts' do |
23 | 23 | article = TextileArticle.create!(:name => 'article for test', :profile => profile) |
24 | 24 | result = article_title(article) |
25 | - assert_no_match /#{show_date(article.published_at)}, by .*#{profile.identifier}/, result | |
25 | + assert_no_match /<span class="date">#{show_date(article.published_at)}<\/span><span class="author">, by .*#{profile.identifier}/, result | |
26 | 26 | end |
27 | 27 | |
28 | 28 | should 'create link on title of blog posts' do | ... | ... |