Class: Redmine::Hook::ViewListener

Inherits:
Listener
  • Object
show all
Includes:
ActionController::UrlWriter, ActionView::Helpers::AssetTagHelper, ActionView::Helpers::FormHelper, ActionView::Helpers::FormOptionsHelper, ActionView::Helpers::FormTagHelper, ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::NumberHelper, ActionView::Helpers::PrototypeHelper, ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, ActionView::Helpers::UrlHelper, ApplicationHelper, ERB::Util
Defined in:
lib/redmine/hook.rb

Overview

Listener class used for views hooks. Listeners that inherit this class will include various helpers by default.

Constant Summary

Constants included from ApplicationHelper

ApplicationHelper::HEADING_RE, ApplicationHelper::RELATIVE_LINK_RE, ApplicationHelper::TOC_RE

Class Method Summary collapse

Methods included from ApplicationHelper

#accesskey, #api_meta, #authoring, #authorize_for, #avatar, #back_url_hidden_field_tag, #body_css_classes, #breadcrumb, #calendar_for, #check_all_links, #checked_image, #content_for, #context_menu, #context_menu_link, #current_theme, #due_date_distance_in_words, #expand_current_menu, #favicon, #format_activity_day, #format_activity_description, #format_activity_title, #format_version_name, #gravatar, #has_content?, #heads_for_theme, #help_menu_item, #html_hours, #html_title, #image_to_function, #include_in_api_response?, #javascript_heads, #jquery_datepicker_settings, #label_tag_for, #labelled_tabular_form_for, #lang_options_for_select, #link_to_attachment, #link_to_if_authorized, #link_to_issue, #link_to_message, #link_to_project, #link_to_remote_if_authorized, #link_to_revision, #link_to_user, #list_users, #main_top_menu_items, #more_top_menu_items, #other_formats_links, #page_header_title, #pagination_links_full, #parse_headings, #parse_inline_attachments, #parse_non_pre_blocks, #parse_redmine_links, #parse_relative_urls, #parse_wiki_links, #path_to_stylesheet, #per_page_links, #principals_check_box_tags, #progress_bar, #project_nested_ul, #project_tree, #project_tree_options_for_select, #projects_check_box_tags, #prompt_to_remote, #render_flash_messages, #render_page_hierarchy, #render_project_jump_box, #render_tabs, #reorder_links, #replace_toc, #robot_exclusion_tag, #simple_format_without_paragraph, #split_top_menu_into_main_or_more_menus, #stylesheet_path, #syntax_highlight, #textilizable, #time_tag, #to_path_param, #toggle_link, #truncate_lines, #truncate_single_line

Methods included from I18n

#current_language, #day_name, #find_language, #format_date, #format_time, included, #l, #l_hours, #l_or_humanize, #ll, #month_name, #set_language_if_valid, #valid_languages

Methods inherited from Listener

inherited

Class Method Details

.default_url_optionsObject

Default to creating links using only the path. Subclasses can change this default as needed


98
99
100
# File 'lib/redmine/hook.rb', line 98

def self.default_url_options
  {:only_path => true }
end

.render_on(hook, options = {}) ⇒ Object

Helper method to directly render a partial using the context:

class MyHook < Redmine::Hook::ViewListener
  render_on :view_issues_show_details_bottom, :partial => "show_more_data"
end

108
109
110
111
112
# File 'lib/redmine/hook.rb', line 108

def self.render_on(hook, options={})
  define_method hook do |context|
    context[:controller].send(:render_to_string, {:locals => context}.merge(options))
  end
end