From 6cbbbc70be7787ec39353555a61c3e61a8e348ab Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sun, 2 Jul 2017 02:45:22 +0530 Subject: [PATCH 01/39] Alinged Logo, Text, Signature to left side --- .../emails/request_access_confirmation.html | 8 ++++---- .../emails/request_access_notification.html | 8 ++++---- .../emails/request_beta_access_notification.html | 8 ++++---- .../templates/datacenterlight/emails/user_activation.html | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html index e96a8ef1..2f71944f 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html +++ b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html @@ -74,7 +74,7 @@
-
+ logo @@ -95,12 +95,12 @@
- -
+ {% trans "Thank you for your request." %}
+

{% trans "You are one step away from being our beta tester!" %}

{% trans "Currently we are running our tests to make sure everything runs perfectly." %}
{% trans "In the meantime, we would like to ask you a little patience
until our team contacts you with beta access." %}
@@ -117,7 +117,7 @@

-
Your data center light team
+
Your data center light team
diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html b/datacenterlight/templates/datacenterlight/emails/request_access_notification.html index 09531ba6..095c917e 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html +++ b/datacenterlight/templates/datacenterlight/emails/request_access_notification.html @@ -73,7 +73,7 @@
-
+ logo @@ -94,12 +94,12 @@
- - @@ -113,7 +113,7 @@
+ An user requested a beta access
+

User {{email}} requested beta access

-
Your data center light team
+
Your data center light team
diff --git a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html index 7991eb69..c6f3033e 100644 --- a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html +++ b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html @@ -73,7 +73,7 @@
-
+ logo @@ -94,14 +94,14 @@
- -
+ An user requested a beta access
+

User {{email}} requested beta access

{% for vm in vms %} Type: {{vm.type}} - Amount: {{vm.amount}} @@ -119,7 +119,7 @@
-
Your data center light team
+
Your data center light team
diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index bf688127..e591fc54 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -74,7 +74,7 @@
-
+ logo @@ -95,12 +95,12 @@
- -
+ {{dcl_text}} {% trans 'account activation' %}
+

{% blocktrans %} You can activate your {{dcl_text}} account by clicking here.

@@ -120,7 +120,7 @@

-
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
+
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
From 2045c424ca2922c21392a0ec8c7172234b51b960 Mon Sep 17 00:00:00 2001 From: Mondi Geetha Date: Sun, 2 Jul 2017 03:00:02 +0530 Subject: [PATCH 02/39] Added padding to LOGO in user activation email --- .../templates/datacenterlight/emails/user_activation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index e591fc54..4b8a7d2b 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -74,7 +74,7 @@
-
+ logo From 79f4b38e4cf666934f01c14acd21b7ba3890e95d Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 12:24:10 +0530 Subject: [PATCH 03/39] Refactored user activation email --- .../datacenterlight/img/dcl-email-bg.jpg | Bin 0 -> 1941 bytes .../datacenterlight/emails/base_email.html | 178 ++++++++++++++++++ .../datacenterlight/emails/base_email.txt | 9 + .../emails/user_activation.html | 142 ++------------ 4 files changed, 199 insertions(+), 130 deletions(-) create mode 100644 datacenterlight/static/datacenterlight/img/dcl-email-bg.jpg create mode 100644 datacenterlight/templates/datacenterlight/emails/base_email.html create mode 100644 datacenterlight/templates/datacenterlight/emails/base_email.txt diff --git a/datacenterlight/static/datacenterlight/img/dcl-email-bg.jpg b/datacenterlight/static/datacenterlight/img/dcl-email-bg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5a62f3e7c568ae366c5154f6e8e8a0d45f6dc298 GIT binary patch literal 1941 zcmd^8Nl@En6#i{_W0|C;kdT~Ikp*aFEw(I66PE!S8am^Yumswf9JKrf6>K?@0K+YT zZd^K9x}F-6CTY{j3`x3$L$lHCmZdF8Pb6KLOq-=^F77Xbfy_`&z4eXsFK_+c``^n= z=Vm}5 zDV8OX25AnZEh$T;&8mWjI5ZVQ%UGJ8#%+(1toK_{0wJACA(cra791~ItyId+E3a)@ zt#A>>vf5_*PzF-1(A4`41tRsTf-$Py%7JV}ghqVI(9okueQ{msPrPc& zOscdT6p|7t&`F*Qg?NUHM4&=SNsdV>JTHgkNWsr?_B`Dn2=#oU5DteKrZLpOHpLq` zmW?yPdY0wm1>5GdX-R1X7Gi5C_PlL;MO!guK*`dLc3tl)bU{mxZs}%^p21_W{Hx>D z2}#k?HnYZlsJXo3(9i~;+GOY{JYQ*1TLuNo2O&oXd6EyqAgX{8A|q;0C84bHYEn^o zfkPFTvsaf?aIRAk2W65e01_igkmY#^lB&u@NQU8gQkFTIlo*AByuz?DEfExgNZHM^ zq?rmV)S>oqVKmTXVYpx#O_YH~C-)0jl^+P8o<$?-$bAb&0p_#`t(Xf#zZ*m3cDr2m z=XHA!xxHSWugK@~mXws1+CQRI3*^Y_yNkWv;?P6W#7 za(cWNTAZfCiTPc?{YV*8zuoh&MC{sK&h9Cb&kvy}{UXXJahXwr~8T zVxH&XoA)0&6<*t}S{E+g@NF6?Dz02NdZ4lC@aY{_I;z*-y?O8A)$e|T{m;Gf_WM&` zegAuM;Q3dNeDLYlKm5Tz(b+xt!fQuA{Op?_|BP(y>dC(N`mv8bpZ@8u8lm}VZRn*p z-ud{8Yd`;8D?a(mv%_O=zI*1&>$CS!;!cDT)!prJ`7kVn^6_IX8?k#kLhRYKdoO!% z;&%DDOEXms6|J&yC%7RL+p}h0+s1L_@rf}o>&8pSG-#v8d zLUqlRoA*W!96tRZ$V`oMx`aQL?r5#t7Vdp^Z+CRJrtrGwM literal 0 HcmV?d00001 diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.html b/datacenterlight/templates/datacenterlight/emails/base_email.html new file mode 100644 index 00000000..ae279731 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/emails/base_email.html @@ -0,0 +1,178 @@ +{% load static from staticfiles %} +{% load i18n %} + + + + + + + {{dcl_text}} + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + +
+ logo + +
+
+ +
+
+
+
+ + + + + + + + + + +
+ {% block email_head %} + {% endblock %} +
+

+ {% block email_body %} + {% endblock %} +

  +
+
+
+
+ + + + +
{% trans 'Your' %} {{dcl_text}} {% + trans 'team' %}
+
+
+
+ + + diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.txt b/datacenterlight/templates/datacenterlight/emails/base_email.txt new file mode 100644 index 00000000..f0abda8f --- /dev/null +++ b/datacenterlight/templates/datacenterlight/emails/base_email.txt @@ -0,0 +1,9 @@ +{% load static from staticfiles %} +{% load i18n %} +{% block email_head %} +{% endblock %} + +{% block email_body %} +{% endblock %} + +{% trans 'Your' %} {{dcl_text}} {% trans 'team' %} diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index 4b8a7d2b..1f0df691 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -1,132 +1,14 @@ +{% extends "datacenterlight/emails/base_email.html" %} {% load static from staticfiles %} {% load i18n %} - - - - - - -{{dcl_text}} - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {{dcl_text}} {% trans 'account activation' %} -
-

- {% blocktrans %} - You can activate your {{dcl_text}} account by clicking here.

- You can also copy and paste the following link into the address bar of your browser and follow the link in order to activate your datacenterlight account.
- {{base_url}}{{activation_link}} - {% endblocktrans %} -

 
-
-
-
- - -
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
-
-
-
- - - +{% block email_head %} + {{dcl_text}} {% trans 'account activation' %} +{% endblock %} +{% block email_body %} +{% blocktrans %} +You can activate your Data Center Light account by clicking here.
+You can also copy and paste the following link into the address bar of your browser
+to activate your Data Center Light account.
+{{base_url}}{{activation_link}} +{% endblocktrans %} +{% endblock %} From f4726954b8213ab61cfc4c7d99e5dc9695a054a4 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 12:35:01 +0530 Subject: [PATCH 04/39] Removed Raleway font --- .../datacenterlight/emails/base_email.html | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.html b/datacenterlight/templates/datacenterlight/emails/base_email.html index ae279731..193e8fac 100644 --- a/datacenterlight/templates/datacenterlight/emails/base_email.html +++ b/datacenterlight/templates/datacenterlight/emails/base_email.html @@ -3,14 +3,14 @@ + style="font-family: 'Lato', 'sans-serif' !important;"> {{dcl_text}} + style="font-family: 'Lato', 'sans-serif' !important; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; color: white; margin: 0;"> - + style="border-collapse: collapse !important; min-width: 600px; font-family: 'Lato', 'sans-serif' !important;"> +
-
+
- + style="border-collapse: collapse !important; font-family: 'Lato', 'sans-serif' !important; background: transparent;"> +
-
+
- + style="border-collapse: collapse !important; font-family: 'Lato', 'sans-serif' !important;"> + @@ -120,33 +120,33 @@ - +
logo + style="max-width: 600px; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; font-family: 'Lato', 'sans-serif' !important; border: none;">
-
+
- + style="border-collapse: collapse !important; font-family: 'Lato', 'sans-serif' !important;"> + - + - + @@ -154,18 +154,18 @@ - +
{% block email_head %} {% endblock %}

{% block email_body %} {% endblock %}

 
-
+
- - +
+
{% trans 'Your' %} {{dcl_text}} {% trans 'team' %}
+ style="font-family: 'Lato', 'sans-serif' !important;">
From aecdff2ab7e2f7b4747a9ac2edd530dcfd3d6125 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 12:47:44 +0530 Subject: [PATCH 05/39] Made into a single text -- Your Data Center Light Team --- .../templates/datacenterlight/emails/base_email.html | 4 +--- .../templates/datacenterlight/emails/base_email.txt | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.html b/datacenterlight/templates/datacenterlight/emails/base_email.html index 193e8fac..be8479d9 100644 --- a/datacenterlight/templates/datacenterlight/emails/base_email.html +++ b/datacenterlight/templates/datacenterlight/emails/base_email.html @@ -163,9 +163,7 @@ style="border-collapse: collapse !important; font-family: 'Lato', 'sans-serif' !important;">
{% trans 'Your' %} {{dcl_text}} {% - trans 'team' %}
+ align="left">{% trans 'Your Data Center Light Team' %}
diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.txt b/datacenterlight/templates/datacenterlight/emails/base_email.txt index f0abda8f..ddf9b9cf 100644 --- a/datacenterlight/templates/datacenterlight/emails/base_email.txt +++ b/datacenterlight/templates/datacenterlight/emails/base_email.txt @@ -6,4 +6,4 @@ {% block email_body %} {% endblock %} -{% trans 'Your' %} {{dcl_text}} {% trans 'team' %} +{% trans 'Your Data Center Light Team' %} From eb79251fc013d365f762c06aae337d5115141ba4 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 13:25:47 +0530 Subject: [PATCH 06/39] Added translation and refactored user activation txt email --- .../locale/de/LC_MESSAGES/django.po | 45 +++++++++---------- .../emails/user_activation.html | 2 +- .../emails/user_activation.txt | 9 ++-- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 80d88c04..cdffc92f 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 03:08+0530\n" +"POT-Creation-Date: 2017-09-02 07:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -102,6 +102,9 @@ msgstr "" msgid "SUBMIT" msgstr "ABSENDEN" +msgid "Your Data Center Light Team" +msgstr "Dein Data Center Light Team" + msgid "Thank you for your request." msgstr "Vielen Dank für Ihre Anfrage." @@ -125,34 +128,24 @@ msgstr "" msgid "Thank you!" msgstr "Vielen Dank!" -msgid "account activation" -msgstr "Accountaktivierung" +msgid "Account Activation" +msgstr "Account Aktivierung" #, python-format msgid "" "\n" -" You can activate your %(dcl_text)s account by clicking here.

\n" -" You can also copy and paste the following link into the " -"address bar of your browser and follow the link in order to activate your " -"datacenterlight account.
\n" -" %(base_url)s%(activation_link)s\n" -" " +"You can activate your Data Center Light account by clicking here.
\n" +"You can also copy and paste the following link into the address bar of your " +"browser
\n" +"to activate your Data Center Light account.
\n" +"%(base_url)s%(activation_link)s\n" msgstr "" "\n" -" Klicke hier " -"um deinen %(dcl_text)s zu aktivieren.

\n" -" Oder kopiere den folgenden Link in die Adressleiste deines " -"Browsers und folge dann dem Link um deinen %(dcl_text)s Account zu " -"aktivieren.
\n" -" %(base_url)s%(activation_link)s\n" -" " - -msgid "Your" -msgstr "Dein" - -msgid "team" -msgstr "Team" +"Klicke hier " +"um deinen Data Center Light Account zu aktivieren oder kopiere den folgenden " +"Link in die Adressleiste deines Browsers.
\n" +"%(base_url)s%(activation_link)s\n" #, python-format msgid "" @@ -481,6 +474,12 @@ msgstr "ist kein gültiger Name" msgid "is not a proper email" msgstr "ist keine gültige E-Mailadresse" +#~ msgid "Your" +#~ msgstr "Dein" + +#~ msgid "team" +#~ msgstr "Team" + #~ msgid "Questions?" #~ msgstr "Fragen?" diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index 1f0df691..ed2753a3 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -2,7 +2,7 @@ {% load static from staticfiles %} {% load i18n %} {% block email_head %} - {{dcl_text}} {% trans 'account activation' %} + {{dcl_text}} {% trans 'Account Activation' %} {% endblock %} {% block email_body %} {% blocktrans %} diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.txt b/datacenterlight/templates/datacenterlight/emails/user_activation.txt index e40ef956..881e8087 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.txt +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.txt @@ -1,11 +1,14 @@ +{% extends "datacenterlight/emails/base_email.txt" %} {% load static from staticfiles %} {% load i18n %} -{{dcl_text}} {% trans 'account activation' %} +{% block email_head %} + {{dcl_text}} {% trans 'Account Activation' %} +{% endblock %} +{% block email_body %} {% blocktrans %} Hi, You can activate your {{dcl_text}} account by clicking here {{base_url}}{{activation_link}} {% endblocktrans %} - -{% trans 'Your' %} {{dcl_text}} {% trans 'team' %} +{% endblock %} From 75611deaddb7712dc7c4e340d3f14c22c44b2992 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 13:32:08 +0530 Subject: [PATCH 07/39] Further refactored user activation email --- datacenterlight/templates/datacenterlight/emails/base_email.txt | 2 -- .../templates/datacenterlight/emails/user_activation.html | 2 +- .../templates/datacenterlight/emails/user_activation.txt | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.txt b/datacenterlight/templates/datacenterlight/emails/base_email.txt index ddf9b9cf..46fd0730 100644 --- a/datacenterlight/templates/datacenterlight/emails/base_email.txt +++ b/datacenterlight/templates/datacenterlight/emails/base_email.txt @@ -2,8 +2,6 @@ {% load i18n %} {% block email_head %} {% endblock %} - {% block email_body %} {% endblock %} - {% trans 'Your Data Center Light Team' %} diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index ed2753a3..24c0d040 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -2,7 +2,7 @@ {% load static from staticfiles %} {% load i18n %} {% block email_head %} - {{dcl_text}} {% trans 'Account Activation' %} +{{dcl_text}} {% trans 'Account Activation' %} {% endblock %} {% block email_body %} {% blocktrans %} diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.txt b/datacenterlight/templates/datacenterlight/emails/user_activation.txt index 881e8087..d626bc8f 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.txt +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.txt @@ -2,7 +2,7 @@ {% load static from staticfiles %} {% load i18n %} {% block email_head %} - {{dcl_text}} {% trans 'Account Activation' %} +{{dcl_text}} {% trans 'Account Activation' %} {% endblock %} {% block email_body %} From cf83a67d51d6966a360425f736301e28aec17717 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 14:17:08 +0530 Subject: [PATCH 08/39] Further refactored to base_email_datacenterlight.html --- .../templates/datacenterlight/emails/base_email.html | 4 +++- .../datacenterlight/emails/base_email_datacenterlight.html | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.html b/datacenterlight/templates/datacenterlight/emails/base_email.html index be8479d9..b65f06aa 100644 --- a/datacenterlight/templates/datacenterlight/emails/base_email.html +++ b/datacenterlight/templates/datacenterlight/emails/base_email.html @@ -163,7 +163,9 @@ style="border-collapse: collapse !important; font-family: 'Lato', 'sans-serif' !important;">
{% trans 'Your Data Center Light Team' %} + align="left"> + {% block email_tail %} + {% endblock %}
diff --git a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html new file mode 100644 index 00000000..fbe5b4ff --- /dev/null +++ b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html @@ -0,0 +1,6 @@ +{% extends "datacenterlight/emails/base_email.html" %} +{% load static from staticfiles %} +{% load i18n %} +{% block email_tail %} +{% trans 'Your Data Center Light Team' %} +{% endblock %} From 61988ae27b92f178d53cb69a277234fc668537be Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 14:24:23 +0530 Subject: [PATCH 09/39] Renamed base_email to base_email_datacenterlight --- .../datacenterlight/emails/base_email.html | 178 ------------------ ...ail.txt => base_email_datacenterlight.txt} | 0 2 files changed, 178 deletions(-) delete mode 100644 datacenterlight/templates/datacenterlight/emails/base_email.html rename datacenterlight/templates/datacenterlight/emails/{base_email.txt => base_email_datacenterlight.txt} (100%) diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.html b/datacenterlight/templates/datacenterlight/emails/base_email.html deleted file mode 100644 index b65f06aa..00000000 --- a/datacenterlight/templates/datacenterlight/emails/base_email.html +++ /dev/null @@ -1,178 +0,0 @@ -{% load static from staticfiles %} -{% load i18n %} - - - - - - - {{dcl_text}} - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {% block email_head %} - {% endblock %} -
-

