Skip to content

Commit

Permalink
Tabs on term_table page, for navigating between houses
Browse files Browse the repository at this point in the history
Makes it easier to move from, for example, a country\u2019s lower to
upper chamber. Will also help people navigate once executive
branch is included (#13297).
  • Loading branch information
zarino authored and octopusinvitro committed Sep 2, 2016
1 parent 6caa54b commit 199a71c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 8 deletions.
47 changes: 39 additions & 8 deletions views/sass/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,43 @@ p.lead {

// Little round social icons for membership tables
.person-link {
display: inline-block;
width: 24px;
padding-top: 24px;
height: 0;
overflow: hidden;
vertical-align: middle;
border-radius: 100%;
margin-right: 0.3em;
display: inline-block;
width: 24px;
padding-top: 24px;
height: 0;
overflow: hidden;
vertical-align: middle;
border-radius: 100%;
margin-right: 0.3em;
}

.house-tabs {
@extend .unstyled-list;
@extend .inline-list;
padding-top: 1em;

@media (min-width: $medium_screen) and (min-height: 600px) {
padding-top: 1.5em;
}
}

.house-tab {
display: inline-block;
padding: 0.5em 1em;
border-radius: 5px 5px 0 0;
background-color: mix($colour_green, #fff, 25%);
background: linear-gradient(180deg, mix($colour_green, #fff, 20%), 50%, mix($colour_green, #fff, 30%));
color: darken($colour_green, 10%) !important;

&:hover,
&:focus {
background-color: mix($colour_green, #fff, 15%);
background: linear-gradient(180deg, mix($colour_green, #fff, 10%), 50%, mix($colour_green, #fff, 20%));
}
}

.house-tab--active,
.house-tab--active:hover,
.house-tab--active:focus {
background: #fff;
}
16 changes: 16 additions & 0 deletions views/term_table.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<div class="page-section page-section--green page-section--no-padding">
<div class="container text-center">
<ul class="house-tabs">
<% @page.country.legislatures.each do |house| %>
<li>
<a
class="house-tab <% if @page.house == house %>house-tab--active<% end %>"
href="<%= term_table_url(house.legislative_periods.first) %>">
<%= house.name %>
</a>
</li>
<% end %>
</ul>
</div>
</div>

<div class="page-section" id="term">
<div class="container text-center">
<h1><span class="avatar"><i class="fa fa-university"></i></span> <%= @page.current_term.name %></h1>
Expand Down

1 comment on commit 199a71c

@tmtmtmtm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems to have gone awry with the quote in the commit message here vs 3c68cdf

Please sign in to comment.