Merge branch 'master' into task/5690/generic-payment-page

This commit is contained in:
PCoder 2018-10-02 09:01:46 +02:00
commit dd9e7dde35
8 changed files with 43 additions and 9 deletions

View file

@ -1,3 +1,6 @@
2.2.2: 2018-09-28
* #5721: Set calculator OS list in alphabetical order and set `Devuan Ascii` as the default (PR #668)
* bugfix: Fix some typos and correct DE translations (PR #667)
2.2.1: 2018-09-25 2.2.1: 2018-09-25
* feature: Change DCLNavbarPlugin to show login option only if set (PR #665) * feature: Change DCLNavbarPlugin to show login option only if set (PR #665)
* bugfix: Log opennebula errors and send proper message when vm terminate is not completed in the stipulated time (PR #648) * bugfix: Log opennebula errors and send proper message when vm terminate is not completed in the stipulated time (PR #648)

View file

@ -354,3 +354,10 @@ class DCLCalculatorPluginModel(CMSPlugin):
"in the backend to be automatically listed in this " "in the backend to be automatically listed in this "
"calculator instance." "calculator instance."
) )
default_selected_template = models.CharField(
default="Devuan Ascii",
null=True,
max_length=128,
help_text="Write the name of the template that you need selected as"
" default when the calculator loads"
)

View file

@ -92,10 +92,13 @@ class DCLCalculatorPlugin(CMSPluginBase):
if ids: if ids:
context['templates'] = VMTemplate.objects.filter( context['templates'] = VMTemplate.objects.filter(
vm_type=instance.vm_type vm_type=instance.vm_type
).filter(opennebula_vm_template_id__in=ids) ).filter(opennebula_vm_template_id__in=ids).order_by('name')
else: else:
context['templates'] = VMTemplate.objects.filter( context['templates'] = VMTemplate.objects.filter(
vm_type=instance.vm_type vm_type=instance.vm_type
).order_by('name')
context['default_selected_template'] = (
instance.default_selected_template
) )
return context return context

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2018-09-27 20:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datacenterlight', '0025_dclnavbarpluginmodel_show_login_option'),
]
operations = [
migrations.AddField(
model_name='dclcalculatorpluginmodel',
name='default_selected_template',
field=models.CharField(default='Devuan Ascii', help_text='Write the name of the template that you need selected as default when the calculator loads', max_length=128, null=True),
),
]

View file

@ -91,7 +91,8 @@
<label for="config">OS</label> <label for="config">OS</label>
<select name="config"> <select name="config">
{% for template in templates %} {% for template in templates %}
<option value="{{template.opennebula_vm_template_id}}">{{template.name}}</option>
<option value="{{template.opennebula_vm_template_id}}" {% if template.name|lower == default_selected_template|lower %}selected="selected"{% endif %}>{{template.name}}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>

View file

@ -209,7 +209,7 @@ msgstr "Du hast eine neue virtuelle Maschine bestellt!"
#, python-format #, python-format
msgid "Your order of <strong>%(vm_name)s</strong> has been charged." msgid "Your order of <strong>%(vm_name)s</strong> has been charged."
msgstr "Deine Bestellung von <strong>%(vm_name)s</strong> wurde erhoben." msgstr "Deine Bestellung von <strong>%(vm_name)s</strong> wurde entgegengenommen."
msgid "You can view your VM detail by clicking the button below." msgid "You can view your VM detail by clicking the button below."
msgstr "Um die Rechnung zu sehen, klicke auf den Button unten." msgstr "Um die Rechnung zu sehen, klicke auf den Button unten."
@ -222,7 +222,7 @@ msgstr "Dein Data Center Light Team"
#, python-format #, python-format
msgid "Your order of %(vm_name)s has been charged." msgid "Your order of %(vm_name)s has been charged."
msgstr "Deine Bestellung von %(vm_name)s wurde erhoben." msgstr "Deine Bestellung von %(vm_name)s wurde entgegengenommen."
msgid "You can view your VM detail by following the link below." msgid "You can view your VM detail by following the link below."
msgstr "Um die Rechnung zu sehen, klicke auf den Link unten." msgstr "Um die Rechnung zu sehen, klicke auf den Link unten."
@ -249,7 +249,7 @@ msgstr "VM Kündigung"
#, python-format #, python-format
msgid "" msgid ""
"You are receiving this email because your virutal machine <strong>" "You are receiving this email because your virtual machine <strong>"
"%(vm_name)s</strong> has been cancelled." "%(vm_name)s</strong> has been cancelled."
msgstr "" msgstr ""
"Du erhälst diese E-Mail, da deine virtuelle Maschine <strong>%(vm_name)s</" "Du erhälst diese E-Mail, da deine virtuelle Maschine <strong>%(vm_name)s</"
@ -265,7 +265,7 @@ msgstr "NEUE VM"
#, python-format #, python-format
msgid "" msgid ""
"You are receiving this email because your virutal machine %(vm_name)s has " "You are receiving this email because your virtual machine %(vm_name)s has "
"been cancelled." "been cancelled."
msgstr "" msgstr ""
"Du erhälst diese E-Mail, da deine virtuelle Maschine %(vm_name)s gekündigt " "Du erhälst diese E-Mail, da deine virtuelle Maschine %(vm_name)s gekündigt "

View file

@ -25,7 +25,7 @@
<tr> <tr>
<td style="padding-top: 25px; font-size: 16px;"> <td style="padding-top: 25px; font-size: 16px;">
<p style="line-height: 1.75; font-family: Lato, Arial, sans-serif; font-weight: 300; margin: 0;"> <p style="line-height: 1.75; font-family: Lato, Arial, sans-serif; font-weight: 300; margin: 0;">
{% blocktrans %}You are receiving this email because your virutal machine <strong>{{ vm_name }}</strong> has been cancelled.{% endblocktrans %} {% blocktrans %}You are receiving this email because your virtual machine <strong>{{ vm_name }}</strong> has been cancelled.{% endblocktrans %}
</p> </p>
<p style="line-height: 1.75; font-family: Lato, Arial, sans-serif; font-weight: 300; margin: 0;"> <p style="line-height: 1.75; font-family: Lato, Arial, sans-serif; font-weight: 300; margin: 0;">
{% blocktrans %}You can always order a new VM by clicking the button below.{% endblocktrans %} {% blocktrans %}You can always order a new VM by clicking the button below.{% endblocktrans %}

View file

@ -2,7 +2,7 @@
{% trans "Virtual Machine Cancellation" %} {% trans "Virtual Machine Cancellation" %}
{% blocktrans %}You are receiving this email because your virutal machine {{vm_name}} has been cancelled.{% endblocktrans %} {% blocktrans %}You are receiving this email because your virtual machine {{vm_name}} has been cancelled.{% endblocktrans %}
{% blocktrans %}You can always order a new VM by following the link below.{% endblocktrans %} {% blocktrans %}You can always order a new VM by following the link below.{% endblocktrans %}
{{ base_url }}{% url 'hosting:create_virtual_machine' %} {{ base_url }}{% url 'hosting:create_virtual_machine' %}