- {% block email_body %} - {% endblock %} -

  -
-
-
-
- - - - -
- {% block email_tail %} - {% endblock %} -
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/base_email.txt b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt similarity index 100% rename from datacenterlight/templates/datacenterlight/emails/base_email.txt rename to datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt From ede949004e6e3dc3ae3d372fb38bd5aa09032d92 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 14:28:18 +0530 Subject: [PATCH 10/39] Fixed an incorrect template name --- .../emails/base_email_datacenterlight.html | 178 +++++++++++++++++- .../emails/user_activation.txt | 2 +- 2 files changed, 175 insertions(+), 5 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html index fbe5b4ff..be8479d9 100644 --- a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html +++ b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html @@ -1,6 +1,176 @@ -{% extends "datacenterlight/emails/base_email.html" %} {% load static from staticfiles %} {% load i18n %} -{% block email_tail %} -{% trans 'Your Data Center Light Team' %} -{% endblock %} + + + + + + + {{dcl_text}} + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + + + +
+ logo + +
+
+ +
+
+
+
+ + + + + + + + + + +
+ {% block email_head %} + {% endblock %} +
+

+ {% block email_body %} + {% endblock %} +

  +
+
+
+
+ + + + +
{% trans 'Your Data Center Light Team' %} +
+
+
+ + + diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.txt b/datacenterlight/templates/datacenterlight/emails/user_activation.txt index d626bc8f..bae6789a 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.txt +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.txt @@ -1,4 +1,4 @@ -{% extends "datacenterlight/emails/base_email.txt" %} +{% extends "datacenterlight/emails/base_email_datacenterlight.txt" %} {% load static from staticfiles %} {% load i18n %} {% block email_head %} From 5381e0fa6759465b02e48f4031c1e5fad970ad4f Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 14:30:10 +0530 Subject: [PATCH 11/39] Fixed another incorrect template --- .../templates/datacenterlight/emails/user_activation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index 24c0d040..955eed18 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -1,4 +1,4 @@ -{% extends "datacenterlight/emails/base_email.html" %} +{% extends "datacenterlight/emails/base_email_datacenterlight.html" %} {% load static from staticfiles %} {% load i18n %} {% block email_head %} From 7c70ee637a63cb34ae380f7e09f8cf8416d3e87b Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 15:56:17 +0530 Subject: [PATCH 12/39] Updated password reset template --- .../hosting/emails/password_reset_email.html | 27 ++++++++++--------- .../hosting/emails/password_reset_email.txt | 27 ++++++++++--------- utils/views.py | 12 +++------ 3 files changed, 32 insertions(+), 34 deletions(-) diff --git a/hosting/templates/hosting/emails/password_reset_email.html b/hosting/templates/hosting/emails/password_reset_email.html index 682834f5..192d043c 100644 --- a/hosting/templates/hosting/emails/password_reset_email.html +++ b/hosting/templates/hosting/emails/password_reset_email.html @@ -1,13 +1,14 @@ -{% load i18n %}{% autoescape off %} -{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %} - -{% trans "Please go to the following page and choose a new password:" %} - {% block reset_link %} - {{ base_url }}{% url 'hosting:reset_password_confirm' uidb64=uid token=token %} - {% endblock %} - -{% trans "Thanks for using our site!" %} - -{% blocktrans %}The {{ site_name }} team{% endblocktrans %} - -{% endautoescape %} \ No newline at end of file +{% extends "datacenterlight/emails/base_email_datacenterlight.html" %} +{% load i18n %} +{% block email_head %} +{% trans 'Password Reset' %} +{% endblock %} +{% block email_body %} +{% url 'hosting:reset_password_confirm' uidb64=uid token=token as password_reset_url %} +{% blocktrans %} +You're receiving this email because you requested a password reset for your user account at {{site_name}}. +Please go to the following page and choose a new password: {{base_url}}{{ password_reset_url }} +If you didn't request a new password, ignore this e-mail. +Thank you! +{% endblocktrans %} +{% endblock %} diff --git a/hosting/templates/hosting/emails/password_reset_email.txt b/hosting/templates/hosting/emails/password_reset_email.txt index 682834f5..67ac9a08 100644 --- a/hosting/templates/hosting/emails/password_reset_email.txt +++ b/hosting/templates/hosting/emails/password_reset_email.txt @@ -1,13 +1,14 @@ -{% load i18n %}{% autoescape off %} -{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %} - -{% trans "Please go to the following page and choose a new password:" %} - {% block reset_link %} - {{ base_url }}{% url 'hosting:reset_password_confirm' uidb64=uid token=token %} - {% endblock %} - -{% trans "Thanks for using our site!" %} - -{% blocktrans %}The {{ site_name }} team{% endblocktrans %} - -{% endautoescape %} \ No newline at end of file +{% extends "datacenterlight/emails/base_email_datacenterlight.txt" %} +{% load i18n %} +{% block email_head %} +{% trans 'Password Reset' %} +{% endblock %} +{% block email_body %} +{% url 'hosting:reset_password_confirm' uidb64=uid token=token as password_reset_url %} +{% blocktrans with amount=article.price%} +You're receiving this email because you requested a password reset for your user account at {{site_name}}. +Please go to the following page and choose a new password: {{base_url}}{{ password_reset_url }} +If you didn't request a new password, ignore this e-mail. +Thank you! +{% endblocktrans %} +{% endblock %} diff --git a/utils/views.py b/utils/views.py index 039e08d8..011a8491 100644 --- a/utils/views.py +++ b/utils/views.py @@ -1,11 +1,12 @@ from django.views.generic import FormView, CreateView from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode +from django.conf import settings from django.contrib import messages from django.contrib.auth.tokens import default_token_generator from django.utils.encoding import force_bytes from django.http import HttpResponseRedirect from django.contrib.auth import authenticate, login - +from django.utils.translation import ugettext_lazy as _ from membership.models import CustomUser from .mailer import BaseEmail @@ -65,10 +66,8 @@ class LoginViewMixin(FormView): class PasswordResetViewMixin(FormView): # template_name = 'hosting/reset_password.html' # form_class = PasswordResetRequestForm - success_message = "The link to reset your email has been sent to your email" + success_message = _("The link to reset your email has been sent to your email") site = '' - success_message = "Thank you! You will shortly receive a password reset mail from us" - # success_url = reverse_lazy('hosting:login') def test_generate_email_context(self, user): context = { @@ -82,12 +81,9 @@ class PasswordResetViewMixin(FormView): return context def form_valid(self, form): - email = form.cleaned_data.get('email') user = CustomUser.objects.get(email=email) - messages.add_message(self.request, messages.SUCCESS, self.success_message) - context = self.test_generate_email_context(user) email_data = { 'subject': 'Password Reset', @@ -97,7 +93,7 @@ class PasswordResetViewMixin(FormView): 'template_path': self.template_email_path } if self.site == 'dcl': - email_data['from_address'] = '(Data Center Light) Data Center Light Support ' + email_data['from_address'] = settings.DCL_SUPPORT_FROM_ADDRESS email = BaseEmail(**email_data) email.send() From b4ba882c9cc4c738c9cc4650c2714870f93a074a Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:01:39 +0530 Subject: [PATCH 13/39] Added password reset email translation --- hosting/locale/de/LC_MESSAGES/django.po | 28 ++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index f905d905..8f0af274 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 03:08+0530\n" +"POT-Creation-Date: 2017-09-02 10:28+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -193,21 +193,25 @@ msgstr "Meine Einstellungen" msgid "Support / Contact" msgstr "Support / Kontakt" +msgid "Password Reset" +msgstr "Passwort zurücksetzen" + #, python-format msgid "" +"\n" "You're receiving this email because you requested a password reset for your " -"user account at %(site_name)s." -msgstr "" - -msgid "Please go to the following page and choose a new password:" -msgstr "" - -msgid "Thanks for using our site!" -msgstr "" - -#, python-format -msgid "The %(site_name)s team" +"user account at %(site_name)s.\n" +"Please go to the following page and choose a new password: %(base_url)s" +"%(password_reset_url)s\n" +"If you didn't request a new password, ignore this e-mail.\n" +"Thank you!\n" msgstr "" +"\n" +"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei " +"Data Center Light zurücksetzen möchtest.\n" +"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s" +"Solltest du kein neues Passwort angefordert haben, dann ignoriere diese E-Mail.\n" +"Dankeschön!" msgid "Don't have an account yet ? " msgstr "Besitzt du kein Benutzerkonto?" From 00e4ae5b768cb1fcc22756d8f5610df04ccf66a9 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:03:39 +0530 Subject: [PATCH 14/39] Added missing new line character --- hosting/locale/de/LC_MESSAGES/django.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 8f0af274..e02f598e 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 10:28+0000\n" +"POT-Creation-Date: 2017-09-02 10:32+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -207,11 +207,11 @@ msgid "" "Thank you!\n" msgstr "" "\n" -"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei " -"Data Center Light zurücksetzen möchtest.\n" -"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s" -"Solltest du kein neues Passwort angefordert haben, dann ignoriere diese E-Mail.\n" -"Dankeschön!" +"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei Data " +"Center Light zurücksetzen möchtest.\n" +"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s Solltest " +"du kein neues Passwort angefordert haben, dann ignoriere diese E-Mail.\n" +"Dankeschön!\n" msgid "Don't have an account yet ? " msgstr "Besitzt du kein Benutzerkonto?" From 22f07837e05657cf69025073a2248d063e81181c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:05:24 +0530 Subject: [PATCH 15/39] Added missing password_reset_url --- hosting/locale/de/LC_MESSAGES/django.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index e02f598e..58893523 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -209,7 +209,7 @@ msgstr "" "\n" "Du erhälst diese E-Mail da du dein Passwort für deinen Account bei Data " "Center Light zurücksetzen möchtest.\n" -"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s Solltest " +"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s%(password_reset_url)s Solltest " "du kein neues Passwort angefordert haben, dann ignoriere diese E-Mail.\n" "Dankeschön!\n" From f701f10e24ef7f55539e80be612c400cbe39021c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:07:05 +0530 Subject: [PATCH 16/39] Added missing site_name --- hosting/locale/de/LC_MESSAGES/django.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 58893523..ef35eab6 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -207,8 +207,8 @@ msgid "" "Thank you!\n" msgstr "" "\n" -"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei Data " -"Center Light zurücksetzen möchtest.\n" +"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei %(site_name)s " +"zurücksetzen möchtest.\n" "Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s%(password_reset_url)s Solltest " "du kein neues Passwort angefordert haben, dann ignoriere diese E-Mail.\n" "Dankeschön!\n" From 1c426239649f1cfaaaa166ebd54703a7ef51c63a Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:24:25 +0530 Subject: [PATCH 17/39] Fixed some password reset email translation issues --- hosting/locale/de/LC_MESSAGES/django.po | 29 +++++++++++++++---- .../hosting/emails/password_reset_email.html | 6 ++-- .../hosting/emails/password_reset_email.txt | 7 ++--- utils/views.py | 2 +- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index ef35eab6..fc9f9765 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 10:32+0000\n" +"POT-Creation-Date: 2017-09-02 10:50+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -200,17 +200,34 @@ msgstr "Passwort zurücksetzen" msgid "" "\n" "You're receiving this email because you requested a password reset for your " +"user account at %(site_name)s.
\n" +"Please go to the following page and choose a new password: %(base_url)s" +"%(password_reset_url)s
\n" +"If you didn't request a new password, ignore this e-mail.
\n" +"Thank you!\n" +msgstr "" +"\n" +"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei " +"%(site_name)s zurücksetzen möchtest.
\n" +"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s" +"%(password_reset_url)s Solltest du kein neues Passwort angefordert haben, " +"dann ignoriere diese E-Mail.
\n" +"Dankeschön!\n" + +#, python-format +msgid "" +"You're receiving this email because you requested a password reset for your " "user account at %(site_name)s.\n" "Please go to the following page and choose a new password: %(base_url)s" "%(password_reset_url)s\n" "If you didn't request a new password, ignore this e-mail.\n" "Thank you!\n" msgstr "" -"\n" -"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei %(site_name)s " -"zurücksetzen möchtest.\n" -"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s%(password_reset_url)s Solltest " -"du kein neues Passwort angefordert haben, dann ignoriere diese E-Mail.\n" +"Du erhälst diese E-Mail da du dein Passwort für deinen Account bei " +"%(site_name)s zurücksetzen möchtest.\n" +"Bitte folge diesem Link und wähle ein neues Passwort: %(base_url)s" +"%(password_reset_url)s Solltest du kein neues Passwort angefordert haben, " +"dann ignoriere diese E-Mail.\n" "Dankeschön!\n" msgid "Don't have an account yet ? " diff --git a/hosting/templates/hosting/emails/password_reset_email.html b/hosting/templates/hosting/emails/password_reset_email.html index 192d043c..b83a08f2 100644 --- a/hosting/templates/hosting/emails/password_reset_email.html +++ b/hosting/templates/hosting/emails/password_reset_email.html @@ -6,9 +6,9 @@ {% block email_body %} {% url 'hosting:reset_password_confirm' uidb64=uid token=token as password_reset_url %} {% blocktrans %} -You're receiving this email because you requested a password reset for your user account at {{site_name}}. -Please go to the following page and choose a new password: {{base_url}}{{ password_reset_url }} -If you didn't request a new password, ignore this e-mail. +You're receiving this email because you requested a password reset for your user account at {{site_name}}.
+Please go to the following page and choose a new password: {{base_url}}{{ password_reset_url }}
+If you didn't request a new password, ignore this e-mail.
Thank you! {% endblocktrans %} {% endblock %} diff --git a/hosting/templates/hosting/emails/password_reset_email.txt b/hosting/templates/hosting/emails/password_reset_email.txt index 67ac9a08..769166ed 100644 --- a/hosting/templates/hosting/emails/password_reset_email.txt +++ b/hosting/templates/hosting/emails/password_reset_email.txt @@ -1,12 +1,9 @@ {% extends "datacenterlight/emails/base_email_datacenterlight.txt" %} {% load i18n %} -{% block email_head %} -{% trans 'Password Reset' %} -{% endblock %} +{% block email_head %}{% trans 'Password Reset' %}{% endblock %} {% block email_body %} {% url 'hosting:reset_password_confirm' uidb64=uid token=token as password_reset_url %} -{% blocktrans with amount=article.price%} -You're receiving this email because you requested a password reset for your user account at {{site_name}}. +{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{site_name}}. Please go to the following page and choose a new password: {{base_url}}{{ password_reset_url }} If you didn't request a new password, ignore this e-mail. Thank you! diff --git a/utils/views.py b/utils/views.py index 011a8491..8aea6d5b 100644 --- a/utils/views.py +++ b/utils/views.py @@ -86,7 +86,7 @@ class PasswordResetViewMixin(FormView): messages.add_message(self.request, messages.SUCCESS, self.success_message) context = self.test_generate_email_context(user) email_data = { - 'subject': 'Password Reset', + 'subject': _('Password Reset'), 'to': email, 'context': context, 'template_name': 'password_reset_email', From 2276533185fa7ebf5998222042bf1e021580d91d Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:36:20 +0530 Subject: [PATCH 18/39] Reformatted utils/views.py and added a condition to DCL_TEXT in passoword reset email --- utils/views.py | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/utils/views.py b/utils/views.py index 8aea6d5b..8198a01c 100644 --- a/utils/views.py +++ b/utils/views.py @@ -1,16 +1,16 @@ -from django.views.generic import FormView, CreateView -from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.conf import settings from django.contrib import messages -from django.contrib.auth.tokens import default_token_generator -from django.utils.encoding import force_bytes -from django.http import HttpResponseRedirect from django.contrib.auth import authenticate, login +from django.contrib.auth.tokens import default_token_generator +from django.http import HttpResponseRedirect +from django.utils.encoding import force_bytes +from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.utils.translation import ugettext_lazy as _ -from membership.models import CustomUser +from django.views.generic import FormView, CreateView -from .mailer import BaseEmail +from membership.models import CustomUser from .forms import SetPasswordForm +from .mailer import BaseEmail class SignupViewMixin(CreateView): @@ -18,8 +18,8 @@ class SignupViewMixin(CreateView): success_url = None def get_success_url(self): - - next_url = self.request.POST.get('next') if self.request.POST.get('next')\ + next_url = self.request.POST.get('next') if self.request.POST.get( + 'next') \ else self.success_url return next_url @@ -66,7 +66,8 @@ class LoginViewMixin(FormView): class PasswordResetViewMixin(FormView): # template_name = 'hosting/reset_password.html' # form_class = PasswordResetRequestForm - success_message = _("The link to reset your email has been sent to your email") + success_message = _( + "The link to reset your email has been sent to your email") site = '' def test_generate_email_context(self, user): @@ -74,8 +75,9 @@ class PasswordResetViewMixin(FormView): 'user': user, 'token': default_token_generator.make_token(user), 'uid': urlsafe_base64_encode(force_bytes(user.pk)), - 'site_name': 'ungleich', - 'base_url': "{0}://{1}".format(self.request.scheme, self.request.get_host()) + 'site_name': 'ungleich' if self.site != 'dcl' else settings.DCL_TEXT, + 'base_url': "{0}://{1}".format(self.request.scheme, + self.request.get_host()) } return context @@ -83,7 +85,8 @@ class PasswordResetViewMixin(FormView): def form_valid(self, form): email = form.cleaned_data.get('email') user = CustomUser.objects.get(email=email) - messages.add_message(self.request, messages.SUCCESS, self.success_message) + messages.add_message(self.request, messages.SUCCESS, + self.success_message) context = self.test_generate_email_context(user) email_data = { 'subject': _('Password Reset'), @@ -103,6 +106,7 @@ class PasswordResetViewMixin(FormView): class PasswordResetConfirmViewMixin(FormView): # template_name = 'hosting/confirm_reset_password.html' form_class = SetPasswordForm + # success_url = reverse_lazy('hosting:login') def post(self, request, uidb64=None, token=None, *arg, **kwargs): @@ -114,7 +118,8 @@ class PasswordResetConfirmViewMixin(FormView): form = self.form_class(request.POST) - if user is not None and default_token_generator.check_token(user, token): + if user is not None and default_token_generator.check_token(user, + token): if form.is_valid(): new_password = form.cleaned_data['new_password2'] user.set_password(new_password) @@ -122,11 +127,13 @@ class PasswordResetConfirmViewMixin(FormView): messages.success(request, 'Password has been reset.') return self.form_valid(form) else: - messages.error(request, 'Password reset has not been successful.') + messages.error(request, + 'Password reset has not been successful.') form.add_error(None, 'Password reset has not been successful.') return self.form_invalid(form) else: - messages.error(request, 'The reset password link is no longer valid.') + messages.error(request, + 'The reset password link is no longer valid.') form.add_error(None, 'The reset password link is no longer valid.') return self.form_invalid(form) From 7d12eff9be0b675152ea236ab96f0bf101607b41 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:50:09 +0530 Subject: [PATCH 19/39] Added translations and reformatted code --- hosting/locale/de/LC_MESSAGES/django.po | 11 ++- hosting/views.py | 115 ++++++++++++++---------- utils/views.py | 12 +-- 3 files changed, 83 insertions(+), 55 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index fc9f9765..8ee04632 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 10:50+0000\n" +"POT-Creation-Date: 2017-09-02 11:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -523,6 +523,15 @@ msgstr "Du kannst dich nun" msgid "Sorry. Your request is invalid." msgstr "Entschuldigung, deine Anfrage ist ungültig." +msgid "Password has been reset." +msgstr "" + +msgid "Password reset has not been successful." +msgstr "" + +msgid "The reset password link is no longer valid." +msgstr "" + msgid "Invalid credit card" msgstr "Ungültige Kreditkarte" diff --git a/hosting/views.py b/hosting/views.py index 08f0862e..a5743e44 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1,40 +1,41 @@ import uuid -from django.core.files.base import ContentFile - -from oca.pool import WrongNameError, WrongIdError -from django.shortcuts import render -from django.http import Http404 -from django.core.urlresolvers import reverse_lazy, reverse -from django.contrib.auth.mixins import LoginRequiredMixin -from django.views.generic import View, CreateView, FormView, ListView, DetailView, \ - DeleteView, TemplateView, UpdateView -from django.http import HttpResponseRedirect -from django.contrib import messages from django.conf import settings -from django.shortcuts import redirect -from django.utils.http import urlsafe_base64_decode +from django.contrib import messages +from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.tokens import default_token_generator - -from guardian.mixins import PermissionRequiredMixin -from stored_messages.settings import stored_messages_settings -from stored_messages.models import Message -from stored_messages.api import mark_read +from django.core.files.base import ContentFile +from django.core.urlresolvers import reverse_lazy, reverse +from django.http import Http404 +from django.http import HttpResponseRedirect +from django.shortcuts import redirect +from django.shortcuts import render +from django.utils.http import urlsafe_base64_decode from django.utils.safestring import mark_safe +from django.utils.translation import ugettext_lazy as _ +from django.views.generic import View, CreateView, FormView, ListView, \ + DetailView, \ + DeleteView, TemplateView, UpdateView +from guardian.mixins import PermissionRequiredMixin +from oca.pool import WrongNameError, WrongIdError +from stored_messages.api import mark_read +from stored_messages.models import Message +from stored_messages.settings import stored_messages_settings from membership.models import CustomUser, StripeCustomer -from utils.stripe_utils import StripeUtils -from utils.forms import BillingAddressForm, PasswordResetRequestForm, UserBillingAddressForm -from utils.views import PasswordResetViewMixin, PasswordResetConfirmViewMixin, LoginViewMixin -from utils.mailer import BaseEmail -from .models import HostingOrder, HostingBill, HostingPlan, UserHostingKey -from .forms import HostingUserSignupForm, HostingUserLoginForm, UserHostingKeyForm, generate_ssh_key_name -from .mixins import ProcessVMSelectionMixin - from opennebula_api.models import OpenNebulaManager from opennebula_api.serializers import VirtualMachineSerializer, \ VirtualMachineTemplateSerializer -from django.utils.translation import ugettext_lazy as _ +from utils.forms import BillingAddressForm, PasswordResetRequestForm, \ + UserBillingAddressForm +from utils.mailer import BaseEmail +from utils.stripe_utils import StripeUtils +from utils.views import PasswordResetViewMixin, PasswordResetConfirmViewMixin, \ + LoginViewMixin +from .forms import HostingUserSignupForm, HostingUserLoginForm, \ + UserHostingKeyForm, generate_ssh_key_name +from .mixins import ProcessVMSelectionMixin +from .models import HostingOrder, HostingBill, HostingPlan, UserHostingKey CONNECTION_ERROR = "Your VMs cannot be displayed at the moment due to a backend \ connection error. please try again in a few minutes." @@ -296,12 +297,13 @@ class PasswordResetConfirmView(PasswordResetConfirmViewMixin): form = self.form_class(request.POST) - if user is not None and default_token_generator.check_token(user, token): + if user is not None and default_token_generator.check_token(user, + token): if form.is_valid(): new_password = form.cleaned_data['new_password2'] user.set_password(new_password) user.save() - messages.success(request, 'Password has been reset.') + messages.success(request, _('Password has been reset.')) # Change opennebula password opennebula_client.change_user_password(new_password) @@ -309,14 +311,15 @@ class PasswordResetConfirmView(PasswordResetConfirmViewMixin): return self.form_valid(form) else: messages.error( - request, 'Password reset has not been successful.') - form.add_error(None, 'Password reset has not been successful.') + request, _('Password reset has not been successful.')) + form.add_error(None, + _('Password reset has not been successful.')) return self.form_invalid(form) else: - messages.error( - request, 'The reset password link is no longer valid.') - form.add_error(None, 'The reset password link is no longer valid.') + error_msg = _('The reset password link is no longer valid.') + messages.error(request, _(error_msg)) + form.add_error(None, error_msg) return self.form_invalid(form) @@ -397,7 +400,8 @@ class SSHKeyListView(LoginRequiredMixin, ListView): def render_to_response(self, context, **response_kwargs): if not self.queryset: return HttpResponseRedirect(reverse('hosting:choice_ssh_keys')) - return super(SSHKeyListView, self).render_to_response(context, **response_kwargs) + return super(SSHKeyListView, self).render_to_response(context, + **response_kwargs) class SSHKeyChoiceView(LoginRequiredMixin, View): @@ -571,8 +575,10 @@ class PaymentVMView(LoginRequiredMixin, FormView): if not customer: msg = _("Invalid credit card") messages.add_message( - self.request, messages.ERROR, msg, extra_tags='make_charge_error') - return HttpResponseRedirect(reverse('hosting:payment') + '#payment_error') + self.request, messages.ERROR, msg, + extra_tags='make_charge_error') + return HttpResponseRedirect( + reverse('hosting:payment') + '#payment_error') # Create Billing Address billing_address = form.save() @@ -586,8 +592,10 @@ class PaymentVMView(LoginRequiredMixin, FormView): if not charge_response.get('response_object'): msg = charge_response.get('error') messages.add_message( - self.request, messages.ERROR, msg, extra_tags='make_charge_error') - return HttpResponseRedirect(reverse('hosting:payment') + '#payment_error') + self.request, messages.ERROR, msg, + extra_tags='make_charge_error') + return HttpResponseRedirect( + reverse('hosting:payment') + '#payment_error') charge = charge_response.get('response_object') @@ -595,7 +603,8 @@ class PaymentVMView(LoginRequiredMixin, FormView): manager = OpenNebulaManager(email=owner.email, password=owner.password) # Get user ssh key - if not UserHostingKey.objects.filter(user=self.request.user).exists(): + if not UserHostingKey.objects.filter( + user=self.request.user).exists(): context.update({ 'sshError': 'error', 'form': form @@ -647,7 +656,8 @@ class PaymentVMView(LoginRequiredMixin, FormView): context = { 'vm': vm, 'order': order, - 'base_url': "{0}://{1}".format(request.scheme, request.get_host()) + 'base_url': "{0}://{1}".format(request.scheme, + request.get_host()) } email_data = { @@ -661,13 +671,15 @@ class PaymentVMView(LoginRequiredMixin, FormView): email.send() return HttpResponseRedirect( - "{url}?{query_params}".format(url=reverse('hosting:orders', kwargs={'pk': order.id}), - query_params='page=payment')) + "{url}?{query_params}".format( + url=reverse('hosting:orders', kwargs={'pk': order.id}), + query_params='page=payment')) else: return self.form_invalid(form) -class OrdersHostingDetailView(PermissionRequiredMixin, LoginRequiredMixin, DetailView): +class OrdersHostingDetailView(PermissionRequiredMixin, LoginRequiredMixin, + DetailView): template_name = "hosting/order_detail.html" context_object_name = "order" login_url = reverse_lazy('hosting:login') @@ -775,7 +787,8 @@ class CreateVirtualMachinesView(LoginRequiredMixin, View): configuration_options = HostingPlan.get_serialized_configs() context = { - 'templates': VirtualMachineTemplateSerializer(templates, many=True).data, + 'templates': VirtualMachineTemplateSerializer(templates, + many=True).data, 'configuration_options': configuration_options, } except: @@ -846,7 +859,8 @@ class VirtualMachineView(LoginRequiredMixin, View): serializer = VirtualMachineSerializer(vm) context = { 'virtual_machine': serializer.data, - 'order': HostingOrder.objects.get(vm_id=serializer.data['vm_id']) + 'order': HostingOrder.objects.get( + vm_id=serializer.data['vm_id']) } except: pass @@ -877,7 +891,8 @@ class VirtualMachineView(LoginRequiredMixin, View): context = { 'vm': vm, - 'base_url': "{0}://{1}".format(self.request.scheme, self.request.get_host()) + 'base_url': "{0}://{1}".format(self.request.scheme, + self.request.get_host()) } email_data = { 'subject': 'Virtual machine plan canceled', @@ -897,7 +912,8 @@ class VirtualMachineView(LoginRequiredMixin, View): return HttpResponseRedirect(self.get_success_url()) -class HostingBillListView(PermissionRequiredMixin, LoginRequiredMixin, ListView): +class HostingBillListView(PermissionRequiredMixin, LoginRequiredMixin, + ListView): template_name = "hosting/bills.html" login_url = reverse_lazy('hosting:login') permission_required = ['view_hostingview'] @@ -907,7 +923,8 @@ class HostingBillListView(PermissionRequiredMixin, LoginRequiredMixin, ListView) ordering = '-id' -class HostingBillDetailView(PermissionRequiredMixin, LoginRequiredMixin, DetailView): +class HostingBillDetailView(PermissionRequiredMixin, LoginRequiredMixin, + DetailView): template_name = "hosting/bill_detail.html" login_url = reverse_lazy('hosting:login') permission_required = ['view_hostingview'] diff --git a/utils/views.py b/utils/views.py index 8198a01c..3150fa6d 100644 --- a/utils/views.py +++ b/utils/views.py @@ -124,16 +124,18 @@ class PasswordResetConfirmViewMixin(FormView): new_password = form.cleaned_data['new_password2'] user.set_password(new_password) user.save() - messages.success(request, 'Password has been reset.') + messages.success(request, _('Password has been reset.')) return self.form_valid(form) else: messages.error(request, - 'Password reset has not been successful.') - form.add_error(None, 'Password reset has not been successful.') + _('Password reset has not been successful.')) + form.add_error(None, + _('Password reset has not been successful.')) return self.form_invalid(form) else: messages.error(request, - 'The reset password link is no longer valid.') - form.add_error(None, 'The reset password link is no longer valid.') + _('The reset password link is no longer valid.')) + form.add_error(None, + _('The reset password link is no longer valid.')) return self.form_invalid(form) From 3b444b38b1d08ee9a2105723e2fa50701321e790 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 16:53:49 +0530 Subject: [PATCH 20/39] Regenerated dcl django.po --- datacenterlight/locale/de/LC_MESSAGES/django.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index cdffc92f..00391df9 100644 --- a/datacenterlight/locale/de/LC_MESSAGES/django.po +++ b/datacenterlight/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 07:47+0000\n" +"POT-Creation-Date: 2017-09-02 11:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -142,9 +142,9 @@ msgid "" "%(base_url)s%(activation_link)s\n" msgstr "" "\n" -"Klicke hier " -"um deinen Data Center Light Account zu aktivieren oder kopiere den folgenden " -"Link in die Adressleiste deines Browsers.
\n" +"Klicke hier um deinen Data " +"Center Light Account zu aktivieren oder kopiere den folgenden Link in die " +"Adressleiste deines Browsers.
\n" "%(base_url)s%(activation_link)s\n" #, python-format From 3a739f1cde47cdde1354af29a8c9f254da1836b3 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 17:23:10 +0530 Subject: [PATCH 21/39] Added utils django.po --- utils/locale/de/LC_MESSAGES/django.po | 784 ++++++++++++++++++++++++++ 1 file changed, 784 insertions(+) create mode 100644 utils/locale/de/LC_MESSAGES/django.po diff --git a/utils/locale/de/LC_MESSAGES/django.po b/utils/locale/de/LC_MESSAGES/django.po new file mode 100644 index 00000000..cd1d7d1b --- /dev/null +++ b/utils/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,784 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-02 11:50+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Andorra" +msgstr "" + +msgid "United Arab Emirates" +msgstr "" + +msgid "Afghanistan" +msgstr "" + +msgid "Antigua & Barbuda" +msgstr "" + +msgid "Anguilla" +msgstr "" + +msgid "Albania" +msgstr "" + +msgid "Armenia" +msgstr "" + +msgid "Netherlands Antilles" +msgstr "" + +msgid "Angola" +msgstr "" + +msgid "Antarctica" +msgstr "" + +msgid "Argentina" +msgstr "" + +msgid "American Samoa" +msgstr "" + +msgid "Austria" +msgstr "" + +msgid "Australia" +msgstr "" + +msgid "Aruba" +msgstr "" + +msgid "Azerbaijan" +msgstr "" + +msgid "Bosnia and Herzegovina" +msgstr "" + +msgid "Barbados" +msgstr "" + +msgid "Bangladesh" +msgstr "" + +msgid "Belgium" +msgstr "" + +msgid "Burkina Faso" +msgstr "" + +msgid "Bulgaria" +msgstr "" + +msgid "Bahrain" +msgstr "" + +msgid "Burundi" +msgstr "" + +msgid "Benin" +msgstr "" + +msgid "Bermuda" +msgstr "" + +msgid "Brunei Darussalam" +msgstr "" + +msgid "Bolivia" +msgstr "" + +msgid "Brazil" +msgstr "" + +msgid "Bahama" +msgstr "" + +msgid "Bhutan" +msgstr "" + +msgid "Bouvet Island" +msgstr "" + +msgid "Botswana" +msgstr "" + +msgid "Belarus" +msgstr "" + +msgid "Belize" +msgstr "" + +msgid "Canada" +msgstr "" + +msgid "Cocos (Keeling) Islands" +msgstr "" + +msgid "Central African Republic" +msgstr "" + +msgid "Congo" +msgstr "" + +msgid "Switzerland" +msgstr "" + +msgid "Ivory Coast" +msgstr "" + +msgid "Cook Iislands" +msgstr "" + +msgid "Chile" +msgstr "" + +msgid "Cameroon" +msgstr "" + +msgid "China" +msgstr "" + +msgid "Colombia" +msgstr "" + +msgid "Costa Rica" +msgstr "" + +msgid "Cuba" +msgstr "" + +msgid "Cape Verde" +msgstr "" + +msgid "Christmas Island" +msgstr "" + +msgid "Cyprus" +msgstr "" + +msgid "Czech Republic" +msgstr "" + +msgid "Germany" +msgstr "" + +msgid "Djibouti" +msgstr "" + +msgid "Denmark" +msgstr "" + +msgid "Dominica" +msgstr "" + +msgid "Dominican Republic" +msgstr "" + +msgid "Algeria" +msgstr "" + +msgid "Ecuador" +msgstr "" + +msgid "Estonia" +msgstr "" + +msgid "Egypt" +msgstr "" + +msgid "Western Sahara" +msgstr "" + +msgid "Eritrea" +msgstr "" + +msgid "Spain" +msgstr "" + +msgid "Ethiopia" +msgstr "" + +msgid "Finland" +msgstr "" + +msgid "Fiji" +msgstr "" + +msgid "Falkland Islands (Malvinas)" +msgstr "" + +msgid "Micronesia" +msgstr "" + +msgid "Faroe Islands" +msgstr "" + +msgid "France" +msgstr "" + +msgid "France, Metropolitan" +msgstr "" + +msgid "Gabon" +msgstr "" + +msgid "United Kingdom (Great Britain)" +msgstr "" + +msgid "Grenada" +msgstr "" + +msgid "Georgia" +msgstr "" + +msgid "French Guiana" +msgstr "" + +msgid "Ghana" +msgstr "" + +msgid "Gibraltar" +msgstr "" + +msgid "Greenland" +msgstr "" + +msgid "Gambia" +msgstr "" + +msgid "Guinea" +msgstr "" + +msgid "Guadeloupe" +msgstr "" + +msgid "Equatorial Guinea" +msgstr "" + +msgid "Greece" +msgstr "" + +msgid "South Georgia and the South Sandwich Islands" +msgstr "" + +msgid "Guatemala" +msgstr "" + +msgid "Guam" +msgstr "" + +msgid "Guinea-Bissau" +msgstr "" + +msgid "Guyana" +msgstr "" + +msgid "Hong Kong" +msgstr "" + +msgid "Heard & McDonald Islands" +msgstr "" + +msgid "Honduras" +msgstr "" + +msgid "Croatia" +msgstr "" + +msgid "Haiti" +msgstr "" + +msgid "Hungary" +msgstr "" + +msgid "Indonesia" +msgstr "" + +msgid "Ireland" +msgstr "" + +msgid "Israel" +msgstr "" + +msgid "India" +msgstr "" + +msgid "British Indian Ocean Territory" +msgstr "" + +msgid "Iraq" +msgstr "" + +msgid "Islamic Republic of Iran" +msgstr "" + +msgid "Iceland" +msgstr "" + +msgid "Italy" +msgstr "" + +msgid "Jamaica" +msgstr "" + +msgid "Jordan" +msgstr "" + +msgid "Japan" +msgstr "" + +msgid "Kenya" +msgstr "" + +msgid "Kyrgyzstan" +msgstr "" + +msgid "Cambodia" +msgstr "" + +msgid "Kiribati" +msgstr "" + +msgid "Comoros" +msgstr "" + +msgid "St. Kitts and Nevis" +msgstr "" + +msgid "Korea, Democratic People's Republic of" +msgstr "" + +msgid "Korea, Republic of" +msgstr "" + +msgid "Kuwait" +msgstr "" + +msgid "Cayman Islands" +msgstr "" + +msgid "Kazakhstan" +msgstr "" + +msgid "Lao People's Democratic Republic" +msgstr "" + +msgid "Lebanon" +msgstr "" + +msgid "Saint Lucia" +msgstr "" + +msgid "Liechtenstein" +msgstr "" + +msgid "Sri Lanka" +msgstr "" + +msgid "Liberia" +msgstr "" + +msgid "Lesotho" +msgstr "" + +msgid "Lithuania" +msgstr "" + +msgid "Luxembourg" +msgstr "" + +msgid "Latvia" +msgstr "" + +msgid "Libyan Arab Jamahiriya" +msgstr "" + +msgid "Morocco" +msgstr "" + +msgid "Monaco" +msgstr "" + +msgid "Moldova, Republic of" +msgstr "" + +msgid "Madagascar" +msgstr "" + +msgid "Marshall Islands" +msgstr "" + +msgid "Mali" +msgstr "" + +msgid "Mongolia" +msgstr "" + +msgid "Myanmar" +msgstr "" + +msgid "Macau" +msgstr "" + +msgid "Northern Mariana Islands" +msgstr "" + +msgid "Martinique" +msgstr "" + +msgid "Mauritania" +msgstr "" + +msgid "Monserrat" +msgstr "" + +msgid "Malta" +msgstr "" + +msgid "Mauritius" +msgstr "" + +msgid "Maldives" +msgstr "" + +msgid "Malawi" +msgstr "" + +msgid "Mexico" +msgstr "" + +msgid "Malaysia" +msgstr "" + +msgid "Mozambique" +msgstr "" + +msgid "Namibia" +msgstr "" + +msgid "New Caledonia" +msgstr "" + +msgid "Niger" +msgstr "" + +msgid "Norfolk Island" +msgstr "" + +msgid "Nigeria" +msgstr "" + +msgid "Nicaragua" +msgstr "" + +msgid "Netherlands" +msgstr "" + +msgid "Norway" +msgstr "" + +msgid "Nepal" +msgstr "" + +msgid "Nauru" +msgstr "" + +msgid "Niue" +msgstr "" + +msgid "New Zealand" +msgstr "" + +msgid "Oman" +msgstr "" + +msgid "Panama" +msgstr "" + +msgid "Peru" +msgstr "" + +msgid "French Polynesia" +msgstr "" + +msgid "Papua New Guinea" +msgstr "" + +msgid "Philippines" +msgstr "" + +msgid "Pakistan" +msgstr "" + +msgid "Poland" +msgstr "" + +msgid "St. Pierre & Miquelon" +msgstr "" + +msgid "Pitcairn" +msgstr "" + +msgid "Puerto Rico" +msgstr "" + +msgid "Portugal" +msgstr "" + +msgid "Palau" +msgstr "" + +msgid "Paraguay" +msgstr "" + +msgid "Qatar" +msgstr "" + +msgid "Reunion" +msgstr "" + +msgid "Romania" +msgstr "" + +msgid "Russian Federation" +msgstr "" + +msgid "Rwanda" +msgstr "" + +msgid "Saudi Arabia" +msgstr "" + +msgid "Solomon Islands" +msgstr "" + +msgid "Seychelles" +msgstr "" + +msgid "Sudan" +msgstr "" + +msgid "Sweden" +msgstr "" + +msgid "Singapore" +msgstr "" + +msgid "St. Helena" +msgstr "" + +msgid "Slovenia" +msgstr "" + +msgid "Svalbard & Jan Mayen Islands" +msgstr "" + +msgid "Slovakia" +msgstr "" + +msgid "Sierra Leone" +msgstr "" + +msgid "San Marino" +msgstr "" + +msgid "Senegal" +msgstr "" + +msgid "Somalia" +msgstr "" + +msgid "Suriname" +msgstr "" + +msgid "Sao Tome & Principe" +msgstr "" + +msgid "El Salvador" +msgstr "" + +msgid "Syrian Arab Republic" +msgstr "" + +msgid "Swaziland" +msgstr "" + +msgid "Turks & Caicos Islands" +msgstr "" + +msgid "Chad" +msgstr "" + +msgid "French Southern Territories" +msgstr "" + +msgid "Togo" +msgstr "" + +msgid "Thailand" +msgstr "" + +msgid "Tajikistan" +msgstr "" + +msgid "Tokelau" +msgstr "" + +msgid "Turkmenistan" +msgstr "" + +msgid "Tunisia" +msgstr "" + +msgid "Tonga" +msgstr "" + +msgid "East Timor" +msgstr "" + +msgid "Turkey" +msgstr "" + +msgid "Trinidad & Tobago" +msgstr "" + +msgid "Tuvalu" +msgstr "" + +msgid "Taiwan, Province of China" +msgstr "" + +msgid "Tanzania, United Republic of" +msgstr "" + +msgid "Ukraine" +msgstr "" + +msgid "Uganda" +msgstr "" + +msgid "United States Minor Outlying Islands" +msgstr "" + +msgid "United States of America" +msgstr "" + +msgid "Uruguay" +msgstr "" + +msgid "Uzbekistan" +msgstr "" + +msgid "Vatican City State (Holy See)" +msgstr "" + +msgid "St. Vincent & the Grenadines" +msgstr "" + +msgid "Venezuela" +msgstr "" + +msgid "British Virgin Islands" +msgstr "" + +msgid "United States Virgin Islands" +msgstr "" + +msgid "Viet Nam" +msgstr "" + +msgid "Vanuatu" +msgstr "" + +msgid "Wallis & Futuna Islands" +msgstr "" + +msgid "Samoa" +msgstr "" + +msgid "Yemen" +msgstr "" + +msgid "Mayotte" +msgstr "" + +msgid "Yugoslavia" +msgstr "" + +msgid "South Africa" +msgstr "" + +msgid "Zambia" +msgstr "" + +msgid "Zaire" +msgstr "" + +msgid "Zimbabwe" +msgstr "" + +msgid "Unknown or unspecified country" +msgstr "" + +msgid "Enter your name or company name" +msgstr "" + +msgid "Cardholder Name" +msgstr "" + +msgid "Street Address" +msgstr "" + +msgid "City" +msgstr "" + +msgid "Postal Code" +msgstr "" + +msgid "Country" +msgstr "" + +msgid "Street Building" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "Email" +msgstr "" + +msgid "Phone number" +msgstr "" + +msgid "Message" +msgstr "" + +msgid "The link to reset your email has been sent to your email" +msgstr "Der Link zum Zurücksetzen Ihrer E-Mail wurde an Ihre E-Mail gesendet" + +msgid "Password Reset" +msgstr "" + +msgid "Password has been reset." +msgstr "" + +msgid "Password reset has not been successful." +msgstr "" + +msgid "The reset password link is no longer valid." +msgstr "" From e38df305c4284689749c3ae6c394649ad758c55d Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 22:08:25 +0530 Subject: [PATCH 22/39] New VM email template updated --- hosting/locale/de/LC_MESSAGES/django.po | 31 +++- .../hosting/emails/new_booked_vm.html | 151 ++---------------- .../hosting/emails/new_booked_vm.txt | 150 ++--------------- hosting/views.py | 10 +- 4 files changed, 59 insertions(+), 283 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 8ee04632..86af85f3 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 11:16+0000\n" +"POT-Creation-Date: 2017-09-02 15:26+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -193,6 +193,31 @@ msgstr "Meine Einstellungen" msgid "Support / Contact" msgstr "Support / Kontakt" +#, python-format +msgid "" +"You have ordered a new virtual machine!
\n" +"Your order of [%(vm.name)s] has been charged.

\n" +"You can view your invoice by clicking the button below.

\n" +msgstr "" +"Du hast eine neue virtuelle Maschine bestellt!
\n" +"Deine Bestellung von [%(vm.name)s] wurde erhoben.

\n" +"Um die Rechnung zu sehen, klicke auf den Button unten.

\n" + +msgid "View Invoice" +msgstr "Zur Rechnung" + +#, python-format +msgid "" +"You have ordered a new virtual machine!\n" +"Your order of [%(vm.name)s] has been charged.\n" +"\n" +"You can view your invoice by clicking the link below.\n" +"\n" +msgstr "" +"Du hast eine neue virtuelle Maschine bestellt!\n" +"Deine Bestellung von [%(vm.name)s] wurde erhoben.\n\n" +"Um die Rechnung zu sehen, klicke auf den Button unten.\n\n" + msgid "Password Reset" msgstr "Passwort zurücksetzen" @@ -535,6 +560,10 @@ msgstr "" msgid "Invalid credit card" msgstr "Ungültige Kreditkarte" +#, python-brace-format +msgid "Your New VM {vm_name} at Data Center Light" +msgstr "Deine neue VM {vm_name} bei Data Center Light" + msgid "Confirm Order" msgstr "Bestellung Bestätigen" diff --git a/hosting/templates/hosting/emails/new_booked_vm.html b/hosting/templates/hosting/emails/new_booked_vm.html index 0f9b4f6e..34a500bb 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.html +++ b/hosting/templates/hosting/emails/new_booked_vm.html @@ -1,140 +1,13 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- You have booked a virtual machine! -
- Your virtual machine {{vm.name}} subscription has been charged, -
- we are going to contact you as soon your virtual machine has been activated. -
- You can view your invoice clicking on the button below. -
-
-View Invoice +{% extends "datacenterlight/emails/base_email_datacenterlight.html" %} +{% load i18n %} +{% block email_head %}{{page_header}}{% endblock %} +{% block email_body %} +{% url 'hosting:orders' order.id as order_url %} +{% blocktrans %}You have ordered a new virtual machine!
+Your order of [{{vm.name}}] has been charged.

+You can view your invoice by clicking the button below.

+{% endblocktrans %} + -
-
-
-
- - -
- ungleich
-
-
-
- - - +{% endblock %} diff --git a/hosting/templates/hosting/emails/new_booked_vm.txt b/hosting/templates/hosting/emails/new_booked_vm.txt index 0f9b4f6e..1e7f8aac 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.txt +++ b/hosting/templates/hosting/emails/new_booked_vm.txt @@ -1,140 +1,12 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- You have booked a virtual machine! -
- Your virtual machine {{vm.name}} subscription has been charged, -
- we are going to contact you as soon your virtual machine has been activated. -
- You can view your invoice clicking on the button below. -
- -
-
-
-
- - -
- ungleich
-
-
-
- - +{% extends "datacenterlight/emails/base_email_datacenterlight.txt" %} +{% load i18n %} +{% block email_head %}{{page_header}}{% endblock %} +{% block email_body %} +{% blocktrans %}You have ordered a new virtual machine! +Your order of [{{vm.name}}] has been charged. +You can view your invoice by clicking the link below. + +{% endblocktrans %} +{{ base_url }}{{order_url}} +{% endblock %} diff --git a/hosting/views.py b/hosting/views.py index a5743e44..d24f18f9 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -652,16 +652,18 @@ class PaymentVMView(LoginRequiredMixin, FormView): vm = VirtualMachineSerializer(manager.get_vm(vm_id)).data - # Send notification to ungleich as soon as VM has been booked + # Send notification to the user as soon as VM has been booked context = { 'vm': vm, 'order': order, 'base_url': "{0}://{1}".format(request.scheme, - request.get_host()) - + request.get_host()), + 'page_header': _( + 'Your New VM {vm_name} at Data Center Light'.format( + vm_name=vm.name)) } email_data = { - 'subject': 'New VM request', + 'subject': context.get('page_header'), 'to': request.user.email, 'context': context, 'template_name': 'new_booked_vm', From b5120040d33b526d2be2dfbac9136e53c5dd0c1b Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 2 Sep 2017 22:47:31 +0530 Subject: [PATCH 23/39] Fixed an error and from address in new vm email template --- hosting/templates/hosting/emails/new_booked_vm.html | 2 +- hosting/templates/hosting/emails/new_booked_vm.txt | 2 +- hosting/views.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hosting/templates/hosting/emails/new_booked_vm.html b/hosting/templates/hosting/emails/new_booked_vm.html index 34a500bb..00430dd5 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.html +++ b/hosting/templates/hosting/emails/new_booked_vm.html @@ -4,7 +4,7 @@ {% block email_body %} {% url 'hosting:orders' order.id as order_url %} {% blocktrans %}You have ordered a new virtual machine!
-Your order of [{{vm.name}}] has been charged.

+Your order of [{{vm|get_value_from_dict:'name'}}] has been charged.

You can view your invoice by clicking the button below.

{% endblocktrans %}
diff --git a/hosting/templates/hosting/emails/new_booked_vm.txt b/hosting/templates/hosting/emails/new_booked_vm.txt index 1e7f8aac..3c8b06ad 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.txt +++ b/hosting/templates/hosting/emails/new_booked_vm.txt @@ -3,7 +3,7 @@ {% block email_head %}{{page_header}}{% endblock %} {% block email_body %} {% blocktrans %}You have ordered a new virtual machine! -Your order of [{{vm.name}}] has been charged. +Your order of [{{vm|get_value_from_dict:'name'}}] has been charged. You can view your invoice by clicking the link below. diff --git a/hosting/views.py b/hosting/views.py index d24f18f9..465b8419 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -660,14 +660,15 @@ class PaymentVMView(LoginRequiredMixin, FormView): request.get_host()), 'page_header': _( 'Your New VM {vm_name} at Data Center Light'.format( - vm_name=vm.name)) + vm_name=vm.get('name'))) } email_data = { 'subject': context.get('page_header'), 'to': request.user.email, 'context': context, 'template_name': 'new_booked_vm', - 'template_path': 'hosting/emails/' + 'template_path': 'hosting/emails/', + 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, } email = BaseEmail(**email_data) email.send() From 50431542f8cac7fbe24f9136329e428be829f0f6 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sat, 2 Sep 2017 20:42:58 +0200 Subject: [PATCH 24/39] Corrected getting VM name in template --- hosting/templates/hosting/emails/new_booked_vm.html | 5 +++-- hosting/templates/hosting/emails/new_booked_vm.txt | 4 ++-- hosting/views.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hosting/templates/hosting/emails/new_booked_vm.html b/hosting/templates/hosting/emails/new_booked_vm.html index 00430dd5..864cf813 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.html +++ b/hosting/templates/hosting/emails/new_booked_vm.html @@ -3,8 +3,9 @@ {% block email_head %}{{page_header}}{% endblock %} {% block email_body %} {% url 'hosting:orders' order.id as order_url %} -{% blocktrans %}You have ordered a new virtual machine!
-Your order of [{{vm|get_value_from_dict:'name'}}] has been charged.

