From 7bd771dbc7627b9a0ff8f7fff43bc42e37c76ae3 Mon Sep 17 00:00:00 2001 From: Markus Graf Date: Fri, 14 Apr 2017 12:46:03 +0200 Subject: [PATCH] Implemented list of statements --- app/assets/stylesheets/application.sass | 15 +++------------ app/assets/stylesheets/statements.sass | 21 +++++++++++++++++++++ app/assets/stylesheets/variables.sass | 10 ++++++++++ app/views/pages/statements.de.slim | 13 +++++++++++++ app/views/shared/_topnavigation.slim | 1 + config/locales/de.yml | 5 +++++ config/locales/fr.yml | 13 ++++++++----- config/locales/it.yml | 5 +++++ config/routes.rb | 1 + 9 files changed, 67 insertions(+), 17 deletions(-) create mode 100644 app/assets/stylesheets/statements.sass create mode 100644 app/assets/stylesheets/variables.sass create mode 100644 app/views/pages/statements.de.slim diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.sass index a24a73f..102d255 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.sass @@ -13,22 +13,13 @@ *= require_tree . *= require_self */ - -$brand-success: #66903F -$navbar-default-bg: #FFF -$navbar-default-border: none -$font-size-base: 14px -$navbar-padding-horizontal: none -$navbar-default-link-color: #66903F -$navbar-default-link-active-bg: #FFF -$font-size-h1: floor($font-size-base * 1.8) -$font-size-h2: floor($font-size-base * 1.5) -$font-size-h3: floor($font-size-base * 1.2) - +@import "variables" @import "bootstrap-sprockets" @import "bootstrap" @import "typeaheadjs" @import "footnotes" +@import "statements" + .alert-alert @extend .alert-danger diff --git a/app/assets/stylesheets/statements.sass b/app/assets/stylesheets/statements.sass new file mode 100644 index 0000000..92aa1ec --- /dev/null +++ b/app/assets/stylesheets/statements.sass @@ -0,0 +1,21 @@ +@import "variables" + +.statement + display: inline-table + width: 45% + margin: 5px + + img + margin-right: 14px + float: left + + h2 + font-size: $font-size-base + margin: 0px + display: inline + +@media (max-width: 800px) + .statement + display: block + width: 100% + margin: 5px \ No newline at end of file diff --git a/app/assets/stylesheets/variables.sass b/app/assets/stylesheets/variables.sass new file mode 100644 index 0000000..f7edb05 --- /dev/null +++ b/app/assets/stylesheets/variables.sass @@ -0,0 +1,10 @@ +$brand-success: #66903F +$navbar-default-bg: #FFF +$navbar-default-border: none +$font-size-base: 14px +$navbar-padding-horizontal: none +$navbar-default-link-color: #66903F +$navbar-default-link-active-bg: #FFF +$font-size-h1: floor($font-size-base * 1.8) +$font-size-h2: floor($font-size-base * 1.5) +$font-size-h3: floor($font-size-base * 1.2) \ No newline at end of file diff --git a/app/views/pages/statements.de.slim b/app/views/pages/statements.de.slim new file mode 100644 index 0000000..cb0be13 --- /dev/null +++ b/app/views/pages/statements.de.slim @@ -0,0 +1,13 @@ +- supporters = Supporter.where('publicity.state' => :approved).desc(:created_at) + +h1 = title t('.title') +- supporters.each do |supporter| + .statement + = image_tag supporter.publicity.avatar.url(:small), alt: "#{supporter.first_name} #{supporter.last_name}" + h2= "#{supporter.first_name} #{supporter.last_name}, #{supporter.city}" + - unless supporter.publicity.organisation.blank? + em= ", #{supporter.publicity.organisation}" + br + = supporter.publicity.statement + hr.clearfix + diff --git a/app/views/shared/_topnavigation.slim b/app/views/shared/_topnavigation.slim index 2d7adbb..0cb84cb 100644 --- a/app/views/shared/_topnavigation.slim +++ b/app/views/shared/_topnavigation.slim @@ -8,6 +8,7 @@ = navbar_item t('.arguments'), arguments_path = navbar_item t('.faq'), faq_path = navbar_item t('.numbers'), numbers_path + = navbar_item t('.statements'), statements_path = navbar_item t('.sponsoring'), sponsoring_path = navbar_item t('.sign_in'), new_supporter_session_path unless supporter_signed_in? = navbar_item t('.sign_out'), destroy_supporter_session_path, nil, 'data-method' => :delete if supporter_signed_in? diff --git a/config/locales/de.yml b/config/locales/de.yml index 3329f77..e4bd743 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -15,6 +15,7 @@ de: faq: Fragen und Antworten sponsoring: Sponsoren & Spenden numbers: Zahlen + statementes: Statements are_you_sure: Bist du sicher? edit: Bearbeiten @@ -100,6 +101,9 @@ de: thanks: title: Besten Dank für deine Unterstützung! + + statements: + title: Statements von unseren Unterstützern routes: initiative_text: initiativtext @@ -107,6 +111,7 @@ de: faq: fragen_und_antworten sponsoring: sponsoren_und_spenden numbers: zahlen + statementes: statements mongoid: models: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bfa9241..06ce674 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -5,8 +5,8 @@ fr: "yes": Oui "no": Non counter: - supporters: "Militant:" - amount_of_supporters: Nous avons actuellement %{amount} supporters. + supporters: "Partisans:" + amount_of_supporters: Nous avons actuellement %{amount} partisans. header: logo: Logo de l'initiative title_html: Oui, je veux légaliser le cannabis en Suisse. @@ -20,6 +20,7 @@ fr: faq: Questions et réponses (en allemand) sponsoring: Donation et Sponsors (en allemand) numbers: Chiffres (en allemand) + statements: Déclarations are_you_sure: Tu es sûre? edit: Éditer @@ -31,9 +32,7 @@ fr: support_type: signer: Je signerais une initiative populaire pour la légalisation du cannabis. supporter: Je signerais une initiative populaire pour la légalisation du cannabis et aiderais activement à trouver des signatures dans ma région. - # activist: Ich unterschreibe eine Volksinitiative für die Legalisierung von Cannabis und beteilige mich bei der Planung und Koordination einer Volksinitiative. - # nonvoting_supporter: Ich bin nicht stimmberechtigt, helfe aber aktiv Unterschriften in meiner Umgebung zu sammeln um Cannabis zu legalisierung. - + age_category: underage: J’ai moins de 18 ans young: J’ai entre 18 et 30 ans @@ -97,6 +96,9 @@ fr: thanks: title: Merci beaucoup pour ton soutien! + + statements: + title: Les déclarations de nos partisans routes: initiative_text: l_initiative_propose @@ -104,6 +106,7 @@ fr: faq: questions_et_reponses sponsoring: donation_et_sponsor numbers: chiffres + statements: declarations mongoid: models: diff --git a/config/locales/it.yml b/config/locales/it.yml index e40582c..4de9fb3 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -17,6 +17,7 @@ it: faq: Domande e risposte (in tedesco) sponsoring: Donazione e Sponsor numbers: Numeri (in tedesco) + statements: Dichiarazioni counter: supporters: "Sostenitore:" @@ -99,6 +100,9 @@ it: show: not_found: La pagina non è stata trovata. + + statements: + title: Dichiarazioni di nostri sostenitori routes: initiative_text: il_testo_dell_iniziativa @@ -106,6 +110,7 @@ it: faq: domande_e_risposte sponsoring: donazione_e_sponsor numbers: numeri + statements: dichiarazioni mongoid: attributes: diff --git a/config/routes.rb b/config/routes.rb index 8f28b07..e7af58f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,6 +17,7 @@ Rails.application.routes.draw do get '/terms_and_conditions', to: 'pages#show', as: :terms_and_conditions, page: 'terms_and_conditions' get '/sponsoring', to: 'pages#show', as: :sponsoring, page: 'sponsoring' get '/numbers', to: 'pages#show', as: :numbers, page: 'numbers' + get '/statements', to: 'pages#show', as: :statements, page: 'statements' end get '/cities_autocomplete', to: 'cities_autocomplete#index', as: :cities_autocomplete