font-size reduced, vm cancel and vm create email data fixed

This commit is contained in:
Arvind Tiwari 2017-09-27 02:07:52 +05:30
commit 21660f8d00
9 changed files with 95 additions and 147 deletions

View file

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -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'),

View file

@ -6,7 +6,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% trans "Data Center Light Account Activation" %}</title>
<link rel="shortcut icon" href="{% static 'datacenterlight/img/favicon.ico' %}" type="image/x-icon">
<link rel="shortcut icon" href="{{ base_url }}{% static 'datacenterlight/img/favicon.ico' %}" type="image/x-icon">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,400">
</head>
@ -14,7 +14,7 @@
<table style="width: 100%; margin: auto; border-spacing: 0; border-collapse: collapse; max-width: 560px; border: 1px solid #aaa;">
<tr>
<td style="padding-top: 25px; padding-left: 22px; padding-right: 30px; font-family: Lato, Arial, sans-serif;">
<img src="{{base_url}}{% static 'datacenterlight/img/logo_black.svg' %}" style="vertical-align: middle; width: 200px; height: 50px;">
<img src="{{base_url}}{% static 'datacenterlight/img/logo_black.svg' %}" style="width: 200px; height: 50px;">
</td>
</tr>
<tr>
@ -35,7 +35,7 @@
</tr>
<tr>
<td style="padding-top: 40px; padding-left: 30px; padding-right: 30px; padding-bottom: 25px;">
<h3 style="font-family: Lato, Arial, sans-serif; margin: 0; font-weight: 400; font-size: 18px;">{% trans "Your Data Center Light Team" %}</h3>
<h3 style="font-family: Lato, Arial, sans-serif; margin: 0; font-weight: 400; font-size: 16px;">{% trans "Your Data Center Light Team" %}</h3>
</td>
</tr>
</table>

View file

@ -6,7 +6,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% trans "Welcome to Data Center Light!" %}</title>
<link rel="shortcut icon" href="{% static 'datacenterlight/img/favicon.ico' %}" type="image/x-icon">
<link rel="shortcut icon" href="{{ base_url }}{% static 'datacenterlight/img/favicon.ico' %}" type="image/x-icon">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,400">
</head>
@ -14,7 +14,7 @@
<table style="width: 100%; margin: auto; border-spacing: 0; border-collapse: collapse; max-width: 560px; border: 1px solid #aaa;">
<tr>
<td style="padding-top: 25px; padding-left: 22px; padding-right: 30px; font-family: Lato, Arial, sans-serif;">
<img src="{{base_url}}{% static 'datacenterlight/img/logo_black.svg' %}" style="vertical-align: middle; width: 200px; height: 50px;">
<img src="{{base_url}}{% static 'datacenterlight/img/logo_black.svg' %}" style="width: 200px; height: 50px;">
</td>
</tr>
<tr>
@ -37,7 +37,7 @@
</tr>
<tr>
<td style="padding-top: 40px; padding-left: 30px; padding-right: 30px; padding-bottom: 25px;">
<h3 style="font-family: Lato, Arial, sans-serif; margin: 0; font-weight: 400; font-size: 18px;">{% trans "Your Data Center Light Team" %}</h3>
<h3 style="font-family: Lato, Arial, sans-serif; margin: 0; font-weight: 400; font-size: 16px;">{% trans "Your Data Center Light Team" %}</h3>
</td>
</tr>
</table>