AyuntamientoMadrid/participacion

View on GitHub
app/views/communities/_subnav.html.erb

Summary

Maintainability
Test Coverage
<div class="row column communities-participant">

  <ul class="tabs" id="communities_show_tabs"
      data-deep-link="true"
      data-update-history="true"
      data-deep-link-smudge="true"
      data-deep-link-smudge-delay="500"
      data-tabs>

    <li class="tabs-title is-active">
      <%= link_to "#tab-participants" do %>
        <h3>
          <%= t("community.show.tab.participants") %>
          <span class="js-comments-count">(<%= @participants.count %>)</span>
        </h3>
      <% end %>
    </li>

    <% if @community.proposal.present? %>
      <li class="tabs-title">
        <%= link_to "#tab-polls" do %>
          <h3>
            <%= t("communities.subnav.surveys") %>
            <span class="js-comments-count">(<%= @community.proposal.polls.count %>)</span>
          </h3>
        <% end %>
      </li>
    <% end %>
  </ul>

  <div class="tabs-content" data-tabs-content="communities_show_tabs">
    <div class="tabs-panel is-active" id="tab-participants">
      <%= render partial: "participant", collection: @participants %>
    </div>

    <% if @community.proposal.present? %>
      <div class="tabs-panel topic-show" id="tab-polls">
        <%= render partial: "poll", collection: @community.proposal.polls %>
      </div>
    <% end %>
  </div>
</div>