+{% blocktrans with vm.name as vm_name %}You have ordered a new virtual machine! +
+Your order of [{{vm_name}}] has been charged.

You can view your invoice by clicking the button below.

{% endblocktrans %}
diff --git a/hosting/templates/hosting/emails/new_booked_vm.txt b/hosting/templates/hosting/emails/new_booked_vm.txt index 3c8b06ad..3e90569d 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.txt +++ b/hosting/templates/hosting/emails/new_booked_vm.txt @@ -2,8 +2,8 @@ {% load i18n %} {% block email_head %}{{page_header}}{% endblock %} {% block email_body %} -{% blocktrans %}You have ordered a new virtual machine! -Your order of [{{vm|get_value_from_dict:'name'}}] has been charged. +{% blocktrans with vm.name as vm_name %}You have ordered a new virtual machine! +Your order of [{{vm_name}}] has been charged. You can view your invoice by clicking the link below. diff --git a/hosting/views.py b/hosting/views.py index 465b8419..128bd4db 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -668,7 +668,7 @@ class PaymentVMView(LoginRequiredMixin, FormView): 'context': context, 'template_name': 'new_booked_vm', 'template_path': 'hosting/emails/', - 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, + 'from_address': settings.DCL_SUPPORT_FROM_ADDRESS, } email = BaseEmail(**email_data) email.send() From 8f2655bda240e1a7e940f44b6a3f65ce710c2868 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sat, 2 Sep 2017 21:35:57 +0200 Subject: [PATCH 25/39] Getting vm name properly in hosting views --- hosting/locale/de/LC_MESSAGES/django.po | 23 +++++++++++++---------- hosting/views.py | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index 86af85f3..4a837fcc 100644 --- a/hosting/locale/de/LC_MESSAGES/django.po +++ b/hosting/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-09-02 15:26+0000\n" +"POT-Creation-Date: 2017-09-02 19:31+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -195,12 +195,13 @@ msgstr "Support / Kontakt" #, python-format msgid "" -"You have ordered a new virtual machine!
\n" -"Your order of [%(vm.name)s] has been charged.

