Patch #21587

Additional view hook for body_top

Added by Tobias Fischer almost 3 years ago. Updated over 2 years ago.

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

0%

Category:Hook requests
Target version:3.3.0

Description

Any chance to add the following one-liner to add another hook at the beginning of the body element like we have it at the bottom?
Let's call it view_layouts_base_body_top (analogous to view_layouts_base_body_bottom).

</head>
<body class="<%=h body_css_classes %>">
<%= call_hook :view_layouts_base_body_top %>
<div id="wrapper">

It's a one-liner, it doesn't need tests, it doesn't break anything – please merge this in the next minor release.

This could be used by plugin authors like me to display additional information at the top of the page...


This is a duplicate of #17454 which doesn't seem to draw attention to the developers as it's just another Feature Request among 20.000 others and can't be changed to the tracker "Patch" to appear in the patch queue...
If someone of the Redmine team ever reads this, please considder changing permissions for ticket authors to allow them to switch the Tracker for their tickets...

0001-Additional-view-hook-body_top.patch Magnifier (766 Bytes) Tobias Fischer, 2015-12-23 00:23

Additional-view-hook-body_top_v2.patch Magnifier - patch against 3.2.0.devel.15067 (416 Bytes) Go MAEDA, 2016-01-18 12:27


Related issues

Related to Redmine - Feature #17454: Additional view hook for body_top Closed

Associated revisions

Revision 15070
Added by Jean-Philippe Lang over 2 years ago

Additional view hook for body_top (#21587).

Patch by Tobias Fischer.

History

#1 Updated by Toshi MARUYAMA almost 3 years ago

#2 Updated by Go MAEDA over 2 years ago

+1 for this suggestion. Updated the patch for 3.2.0.devel.15067.

There are following 3 hooks in app/views/layouts/base.html.erb. I think we would be better to add :view_layouts_base_body_head, corresponding with :view_layouts_base_body_bottom.

  • :view_layouts_base_html_head
  • :view_layouts_base_content
  • :view_layouts_base_body_bottom

#3 Updated by Tobias Fischer over 2 years ago

Thanks for review and assigning to 3.3 !

Regarding the naming:
I personally would stick to my suggestion :view_layouts_base_body_top and not use :view_layouts_base_body_head as it might be confusing whether it applies to the <head> or the <body> element.
Also, other view hooks which insert things at the start are named _top:
  • :view_issues_new_top
  • :view_account_login_top (and correspondant :view_account_login_bottom)

#4 Updated by Go MAEDA over 2 years ago

Tobias Fischer wrote:

I personally would stick to my suggestion :view_layouts_base_body_top and not use :view_layouts_base_body_head as it might be confusing whether it applies to the <head> or the <body> element.

Sorry, my comment on #21587#note-2 has an error. Please interpret :view_layouts_base_body_head as :view_layouts_base_body_top.
No problem in the patch Additional-view-hook-body_top_v2.patch.

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

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks.

#6 Updated by Tobias Fischer over 2 years ago

Great, thanks! :)

Also available in: Atom PDF