Updates active to is-active class for menus

This commit is contained in:
decabeza
2018-04-10 19:55:28 +02:00
parent e84e82d3ce
commit ee884ed998
9 changed files with 30 additions and 21 deletions

View File

@@ -253,12 +253,21 @@ a {
} }
} }
&.active { & + li {
border-bottom: 2px solid $brand; margin-left: 0;
color: $brand;
} }
&:not(.active) { &.is-active {
border-bottom: 2px solid $brand;
color: $brand;
padding-bottom: rem-calc(1);
h2 a {
color: $brand;
}
}
&:not(.is-active) {
margin-bottom: $line-height / 3; margin-bottom: $line-height / 3;
} }
} }

View File

@@ -1,6 +1,6 @@
<ul class="menu simple clear"> <ul class="menu simple clear">
<% if active == 'info' %> <% if active == 'info' %>
<li class="active"> <li class="is-active">
<h2><%= t("admin.legislation.processes.subnav.info") %></h2> <h2><%= t("admin.legislation.processes.subnav.info") %></h2>
</li> </li>
<% else %> <% else %>
@@ -10,7 +10,7 @@
<% end %> <% end %>
<% if active == 'questions' %> <% if active == 'questions' %>
<li class="active"> <li class="is-active">
<h2><%= t("admin.legislation.processes.subnav.questions") %></h2> <h2><%= t("admin.legislation.processes.subnav.questions") %></h2>
</li> </li>
<% else %> <% else %>
@@ -20,7 +20,7 @@
<% end %> <% end %>
<% if active == 'proposals' %> <% if active == 'proposals' %>
<li class="active"> <li class="is-active">
<h2><%= t("admin.legislation.processes.subnav.proposals") %></h2> <h2><%= t("admin.legislation.processes.subnav.proposals") %></h2>
</li> </li>
<% else %> <% else %>
@@ -30,7 +30,7 @@
<% end %> <% end %>
<% if active == 'draft_versions' %> <% if active == 'draft_versions' %>
<li class="active"> <li class="is-active">
<h2><%= t("admin.legislation.processes.subnav.draft_texts") %></h2> <h2><%= t("admin.legislation.processes.subnav.draft_texts") %></h2>
</li> </li>
<% else %> <% else %>

View File

@@ -1,6 +1,6 @@
<ul class="menu simple clear" id="assigned-resources-tabs"> <ul class="menu simple clear" id="assigned-resources-tabs">
<% if controller_name == "polls" %> <% if controller_name == "polls" %>
<li class="active"> <li class="is-active">
<h2> <h2>
<%= t("admin.polls.show.questions_tab") %> <%= t("admin.polls.show.questions_tab") %>
(<%= @poll.questions.count %>) (<%= @poll.questions.count %>)
@@ -16,7 +16,7 @@
<% end %> <% end %>
<% if controller_name == "booth_assignments" %> <% if controller_name == "booth_assignments" %>
<li class="active"> <li class="is-active">
<h2> <h2>
<%= t("admin.polls.show.booths_tab") %> <%= t("admin.polls.show.booths_tab") %>
(<%= @poll.booth_assignments.select(:booth_id).distinct.count %>) (<%= @poll.booth_assignments.select(:booth_id).distinct.count %>)
@@ -32,7 +32,7 @@
<% end %> <% end %>
<% if controller_name == "officer_assignments" %> <% if controller_name == "officer_assignments" %>
<li class="active"> <li class="is-active">
<h2> <h2>
<%= t("admin.polls.show.officers_tab") %> <%= t("admin.polls.show.officers_tab") %>
(<%= @poll.officer_assignments.select(:officer_id).distinct.count %>) (<%= @poll.officer_assignments.select(:officer_id).distinct.count %>)
@@ -48,7 +48,7 @@
<% end %> <% end %>
<% if controller_name == "recounts" %> <% if controller_name == "recounts" %>
<li class="active"> <li class="is-active">
<h2> <h2>
<%= t("admin.polls.show.recounts_tab") %> <%= t("admin.polls.show.recounts_tab") %>
</h2> </h2>
@@ -60,7 +60,7 @@
<% end %> <% end %>
<% if controller_name == "results" %> <% if controller_name == "results" %>
<li class="active"> <li class="is-active">
<h2> <h2>
<%= t("admin.polls.show.results_tab") %> <%= t("admin.polls.show.results_tab") %>
</h2> </h2>

