Commit a45ffb4ba66b9a642cd3b103efdf09fe8b128a02

Authored by Joenio Costa
1 parent 003856fe

Changing style of "Suggest article" to be equal as "Edit article"

(ActionItem1911)
app/views/content_viewer/view_page.rhtml
... ... @@ -8,8 +8,8 @@
8 8  
9 9  
10 10 <div<%= " class='logged-in'" if user %>>
  11 + <div id="article-actions">
11 12 <% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %>
12   - <div id="article-actions">
13 13 <% if @page.allow_post_content?(user) %>
14 14 <%= link_to content_tag( 'span', label_for_edit_article(@page) ),
15 15 profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }),
... ... @@ -49,12 +49,10 @@
49 49 <% if profile.kind_of?(Enterprise) && @page.gallery? %>
50 50 <%= button('upload-file', _('Upload files'), :controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent)) %>
51 51 <% end %>
52   - </div>
53   - <% else %>
54   - <% if profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %>
  52 + <% elsif profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %>
55 53 <%= link_to content_tag( 'span', _('Suggest an article') ), profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}), :id => 'suggest-article-link', :class => 'button with-text icon-new' %>
56   - <% end %>
57 54 <% end %>
  55 + </div>
58 56 <div id="article-header">
59 57 <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
60 58 <%= article_title(@page, :no_link => true) %>
... ...
test/functional/content_viewer_controller_test.rb
... ... @@ -1374,4 +1374,12 @@ class ContentViewerControllerTest &lt; Test::Unit::TestCase
1374 1374 assert_equal 2, assigns(:comments_count)
1375 1375 end
1376 1376  
  1377 + should 'suggest article link displayed into article-actions div' do
  1378 + community = fast_create(Community)
  1379 + blog = fast_create(Blog, :profile_id => community.id, :path => 'blog')
  1380 + get :view_page, :profile => community.identifier, :page => [ 'blog' ]
  1381 + assert_tag :tag => 'div', :attributes => {:id => 'article-actions'},
  1382 + :descendant => {:tag => 'a', :attributes => {:id => 'suggest-article-link'}}
  1383 + end
  1384 +
1377 1385 end
... ...