forked from saurabh/orbit4-5
35 lines
1.0 KiB
Ruby
35 lines
1.0 KiB
Ruby
|
module SideBarRenderer
|
||
|
include Renderer
|
||
|
include ActionView::Helpers::TextHelper
|
||
|
|
||
|
def render(request,params,current_module_app)
|
||
|
@belong_module_app = get_module_app
|
||
|
@current_module_app = current_module_app
|
||
|
@request = request
|
||
|
@params = params
|
||
|
content_tag :div, class: "sub-nav-block #{@icon_class}" do
|
||
|
concat content_tag :h4, I18n.t(@head_label)
|
||
|
concat (content_tag :ul, class: "nav nav-list" do
|
||
|
@context_links.sort_by {| obj | obj.priority}.map{ |link|
|
||
|
link.render(request, params, @current_module_app, @belong_module_app)
|
||
|
}.join.html_safe
|
||
|
end)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def render_head(request, params, current_module_app)
|
||
|
@belong_module_app = get_module_app
|
||
|
@current_module_app = current_module_app
|
||
|
@request = request
|
||
|
@params = params
|
||
|
content_tag :li, class: (module_sidebar_active? ? 'active' : nil) do
|
||
|
link_to eval(@head_link) do
|
||
|
content_tag :span do
|
||
|
content_tag(:i, nil, class: @icon_class)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
|
||
|
end
|