プロジェクト

全般

プロフィール

Vote #77046

完了

Additional view hook for body_top

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Hook requests_54
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
54
version_id:
110
issue_org_id:
21587
author_id:
48494
assigned_to_id:
1
comments:
6
status_id:
5
tracker_id:
3
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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



<%= call_hook :view_layouts_base_body_top %>

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


journals

--------------------------------------------------------------------------------
+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
--------------------------------------------------------------------------------
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@)
--------------------------------------------------------------------------------

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 attachment:Additional-view-hook-body_top_v2.patch.

--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------
Great, thanks! :)
--------------------------------------------------------------------------------


related_issues

relates,Closed,17454,Additional view hook for body_top

Admin Redmine さんが約4年前に更新

  • カテゴリHook requests_54 にセット
  • 対象バージョン3.3.0_110 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0