From 21660f8d00322f22569a262281d91aa93a39b4cc Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Wed, 27 Sep 2017 02:07:52 +0530 Subject: [PATCH] font-size reduced, vm cancel and vm create email data fixed --- .../locale/de/LC_MESSAGES/django.po | 2 +- datacenterlight/tasks.py | 21 +- .../emails/user_activation.html | 6 +- .../datacenterlight/emails/welcome_user.html | 6 +- hosting/locale/de/LC_MESSAGES/django.po | 181 ++++++------------ .../hosting/emails/new_booked_vm.html | 8 +- .../hosting/emails/password_reset_email.html | 6 +- .../templates/hosting/emails/vm_canceled.html | 10 +- hosting/views.py | 2 +- 9 files changed, 95 insertions(+), 147 deletions(-) diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index 89e35e8c..96dd650c 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-23 02:19+0530\n" +"POT-Creation-Date: 2017-09-27 02:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 1335869b..61c6fb4b 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -5,6 +5,7 @@ from celery.utils.log import get_task_logger from celery import current_task from django.conf import settings from django.core.mail import EmailMessage +from django.core.urlresolvers import reverse from django.utils import translation from django.utils.translation import ugettext_lazy as _ @@ -52,7 +53,8 @@ def create_vm_task(self, vm_template_id, user, specs, template, stripe_customer_id, billing_address_data, billing_address_id, charge, cc_details): - logger.debug("Running create_vm_task on {}".format(current_task.request.hostname)) + logger.debug("Running create_vm_task on {}".format( + current_task.request.hostname)) vm_id = None try: final_price = specs.get('price') @@ -126,9 +128,9 @@ def create_vm_task(self, vm_template_id, user, specs, template, 'storage': specs.get('disk_size'), 'price': specs.get('price'), 'template': template.get('name'), - 'vm.name': vm['name'], - 'vm.id': vm['vm_id'], - 'order.id': order.id + 'vm_name': vm['name'], + 'vm_id': vm['vm_id'], + 'order_id': order.id } email_data = { 'subject': settings.DCL_TEXT + " Order from %s" % context['email'], @@ -142,20 +144,21 @@ def create_vm_task(self, vm_template_id, user, specs, template, email.send() if 'pass' in user: - lang = 'en-us' + lang = 'en-us' if user.get('language') is not None: - logger.debug("Language is set to {}".format(user.get('language'))) + logger.debug("Language is set to {}".format( + user.get('language'))) lang = user.get('language') translation.activate(lang) # Send notification to the user as soon as VM has been booked context = { - 'vm': vm, - 'order': order, 'base_url': "{0}://{1}".format(user.get('request_scheme'), user.get('request_host')), + 'order_url': reverse('hosting:orders', + kwargs={'pk': order.id}), 'page_header': _( 'Your New VM %(vm_name)s at Data Center Light') % { - 'vm_name': vm.get('name')} + 'vm_name': vm.get('name')} } email_data = { 'subject': context.get('page_header'), diff --git a/datacenterlight/templates/datacenterlight/emails/user_activation.html b/datacenterlight/templates/datacenterlight/emails/user_activation.html index 9c8c0367..409ea153 100644 --- a/datacenterlight/templates/datacenterlight/emails/user_activation.html +++ b/datacenterlight/templates/datacenterlight/emails/user_activation.html @@ -6,7 +6,7 @@ {% trans "Data Center Light Account Activation" %} - + @@ -14,7 +14,7 @@ @@ -35,7 +35,7 @@
- +
-

{% trans "Your Data Center Light Team" %}

+

{% trans "Your Data Center Light Team" %}

diff --git a/datacenterlight/templates/datacenterlight/emails/welcome_user.html b/datacenterlight/templates/datacenterlight/emails/welcome_user.html index f426de20..ba0e5026 100644 --- a/datacenterlight/templates/datacenterlight/emails/welcome_user.html +++ b/datacenterlight/templates/datacenterlight/emails/welcome_user.html @@ -6,7 +6,7 @@ {% trans "Welcome to Data Center Light!" %} - + @@ -14,7 +14,7 @@ @@ -37,7 +37,7 @@
- +
-

{% trans "Your Data Center Light Team" %}

+

{% trans "Your Data Center Light Team" %}

diff --git a/hosting/locale/de/LC_MESSAGES/django.po b/hosting/locale/de/LC_MESSAGES/django.po index e1a3c694..27a87c53 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-24 12:34+0000\n" +"POT-Creation-Date: 2017-09-27 02:06+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -221,7 +221,9 @@ msgid "We received a request to reset your password." msgstr "Wir haben eine Anfrage erhalten, um Dein Passwort zurückzusetzen." msgid "If you didn't make this request you can safely ignore this email." -msgstr "Falls Du kein neues Passwort angefragt hast, kannst Du diese E-mail ignorieren." +msgstr "" +"Falls Du kein neues Passwort angefragt hast, kannst Du diese E-mail " +"ignorieren." msgid "Otherwise, click here to reset your password." msgstr "Andernfalls klicke hier, um Dein Passwort zurückzusetzen." @@ -232,50 +234,18 @@ msgstr "Dankeschön!" msgid "Virtual Machine Cancellation" msgstr "VM Kündigung" -#, python-format -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 "" -"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 are receiving this email because your virutal machine [%(vm_name)s] has " "been cancelled." msgstr "" -"Du erhälst diese E-Mail, da deine virtuelle Maschine [%(vm_name)s] " -"gekündigt wurde." +"Du erhälst diese E-Mail, da deine virtuelle Maschine [%(vm_name)s] gekündigt " +"wurde." msgid "You can always order a new VM by clicking the button below." -msgstr "Du kannst einfach eine neue VM bestellen, indem Du den Knopf weiter unten drückst." +msgstr "" +"Du kannst einfach eine neue VM bestellen, indem Du den Knopf weiter unten " +"drückst." msgid "CREATE VM" msgstr "NEUE VM" @@ -283,24 +253,6 @@ msgstr "NEUE VM" msgid "You can always order a new VM by following the link below." msgstr "" -#, python-format -msgid "" -"You're receiving this mail because your virtual machine [%(vm_name)s] has " -"been cancelled.\n" -"You can see your order status by clicking here\n" -"%(base_url)s%(vm_order_url)s\n" -"If you want to order a new virtual machine, you can do it by clicking this " -"link.\n" -"%(base_url)s%(my_virtual_machines_url)s\n" -msgstr "" -"Du erhälst diese E-Mail, da Deine virtuelle Maschine [%(vm_name)s] gekündigt " -"wurde.\n" -"Um Deinen Auftragsstatus zu sehen, klicke hier.\n" -"%(base_url)s%(vm_order_url)s\n" -"Falls Du eine neue virtuelle Maschine bestellen möchtest, kannst Du dies " -"tun, indem Du diesen Link klickst.\n" -"%(base_url)s%(my_virtual_machines_url)s\n" - msgid "Toggle navigation" msgstr "Umschalten" @@ -620,8 +572,8 @@ msgid "" "Your Virtual Machine %(machine_name)s is successfully " "terminated!" msgstr "" -"Deine Virtuelle Machine (VM) %(machine_name)s wurde erfolgreich " -"beendet!" +"Deine Virtuelle Machine (VM) %(machine_name)s wurde " +"erfolgreich beendet!" msgid "Virtual Machines" msgstr "Virtuelle Maschinen" @@ -704,25 +656,67 @@ msgid "" "contact Data Center Light Support." msgstr "Kontaktiere den Data Center Light Support." -#, python-format -msgid "VM %(VM_ID)s terminated successfully" -msgstr "VM %(VM_ID)s erfolgreich beendet" - msgid "Terminated" msgstr "Beendet" msgid "Error terminating VM" msgstr "Fehler beenden VM" -msgid "Virtual Machine Cancellation" -msgstr "VM Kündigung" +#~ 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" -#~ msgid "Close" -#~ msgstr "Schliessen" +#~ 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 "" +#~ "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 "" +#~ "You're receiving this mail because your virtual machine [%(vm_name)s] has " +#~ "been cancelled.\n" +#~ "You can see your order status by clicking here\n" +#~ "%(base_url)s%(vm_order_url)s\n" +#~ "If you want to order a new virtual machine, you can do it by clicking " +#~ "this link.\n" +#~ "%(base_url)s%(my_virtual_machines_url)s\n" +#~ msgstr "" +#~ "Du erhälst diese E-Mail, da Deine virtuelle Maschine [%(vm_name)s] " +#~ "gekündigt wurde.\n" +#~ "Um Deinen Auftragsstatus zu sehen, klicke hier.\n" +#~ "%(base_url)s%(vm_order_url)s\n" +#~ "Falls Du eine neue virtuelle Maschine bestellen möchtest, kannst Du dies " +#~ "tun, indem Du diesen Link klickst.\n" +#~ "%(base_url)s%(my_virtual_machines_url)s\n" #~ msgid "VM %(VM_ID)s terminated successfully" #~ msgstr "VM %(VM_ID)s erfolgreich beendet" +#~ msgid "Close" +#~ msgstr "Schliessen" + #~ msgid "days" #~ msgstr "Tage" @@ -762,55 +756,6 @@ msgstr "VM Kündigung" #~ "tun, indem du diesen " #~ "Link klickst.
\n" -#~ msgid "" -#~ "You're receiving this mail because your virtual machine [%(vm_name)s] has " -#~ "been cancelled.\n" -#~ "You can see your order status by clicking here\n" -#~ "%(base_url)s%(vm_order_url)s\n" -#~ "If you want to order a new virtual machine, you can do it by clicking " -#~ "this link.\n" -#~ "%(base_url)s%(my_virtual_machines_url)s\n" -#~ msgstr "" -#~ "Du erhälst diese E-Mail, da deine virtuelle Maschine [%(vm_name)s] " -#~ "gekündigt wurde.\n" -#~ "Um deinen Auftragsstatus zu sehen, klicke hier.\n" -#~ "%(base_url)s%(vm_order_url)s\n" -#~ "Falls du eine neue virtuelle Maschine bestellen möchtest, kannst du dies " -#~ "tun, indem du diesen Link klickst.\n" -#~ "%(base_url)s%(my_virtual_machines_url)s\n" - -#~ 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" - -#~ 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 "" -#~ "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 "Finish Configuration" #~ msgstr "Konfiguration beenden" @@ -917,5 +862,5 @@ msgstr "VM Kündigung" #~ "Your SSH private key was already generated and downloaded, if you lost " #~ "it, contact us. " #~ msgstr "" -#~ "Dein privater SSH Key wurde bereits generiert und heruntergeladen. " -#~ "Falls Du ihn verloren hast, kontaktiere uns." +#~ "Dein privater SSH Key wurde bereits generiert und heruntergeladen. Falls " +#~ "Du ihn verloren hast, kontaktiere uns." diff --git a/hosting/templates/hosting/emails/new_booked_vm.html b/hosting/templates/hosting/emails/new_booked_vm.html index 78134307..2aa5b4e8 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.html +++ b/hosting/templates/hosting/emails/new_booked_vm.html @@ -6,7 +6,7 @@ {% blocktrans %}Your New VM {{vm_name}}{% endblocktrans %} - + @@ -14,7 +14,7 @@ @@ -26,7 +26,7 @@ @@ -38,7 +38,7 @@
- +

{% blocktrans %}You have ordered a new virtual machine!{% endblocktrans %}
- {% blocktrans %}Your order of [{{vm_name}}] has been charged.{% endblocktrans %}
+ {% blocktrans %}Your order of [{{ vm_name }}] has been charged.{% endblocktrans %}
{% blocktrans %}You can view your VM detail by clicking the button below.{% endblocktrans %}

-

{% trans "Your Data Center Light Team" %}

+

{% trans "Your Data Center Light Team" %}

diff --git a/hosting/templates/hosting/emails/password_reset_email.html b/hosting/templates/hosting/emails/password_reset_email.html index f5929f33..8bfddae7 100644 --- a/hosting/templates/hosting/emails/password_reset_email.html +++ b/hosting/templates/hosting/emails/password_reset_email.html @@ -6,7 +6,7 @@ {% trans "Password Reset" %} - + @@ -14,7 +14,7 @@ @@ -40,7 +40,7 @@
- +
-

{% trans "Your Data Center Light Team" %}

+

{% trans "Your Data Center Light Team" %}

diff --git a/hosting/templates/hosting/emails/vm_canceled.html b/hosting/templates/hosting/emails/vm_canceled.html index 1baa6954..535ea2ed 100644 --- a/hosting/templates/hosting/emails/vm_canceled.html +++ b/hosting/templates/hosting/emails/vm_canceled.html @@ -6,7 +6,7 @@ {% trans "Virtual Machine Cancellation" %} - + @@ -14,7 +14,7 @@ @@ -25,19 +25,19 @@
- +

- {% blocktrans %}You are receiving this email because your virutal machine [{{vm_name}}] has been cancelled.{% endblocktrans %}
+ {% blocktrans %}You are receiving this email because your virutal machine [{{ vm_name }}] has been cancelled.{% endblocktrans %}
{% blocktrans %}You can always order a new VM by clicking the button below.{% endblocktrans %}

- + {% trans "CREATE VM" %} + {% trans "CREATE VM" %}
-

{% trans "Your Data Center Light Team" %}

+

{% trans "Your Data Center Light Team" %}

diff --git a/hosting/views.py b/hosting/views.py index f5da9c26..1f4bc895 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1079,7 +1079,7 @@ class VirtualMachineView(LoginRequiredMixin, View): else: sleep(2) context = { - 'vm': vm_data, + 'vm_name': vm_data.name, 'base_url': "{0}://{1}".format(self.request.scheme, self.request.get_host()), 'page_header': _('Virtual Machine Cancellation')