Project

General

Profile

Actions

Patch #21587

closed

Additional view hook for body_top

Added by Tobias Fischer almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Hook requests
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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...


Files

0001-Additional-view-hook-body_top.patch (766 Bytes) 0001-Additional-view-hook-body_top.patch Tobias Fischer, 2015-12-23 00:23
Additional-view-hook-body_top_v2.patch (416 Bytes) Additional-view-hook-body_top_v2.patch patch against 3.2.0.devel.15067 Go MAEDA, 2016-01-18 12:27

Related issues

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

Actions
Actions #1

Updated by Toshi MARUYAMA almost 9 years ago

Actions #2

Updated by Go MAEDA almost 9 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
Actions #3

Updated by Tobias Fischer almost 9 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)
Actions #4

Updated by Go MAEDA almost 9 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.

Actions #5

Updated by Jean-Philippe Lang almost 9 years ago

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

Committed, thanks.

Actions #6

Updated by Tobias Fischer almost 9 years ago

Great, thanks! :)

Actions

Also available in: Atom PDF