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 (collapse)

Methods included from ApplicationHelper

#accesskey, #authoring, #authorize_for, #avatar, #back_url_hidden_field_tag, #breadcrumb, #calendar_for, #check_all_links, #content_for, #context_menu_link, #current_role, #due_date_distance_in_words, #format_activity_day, #format_activity_description, #format_activity_title, #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_user, #other_formats_links, #page_header_title, #pagination_links_full, #path_to_stylesheet, #per_page_links, #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, #reorder_links, #simple_format_without_paragraph, #stylesheet_path, #syntax_highlight, #textilizable, #to_path_param, #toggle_link, #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 included from WikiFormatting::Macros::Definitions

#exec_macro, #extract_macro_options

Methods inherited from Listener

inherited

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