Commit a45ffb4ba66b9a642cd3b103efdf09fe8b128a02
1 parent
003856fe
Exists in
master
and in
28 other branches
Changing style of "Suggest article" to be equal as "Edit article"
(ActionItem1911)
Showing
2 changed files
with
11 additions
and
5 deletions
Show diff stats
app/views/content_viewer/view_page.rhtml
@@ -8,8 +8,8 @@ | @@ -8,8 +8,8 @@ | ||
8 | 8 | ||
9 | 9 | ||
10 | <div<%= " class='logged-in'" if user %>> | 10 | <div<%= " class='logged-in'" if user %>> |
11 | + <div id="article-actions"> | ||
11 | <% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %> | 12 | <% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %> |
12 | - <div id="article-actions"> | ||
13 | <% if @page.allow_post_content?(user) %> | 13 | <% if @page.allow_post_content?(user) %> |
14 | <%= link_to content_tag( 'span', label_for_edit_article(@page) ), | 14 | <%= link_to content_tag( 'span', label_for_edit_article(@page) ), |
15 | profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }), | 15 | profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }), |
@@ -49,12 +49,10 @@ | @@ -49,12 +49,10 @@ | ||
49 | <% if profile.kind_of?(Enterprise) && @page.gallery? %> | 49 | <% if profile.kind_of?(Enterprise) && @page.gallery? %> |
50 | <%= button('upload-file', _('Upload files'), :controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent)) %> | 50 | <%= button('upload-file', _('Upload files'), :controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent)) %> |
51 | <% end %> | 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 | <%= 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' %> | 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 | <% end %> | 54 | <% end %> |
55 | + </div> | ||
58 | <div id="article-header"> | 56 | <div id="article-header"> |
59 | <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %> | 57 | <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %> |
60 | <%= article_title(@page, :no_link => true) %> | 58 | <%= article_title(@page, :no_link => true) %> |
test/functional/content_viewer_controller_test.rb
@@ -1374,4 +1374,12 @@ class ContentViewerControllerTest < Test::Unit::TestCase | @@ -1374,4 +1374,12 @@ class ContentViewerControllerTest < Test::Unit::TestCase | ||
1374 | assert_equal 2, assigns(:comments_count) | 1374 | assert_equal 2, assigns(:comments_count) |
1375 | end | 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 | end | 1385 | end |