diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.sass index 9c643ed..0ccfe41 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.sass @@ -28,7 +28,7 @@ $font-size-h3: floor($font-size-base * 1.2) @import "bootstrap-sprockets" @import "bootstrap" @import "typeaheadjs" - +@import "footnotes" .alert-alert @extend .alert-danger diff --git a/app/assets/stylesheets/footnotes.css b/app/assets/stylesheets/footnotes.css new file mode 100644 index 0000000..f108caa --- /dev/null +++ b/app/assets/stylesheets/footnotes.css @@ -0,0 +1,49 @@ +/** + * Initialiazing a `footnotes` counter on the wrapper + */ +article { + counter-reset: footnotes; +} + +/** + * Inline footnotes references + * 1. Increment the counter at each new reference + * 2. Reset link styles to make it appear like regular text + */ +a[aria-describedby="footnote-label"] { + counter-increment: footnotes; /* 1 */ + text-decoration: none; /* 2 */ + color: inherit; /* 2 */ + cursor: default; /* 2 */ + outline: none; /* 2 */ +} + +/** + * Actual numbered references + * 1. Display the current state of the counter (e.g. `[1]`) + * 2. Align text as superscript + * 3. Make the number smaller (since it's superscript) + * 4. Slightly offset the number from the text + * 5. Reset link styles on the number to show it's usable + */ +a[aria-describedby="footnote-label"]::after { + content: '[' counter(footnotes) ']'; /* 1 */ + vertical-align: super; /* 2 */ + font-size: 0.5em; /* 3 */ + margin-left: 2px; /* 4 */ + color: blue; /* 5 */ + text-decoration: underline; /* 5 */ + cursor: pointer; /* 5 */ +} + +/** + * Resetting the default focused styles on the number + */ +a[aria-describedby="footnote-label"]:focus::after { + outline: thin dotted; + outline-offset: 2px; +} + +footer :target { + background: yellow; +} \ No newline at end of file diff --git a/app/views/pages/numbers.de.slim b/app/views/pages/numbers.de.slim new file mode 100644 index 0000000..940137e --- /dev/null +++ b/app/views/pages/numbers.de.slim @@ -0,0 +1,86 @@ +article + h1 = title t("Die Cannabis-Legalisierung in Zahlen: Der Staat wirft Geld aus dem Fenster und verpasst Millionen an Steuereinnahmen") + h2 Cannabis-Konsum + table.table.table-bordered.table-condensed + caption Cannabis-Konsum im Jahr 2014 gemäss Suchtmonitoring + thead + tr + th + th Absolut + th Bevölkerungsanteil + tr + td Gelegenheitskonsumenten (Konsum innerhalb von 12 Monaten) + td ca. 536’000 + td 6.7% + tr + td Regelmässige Konsumenten (Konsum innerhalb von 30 Tagen) + td ca. 240’000 + td 3% + tr + td Schweizer Bürger, die mindestens einmal im Leben Cannabis konsumiert haben + td ca. 3’136’000 + td 39.2% + + h2 Strafverfolgung + table.table.table-bordered.table-condensed + caption Strafverfolgung im Jahr 2015 gemäss Bundesamt für Statistik + thead.sr-only + tr + th Beschreibung + th Absolut + tr + td Jährliche Kosten für die Strafverfolgung (gemäss «Der Cannabis-Irrsinn») + td ca. 200’000’000 Fr. + tr + td Verzeigte Straftaten oder Ordnungsbussen + td ca. 50’000 + tr + td Kosten pro Straftat oder Ordnungsbusse + td ca. 4’000 Fr. + .lead Im Durchschnitt kostet jedes Delikt im Zusammenhang mit Cannabis den Steuerzahler ca. 4’000 Fr. + + h2 Potenzielle Steuereinnahmen durch kontrollierten Handel (Modellrechnung) + table.table.table-bordered.table-condensed + caption Potenzielle Steuereinnahmen + thead.sr-only + tr + th Beschreibung + th Zahlen + tr + td Geschätzte Anzahl Konsumenten + td + a href="#prevalenz" aria-describedby="footnote-label" id="prevalenz-ref" ca. 800’000 + tr + td Jährliche Konsumation pro Person + td ca. 50 Gramm + tr + td Durchschnittlicher Verkaufspreis pro Gramm + td + a href="#preis" aria-describedby="footnote-label" id="preis-ref" ca. 10 Fr + + table.table.table-bordered.table-condensed + caption Bilanz + thead.sr-only + tr + th Beschreibung + th Zahlen + tr + td Jährliche Steuereinnahmen + td ca. 100’000’000 Fr. + tr + td Jährliche Einsparungen + td ca. 200’000’000 Fr. + tr + td + strong Total + td + strong ca. 300’000’000 Fr. + + footer + ol + li#prevalenz + | Es wird geschätzt, dass 10% der Schweizer Bevölkerung nach der Legalisierung Cannabis konsumiert. + a href="#prevalenz-ref" aria-label="Zurück zum Inhalt"↵ + li#preis + | Der Verkaufspreis auf dem Schwarzmarkt liegt derzeit bei ca. 10 - 15 Fr. pro Gramm. Um den Schwarzmarkt wirksam zu bekämpfen, darf der Verkaufspreis inklusive Steuern nicht höher ausfallen, als der Preis auf dem Schwarzmarkt. Reine Produktionskosten liegen bei ca. 0.8 Fr. pro Gramm. + a href="#preis-ref" aria-label="Zurück zum Inhalt"↵ \ No newline at end of file diff --git a/app/views/shared/_topnavigation.slim b/app/views/shared/_topnavigation.slim index 7310611..458c103 100644 --- a/app/views/shared/_topnavigation.slim +++ b/app/views/shared/_topnavigation.slim @@ -7,6 +7,7 @@ = navbar_item t('.initiative_text'), initiative_text_path = navbar_item t('.arguments'), arguments_path = navbar_item t('.faq'), faq_path + = navbar_item t('.numbers'), numbers_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 1e1e17d..a313ba8 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -14,6 +14,7 @@ de: arguments: Argumentarium faq: Fragen und Antworten sponsoring: Sponsoren & Spenden + numbers: Zahlen counter: supporters: "Unterstützer:" @@ -77,6 +78,7 @@ de: arguments: argumentarium faq: fragen_und_antworten sponsoring: sponsoren_und_spenden + numbers: zahlen mongoid: models: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bd5cef4..e72f301 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -19,6 +19,7 @@ fr: arguments: Arguments (en allemand) faq: Questions et réponses (en allemand) sponsoring: Donation et Sponsors (en allemand) + numbers: Chiffres (en allemand) welcome_email: subject: Merci beaucoup pour ton soutien! @@ -74,6 +75,7 @@ fr: arguments: arguments faq: questions_et_reponses sponsoring: donation_et_sponsor + numbers: chiffres mongoid: models: diff --git a/config/locales/it.yml b/config/locales/it.yml index c672240..c46e884 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -16,6 +16,7 @@ it: arguments: Argomentazioni faq: Domande e risposte (in tedesco) sponsoring: Donazione e Sponsor + numbers: Numeri (in tedesco) counter: supporters: "Sostenitore:" @@ -77,6 +78,7 @@ it: arguments: argomentazioni faq: domande_e_risposte sponsoring: donazione_e_sponsor + numbers: numeri mongoid: attributes: diff --git a/config/routes.rb b/config/routes.rb index 420bc96..699a23b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,8 @@ Rails.application.routes.draw do get '/arguments', to: 'pages#show', as: :arguments, page: 'arguments' get '/faq', to: 'pages#show', as: :faq, page: 'faq' 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' end get '/cities_autocomplete', to: 'cities_autocomplete#index', as: :cities_autocomplete