From e0c5a79fae9e46bc2eee0ea5219a18132a339704 Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 13 Oct 2018 12:59:05 +0200 Subject: [PATCH 1/5] Removes dashboard mailer css --- app/assets/stylesheets/dashboard_mailer.scss | 66 -------------------- config/initializers/assets.rb | 1 - 2 files changed, 67 deletions(-) delete mode 100644 app/assets/stylesheets/dashboard_mailer.scss diff --git a/app/assets/stylesheets/dashboard_mailer.scss b/app/assets/stylesheets/dashboard_mailer.scss deleted file mode 100644 index 8e4f3ba6b..000000000 --- a/app/assets/stylesheets/dashboard_mailer.scss +++ /dev/null @@ -1,66 +0,0 @@ -@import 'application'; - -body { - padding-left: 30%; - padding-right: 30%; - - p { - text-align: justify; - } -} - -header { - background-color: #3700fd; - color: #fff; - padding: 20pt; - margin-bottom: 0; - border-bottom: 0; - - h1 { - font-size: 40pt; - text-align: center; - } - - h2 { - font-size: 25pt; - text-align: center; - } -} - -.proposal-image { - width: 100%; -} - -.mail-body { - color: #838383; - font-size: 18pt; - margin-top: 20pt; -} - -.support-link { - display: block; - background-color: #004a84; - color: #dff; - text-decoration: none; - border: 1px solid $border; - width: 80%; - margin-left: auto; - margin-right: auto; - font-size: 40pt; - padding: 20pt; - border-radius: 5pt; - text-align: center; - margin-top: 50pt; - margin-bottom: 50pt; -} - -.support-link:hover { - color: #ddffffff; - text-decoration: none; -} - -.share-title { - font-weight: bold; - font-size: 25pt; -} - diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 03469442d..b7fafd0f0 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -15,7 +15,6 @@ Rails.application.config.assets.precompile += %w( stat_graphs.js ) Rails.application.config.assets.precompile += %w( dashboard_graphs.js ) Rails.application.config.assets.precompile += %w( print.css ) Rails.application.config.assets.precompile += %w( ie.css ) -Rails.application.config.assets.precompile += %w( dashboard_mailer.css ) Rails.application.config.assets.precompile += %w( pdf_fonts.css ) # Loads app/assets/images/custom before app/assets/images From 84975143bb8af5d3c98b19663a07d1a057c0a2af Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 13 Oct 2018 12:59:24 +0200 Subject: [PATCH 2/5] Removes dashboard mailer layout --- app/mailers/dashboard/mailer.rb | 2 +- app/views/layouts/dashboard/mailer.html.erb | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 app/views/layouts/dashboard/mailer.html.erb diff --git a/app/mailers/dashboard/mailer.rb b/app/mailers/dashboard/mailer.rb index 3000f7d67..e246fb914 100644 --- a/app/mailers/dashboard/mailer.rb +++ b/app/mailers/dashboard/mailer.rb @@ -1,5 +1,5 @@ class Dashboard::Mailer < ApplicationMailer - layout 'dashboard/mailer' + layout 'mailer' def forward(proposal) @proposal = proposal diff --git a/app/views/layouts/dashboard/mailer.html.erb b/app/views/layouts/dashboard/mailer.html.erb deleted file mode 100644 index 1d57e6bdd..000000000 --- a/app/views/layouts/dashboard/mailer.html.erb +++ /dev/null @@ -1,10 +0,0 @@ - - - - - <%= stylesheet_link_tag "dashboard_mailer" %> - - - <%= yield %> - - From eeea1acd9f79945fa4bdcc85ed63d12e59bfd773 Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 13 Oct 2018 13:00:01 +0200 Subject: [PATCH 3/5] Updates i18n for dashboard mailer --- config/locales/en/general.yml | 32 +++++--------------------------- config/locales/es/general.yml | 32 +++++--------------------------- 2 files changed, 10 insertions(+), 54 deletions(-) diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 06ab0fba4..3fc400f87 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -607,34 +607,12 @@ en: mailer: forward: subtitle: If you support me, we will achieve it. - support_it: Support this proposal + support_button: Support this proposal share_in: Share in - introduction: - "

Hello!

- -

- I am writing to let you know that I am - participating in Decide Madrid, the platform for - Madrid and Madrid we can decide which city - we want. And for that, I created my own citizen proposal - and now, I'm going to need your support! But do not worry because - It is very simple. -

- -

- You just have to click on the button that you will see below - 'Support this proposal' and you can directly inform yourself about - before promoting it. Only the proposals that achieve the - maximum support will be carried out by our City Council, - and I thought that you, I'm sure you help me achieve it! -

" - share_info: - "

- And if you also do me the great favor of sharing my proposal with - your friends, family and contacts, it would be the bomb! Can - do it next from the social network that you want or from your - email: -

" + hi: "Hello!" + introduction: I am writing to let you know that I am participating in %{org}, the platform we can decide which city we want. And for that, I created my own citizen proposal and now, I'm going to need your support! But do not worry because It is very simple. + support: "You just have to click on the button that you will see below 'Support this proposal' and you can directly inform yourself about before promoting it. Only the proposals that achieve the maximum support will be carried out by our City Council, and I thought that you, I'm sure you help me achieve it!" + share: "And if you also do me the great favor of sharing my proposal with your friends, family and contacts, it would be the bomb! Can do it next from the social network that you want or from your email." polls: all: "All" no_dates: "no date assigned" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index c32be9b97..0c461fc9f 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -607,34 +607,12 @@ es: mailer: forward: subtitle: Si me apoyas, lo conseguiremos. - support_it: Apoyar esta propuesta + support_button: Apoyar esta propuesta share_in: Compartir en - introduction: -

¡Hola!

- -

- Te escribo para comunicarte que estoy - participando en Decide Madrid, la plataforma para que - los madrileños y madrileñas podamos decidir qué ciudad - queremos. Y para ello, he creado mi propia propuesta ciudadana - y ahora, ¡voy a necesitar tu apoyo! Pero no te preocupes porque - es muy sencillo. -

- -

- Tan sólo tienes que pinchar en el botón que verás a continuación - 'Apoyar esta propuesta' y directamente podrás informarte a cerca de - ella antes de impulsarla. Sólo las propuestas que consigan el - máximo apoyo se llevarán a cabo por parte de nuestro Ayuntamiento, - y he pensado que tú, ¡seguro que me ayudas a lograrlo! -

- share_info: - "

- Y si además, me haces el gran favor de compartir mi propuesta con - tus amigos, familiares y contactos, ¡ya sería la bomba! Puedes - hacerlo a continuación desde la red social que tú quieras o desde tu - correo electrónico: -

" + hi: "¡Hola!" + introduction: "Te escribo para comunicarte que estoy participando en %{org}, la plataforma para que podamos decidir qué ciudad queremos. Y para ello, he creado mi propia propuesta ciudadana y ahora, ¡voy a necesitar tu apoyo! Pero no te preocupes porque es muy sencillo." + support: "Tan sólo tienes que hacer clic en el botón que verás a continuación 'Apoyar esta propuesta' y directamente podrás informarte acerca de ella antes de impulsarla. Sólo las propuestas que consigan el máximo apoyo se llevarán a cabo por parte de nuestro Ayuntamiento, y he pensado que tú, ¡seguro que me ayudas a lograrlo!" + share: "Y si además, me haces el gran favor de compartir mi propuesta con tus amigos, familiares y contactos, ¡ya sería la bomba! Puedes hacerlo a continuación desde la red social que tú quieras o desde tu correo electrónico." polls: all: "Todas" no_dates: "sin fecha asignada" From 5d00952b058a1005a61b628a8f5a632229f17331 Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 13 Oct 2018 13:01:38 +0200 Subject: [PATCH 4/5] Improves styles for dashboard mailer preview --- app/assets/stylesheets/dashboard.scss | 6 +++++- app/views/dashboard/mailing/index.html.erb | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss index a97a67f85..db9ac5b93 100644 --- a/app/assets/stylesheets/dashboard.scss +++ b/app/assets/stylesheets/dashboard.scss @@ -424,7 +424,7 @@ .dashboard-mail-preview { .mail-header { - background-color: $brand; + background: #3700fd; color: #fff; padding: $line-height; text-align: center; @@ -432,6 +432,10 @@ .mail-body { text-align: justify; + + .button { + background: #3700fd; + } } } diff --git a/app/views/dashboard/mailing/index.html.erb b/app/views/dashboard/mailing/index.html.erb index a08141ac7..abca60739 100644 --- a/app/views/dashboard/mailing/index.html.erb +++ b/app/views/dashboard/mailing/index.html.erb @@ -15,14 +15,16 @@
- <%== t("dashboard.mailer.forward.introduction") %> +

<%= t("dashboard.mailer.forward.hi") %>

+

<%= t("dashboard.mailer.forward.introduction", org: setting['org_name']) %>

+

<%= t("dashboard.mailer.forward.support") %>

- <%= link_to t("dashboard.mailer.forward.support_it"), + <%= link_to t("dashboard.mailer.forward.support_button"), proposal_url(@proposal), class: "button large" %>
- <%== t("dashboard.mailer.forward.share_info") %> + <%= t("dashboard.mailer.forward.share") %>

<%= t("dashboard.mailer.forward.share_in") %>

From c33d9fa97bf63bafccc72506dcace1f0698ad8eb Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 13 Oct 2018 13:03:02 +0200 Subject: [PATCH 5/5] Improves styles for dashboard mailer forward Uses layout with tables and inline styles to avoid display errors in mail readers --- app/assets/images/social_buttons_mailer.png | Bin 0 -> 2768 bytes app/views/dashboard/mailer/forward.html.erb | 76 +++++++++++++++----- 2 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 app/assets/images/social_buttons_mailer.png diff --git a/app/assets/images/social_buttons_mailer.png b/app/assets/images/social_buttons_mailer.png new file mode 100644 index 0000000000000000000000000000000000000000..522f575cb83bff9ebb4e1e21bf35b62de576a2c3 GIT binary patch literal 2768 zcmaJ@c{r478`nw>6Viv_FpagvY+=mENHdn9VH(unklC1#SgIIKH@BwoIjKIS( zm@LO|KEo~C#hn&@h=!trZ7`r+BD9Qv%@9&RB6bi*fEHPUKl7qx`xP-14En4hJY)_2 z;uM)c1Yx;+2FM&@VM>GVv;-kh5V$$Y5@EIjgn+>|_mQ3WYp06dD>D3JKi_;qn8Za1;s!g(08_gsDu!R1n4yQbeX4f&MoJ z9790kvv@)lmjha1q)@pbLTj+h(=Q>gdEaR{g0E?kB@8N}@St!AY$c>`iUh*{S7o!m zYYT)V#=rjlPhx?47>@xZF$CNYK226QfBh9xJT#Wipa{8qcP=;RTNa5-u8=EWa(N&u zb|q^_kO_f8V{ul5TR)=+1T>x_5K=fa1|DY(mhnJXEIJwiN5ajK_9(1{y)7JWXK85x zgJZEM^F2GwEbU-8I3H8;Q{veE+>K0smz9v4hP99Nm`Z#O>01R?XGFLNR(~phE zt85fqAa_yU|Grh<$GEQ6na-D}VRF-MF#c3LmPOGc2%OVM?uD;*+iW*&}5s&6UHe$Qsb& z*(3WD-XFwcTdr`+HkTS_IQk?_CHC{okx!87eWZeh+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%d%(rO7tWJM25{vcqi6rtIP>Yn z(^mzO^k>Vf7O+y)msJ|74F_`?HWOVXN=r);l_cFqui^%OTDre^)0oXGjfhWW<$ZMr zEUl~F#g9C<%DO)a%y(|dx^*MY(kvn2X^bNmnF%f2lasgeQ0K$CrK&-%T1XkP3fr8! zC>^)S(vnS?FQZ2`guaX(*%107luf4mA?~X6aw&@!W8a)jsb2ZV#M`;xZtwAn{Rd2e B#CZS! literal 0 HcmV?d00001 diff --git a/app/views/dashboard/mailer/forward.html.erb b/app/views/dashboard/mailer/forward.html.erb index b3f5ee999..3788c94aa 100644 --- a/app/views/dashboard/mailer/forward.html.erb +++ b/app/views/dashboard/mailer/forward.html.erb @@ -1,19 +1,61 @@ -
-

<%= @proposal.title %>

-

<%= t("dashboard.mailer.forward.subtitle") %>

-
-<%= image_tag @proposal.image.attachment.url(:large), class: 'proposal-image' if @proposal.image.present? %> -<%= image_tag 'default_mailing.jpg', class: 'proposal-image' unless @proposal.image.present? %> -
- <%== t("dashboard.mailer.forward.introduction") %> - <%= link_to t("dashboard.mailer.forward.support_it"), proposal_url(@proposal), class: 'support-link' %> - <%== t("dashboard.mailer.forward.share_info") %> + - - <%= render partial: 'shared/social_share', locals: { - title: @proposal.title, - url: proposal_url(@proposal), - description: @proposal.summary - } %> + + + + + + +
+

<%= @proposal.title %>

+

<%= t("dashboard.mailer.forward.subtitle") %>

+
-
+ <% if @proposal.image.present? %> + <%= image_tag @proposal.image.attachment.url(:large), style: "max-width: 100%;" %> + <% else %> + <%= image_tag "default_mailing.jpg", style: "max-width: 100%;" %> + <% end %> + +

<%= t("dashboard.mailer.forward.hi")%>

+

<%= t("dashboard.mailer.forward.introduction", org: setting['org_name']) %>

+

<%= t("dashboard.mailer.forward.support") %>

+ + + + + + + +
+ <%= link_to proposal_url(@proposal), + style: "font-family: 'Open Sans',arial,sans-serif; background: #3700fd; + border-radius: 6px; color: #fff !important; font-weight: bold; + padding: 17px 20px; text-align: center; text-decoration: none; + font-size: 20px; min-width: 200px; display: inline-block;", + target: "_blank" do %> + <%= t("dashboard.mailer.forward.support_button") %> + <% end %> +
+ +

<%= t("dashboard.mailer.forward.share") %>

+ + + + + + + + + + +
+

<%= t("dashboard.mailer.forward.share_in") %>

+
+ <%= link_to proposal_url(@proposal, anchor: "social-share") do %> + <%= image_tag("social_buttons_mailer.png", alt: t("dashboard.mailer.forward.share_in"), + style: "max-width: 100%;") %> + <% end %> +
+