Merge pull request #60 from medialab-prado/frontend-improvements

Frontend improvements
This commit is contained in:
Amaia Castro
2017-01-16 11:58:45 +01:00
committed by GitHub
10 changed files with 170 additions and 106 deletions

View File

@@ -4,6 +4,11 @@ App.Legislation =
$('#js-toggle-debate').on
click: ->
$('#debate-info').toggle()
$('#js-toggle-small-debate').on
click: ->
$('#debate-info').toggle()
$('span').toggleClass('icon-angle-up')
$('form#new_legislation_answer input.button').hide()
$('form#new_legislation_answer input[type=radio]').on
@@ -17,7 +22,4 @@ App.Legislation =
$('#js-toggle-legislation-process-header').on
click: ->
$('[data-target="legislation-header-small"]').toggle()
$('[data-target="legislation-header-full"]').toggle()

View File

@@ -9,7 +9,7 @@
// -----------------
.brand-heading {
background: $brand;
margin-bottom: 2rem;
margin-bottom: 5rem;
.column {
padding-top: 10rem;
@@ -58,7 +58,7 @@
// 03. Legislation cards
// -----------------
.legislation {
margin: 0 0 4rem 0;
margin: 0 0 5rem 0;
background: white;
border: 1px solid;
border-color: #e5e6e9 #dfe0e4 #d0d1d5;

View File

@@ -34,6 +34,8 @@
font-weight: 700;
}
$epigraph-font-size: rem-calc(15);
// 02. Hero
// -----------------
.legislation-hero {
@@ -63,7 +65,9 @@
#debate-info {
display: none;
margin-top: 1rem;
margin-top: 3rem;
padding-top: 4rem;
border-top: 1px solid darken($border, 10%);
@include breakpoint(medium) {
margin-bottom: 2rem;
@@ -80,6 +84,7 @@
}
p {
font-size: $base-font-size;
@include breakpoint(medium) {
margin-left: 25%;
}
@@ -97,7 +102,7 @@
}
.center .button {
background: #004A83;
background: $brand;
margin-bottom: 0;
}
@@ -112,6 +117,14 @@
.description {
margin-bottom: 1rem;
p {
font-size: $epigraph-font-size;
}
h4 {
font-size: $base-font-size;
}
@include breakpoint(medium) {
margin-bottom: 0;
@@ -145,61 +158,77 @@
// -----------------
.legislation-process-categories {
position: relative;
svg {
position: absolute;
top: 1.5rem;
left: 0;
@include breakpoint(medium) {
transform: rotate(-8deg);
top: 0.75rem;
}
}
ul {
padding-top: 4rem;
list-style: none;
margin-left: 0;
padding-left: 0;
.legislation-process-list {
border-bottom: 1px solid $medium-gray;
li {
cursor: pointer;
margin: 0 1rem 1rem 1rem;
@include breakpoint(medium) {
margin-left: 0;
display: inline-block;
margin-bottom: 1rem;
margin-right: 1rem;
}
ul {
position: relative;
max-width: 75rem;
margin-left: auto;
margin-right: auto;
list-style: none;
padding-top: 4rem;
padding-left: 0;
margin-bottom: 0;
@include breakpoint(medium) {
padding-left: 1rem;
}
svg {
position: absolute;
top: 1.25rem;
left: -1rem;
@media (min-width: 950px) {
margin-right: 0;
margin-left: 3rem;
margin-bottom: 0;
@include breakpoint(medium) {
transform: rotate(-6deg);
top: 0.75rem;
}
}
a,
h4 {
color: #6D6D6D;
margin-bottom: 0;
}
a {
&:hover, &:active {
text-decoration: none;
li {
cursor: pointer;
display: inline-block;
margin: 0 1rem 1rem 0;
&:first-of-type {
margin-left: 0;
}
p {
margin-bottom: 0;
@media (min-width: 950px) {
margin: 0 0 0 3rem;
}
@include breakpoint(medium) {
margin-bottom: 1rem;
a,
h4 {
color: #6D6D6D;
margin-bottom: 0;
}
a {
&:hover, &:active {
text-decoration: none;
}
p {
margin-bottom: 0;
@include breakpoint(medium) {
margin-bottom: 1rem;
}
}
}
}
}
.active {
border-bottom: 2px solid $brand;
.active {
border-bottom: 2px solid $brand;
}
}
}
}
@@ -252,7 +281,10 @@
// 05. Debate quiz
// -----------------
.debate-quiz {
.debate-questions {
.comments {
margin-top: 4rem;
}
.quiz-header {
margin-bottom: 2rem;
@@ -283,6 +315,7 @@
}
.quiz-next-link {
display: block;
&:hover, &:active {
text-decoration: none;
@@ -321,6 +354,10 @@
.debate-questions {
position: relative;
list-style: none;
.participation-not-allowed {
padding-bottom: 3rem;
}
.control {
position: relative;
@@ -332,6 +369,7 @@
border-radius: 4px;
padding: 0.75rem 2.5rem;
margin-right: 1.5rem;
margin-bottom: 0.5rem;
}
.active {
@@ -402,12 +440,26 @@
.headline {
margin-bottom: 0;
.headline-small {
padding-top: 0.75rem;
}
}
.button-circle {
line-height: 0;
padding: 0.5em;
padding: 0em;
width: 30px;
height: 30px;
border-radius: 50%;
span {
padding-left: 1px;
&:before {
line-height: 1.55;
}
}
}
.icon-checkmark-circle {
@@ -457,15 +509,12 @@
}
span {
margin-left: 0.75rem;
margin-left: 0.25rem;
font-style: italic;
font-size: $small-font-size;
color: $text-medium;
vertical-align: top;
@include breakpoint(medium) {
margin-left: 1rem;
}
line-height: 2.35rem;
}
.select-box {
@@ -520,17 +569,14 @@
// Panel calcs for desktop
@media screen and (min-width: 40em) {
.calc-index {
transition: all 0.25s;
width: calc(35% - 25px);
}
.calc-text {
transition: all 0.25s;
width: calc(65% - 25px)
}
.calc-comments {
transition: all 0.25s;
cursor: pointer;
background: #F2F2F2;
width: 50px;

View File

@@ -2,7 +2,7 @@
<div class="legislation-hero legislation-allegation no-margin-top grey-heading" data-target="legislation-header-small">
<div class="row headline">
<div class="small-12 medium-7 column">
<h3><%= process.title %></h3>
<h3 class="headline-small"><%= process.title %></h3>
</div>
<div class="small-12 medium-4 column right">
<a class="button-subscribed expanded button strong" title="Suscríbete al proceso" data-remote="true" rel="nofollow" data-method="post" href="#">
@@ -11,8 +11,17 @@
</a>
</div>
</div>
<div class="row description">
<div id="debate-info" style="display: none" class="small-12 column">
<div class="debate-info-wrapper">
<%= markdown process.additional_info if process.additional_info %>
</div>
</div>
</div>
<div class="center half-gradient">
<a class="button big center button-circle" title="<%= t('.view_process_information') %>" id="js-toggle-legislation-process-header">
<a class="button big center button-circle" title="<%= t('.view_process_information') %>" id="js-toggle-small-debate">
<span class="icon-angle-down" aria-hidden="true"></span>
</a>
</div>

View File

@@ -1,29 +1,32 @@
<nav class="legislation-process-categories">
<%= render 'legislation/processes/key_dates_svg' %>
<ul>
<li <%= "class=active" if phase == :debate %>>
<%= link_to process do %>
<h4><%= t('legislation.processes.shared.debate_dates') %></h4>
<p><%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %></p>
<% end %>
</li>
<li <%= "class=active" if phase == :draft_publication %>>
<%= link_to legislation_process_draft_publication_path(process) do %>
<h4><%= t('legislation.processes.shared.draft_publication_date') %></h4>
<p><%= format_date(process.draft_publication_date) %></p>
<% end %>
</li>
<li <%= "class=active" if phase == :allegations %>>
<%= link_to legislation_process_allegations_path(process) do %>
<h4><%= t('legislation.processes.shared.allegations_dates') %></h4>
<p><%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %></p>
<% end %>
</li>
<li <%= "class=active" if phase == :final_version_publication %>>
<%= link_to legislation_process_final_version_publication_path(process) do %>
<h4><%= t('legislation.processes.shared.final_publication_date') %></h4>
<p><%= format_date(process.final_publication_date) %></p>
<% end %>
</li>
</ul>
<nav class="legislation-process-categories">
<div class="legislation-process-list">
<ul>
<%= render 'legislation/processes/key_dates_svg' %>
<li <%= "class=active" if phase == :debate %>>
<%= link_to process do %>
<h4><%= t('legislation.processes.shared.debate_dates') %></h4>
<p><%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %></p>
<% end %>
</li>
<li <%= "class=active" if phase == :draft_publication %>>
<%= link_to legislation_process_draft_publication_path(process) do %>
<h4><%= t('legislation.processes.shared.draft_publication_date') %></h4>
<p><%= format_date(process.draft_publication_date) %></p>
<% end %>
</li>
<li <%= "class=active" if phase == :allegations %>>
<%= link_to legislation_process_allegations_path(process) do %>
<h4><%= t('legislation.processes.shared.allegations_dates') %></h4>
<p><%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %></p>
<% end %>
</li>
<li <%= "class=active" if phase == :final_version_publication %>>
<%= link_to legislation_process_final_version_publication_path(process) do %>
<h4><%= t('legislation.processes.shared.final_publication_date') %></h4>
<p><%= format_date(process.final_publication_date) %></p>
<% end %>
</li>
</ul>
</div>
</nav>

View File

@@ -3,7 +3,6 @@
<div class="small-12 medium-8 column">
<div class="legislation-text">
<h3><%= link_to process.title, process %></h3>
<%= markdown(first_paragraph(process.description)) %>
</div>
</div>
@@ -12,6 +11,10 @@
<span class="icon-comments"></span>&nbsp; <%= t('.see_latest_comments') %>
<% end %>
</div>
<div class="small-12 medium-11 column end">
<%= markdown(first_paragraph(process.description)) %>
</div>
</div>
<div class="column row">

View File

@@ -2,9 +2,9 @@
<%= render 'legislation/processes/header', process: @process, header: :full %>
<div class="row">
<%= render 'legislation/processes/key_dates', process: @process, phase: @phase %>
<%= render 'legislation/processes/key_dates', process: @process, phase: @phase %>
<div class="row">
<div class="debate-chooser">
<div class="row">
<p><%= t(".empty") %></p>

View File

@@ -2,9 +2,9 @@
<%= render 'legislation/processes/header', process: @process, header: :full %>
<div class="row">
<%= render 'legislation/processes/key_dates', process: @process, phase: @phase %>
<%= render 'legislation/processes/key_dates', process: @process, phase: @phase %>
<div class="row">
<div class="debate-chooser">
<div class="row">
<div class="debate-draft">

View File

@@ -2,9 +2,9 @@
<%= render 'legislation/processes/header', process: @process, header: :full %>
<div class="row">
<%= render 'key_dates', process: @process, phase: :debate %>
<%= render 'key_dates', process: @process, phase: :debate %>
<div class="row">
<div class="debate-chooser">
<div class="row">
<%= render 'debate', process: @process %>

View File

@@ -1,6 +1,6 @@
<% provide :title do %><%= @question.title %><% end %>
<section class="debate-quiz">
<section class="debate-questions">
<div class="quiz-header row small-collapse">
<div class="small-12 medium-9 column">
<div class="quiz-title">
@@ -39,14 +39,15 @@
<div id="social-share" class="sidebar-divider"></div>
<h3><%= t('.share') %></h3>
<div class="social-share-full">
<div class="social-share-button" data-title="<%= @question.title.truncate(115) %>" data-img="" data-url="" data-desc="" data-via="">
<a rel="nofollow " data-site="twitter" class="ssb-icon ssb-twitter" onclick="return SocialShareButton.share(this);" title="<%= t('.share_twitter') %>" href="#"><span class="sr-only">twitter</span></a>
<a rel="nofollow " data-site="facebook" class="ssb-icon ssb-facebook" onclick="return SocialShareButton.share(this);" title="<%= t('.share_facebook') %>" href="#"><span class="sr-only">facebook</span></a>
<a rel="nofollow " data-site="google_plus" class="ssb-icon ssb-google_plus" onclick="return SocialShareButton.share(this);" title="<%= t('.share_gplus') %>" href="#"><span class="sr-only">google_plus</span></a>
</div>
<div class="social-share-button" data-title="<%= @question.title.truncate(115) %>" data-img="" data-url="" data-desc="" data-via="">
<a rel="nofollow " data-site="twitter" class="ssb-icon ssb-twitter" onclick="return SocialShareButton.share(this);" title="<%= t('.share_twitter') %>" href="#"><span class="sr-only">twitter</span></a>
<a rel="nofollow " data-site="facebook" class="ssb-icon ssb-facebook" onclick="return SocialShareButton.share(this);" title="<%= t('.share_facebook') %>" href="#"><span class="sr-only">facebook</span></a>
<a rel="nofollow " data-site="google_plus" class="ssb-icon ssb-google_plus" onclick="return SocialShareButton.share(this);" title="<%= t('.share_gplus') %>" href="#"><span class="sr-only">google_plus</span></a>
</div>
</div>
</div>
</aside>
</div>
</section>
<%= render 'legislation/shared/comments', commentable: @question %>
<%= render 'legislation/shared/comments', commentable: @question %>
</section>