To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / common / _tabs.html.erb @ 912:5e80956cc792

History | View | Annotate | Download (1.14 KB)

1 0:513646585e45 Chris
<% selected_tab = params[:tab] ? params[:tab].to_s : tabs.first[:name] %>
2
3
<div class="tabs">
4
  <ul>
5
  <% tabs.each do |tab| -%>
6
    <li><%= link_to l(tab[:label]), { :tab => tab[:name] },
7
                                    :id => "tab-#{tab[:name]}",
8
                                    :class => (tab[:name] != selected_tab ? nil : 'selected'),
9
                                    :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li>
10
  <% end -%>
11
  </ul>
12
  <div class="tabs-buttons" style="display:none;">
13 909:cbb26bc654de Chris
    <button class="tab-left" onclick="moveTabLeft(this);"></button>
14
    <button class="tab-right" onclick="moveTabRight(this);"></button>
15 0:513646585e45 Chris
  </div>
16
</div>
17
18
<script>
19 909:cbb26bc654de Chris
  Event.observe(window, 'load', function() { displayTabsButtons(); });
20
  Event.observe(window, 'resize', function() { displayTabsButtons(); });
21 0:513646585e45 Chris
</script>
22
23
<% tabs.each do |tab| -%>
24 909:cbb26bc654de Chris
  <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
25 0:513646585e45 Chris
                       :id => "tab-content-#{tab[:name]}",
26
                       :style => (tab[:name] != selected_tab ? 'display:none' : nil),
27
                       :class => 'tab-content') %>
28
<% end -%>