\n" +"You have ordered a new virtual machine!\n" +"
\n" +"Your order of [%(vm_name)s] has been charged.

\n" "You can view your invoice by clicking the button below.

\n" msgstr "" "Du hast eine neue virtuelle Maschine bestellt!
\n" -"Deine Bestellung von [%(vm.name)s] wurde erhoben.

\n" +"Deine Bestellung von [%(vm_name)s] wurde erhoben.

\n" "Um die Rechnung zu sehen, klicke auf den Button unten.

\n" msgid "View Invoice" @@ -209,14 +210,16 @@ msgstr "Zur Rechnung" #, python-format msgid "" "You have ordered a new virtual machine!\n" -"Your order of [%(vm.name)s] has been charged.\n" +"Your order of [%(vm_name)s] has been charged.\n" "\n" "You can view your invoice by clicking the link below.\n" "\n" msgstr "" "Du hast eine neue virtuelle Maschine bestellt!\n" -"Deine Bestellung von [%(vm.name)s] wurde erhoben.\n\n" -"Um die Rechnung zu sehen, klicke auf den Button unten.\n\n" +"Deine Bestellung von [%(vm_name)s] wurde erhoben.\n" +"\n" +"Um die Rechnung zu sehen, klicke auf den Button unten.\n" +"\n" msgid "Password Reset" msgstr "Passwort zurücksetzen" @@ -560,9 +563,9 @@ msgstr "" msgid "Invalid credit card" msgstr "Ungültige Kreditkarte" -#, python-brace-format -msgid "Your New VM {vm_name} at Data Center Light" -msgstr "Deine neue VM {vm_name} bei Data Center Light" +#, python-format +msgid "Your New VM %(vm_name)s at Data Center Light" +msgstr "Deine neue VM %(vm_name)s bei Data Center Light" msgid "Confirm Order" msgstr "Bestellung Bestätigen" diff --git a/hosting/views.py b/hosting/views.py index 128bd4db..92a40fac 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -659,8 +659,8 @@ class PaymentVMView(LoginRequiredMixin, FormView): 'base_url': "{0}://{1}".format(request.scheme, request.get_host()), 'page_header': _( - 'Your New VM {vm_name} at Data Center Light'.format( - vm_name=vm.get('name'))) + 'Your New VM %(vm_name)s at Data Center Light') % { + 'vm_name': vm.get('name')} } email_data = { 'subject': context.get('page_header'), From f041a4047d579167efec3176960e9572ad10d9a1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 3 Sep 2017 02:33:05 +0530 Subject: [PATCH 26/39] Started with VM cancellation template --- .../templates/hosting/emails/vm_canceled.html | 14 ++ ...vm_status_changed.html => vm_canceled.txt} | 0 .../hosting/emails/vm_status_changed.txt | 136 ------------------ hosting/views.py | 10 +- 4 files changed, 20 insertions(+), 140 deletions(-) create mode 100644 hosting/templates/hosting/emails/vm_canceled.html rename hosting/templates/hosting/emails/{vm_status_changed.html => vm_canceled.txt} (100%) delete mode 100644 hosting/templates/hosting/emails/vm_status_changed.txt diff --git a/hosting/templates/hosting/emails/vm_canceled.html b/hosting/templates/hosting/emails/vm_canceled.html new file mode 100644 index 00000000..8f10ccda --- /dev/null +++ b/hosting/templates/hosting/emails/vm_canceled.html @@ -0,0 +1,14 @@ +{% extends "datacenterlight/emails/base_email_datacenterlight.html" %} +{% load i18n %} +{% block email_head %}{{page_header}}{% endblock %} +{% block email_body %} +{% url 'hosting:virtual_machines' as my_virtual_machines_url %} +{% blocktrans with vm.name as vm_name %}You're receiving this mail because your virtual machine [{{vm_name}}] has been cancelled.
+You can see your order status by clicking [my VM page] below. +If you want to order a new virtual machine, you can do it by clicking this link []. + +Visit [my VM page] Now + +{% endblocktrans %} +{% endblock %} + diff --git a/hosting/templates/hosting/emails/vm_status_changed.html b/hosting/templates/hosting/emails/vm_canceled.txt similarity index 100% rename from hosting/templates/hosting/emails/vm_status_changed.html rename to hosting/templates/hosting/emails/vm_canceled.txt diff --git a/hosting/templates/hosting/emails/vm_status_changed.txt b/hosting/templates/hosting/emails/vm_status_changed.txt deleted file mode 100644 index c60ba661..00000000 --- a/hosting/templates/hosting/emails/vm_status_changed.txt +++ /dev/null @@ -1,136 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- Your virtual machine {{vm.name}} status has been updated to {{vm.get_status_display}} -
- You can manage your vm clicking on the button below -
- -
-
-
-
- - -
- ungleich
-
-
-
- - - diff --git a/hosting/views.py b/hosting/views.py index 92a40fac..ed72d8f6 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -895,14 +895,16 @@ class VirtualMachineView(LoginRequiredMixin, View): context = { 'vm': vm, 'base_url': "{0}://{1}".format(self.request.scheme, - self.request.get_host()) + self.request.get_host()), + 'page_header': _('Virtual Machine Cancellation') } email_data = { - 'subject': 'Virtual machine plan canceled', + 'subject': context['page_header'], 'to': self.request.user.email, 'context': context, - 'template_name': 'vm_status_changed', - 'template_path': 'hosting/emails/' + 'template_name': 'vm_canceled', + 'template_path': 'hosting/emails/', + 'from_address': settings.DCL_SUPPORT_FROM_ADDRESS, } email = BaseEmail(**email_data) email.send() From 0d4c40cfa23c0259400289cc9f9a2380b9d13fae Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sun, 3 Sep 2017 12:44:42 +0200 Subject: [PATCH 27/39] Fixed missing trans tag in _footer.html --- hosting/templates/hosting/includes/_footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/templates/hosting/includes/_footer.html b/hosting/templates/hosting/includes/_footer.html index 65177315..24f4cea6 100644 --- a/hosting/templates/hosting/includes/_footer.html +++ b/hosting/templates/hosting/includes/_footer.html @@ -1,5 +1,5 @@ {% load staticfiles %} - +{% load i18n %}