Project

General

Profile

Patch #44660 » view_hooks.patch

Jimmy Westberg, 2026-10-22 18:00

View differences:

app/helpers/application_helper.rb
end
end
html_title args.reverse.map {|s| (s.is_a?(Array) ? s.first : s).to_s}
content_tag('h2', strings.join(' » ').html_safe)
content_tag('h2', strings.join(' » ').html_safe) +
call_hook(:view_layouts_base_title_after, :title => args)
end
# Sets the html title
......
end
def sidebar_content?
content_for?(:sidebar) || view_layouts_base_sidebar_hook_response.present?
content_for?(:sidebar) || view_layouts_base_sidebar_hook_response.present? ||
view_layouts_base_sidebar_top_hook_response.present?
end
def view_layouts_base_sidebar_hook_response
@view_layouts_base_sidebar_hook_response ||= call_hook(:view_layouts_base_sidebar)
end
# The CSS classes that plugins add to an element through +hook+, as a plain
# (not html_safe) String so that it is escaped in the attribute
def css_classes_from_hook(hook, context={})
String.new(call_hook(hook, context)).split.join(' ')
end
def view_layouts_base_sidebar_top_hook_response
@view_layouts_base_sidebar_top_hook_response ||= call_hook(:view_layouts_base_sidebar_top)
end
def email_delivery_enabled?
!!ActionMailer::Base.perform_deliveries
end
app/helpers/groups_helper.rb
tabs << {:name => 'general', :partial => 'groups/general', :label => :label_general}
tabs << {:name => 'users', :partial => 'groups/users', :label => :label_user_plural} if group.givable?
tabs << {:name => 'memberships', :partial => 'groups/memberships', :label => :label_project_plural}
tabs
Redmine::Tabs.add_to(:group, tabs, :group => group)
end
def render_principals_for_new_group_users(group, limit=100)
app/helpers/issues_helper.rb
# Returns the textual representation of a single journal detail
def show_detail(detail, no_html=false, options={})
if (renderer = Redmine::JournalDetails.renderer_for(detail))
return renderer.call(detail, self, no_html, options)
end
multiple = false
show_diff = false
no_details = false
......
"'#{issue_path(@issue, :tab => 'changesets')}')"
}
end
tabs
Redmine::Tabs.add_to(:issue_history, tabs, :issue => @issue)
end
def issue_history_default_tab
app/helpers/projects_helper.rb
{:name => 'activities', :action => :manage_project_activities,
:partial => 'projects/settings/activities', :label => :label_time_tracking}
]
# A plugin tab without a :permission needs the one of the project tab
tabs = Redmine::Tabs.add_to(:project_settings, tabs, :project => @project).each {|tab| tab[:action] ||= :edit_project}
tabs.
select {|tab| User.current.allowed_to?(tab[:action], @project)}.
select {|tab| tab[:module].nil? || @project.module_enabled?(tab[:module])}
app/helpers/settings_helper.rb
{:name => 'repositories', :partial => 'settings/repositories',
:label => :label_repository_plural}
]
Redmine::Tabs.add_to(:administration_settings, tabs)
end
def render_settings_error(errors)
app/helpers/users_helper.rb
if Group.givable.any?
tabs.insert 1, {:name => 'groups', :partial => 'users/groups', :label => :label_group_plural}
end
tabs
Redmine::Tabs.add_to(:user, tabs, :user => @user)
end
end
app/views/boards/show.html.erb
{:controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'},
:class => 'icon icon-settings' if User.current.allowed_to?(:manage_boards, @project) %>
<%= call_hook(:view_boards_show_contextual, {:board => @board, :project => @project}) %>
</div>
<div id="add-message" style="display:none;">
app/views/context_menus/issues.html.erb
:method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon icon-del', :disabled => !@can[:delete] %></li>
<% end %>
<%= render_object_menu_items(:issue_context_menu, @issues, @project, list: true) %>
<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
</ul>
app/views/documents/index.html.erb
<div class="contextual">
<%= link_to sprite_icon('add', l(:label_document_new)), new_project_document_path(@project), :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-document", "document_title"); return false;' if User.current.allowed_to?(:add_documents, @project) %>
<%= call_hook(:view_documents_index_contextual, {:project => @project}) %>
</div>
<div id="add-document" style="display:none;">
app/views/documents/show.html.erb
<% if User.current.allowed_to?(:delete_documents, @project) %>
<%= delete_link document_path(@document) %>
<% end %>
<%= call_hook(:view_documents_show_contextual, {:document => @document, :project => @project}) %>
</div>
<h2><%= @document.title %></h2>
app/views/groups/_form.html.erb
<%= error_messages_for @group %>
<div class="box tabular">
<%= call_hook(:view_groups_form_top, :group => @group, :form => f) %>
<p><%= f.text_field :name, :required => true, :size => 60,
:disabled => !@group.safe_attribute?('name') %></p>
<% unless @group.builtin? %>
......
<% @group.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :group, value %></p>
<% end %>
<%= call_hook(:view_groups_form_bottom, :group => @group, :form => f) %>
</div>
app/views/groups/show.html.erb
<div class="contextual">
<%= link_to(sprite_icon('edit', l(:button_edit)), edit_group_path(@group), :class => 'icon icon-edit') if User.current.admin? %>
<%= call_hook(:view_groups_show_contextual, {:group => @group}) %>
</div>
<h2><%= @group.name %></h2>
app/views/issues/_action_menu.html.erb
<%= watcher_link(@issue, User.current) %>
<%= link_to sprite_icon('copy', l(:button_copy)), project_copy_issue_path(@project, @issue),
:class => 'icon icon-copy ' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %>
<%= call_hook(:view_issues_show_contextual, {:issue => @issue, :project => @project}) %>
<%= actions_dropdown do %>
<%= copy_object_url_link(issue_url(@issue, only_path: false)) %>
<%= render_object_menu_items(:issue_actions, @issue, @project) %>
<%= link_to sprite_icon('del', l(:button_delete_object, object_name: l(:label_issue)).capitalize), issue_path(@issue),
:data => {:confirm => issues_destroy_confirmation_message(@issue)},
:method => :delete, :class => 'icon icon-del ' if @issue.deletable? %>
<%= call_hook(:view_issues_show_actions_menu, {:issue => @issue, :project => @project}) %>
<% end %>
</div>
app/views/issues/_form.html.erb
<% if @issue.safe_attribute? 'subject' %>
<p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true %></p>
<% end %>
<%= call_hook(:view_issues_form_after_subject, { :issue => @issue, :form => f }) %>
<% if @issue.safe_attribute? 'description' %>
<p>
......
</p>
<%= wikitoolbar_for 'issue_description', preview_issue_path(:project_id => @issue.project, :issue_id => @issue.id) %>
<% end %>
<%= call_hook(:view_issues_form_after_description, { :issue => @issue, :form => f }) %>
<div id="attributes" class="attributes">
<%= render :partial => 'issues/attributes' %>
</div>
<%= call_hook(:view_issues_form_after_attributes, { :issue => @issue, :form => f }) %>
<%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
<% end %>
app/views/issues/_form_custom_fields.html.erb
<% custom_field_values = @issue.editable_custom_field_values %>
<% custom_field_values_full_width = custom_field_values.select { |value| value.custom_field.full_width_layout? } %>
<% custom_field_values -= custom_field_values_full_width %>
<%= call_hook(:view_issues_form_custom_fields_top, { :issue => @issue, :custom_field_values => custom_field_values }) %>
<% if custom_field_values.present? %>
<div class="splitcontent">
......
<p><%= custom_field_tag_with_label :issue, value, :required => @issue.required_attribute?(value.custom_field_id) %></p>
<%= wikitoolbar_for "issue_custom_field_values_#{value.custom_field_id}", preview_issue_path(:project_id => @issue.project, :issue_id => @issue.id) if value.custom_field.full_text_formatting? %>
<% end %>
<%= call_hook(:view_issues_form_custom_fields_bottom, { :issue => @issue, :custom_field_values => custom_field_values }) %>
app/views/issues/_list.html.erb
</td>
</tr>
<% end %>
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %> <%= css_classes_from_hook(:view_issues_list_row_css_classes, {:issue => issue, :query => query}) %>">
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
<% query.inline_columns.each do |column| %>
<%= content_tag('td', column_content(column, issue), :class => column.css_classes) %>
......
</tr>
<% end -%>
<% end -%>
<%= call_hook(:view_issues_list_row_after, {:issue => issue, :query => query, :colspan => query.inline_columns.size + 2}) %>
<% end -%>
</tbody>
</table>
app/views/issues/index.html.erb
<% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?) %>
<%= link_to sprite_icon('add', l(:label_issue_new)), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %>
<% end %>
<%= call_hook(:view_issues_index_contextual, {:project => @project, :query => @query}) %>
<%= actions_dropdown do %>
<% if @project %>
<%= link_to sprite_icon('summary', l(:field_summary)), project_issues_report_path(@project), :class => 'icon icon-stats' %>
......
<%= link_to_if_authorized sprite_icon('settings', l(:label_settings)),
{:controller => 'projects', :action => 'settings', :id => @project, :tab => 'issues'},
:class => 'icon icon-settings' if User.current.allowed_to?(:edit_project, @project) %>
<%= call_hook(:view_issues_index_actions_menu, {:project => @project, :query => @query}) %>
<% end %>
</div>
app/views/issues/show.html.erb
<% if @issue.is_private? %>
<span class="badge badge-private private"><%= l(:field_is_private) %></span>
<% end %>
<%= call_hook(:view_issues_show_top, :issue => @issue) %>
<div class="<%= @issue.css_classes %> details">
<% if @prev_issue_id || @next_issue_id %>
......
<%= render :partial => 'relations' %>
<% end %>
<% end %>
<%= call_hook(:view_issues_show_details_end, :issue => @issue) %>
</div>
<%= call_hook(:view_issues_show_bottom, :issue => @issue) %>
<%= render partial: 'action_menu_edit' if User.current.wants_comments_in_reverse_order? %>
app/views/layouts/base.html.erb
</nav>
<div id="header">
<%= call_hook :view_layouts_base_header_top %>
<a href="#" class="mobile-toggle-button js-flyout-menu-toggle-button"></a>
......
</div>
</div>
<% end %>
<%= call_hook :view_layouts_base_header_bottom %>
</div>
<div id="main" class="<%= sidebar_content? ? 'collapsiblesidebar' : 'nosidebar' %>">
......
<%= javascript_tag "$('#sidebar-switch-panel').css('visibility', 'visible');" %>
<% end %>
<div id="sidebar-wrapper">
<%= view_layouts_base_sidebar_top_hook_response %>
<%= yield :sidebar %>
<%= view_layouts_base_sidebar_hook_response %>
</div>
......
<% if @project && !@project.active? %>
<p class="warning"><span class="icon icon-lock"><%= sprite_icon('lock', l(:text_project_closed)) %></span></p>
<% end %>
<%= call_hook :view_layouts_base_content_top %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
</div>
<div id="footer">
<%= call_hook :view_layouts_base_footer_top %>
Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url, :target => '_blank', :rel => 'noopener' %> &copy; 2006-2026 Jean-Philippe Lang
<%= call_hook :view_layouts_base_footer_bottom %>
</div>
<div id="ajax-indicator" style="display:none;">
app/views/messages/show.html.erb
:data => { :confirm => l(:text_are_you_sure) },
:class => 'icon icon-del'
) if @message.destroyable_by?(User.current) %>
<%= call_hook(:view_messages_show_contextual, {:topic => @topic, :message => @message, :project => @project}) %>
</div>
<h2><%= avatar(@topic.author) %><%= @topic.subject %></h2>
app/views/news/index.html.erb
:class => 'icon icon-add add-news-link',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if User.current.allowed_to?(:manage_news, @project, global: true) %>
<%= watcher_link(@project.enabled_module('news'), User.current) if @project && User.current.logged? %>
<%= call_hook(:view_news_index_contextual, {:project => @project}) %>
</div>
<div id="add-news" style="display:none;">
app/views/news/show.html.erb
:accesskey => accesskey(:edit),
:onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
<%= call_hook(:view_news_show_contextual, {:news => @news, :project => @project}) %>
</div>
<h2><%= avatar(@news.author) %> <%=h @news.title %></h2>
app/views/projects/_form.html.erb
<div class="box tabular">
<!--[form:project]-->
<%= call_hook(:view_projects_form_top, :project => @project, :form => f) %>
<p><%= f.text_field :name, :required => true, :size => 60 %></p>
<p><%= f.textarea :description, :rows => 8, :class => 'wiki-edit', :data => wiki_textarea_stimulus_attributes %></p>
......
<%= hidden_field_tag 'project[enabled_module_names][]', '' %>
</fieldset>
<% end %>
<%= call_hook(:view_projects_form_bottom, :project => @project, :form => f) %>
<!--[eoform:project]-->
<% unless @project.identifier_frozen? %>
app/views/projects/_list.html.erb
<% end %>
</tr>
<% end %>
<tr id="project-<%= entry.id %>" class="<%= cycle('odd', 'even') %> <%= 'hascontextmenu' if @admin_list %> <%= entry.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<tr id="project-<%= entry.id %>" class="<%= cycle('odd', 'even') %> <%= 'hascontextmenu' if @admin_list %> <%= entry.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %> <%= css_classes_from_hook(:view_projects_list_row_css_classes, {:project => entry, :query => @query}) %>">
<% if @admin_list %>
<% if !entry.scheduled_for_deletion? %>
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td>
......
<% end %>
<% end %>
</tr>
<%= call_hook(:view_projects_list_row_after, {:project => entry, :query => @query, :colspan => @query.inline_columns.size + (@admin_list ? 2 : 0)}) %>
<% end -%>
</tbody>
</table>
app/views/projects/index.html.erb
<%= form_tag({}, :method => :get) do %>
<% end %>
<%= render_project_action_links %>
<%= call_hook(:view_projects_index_contextual, {:query => @query}) %>
</div>
<h2><%= @query.new_record? ? l(:label_project_plural) : @query.name %></h2>
app/views/projects/show.html.erb
<div class="contextual">
<%= bookmark_link @project %>
<%= call_hook(:view_projects_show_contextual, {:project => @project}) %>
<%= actions_dropdown do %>
<% if User.current.allowed_to?(:add_subprojects, @project) %>
<%= link_to sprite_icon('add', l(:label_subproject_new)), new_project_path(:parent_id => @project), :class => 'icon icon-add' %>
......
<%= link_to_if_authorized sprite_icon('settings', l(:label_settings)),
{:controller => 'projects', :action => 'settings', :id => @project},
:class => 'icon icon-settings' if User.current.allowed_to?(:edit_project, @project) %>
<%= render_object_menu_items(:project_actions, @project, @project) %>
<%= call_hook(:view_projects_show_actions_menu, {:project => @project}) %>
<% end %>
</div>
app/views/repositories/_navigation.html.erb
<%= link_to sprite_icon('reload', l(:button_fetch_changesets)),
{:action => :fetch_changesets, :id => @project, :repository_id => @repository.identifier_param},
:class => 'icon icon-reload', :method => :post if User.current.allowed_to?(:manage_repository, @project) && !Setting.autofetch_changesets? %>
<%= call_hook(:view_repositories_navigation_actions_menu, {:repository => @repository, :project => @project}) %>
<% end %>
<%= form_tag({:action => controller.action_name,
app/views/timelog/index.html.erb
<%= link_to sprite_icon('time-add', l(:button_log_time)),
_new_time_entry_path(@project, @query.filtered_issue_id),
:class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %>
<%= call_hook(:view_timelog_index_contextual, {:project => @project, :query => @query}) %>
<%= actions_dropdown do %>
<% if User.current.allowed_to?(:import_time_entries, @project, :global => true) && User.current.allowed_to?(:log_time, @project, :global => true) %>
<%= link_to sprite_icon('import', l(:button_import)), new_time_entries_import_path(:project_id => @project), :class => 'icon icon-import' %>
......
<%= link_to_if_authorized sprite_icon('settings', l(:label_settings)),
{:controller => 'projects', :action => 'settings', :id => @project, :tab => 'activities'},
:class => 'icon icon-settings' if User.current.allowed_to?(:manage_project_activities, @project) %>
<%= call_hook(:view_timelog_index_actions_menu, {:project => @project, :query => @query}) %>
<% end %>
</div>
app/views/trackers/_form.html.erb
<div class="splitcontentleft">
<div class="box tabular">
<!--[form:tracker]-->
<%= call_hook(:view_trackers_form_top, :tracker => @tracker, :form => f) %>
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.select :default_status_id,
IssueStatus.sorted.map {|s| [s.name, s.id]},
......
<p><label for="copy_workflow_from"><%= l(:label_copy_workflow_from) %></label>
<%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@trackers, :id, :name, params[:copy_workflow_from] || @copy_from.try(:id))) %></p>
<% end %>
<%= call_hook(:view_trackers_form_bottom, :tracker => @tracker, :form => f) %>
<!--[eoform:tracker]-->
</div>
<%= submit_tag l(@tracker.new_record? ? :button_create : :button_save), class: "mobile-hide" %>
app/views/users/_form.html.erb
<div id="user_form">
<!--[form:user]-->
<%= call_hook(:view_users_form_top, :user => @user, :form => f) %>
<div class="splitcontent">
<div class="splitcontentleft">
<fieldset class="box tabular">
......
</p>
<% end -%>
</fieldset>
<%= call_hook(:view_users_form_after_authentication, :user => @user, :form => f) %>
<p class="mobile-hide">
<% if @user.new_record? %>
<%= submit_tag l(:button_create) %>
......
<legend><%=l(:field_mail_notification)%></legend>
<%= render :partial => 'users/mail_notifications' %>
</fieldset>
<%= call_hook(:view_users_form_after_mail_notifications, :user => @user, :form => f) %>
<fieldset class="box">
<legend><%=l(:label_auto_watch_on)%></legend>
......
<%= render :partial => 'users/preferences' %>
<%= call_hook(:view_users_form_preferences, :user => @user, :form => f) %>
</fieldset>
<%= call_hook(:view_users_form_bottom, :user => @user, :form => f) %>
</div>
</div>
</div>
app/views/users/_list.html.erb
</td>
</tr>
<% end %>
<tr id="user-<%= user.id %>" class="hascontextmenu <%= cycle("odd", "even") %> <%= user.css_classes %>">
<tr id="user-<%= user.id %>" class="hascontextmenu <%= cycle("odd", "even") %> <%= user.css_classes %> <%= css_classes_from_hook(:view_users_list_row_css_classes, {:user => user, :query => @query}) %>">
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", user.id, false, id: nil) %></td>
<% @query.inline_columns.each do |column| %>
<% if column.name == :login %>
......
</tr>
<% end -%>
<% end -%>
<%= call_hook(:view_users_list_row_after, {:user => user, :query => @query, :colspan => @query.inline_columns.size + 2}) %>
<% end -%>
</tbody>
</table>
app/views/users/edit.html.erb
<%=
page_title = title [l(:label_user_plural), users_path], @user.login
page_title.insert(page_title.rindex(' ') + 1, avatar(@user).to_s)
page_title.insert(page_title.rindex(' ', page_title.index('</h2>')) + 1, avatar(@user).to_s)
%>
<%= render_tabs user_settings_tabs %>
app/views/users/index.html.erb
<div class="contextual">
<%= link_to sprite_icon('add', l(:label_user_new)), new_user_path, :class => 'icon icon-add' %>
<%= call_hook(:view_users_index_contextual, {:query => @query}) %>
<%= actions_dropdown do %>
<% if User.current.allowed_to?(:import_users, nil, :global => true) %>
<%= link_to sprite_icon('import', l(:button_import)), new_users_import_path, :class => 'icon icon-import' %>
<% end %>
<%= call_hook(:view_users_index_actions_menu, {:query => @query}) %>
<% end %>
</div>
app/views/users/show.html.erb
<div class="contextual">
<%= link_to(sprite_icon('edit', l(:button_edit)), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? && @user.logged? %>
<%= render_object_menu_items(:user_actions, @user) %>
<%= call_hook(:view_users_show_contextual, {:user => @user}) %>
</div>
<h2><%= avatar_edit_link(@user, :size => "50") %> <%= @user.name %></h2>
app/views/versions/_form.html.erb
<%= error_messages_for 'version' %>
<div class="box tabular">
<%= call_hook(:view_versions_form_top, :version => @version, :form => f) %>
<p><%= f.text_field :name, :maxlength => 60, :size => 60, :required => true %></p>
<p><%= f.text_field :description, :size => 60 %></p>
<% unless @version.new_record? %>
......
<% @version.visible_custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :version, value %></p>
<% end %>
<%= call_hook(:view_versions_form_bottom, :version => @version, :form => f) %>
</div>
app/views/versions/index.html.erb
<div class="contextual">
<%= link_to(sprite_icon('add', l(:label_version_new)), new_project_version_path(@project),
:class => 'icon icon-add') if User.current.allowed_to?(:manage_versions, @project) %>
<%= call_hook(:view_versions_index_contextual, {:project => @project}) %>
<%= actions_dropdown do %>
<%= link_to_if_authorized sprite_icon('settings', l(:label_settings)),
{:controller => 'projects', :action => 'settings', :id => @project, :tab => 'versions'},
:class => 'icon icon-settings' if User.current.allowed_to?(:manage_versions, @project) %>
<%= call_hook(:view_versions_index_actions_menu, {:project => @project}) %>
<% end %>
</div>
app/views/versions/show.html.erb
<%= link_to_if_authorized(sprite_icon('edit', l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title)), { :controller => 'wiki', :action => 'edit', :project_id => @version.project, :id => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @version.project.wiki.nil? %>
<%= delete_link version_path(@version, :back_url => url_for(:controller => 'versions', :action => 'index', :project_id => @version.project)) if User.current.allowed_to?(:manage_versions, @version.project) %>
<%= link_to_new_issue(@version, @project) %>
<%= render_object_menu_items(:version_actions, @version, @version.project) %>
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
</div>
app/views/wiki/show.html.erb
<% end %>
<% end %>
<%= call_hook(:view_wiki_show_contextual, {:page => @page, :project => @project}) %>
<%= actions_dropdown do %>
<%= link_to_if_authorized(sprite_icon('history', l(:label_history)), { :action => 'history', :id => @page.title}, :class => 'icon icon-history') %>
......
<% if User.current.allowed_to?(:edit_wiki_pages, @project) %>
<%= link_to sprite_icon('add', l(:label_wiki_page_new)), new_project_wiki_page_path(@project, :parent => @page.title), :remote => true, :class => 'icon icon-add' %>
<% end %>
<%= call_hook(:view_wiki_show_actions_menu, {:page => @page, :project => @project}) %>
<% end %>
</div>
doc/HOOKS
= Redmine hooks
Every hook that Redmine calls, with the file it is called in and the keys of its
context (besides :project, :controller, :request and :hook_caller, which view hooks
always get). A plugin implements a hook as a method of a Redmine::Hook::Listener
(controller and model hooks) or Redmine::Hook::ViewListener (view hooks), or with
render_on. A hook listed here is kept; it is removed only after a deprecation notice
in this file and in the changelog. test/unit/lib/redmine/hook_list_test.rb checks
that every hook called in app/ and lib/ is listed here, and the other way round.
Since: the version the hook appeared in; - for hooks older than this list.
Context: the keys given on the line of the call (see the file for the rest).
after_plugins_loaded
Since: -
Context: -
Called in: lib/redmine/plugin_loader.rb
another_hook
Since: -
Context: :foo
Called in: lib/redmine/hook.rb
controller_account_success_authentication_after
Since: -
Context: :user
Called in: app/controllers/account_controller.rb
controller_custom_fields_edit_after_save
Since: -
Context: :params, :custom_field
Called in: app/controllers/custom_fields_controller.rb
controller_custom_fields_new_after_save
Since: -
Context: :params, :custom_field
Called in: app/controllers/custom_fields_controller.rb
controller_issues_bulk_edit_after_save
Since: -
Context: :params, :issue, :journal
Called in: app/controllers/issues_controller.rb
controller_issues_bulk_edit_before_save
Since: -
Context: :params, :issue
Called in: app/controllers/issues_controller.rb
controller_issues_edit_after_save
Since: 7.1.0
Context: -
Called in: app/controllers/issues_controller.rb
controller_issues_edit_before_save
Since: 7.1.0
Context: -
Called in: app/controllers/issues_controller.rb
controller_issues_new_after_save
Since: -
Context: :params, :issue
Called in: app/controllers/issues_controller.rb
controller_issues_new_before_save
Since: -
Context: :params, :issue
Called in: app/controllers/issues_controller.rb
controller_journals_edit_post
Since: -
Context: :journal, :params
Called in: app/controllers/journals_controller.rb
controller_messages_new_after_save
Since: -
Context: :params, :message
Called in: app/controllers/messages_controller.rb
controller_messages_reply_after_save
Since: -
Context: :params, :message
Called in: app/controllers/messages_controller.rb
controller_time_entries_bulk_edit_before_save
Since: 7.1.0
Context: -
Called in: app/controllers/timelog_controller.rb
controller_timelog_edit_before_save
Since: -
Context: -
Called in: app/controllers/timelog_controller.rb
controller_wiki_edit_after_save
Since: -
Context: :params, :page
Called in: app/controllers/wiki_controller.rb
controller_wiki_show_before_render
Since: -
Context: :content, :format
Called in: app/controllers/wiki_controller.rb
helper_issues_show_detail_after_setting
Since: -
Context: -
Called in: app/helpers/issues_helper.rb
helper_queries_column_content
Since: -
Context: -
Called in: app/helpers/queries_helper.rb
helper_queries_column_value
Since: -
Context: -
Called in: app/helpers/queries_helper.rb
model_changeset_scan_commit_for_issue_ids_pre_issue_update
Since: -
Context: -
Called in: app/models/changeset.rb
model_project_copy_before_save
Since: -
Context: -
Called in: app/models/project.rb
some_hook
Since: -
Context: -
Called in: lib/redmine/hook.rb
view_account_left_bottom
Since: -
Context: :user
Called in: app/views/users/show.html.erb
view_account_login_bottom
Since: -
Context: -
Called in: app/views/account/login.html.erb
view_account_login_top
Since: -
Context: -
Called in: app/views/account/login.html.erb
view_account_right_bottom
Since: -
Context: :user
Called in: app/views/users/show.html.erb
view_admin_projects_sidebar_queries_bottom
Since: -
Context: -
Called in: app/views/admin/projects.html.erb
view_boards_show_contextual
Since: 7.1.0
Context: :board, :project
Called in: app/views/boards/show.html.erb
view_calendars_show_bottom
Since: -
Context: :year, :month, :project, :query
Called in: app/views/calendars/show.html.erb
view_custom_fields_form_upper_box
Since: -
Context: :custom_field, :form
Called in: app/views/custom_fields/_form.html.erb
view_documents_index_contextual
Since: 7.1.0
Context: :project
Called in: app/views/documents/index.html.erb
view_documents_show_contextual
Since: 7.1.0
Context: :document, :project
Called in: app/views/documents/show.html.erb
view_groups_form_bottom
Since: 7.1.0
Context: :group, :form
Called in: app/views/groups/_form.html.erb
view_groups_form_top
Since: 7.1.0
Context: :group, :form
Called in: app/views/groups/_form.html.erb
view_groups_memberships_table_header
Since: -
Context: :group
Called in: app/helpers/principal_memberships_helper.rb
view_groups_memberships_table_row
Since: -
Context: :group, :membership
Called in: app/helpers/principal_memberships_helper.rb
view_groups_show_contextual
Since: 7.1.0
Context: :group
Called in: app/views/groups/show.html.erb
view_issue_statuses_form
Since: -
Context: :issue_status
Called in: app/views/issue_statuses/_form.html.erb
view_issues_bulk_edit_details_bottom
Since: -
Context: :issues
Called in: app/views/issues/bulk_edit.html.erb
view_issues_context_menu_end
Since: -
Context: :issues, :can, :back
Called in: app/views/context_menus/issues.html.erb
view_issues_context_menu_start
Since: -
Context: :issues, :can, :back
Called in: app/views/context_menus/issues.html.erb
view_issues_edit_notes_bottom
Since: -
Context: :issue, :notes, :form
Called in: app/views/issues/_edit.html.erb
view_issues_edit_top
Since: -
Context: :issue, :form
Called in: app/views/issues/_edit.html.erb
view_issues_form_after_attributes
Since: 7.1.0
Context: :issue, :form
Called in: app/views/issues/_form.html.erb
view_issues_form_after_description
Since: 7.1.0
Context: :issue, :form
Called in: app/views/issues/_form.html.erb
view_issues_form_after_subject
Since: 7.1.0
Context: :issue, :form
Called in: app/views/issues/_form.html.erb
view_issues_form_custom_fields_bottom
Since: 7.1.0
Context: :issue, :custom_field_values
Called in: app/views/issues/_form_custom_fields.html.erb
view_issues_form_custom_fields_top
Since: 7.1.0
Context: :issue, :custom_field_values
Called in: app/views/issues/_form_custom_fields.html.erb
view_issues_form_details_bottom
Since: -
Context: :issue, :form
Called in: app/views/issues/_form.html.erb
view_issues_form_details_top
Since: -
Context: :issue, :form
Called in: app/views/issues/_form.html.erb
view_issues_history_changeset_bottom
Since: -
Context: :changeset
Called in: app/views/issues/tabs/_changesets.html.erb
view_issues_history_journal_bottom
Since: -
Context: :journal
Called in: app/views/issues/tabs/_history.html.erb
view_issues_history_time_entry_bottom
Since: -
Context: :time_entry
Called in: app/views/issues/tabs/_time_entries.html.erb
view_issues_index_actions_menu
Since: 7.1.0
Context: :project, :query
Called in: app/views/issues/index.html.erb
view_issues_index_bottom
Since: -
Context: :issues, :project, :query
Called in: app/views/issues/index.html.erb
view_issues_index_contextual
Since: 7.1.0
Context: :project, :query
Called in: app/views/issues/index.html.erb
view_issues_list_row_after
Since: 7.1.0
Context: :issue, :query, :colspan
Called in: app/views/issues/_list.html.erb
view_issues_new_top
Since: -
Context: :issue
Called in: app/views/issues/new.html.erb
view_issues_show_actions_menu
Since: 7.1.0
Context: :issue, :project
Called in: app/views/issues/_action_menu.html.erb
view_issues_show_bottom
Since: 7.1.0
Context: :issue
Called in: app/views/issues/show.html.erb
view_issues_show_contextual
Since: 7.1.0
Context: :issue, :project
Called in: app/views/issues/_action_menu.html.erb
view_issues_show_description_bottom
Since: -
Context: :issue
Called in: app/views/issues/show.html.erb
view_issues_show_details_bottom
Since: -
Context: :issue
Called in: app/views/issues/show.html.erb
view_issues_show_details_end
Since: 7.1.0
Context: :issue
Called in: app/views/issues/show.html.erb
view_issues_show_top
Since: 7.1.0
Context: :issue
Called in: app/views/issues/show.html.erb
view_issues_sidebar_issues_bottom
Since: -
Context: -
Called in: app/views/issues/_sidebar.html.erb
view_issues_sidebar_planning_bottom
Since: -
Context: -
Called in: app/views/issues/_sidebar.html.erb
view_issues_sidebar_queries_bottom
Since: -
Context: -
Called in: app/views/issues/_sidebar.html.erb
view_journals_notes_form_after_notes
Since: -
Context: :journal
Called in: app/views/journals/_notes_form.html.erb
view_journals_update_js_bottom
Since: -
Context: :journal
Called in: app/views/journals/update.js.erb
view_layouts_base_body_bottom
Since: -
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_body_top
Since: -
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_content
Since: -
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_content_top
Since: 7.1.0
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_footer_bottom
Since: 7.1.0
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_footer_top
Since: 7.1.0
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_header_bottom
Since: 7.1.0
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_header_top
Since: 7.1.0
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_html_head
Since: -
Context: -
Called in: app/views/layouts/base.html.erb
view_layouts_base_sidebar
Since: -
Context: -
Called in: app/helpers/application_helper.rb
view_layouts_base_sidebar_top
Since: 7.1.0
Context: -
Called in: app/helpers/application_helper.rb
view_layouts_base_title_after
Since: 7.1.0
Context: :title
Called in: app/helpers/application_helper.rb
view_messages_show_contextual
Since: 7.1.0
Context: :topic, :message, :project
Called in: app/views/messages/show.html.erb
view_my_account
Since: -
Context: :user, :form
Called in: app/views/my/account.html.erb
view_my_account_contextual
Since: -
Context: :user
Called in: app/views/my/account.html.erb
view_my_account_preferences
Since: -
Context: :user, :form
Called in: app/views/my/account.html.erb
view_my_page_contextual
Since: -
Context: :user
Called in: app/views/my/page.html.erb
view_my_page_splitcontent
Since: -
Context: :user
Called in: app/views/my/page.html.erb
view_news_index_contextual
Since: 7.1.0
Context: :project
Called in: app/views/news/index.html.erb
view_news_show_contextual
Since: 7.1.0
Context: :news, :project
Called in: app/views/news/show.html.erb
view_projects_copy_only_items
Since: -
Context: :project, :f
Called in: app/views/projects/copy.html.erb
view_projects_form
Since: -
Context: :project, :form
Called in: app/views/projects/_form.html.erb
view_projects_form_bottom
Since: 7.1.0
Context: :project, :form
Called in: app/views/projects/_form.html.erb
view_projects_form_top
Since: 7.1.0
Context: :project, :form
Called in: app/views/projects/_form.html.erb
view_projects_index_contextual
Since: 7.1.0
Context: :query
Called in: app/views/projects/index.html.erb
view_projects_list_row_after
Since: 7.1.0
Context: :project, :query, :colspan
Called in: app/views/projects/_list.html.erb
view_projects_roadmap_version_bottom
Since: -
Context: :version
Called in: app/views/versions/index.html.erb
view_projects_settings_members_table_header
Since: -
Context: :project
Called in: app/views/members/_members.html.erb
view_projects_settings_members_table_row
Since: -
Context: :project, :member
Called in: app/views/members/_members.html.erb
view_projects_show_actions_menu
Since: 7.1.0
Context: :project
Called in: app/views/projects/show.html.erb
view_projects_show_contextual
Since: 7.1.0
Context: :project
Called in: app/views/projects/show.html.erb
view_projects_show_left
Since: -
Context: :project
Called in: app/views/projects/show.html.erb
view_projects_show_right
Since: -
Context: :project
Called in: app/views/projects/show.html.erb
view_projects_show_sidebar_bottom
Since: -
Context: :project
Called in: app/views/projects/show.html.erb
view_projects_sidebar_queries_bottom
Since: -
Context: -
Called in: app/views/projects/_sidebar.html.erb
view_reports_issue_report_split_content_left
Since: -
Context: :project
Called in: app/views/reports/issue_report.html.erb
view_reports_issue_report_split_content_right
Since: -
Context: :project
Called in: app/views/reports/issue_report.html.erb
view_repositories_navigation_actions_menu
Since: 7.1.0
Context: :repository, :project
Called in: app/views/repositories/_navigation.html.erb
view_repositories_show_contextual
Since: -
Context: :repository, :project
Called in: app/views/repositories/annotate.html.erb
Called in: app/views/repositories/changes.html.erb
Called in: app/views/repositories/entry.html.erb
Called in: app/views/repositories/show.html.erb
view_search_index_options_content_bottom
Since: -
Context: -
Called in: app/views/search/index.html.erb
view_settings_general_form
Since: -
Context: -
Called in: app/views/settings/_general.html.erb
view_time_entries_bulk_edit_details_bottom
Since: -
Context: :time_entries
Called in: app/views/timelog/bulk_edit.html.erb
view_time_entries_context_menu_end
Since: -
Context: :time_entries, :can, :back
Called in: app/views/context_menus/time_entries.html.erb
view_time_entries_context_menu_start
Since: -
Context: :time_entries, :can, :back
Called in: app/views/context_menus/time_entries.html.erb
view_timelog_edit_form_bottom
Since: -
Context: :time_entry, :form
Called in: app/views/timelog/_form.html.erb
view_timelog_index_actions_menu
Since: 7.1.0
Context: :project, :query
Called in: app/views/timelog/index.html.erb
view_timelog_index_contextual
Since: 7.1.0
Context: :project, :query
Called in: app/views/timelog/index.html.erb
view_trackers_form_bottom
Since: 7.1.0
Context: :tracker, :form
Called in: app/views/trackers/_form.html.erb
view_trackers_form_top
Since: 7.1.0
Context: :tracker, :form
Called in: app/views/trackers/_form.html.erb
view_users_form
Since: -
Context: :user, :form
Called in: app/views/users/_form.html.erb
view_users_form_after_authentication
Since: 7.1.0
Context: :user, :form
Called in: app/views/users/_form.html.erb
view_users_form_after_mail_notifications
Since: 7.1.0
Context: :user, :form
Called in: app/views/users/_form.html.erb
view_users_form_bottom
Since: 7.1.0
Context: :user, :form
Called in: app/views/users/_form.html.erb
view_users_form_preferences
Since: -
Context: :user, :form
Called in: app/views/users/_form.html.erb
view_users_form_top
Since: 7.1.0
Context: :user, :form
Called in: app/views/users/_form.html.erb
view_users_index_actions_menu
Since: 7.1.0
Context: :query
Called in: app/views/users/index.html.erb
view_users_index_contextual
Since: 7.1.0
Context: :query
Called in: app/views/users/index.html.erb
view_users_list_row_after
Since: 7.1.0
Context: :user, :query, :colspan
Called in: app/views/users/_list.html.erb
view_users_memberships_table_header
Since: -
Context: :user
Called in: app/helpers/principal_memberships_helper.rb
view_users_memberships_table_row
Since: -
Context: :user, :membership
Called in: app/helpers/principal_memberships_helper.rb
view_users_show_contextual
Since: 7.1.0
Context: :user
Called in: app/views/users/show.html.erb
view_users_sidebar_queries_bottom
Since: -
Context: -
Called in: app/views/users/index.html.erb
view_versions_form_bottom
Since: 7.1.0
Context: :version, :form
Called in: app/views/versions/_form.html.erb
view_versions_form_top
Since: 7.1.0
Context: :version, :form
Called in: app/views/versions/_form.html.erb
view_versions_index_actions_menu
Since: 7.1.0
Context: :project
Called in: app/views/versions/index.html.erb
view_versions_index_contextual
Since: 7.1.0
Context: :project
Called in: app/views/versions/index.html.erb
view_versions_show_bottom
Since: -
Context: :version
Called in: app/views/versions/show.html.erb
view_versions_show_contextual
Since: -
Context: :version, :project
Called in: app/views/versions/show.html.erb
view_welcome_index_left
Since: -
Context: -
Called in: app/views/welcome/index.html.erb
view_welcome_index_right
Since: -
Context: -
Called in: app/views/welcome/index.html.erb
view_wiki_show_actions_menu
Since: 7.1.0
Context: :page, :project
Called in: app/views/wiki/show.html.erb
view_wiki_show_contextual
Since: 7.1.0
Context: :page, :project
Called in: app/views/wiki/show.html.erb
view_wiki_show_sidebar_bottom
Since: -
Context: :wiki, :page
Called in: app/views/wiki/_sidebar.html.erb
lib/redmine/journal_details.rb
# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006- Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module Redmine
# Registry of the renderers for journal details that plugins write with a
# property of their own (journal_details.property), so that a plugin does not
# have to override IssuesHelper#show_detail.
#
# A renderer responds to +call+ with the detail, the view and the options of
# show_detail, and returns the line as HTML or, when +no_html+ is true, as text
# (the text is also used in emails):
#
# class APlugin::JournalDetail
# def self.call(detail, view, no_html, options)
# label = no_html ? 'Sample' : view.content_tag('strong', 'Sample')
# view.l(:text_journal_set_to, :label => label, :value => detail.value)
# end
# end
#
# Redmine::Plugin.register :a_plugin do
# journal_detail :property => 'a_plugin', :renderer => APlugin::JournalDetail
# end
#
# A renderer registered with a :prop_key is used for that key only and comes
# before one registered for the whole property.
module JournalDetails
@renderers = {}
class << self
def register(property, renderer, prop_key: nil)
unless renderer.respond_to?(:call)
raise ArgumentError, "Invalid renderer for journal detail property '#{property}'"
end
@renderers[[property.to_s, prop_key&.to_s]] = renderer
end
# Returns the renderer for +detail+, or nil when none is registered
def renderer_for(detail)
property = detail.property.to_s
@renderers[[property, detail.prop_key.to_s]] || @renderers[[property, nil]]
end
def clear
@renderers.clear
... This diff was truncated because it exceeds the maximum size that can be displayed.
(1-1/11)