View File

@@ -10,7 +10,7 @@
class: "button hollow float-right-medium" %> class: "button hollow float-right-medium" %>
<ul class="menu simple clear"> <ul class="menu simple clear">
<li class="active"> <li class="is-active">
<h2><%= link_to t("notifications.index.unread"), notifications_path %></h2> <h2><%= link_to t("notifications.index.unread"), notifications_path %></h2>
</li> </li>
<li> <li>

View File

@@ -7,7 +7,7 @@
<li> <li>
<%= link_to t("notifications.index.unread"), notifications_path %> <%= link_to t("notifications.index.unread"), notifications_path %>
</li> </li>
<li class="active"> <li class="is-active">
<h2><%= link_to t("notifications.index.read"), read_notifications_path %></h2> <h2><%= link_to t("notifications.index.read"), read_notifications_path %></h2>
</li> </li>
</ul> </ul>

View File

@@ -5,7 +5,7 @@
<ul class="menu simple clear"> <ul class="menu simple clear">
<% if current_user && current_user.administrator? || @poll.results_enabled? %> <% if current_user && current_user.administrator? || @poll.results_enabled? %>
<% if controller_name == "polls" && action_name == "results" %> <% if controller_name == "polls" && action_name == "results" %>
<li class="active"> <li class="is-active">
<h2><%= t("polls.show.results_menu") %></h2> <h2><%= t("polls.show.results_menu") %></h2>
</li> </li>
<% else %> <% else %>
@@ -15,7 +15,7 @@
<% if current_user && current_user.administrator? || @poll.stats_enabled? %> <% if current_user && current_user.administrator? || @poll.stats_enabled? %>
<% if controller_name == "polls" && action_name == "stats" %> <% if controller_name == "polls" && action_name == "stats" %>
<li class="active"> <li class="is-active">
<h2><%= t("polls.show.stats_menu") %></h2> <h2><%= t("polls.show.stats_menu") %></h2>
</li> </li>
<% else %> <% else %>
@@ -24,7 +24,7 @@
<% end %> <% end %>
<% if controller_name == "polls" && action_name == "show" %> <% if controller_name == "polls" && action_name == "show" %>
<li class="active"> <li class="is-active">
<h2><%= t("polls.show.info_menu") %></h2> <h2><%= t("polls.show.info_menu") %></h2>
</li> </li>
<% else %> <% else %>

View File

@@ -3,7 +3,7 @@
<% @valid_filters.each do |filter| %> <% @valid_filters.each do |filter| %>
<% if @current_filter == filter %> <% if @current_filter == filter %>
<li class="active"><h2><%= t("#{i18n_namespace}.filters.#{filter}") %></h2></li> <li class="is-active"><h2><%= t("#{i18n_namespace}.filters.#{filter}") %></h2></li>
<% else %> <% else %>
<li><%= link_to t("#{i18n_namespace}.filters.#{filter}"), <li><%= link_to t("#{i18n_namespace}.filters.#{filter}"),
current_path_with_query_params(filter: filter, page: 1) %></li> current_path_with_query_params(filter: filter, page: 1) %></li>

View File

@@ -27,7 +27,7 @@
<% @valid_filters.each do |filter| %> <% @valid_filters.each do |filter| %>
<% if @activity_counts[filter] > 0 %> <% if @activity_counts[filter] > 0 %>
<% if @current_filter == filter %> <% if @current_filter == filter %>
<li class="active"> <li class="is-active">
<h2><%= t("users.show.filters.#{filter}", count: @activity_counts[filter]) %></h2> <h2><%= t("users.show.filters.#{filter}", count: @activity_counts[filter]) %></h2>
</li> </li>
<% else %> <% else %>

View File

@@ -440,7 +440,7 @@ feature 'Users' do
visit user_path(@user, filter: "follows") visit user_path(@user, filter: "follows")
expect(page).to have_selector(".activity li.active", text: "1 Following") expect(page).to have_selector(".activity li.is-active", text: "1 Following")
end end
describe 'Proposals' do describe 'Proposals' do