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.

Class Method Summary

Methods included from ApplicationHelper

#accesskey, #authoring, #authorize_for, #avatar, #back_url_hidden_field_tag, #breadcrumb, #calendar_for, #check_all_links, #checked_image, #content_for, #context_menu, #context_menu_link, #due_date_distance_in_words, #format_activity_day, #format_activity_description, #format_activity_title, #format_version_name, #has_content?, #html_hours, #html_title, #image_to_function, #include_calendar_headers_tags, #label_tag_for, #labelled_tabular_form_for, #lang_options_for_select, #link_to_attachment, #link_to_if_authorized, #link_to_issue, #link_to_remote_if_authorized, #link_to_revision, #link_to_user, #other_formats_links, #page_header_title, #pagination_links_full, #parse_inline_attachments, #parse_non_pre_blocks, #parse_redmine_links, #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, #prompt_to_remote, #render_flash_messages, #render_page_hierarchy, #render_project_jump_box, #render_tabs, #reorder_links, #simple_format_without_paragraph, #stylesheet_path, #syntax_highlight, #textilizable, #time_tag, #to_path_param, #toggle_link, #truncate_lines, #truncate_single_line

Methods included from Redmine::WikiFormatting::Macros::Definitions

#exec_macro, #extract_macro_options

Methods included from Redmine::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 included from GravatarHelper::PublicMethods

#gravatar, #gravatar_api_url, #gravatar_for, #gravatar_url

Methods inherited from Listener

inherited

Methods included from Redmine::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

Class Method Details

+ (Object) default_url_options

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



101
102
103
# File 'lib/redmine/hook.rb', line 101

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

+ (Object) render_on(hook, options = {})

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


111
112
113
114
115
# File 'lib/redmine/hook.rb', line 111

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