Commit 3de507f5a093c32b08881e7346048bf4b2c587a9
Exists in
master
and in
28 other branches
Merge commit '9470a284bab85da6067d6d337a4a81dcf9213d62' into v0.11.x
Showing
3 changed files
with
15 additions
and
76 deletions
Show diff stats
app/views/content_viewer/view_page.rhtml
| ... | ... | @@ -45,10 +45,12 @@ |
| 45 | 45 | <% end %> |
| 46 | 46 | </div> |
| 47 | 47 | |
| 48 | -<div id="article-tags"> | |
| 49 | - <%= _("This article's tags:") %> | |
| 50 | - <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %> | |
| 51 | -</div> | |
| 48 | +<% if !@page.tags.empty? %> | |
| 49 | + <div id="article-tags"> | |
| 50 | + <%= _("This article's tags:") %> | |
| 51 | + <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %> | |
| 52 | + </div> | |
| 53 | +<% end %> | |
| 52 | 54 | |
| 53 | 55 | <% if @page.parent && !@page.parent.path.blank? %> |
| 54 | 56 | <div id="article-parent"> | ... | ... |
app/views/search/_product_categories_menu.rhtml
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | <% end %> |
| 17 | 17 | <% end %> |
| 18 | 18 | <% product_categories_menu.each do |cat, hits, childs| %> |
| 19 | - <li class="cat-parent" onmouseover="prodCatMenuOver(this)" onmouseout="prodCatMenuOut(this)"> | |
| 19 | + <li class="cat-parent" > | |
| 20 | 20 | <%= link_to( |
| 21 | 21 | cat.name + " " + content_tag('small', "(#{hits})"), |
| 22 | 22 | params.merge({:product_category => cat.id}) |
| ... | ... | @@ -38,76 +38,5 @@ |
| 38 | 38 | </ul> |
| 39 | 39 | </div> |
| 40 | 40 | |
| 41 | -<script type="text/javascript"> | |
| 42 | - | |
| 43 | -function prodCatMenuOver( li ) { | |
| 44 | - clearTimeout( li.timeout ); | |
| 45 | - //if ( ! ( li.opened || li.opening ) ) { | |
| 46 | - if ( | |
| 47 | - ( ! li.opened ) && ( ! li.opening ) && | |
| 48 | - ( ( ! li.e ) || li.e.state == "finished" ) | |
| 49 | - ) { | |
| 50 | - li.opening = true; | |
| 51 | - li.className = "cat-parent sub-opening"; | |
| 52 | - li.subMenu.className = "opening"; | |
| 53 | - li.e = Effect.BlindDown(li.subMenu, { duration: 0.33 }); | |
| 54 | - li.e._finish = li.e.finish; | |
| 55 | - li.e.finish = function(){ | |
| 56 | - this._finish(); | |
| 57 | - this.element.li.closed = false; | |
| 58 | - this.element.li.opened = true; | |
| 59 | - this.element.li.opening = false; | |
| 60 | - this.element.className = "opened"; | |
| 61 | - this.element.li.className = "cat-parent sub-opened"; | |
| 62 | - } | |
| 63 | - li.closed = false; | |
| 64 | - } | |
| 65 | -} | |
| 66 | - | |
| 67 | -function prodCatMenuOut( li ) { | |
| 68 | - //if ( li.e.state == "finished" ) { | |
| 69 | - if ( | |
| 70 | - ( ! li.closed ) && ( ! li.closeing ) && | |
| 71 | - ( li.e.state == "finished" ) | |
| 72 | - ) { | |
| 73 | - li.timeout = setTimeout( function () { | |
| 74 | - this.closeing = true; | |
| 75 | - this.className = "cat-parent sub-closeing"; | |
| 76 | - this.subMenu.className = "closeing"; | |
| 77 | - this.e = Effect.BlindUp(this.subMenu, { duration: 0.5 }); | |
| 78 | - this.e._finish = this.e.finish; | |
| 79 | - this.e.finish = function(){ | |
| 80 | - this._finish(); | |
| 81 | - this.element.li.opened = false; | |
| 82 | - this.element.li.closed = true; | |
| 83 | - this.element.li.closeing = false; | |
| 84 | - this.element.className = "closed"; | |
| 85 | - this.element.li.className = "cat-parent sub-closed"; | |
| 86 | - } | |
| 87 | - }.bind(li), 200 ); | |
| 88 | - } else { | |
| 89 | - li.timeout = setTimeout( li.onmouseout.bind(li), 200 ); | |
| 90 | - } | |
| 91 | -} | |
| 92 | - | |
| 93 | -if ( document.all ) { | |
| 94 | - | |
| 95 | - function prodCatMenuOver( li ) { li.className = "cat-parent sub-opened" } | |
| 96 | - function prodCatMenuOut( li ) { li.className = "cat-parent sub-closed" } | |
| 97 | - | |
| 98 | -} else { | |
| 99 | - | |
| 100 | - $$("#product-categories-menu ul div").each( function(subMenu){ | |
| 101 | - var li = subMenu.parentNode; | |
| 102 | - subMenu.li = li; | |
| 103 | - li.subMenu = subMenu; | |
| 104 | - li.subMenu.style.display = "none"; | |
| 105 | - li.closed = true; | |
| 106 | - }) | |
| 107 | - | |
| 108 | -} | |
| 109 | - | |
| 110 | -</script> | |
| 111 | - | |
| 112 | 41 | <% end %> |
| 113 | 42 | ... | ... |
test/functional/content_viewer_controller_test.rb
| ... | ... | @@ -273,6 +273,14 @@ class ContentViewerControllerTest < Test::Unit::TestCase |
| 273 | 273 | assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { :content => /This article's tags:/ } |
| 274 | 274 | end |
| 275 | 275 | |
| 276 | + should "not display current article's tags" do | |
| 277 | + page = profile.articles.create!(:name => 'myarticle', :body => 'test article') | |
| 278 | + | |
| 279 | + get :view_page, :profile => profile.identifier, :page => [ 'myarticle' ] | |
| 280 | + assert_no_tag :tag => 'div', :attributes => { :id => 'article-tags' } | |
| 281 | + assert_no_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { :content => /This article's tags:/ } | |
| 282 | + end | |
| 283 | + | |
| 276 | 284 | should 'not display forbidden articles' do |
| 277 | 285 | profile.articles.create!(:name => 'test') |
| 278 | 286 | profile.update_attributes!(:public_content => false) | ... | ... |