Project

General

Profile

Feature #25999 » 0003-Make-common-_tabs-partial-usable-without-JS-partial-.patch

Jan from Planio www.plan.io, 2017-05-18 12:30

View differences:

app/views/common/_tabs.html.erb
4 4
    <li><%= link_to l(tab[:label]), (tab[:url] || { :tab => tab[:name] }),
5 5
                                    :id => "tab-#{tab[:name]}",
6 6
                                    :class => (tab[:name] != selected_tab ? nil : 'selected'),
7
                                    :onclick => "showTab('#{tab[:name]}', this.href); this.blur(); return false;" %></li>
7
                                    :onclick => tab[:partial] ? "showTab('#{tab[:name]}', this.href); this.blur(); return false;" : nil %></li>
8 8
  <% end -%>
9 9
  </ul>
10 10
  <div class="tabs-buttons" style="display:none;">
......
17 17
  <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
18 18
                       :id => "tab-content-#{tab[:name]}",
19 19
                       :style => (tab[:name] != selected_tab ? 'display:none' : nil),
20
                       :class => 'tab-content') %>
20
                       :class => 'tab-content') if tab[:partial] %>
21 21
<% end -%>
(3-3/6)