Defect #3259

remove "main-menu" div when the menu is empty

Added by Ludovic Gasc over 12 years ago. Updated over 11 years ago.

Status:ClosedStart date:2009-04-29
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

100%

Category:UI
Target version:0.9.4
Resolution:Fixed Affected version:0.8.3

Description

On some pages, like Home or My page, the project menu is empty but the div html is still present.

It's a problem when you a background image in CSS, because you see the background image without the menu items (see the screenshot).

Could you remove:

<div id="main-menu">

</div>

or add a CSS class to identify an empty menu ?

Thank you very much.

bug0021.jpeg (9.85 KB) Ludovic Gasc, 2009-04-29 11:41

redmine-3259.diff Magnifier (575 Bytes) Christian Bradley, 2010-03-02 09:47


Related issues

Related to Redmine - Defect #13773: remove "main-menu" div when the project menu is empty New

Associated revisions

Revision 3539
Added by Eric Davis over 11 years ago

Hide the main menu div if there isn't any items for it. #3259

History

#1 Updated by Christian Bradley over 11 years ago

Fixed by:

  • Saving for the result of render_main_menu into menu_html
  • Adding a class "empty" on main_menu if menu_html.nil?

The attached patch should resolve this issue.

#2 Updated by Christian Bradley over 11 years ago

  • Status changed from New to Resolved

#3 Updated by Felix Schäfer over 11 years ago

  • Status changed from Resolved to 7
  • Assignee set to Jean-Philippe Lang

JPLang, pushing this up on your radar. The patch seems ok, though I'm not sure this kind of logic should be in a view, I don't have a better idea at the moment though.

#4 Updated by Eric Davis over 11 years ago

  • Status changed from 7 to Resolved
  • Target version set to 0.9.4
  • Resolution set to Fixed

Felix Schäfer wrote:

The patch seems ok, though I'm not sure this kind of logic should be in a view, I don't have a better idea at the moment though.

I agree. I've committed a different version of it which will not display the main-menu div if it's empty (commit r3539)

#5 Updated by Jean-Philippe Lang over 11 years ago

  • Status changed from Resolved to Closed

#6 Updated by Go MAEDA 3 months ago

  • Related to Defect #13773: remove "main-menu" div when the project menu is empty added

Also available in: Atom PDF