You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_tabs.html.erb 1.0KB

123456789101112131415161718192021
  1. <div class="tabs">
  2. <ul>
  3. <% tabs.each do |tab| -%>
  4. <li><%= link_to l(tab[:label]), (tab[:url] || { :tab => tab[:name] }),
  5. :id => "tab-#{tab[:name]}",
  6. :class => (tab[:name] != selected_tab ? nil : 'selected'),
  7. :onclick => tab[:partial] ? "showTab('#{tab[:name]}', this.href); this.blur(); return false;" : nil %></li>
  8. <% end -%>
  9. </ul>
  10. <div class="tabs-buttons" style="display:none;">
  11. <button class="tab-left" type="button" onclick="moveTabLeft(this);"></button>
  12. <button class="tab-right" type="button" onclick="moveTabRight(this);"></button>
  13. </div>
  14. </div>
  15. <% tabs.each do |tab| -%>
  16. <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
  17. :id => "tab-content-#{tab[:name]}",
  18. :style => (tab[:name] != selected_tab ? 'display:none' : nil),
  19. :class => 'tab-content') if tab[:partial] %>
  20. <% end -%>