From a45ffb4ba66b9a642cd3b103efdf09fe8b128a02 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Tue, 1 Mar 2011 17:47:02 -0300 Subject: [PATCH] Changing style of "Suggest article" to be equal as "Edit article" --- app/views/content_viewer/view_page.rhtml | 8 +++----- test/functional/content_viewer_controller_test.rb | 8 ++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml index 78a60b0..b4eaac3 100644 --- a/app/views/content_viewer/view_page.rhtml +++ b/app/views/content_viewer/view_page.rhtml @@ -8,8 +8,8 @@ > +
<% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %> -
<% if @page.allow_post_content?(user) %> <%= link_to content_tag( 'span', label_for_edit_article(@page) ), profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }), @@ -49,12 +49,10 @@ <% if profile.kind_of?(Enterprise) && @page.gallery? %> <%= button('upload-file', _('Upload files'), :controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent)) %> <% end %> -
- <% else %> - <% if profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %> + <% elsif profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %> <%= 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' %> - <% end %> <% end %> +
<%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %> <%= article_title(@page, :no_link => true) %> diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 1641e08..463e4ca 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -1374,4 +1374,12 @@ class ContentViewerControllerTest < Test::Unit::TestCase assert_equal 2, assigns(:comments_count) end + should 'suggest article link displayed into article-actions div' do + community = fast_create(Community) + blog = fast_create(Blog, :profile_id => community.id, :path => 'blog') + get :view_page, :profile => community.identifier, :page => [ 'blog' ] + assert_tag :tag => 'div', :attributes => {:id => 'article-actions'}, + :descendant => {:tag => 'a', :attributes => {:id => 'suggest-article-link'}} + end + end -- libgit2 0.21.2