codn/adminpanel

View on GitHub
app/views/adminpanel/sections/index.html.erb

Summary

Maintainability
Test Coverage
<%= provide(:page_title, I18n.t('model.Section')) %>

<div class="row-fluid">
  <div class="widget widget-padding span12" id="wizard">
    <div class="widget-header">
      <ul class="nav nav-tabs">
        <% current_page = "no-page" %>
        <% @sections.each_with_index do |section, index| %>
          <% if current_page != section.page %>
            <li class="<%= active_tab(index) %>">
              <%= link_to (section.page.capitalize), "#tab#{index}", "data-toggle" => "tab" %>
            </li>
            <% current_page = section.page %>
          <% end %>
        <% end %>
      </ul>
    </div>

    <div class="widget-body">
      <div class="tab-content">
        <% current_page = "no-page" %>
        <% @sections.each_with_index do |section, index| %>
          <% if current_page != section.page %>
            <div class="tab-pane <%= active_tab(index) %>" id="tab<%= index %>">
              <% section_pages = Adminpanel::Section.of_page section.page %>
              <%= render "sections_table", :sections => section_pages %>
            </div>
            <% current_page = section.page %>
          <% end %>
        <% end %>
      </div>

    </div>
  </div>
</div>