diff --git a/hosting/templates/hosting/emails/user_activation.html b/hosting/templates/hosting/emails/user_activation.html new file mode 100755 index 0000000..4eaeb7a --- /dev/null +++ b/hosting/templates/hosting/emails/user_activation.html @@ -0,0 +1,59 @@ +{% load static i18n %} + + + + + + + {% trans "Data Center Light Account Activation" %} + + + + + + + + + + + + + + + + + + +
+ +
+

{% trans "Data Center Light Account Activation" %}

+
+

+ {% blocktrans %}You can activate your Data Center Light account by clicking here.{% endblocktrans %} +

+

+ {% blocktrans %}You can also copy and paste the following link into the address bar of your browser to activate your Data Center Light account.{% endblocktrans %} +

+

+ {{base_url}}{{activation_link}} +

+ {% if account_details %} + {% url 'hosting:reset_password' as reset_password_url %} +

+ {% trans "Your account details are as follows" %}: +

+

+ {% trans "Username" %} : {% trans "Your email address" %}
+ {% trans "Password" %} : {{account_details}} +

+

+ {% blocktrans %}You can reset your password here.{% endblocktrans %} +

+ {% endif %} +
+

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

+
+ + + diff --git a/hosting/templates/hosting/emails/user_activation.txt b/hosting/templates/hosting/emails/user_activation.txt new file mode 100755 index 0000000..4f66e23 --- /dev/null +++ b/hosting/templates/hosting/emails/user_activation.txt @@ -0,0 +1,20 @@ +{% load i18n %} + +{% trans "Data Center Light Account Activation" %} + +{% blocktrans %}You can copy and paste the following link into the address bar of your browser to activate your Data Center Light account.{% endblocktrans %} + +{{base_url}}{{activation_link}} + +{% if account_details %} + {% url 'hosting:reset_password' as reset_password_url %} + {% trans "Your account details are as follows" %}: + + {% trans "Username" %} : {% trans "Your email address" %} + {% trans "Password" %} : {{account_details}} + + {% trans "You can reset your password here" %}: + {{base_url}}{{reset_password_url}} +{% endif %} + +{% trans "Your Data Center Light Team" %} \ No newline at end of file diff --git a/hosting/templates/hosting/emails/welcome_user.html b/hosting/templates/hosting/emails/welcome_user.html new file mode 100755 index 0000000..e2e854f --- /dev/null +++ b/hosting/templates/hosting/emails/welcome_user.html @@ -0,0 +1,48 @@ +{% load static i18n %} + + + + + + + {% trans "Welcome to Data Center Light!" %} + + + + + + + + + + + + + + + + + + + + + +
+ +
+

{% trans "Welcome to Data Center Light!" %}

+
+

+ {% blocktrans %}Thanks for joining us! We provide the most affordable virtual machines from the heart of Switzerland.{% endblocktrans %} +

+

+ {% blocktrans %}Try now, order a VM. VM price starts from only 11.5 CHF per month.{% endblocktrans %} +

+
+ {% trans "ORDER VM" %} +
+

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

+
+ + + \ No newline at end of file diff --git a/hosting/templates/hosting/emails/welcome_user.txt b/hosting/templates/hosting/emails/welcome_user.txt new file mode 100755 index 0000000..06e8aa3 --- /dev/null +++ b/hosting/templates/hosting/emails/welcome_user.txt @@ -0,0 +1,10 @@ +{% load i18n %} + +{% trans "Welcome to Data Center Light!" %} + +{% blocktrans %}Thanks for joining us! We provide the most affordable virtual machines from the heart of Switzerland.{% endblocktrans %} +{% blocktrans %}Try now, order a VM. VM price starts from only 11.5 CHF per month.{% endblocktrans %} + +{{ base_url }}{% url 'hosting:create_virtual_machine' %} + +{% trans "Your Data Center Light Team" %} \ No newline at end of file diff --git a/hosting/templatetags/__init__.py b/hosting/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hosting/templatetags/custom_tags.py b/hosting/templatetags/custom_tags.py new file mode 100644 index 0000000..93fd171 --- /dev/null +++ b/hosting/templatetags/custom_tags.py @@ -0,0 +1,27 @@ + +import logging + +from django import template +from django.urls import resolve, reverse +from django.utils.translation import activate, get_language + +logger = logging.getLogger(__name__) + +register = template.Library() + + +@register.simple_tag(takes_context=True) +def change_lang(context, lang=None, *args, **kwargs): + + path = context['request'].path + url_parts = resolve(path) + + url = path + cur_language = get_language() + try: + activate(lang) + url = reverse(url_parts.view_name, kwargs=url_parts.kwargs) + finally: + activate(cur_language) + + return "%s" % url