2019-06-20 07:06:47 +00:00
|
|
|
<% default_action = false %>
|
|
|
|
|
|
2009-09-12 09:13:13 +00:00
|
|
|
<div class="tabs">
|
|
|
|
|
<ul>
|
|
|
|
|
<% tabs.each do |tab| -%>
|
2019-06-20 07:06:47 +00:00
|
|
|
<% action = get_tab_action(tab) %>
|
2016-08-30 21:05:22 +00:00
|
|
|
<li><%= link_to l(tab[:label]), (tab[:url] || { :tab => tab[:name] }),
|
2009-09-12 09:13:13 +00:00
|
|
|
:id => "tab-#{tab[:name]}",
|
|
|
|
|
:class => (tab[:name] != selected_tab ? nil : 'selected'),
|
2019-06-20 07:06:47 +00:00
|
|
|
:onclick => (action.nil? ? nil : "#{ action }; return false;") %></li>
|
|
|
|
|
<% default_action = action if tab[:name] == selected_tab %>
|
2009-09-12 09:13:13 +00:00
|
|
|
<% end -%>
|
|
|
|
|
</ul>
|
2009-12-14 20:13:29 +00:00
|
|
|
<div class="tabs-buttons" style="display:none;">
|
2025-03-26 21:42:45 +00:00
|
|
|
<button class="tab-left icon-only" type="button" onclick="moveTabLeft(this);">
|
2026-01-12 05:36:55 +00:00
|
|
|
<%= sprite_icon("angle-left", rtl: true) %>
|
2025-03-26 21:42:45 +00:00
|
|
|
</button>
|
|
|
|
|
<button class="tab-right icon-only" type="button" onclick="moveTabRight(this);">
|
2026-01-12 05:36:55 +00:00
|
|
|
<%= sprite_icon("angle-right", rtl: true) %>
|
2025-03-26 21:42:45 +00:00
|
|
|
</button>
|
2009-12-14 20:13:29 +00:00
|
|
|
</div>
|
2009-09-12 09:13:13 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<% tabs.each do |tab| -%>
|
2019-06-20 07:12:30 +00:00
|
|
|
<%= content_tag('div', (render(:partial => tab[:partial], :locals => {:tab => tab}) if tab[:partial]) ,
|
2009-09-12 09:13:13 +00:00
|
|
|
:id => "tab-content-#{tab[:name]}",
|
|
|
|
|
:style => (tab[:name] != selected_tab ? 'display:none' : nil),
|
2019-06-20 07:12:30 +00:00
|
|
|
:class => 'tab-content') if tab[:partial] || tab[:remote] %>
|
2009-09-12 09:13:13 +00:00
|
|
|
<% end -%>
|
2019-06-20 07:06:47 +00:00
|
|
|
|
|
|
|
|
<%= javascript_tag default_action if default_action %>
|