diff --git a/Changelog b/Changelog index b85dd4ff..a9032757 100644 --- a/Changelog +++ b/Changelog @@ -1,21 +1,3 @@ -Next: - * bugfix: Use correct version of django-multisite (MR #676) -2.4.1: 2018-10-18 - * bugfix: Update pycryptodome module from 3.4 to 3.6.6 (PR #674) -2.4: 2018-10-18 - * #5681: [hosting,dcl] Allow admin to lower minimum RAM to 512 MB (PR #672) -2.3.1: 2018-10-17 - * bugfix: [hosting, dcl] Show VAT percent rounded to 2 decimal places in the order confirmation page (PR #673) -2.3: 2018-10-08 - * #5690: Generic payment page - allow admin to add a onetime/monthly product and the frontend for user to pay for this product (PR #666) -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 - * 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) -2.2: 2018-09-06 - * bugfix: Include price in the Stripe plan name to make it distinct and to correct pricing since version 1.9 2.1.2: 2018-08-30 * bugfix: [blog, comic] Set blog rss feed for all blog templates 2.1.1: 2018-08-24 diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index 2d1a98b5..62a7b312 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -180,10 +180,6 @@ class DCLNavbarPluginModel(CMSPlugin): default=True, help_text='Select to include the language selection dropdown.' ) - show_login_option = models.BooleanField( - default=True, - help_text='Uncheck this if you do not want to show login/dashboard.' - ) def get_logo_dark(self): # used only if atleast one logo exists @@ -354,11 +350,3 @@ class DCLCalculatorPluginModel(CMSPlugin): "in the backend to be automatically listed in this " "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" - ) - enable_512mb_ram = models.BooleanField(default=False) diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index c3ec974f..95a496d8 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -9,7 +9,6 @@ from .cms_models import ( DCLSectionPromoPluginModel, DCLCalculatorPluginModel ) from .models import VMTemplate -from datacenterlight.utils import clear_all_session_vars @plugin_pool.register_plugin @@ -86,7 +85,6 @@ class DCLCalculatorPlugin(CMSPluginBase): require_parent = True def render(self, context, instance, placeholder): - clear_all_session_vars(context['request']) context = super(DCLCalculatorPlugin, self).render( context, instance, placeholder ) @@ -94,13 +92,11 @@ class DCLCalculatorPlugin(CMSPluginBase): if ids: context['templates'] = VMTemplate.objects.filter( vm_type=instance.vm_type - ).filter(opennebula_vm_template_id__in=ids).order_by('name') + ).filter(opennebula_vm_template_id__in=ids) else: context['templates'] = VMTemplate.objects.filter( vm_type=instance.vm_type - ).order_by('name') - context['instance'] = instance - context['min_ram'] = 0.5 if instance.enable_512mb_ram else 1 + ) return context diff --git a/datacenterlight/locale/de/LC_MESSAGES/django.po b/datacenterlight/locale/de/LC_MESSAGES/django.po index d43e91ea..1b66b640 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: 2018-09-26 20:44+0000\n" +"POT-Creation-Date: 2018-07-05 23:11+0000\n" "PO-Revision-Date: 2018-03-30 23:22+0000\n" "Last-Translator: b'Anonymous User '\n" "Language-Team: LANGUAGE \n" @@ -293,9 +293,6 @@ msgstr "Registrieren" msgid "Billing Address" msgstr "Rechnungsadresse" -msgid "Make a payment" -msgstr "" - msgid "Your Order" msgstr "Deine Bestellung" @@ -339,9 +336,9 @@ msgid "" "database." msgstr "" "Bitte wähle eine der zuvor genutzten Kreditkarten oder gib Deine " -"Kreditkartendetails unten an. Die Bezahlung wird über Stripe abgewickelt. Wir speichern Deine " -"Kreditkartendetails nicht in unserer Datenbank." +"Kreditkartendetails unten an. Die Bezahlung wird über " +"Stripe abgewickelt. " +"Wir speichern Deine Kreditkartendetails nicht in unserer Datenbank." msgid "" "Please fill in your credit card information below. We are using cardPricing[data].min) { - if(data === 'ram' && String(cardPricing[data].value) === "1" && minRam === 0.5){ - cardPricing[data].value = 0.5; - $('#ramValue').val('0.5'); - $("#ramValue").attr('step', 0.5); - } else { - cardPricing[data].value = Number(cardPricing[data].value) - cardPricing[data].interval; - } + cardPricing[data].value = Number(cardPricing[data].value) - cardPricing[data].interval; } _fetchPricing(); - $('#ramValue').data('old-value', $('#ramValue').val()); }); $('.fa-plus-circle.right').click(function(event) { var data = $(this).data('plus'); if (cardPricing[data].value < cardPricing[data].max) { - if(data === 'ram' && String(cardPricing[data].value) === "0.5" && minRam === 0.5){ - cardPricing[data].value = 1; - $('#ramValue').val('1'); - $("#ramValue").attr('step', 1); - } else { - cardPricing[data].value = Number(cardPricing[data].value) + cardPricing[data].interval; - } + cardPricing[data].value = Number(cardPricing[data].value) + cardPricing[data].interval; } _fetchPricing(); - $('#ramValue').data('old-value', $('#ramValue').val()); }); $('.input-price').change(function() { var data = $(this).attr("name"); - var input = $('input[name=' + data + ']'); - var inputValue = input.val(); - - if(data === 'ram') { - var ramInput = $('#ramValue'); - if ($('#ramValue').data('old-value') < $('#ramValue').val()) { - if($('#ramValue').val() === '1' && minRam === 0.5) { - $("#ramValue").attr('step', 1); - $('#ramValue').val('1'); - } - } else { - if($('#ramValue').val() === '0' && minRam === 0.5) { - $("#ramValue").attr('step', 0.5); - $('#ramValue').val('0.5'); - } - } - inputValue = $('#ramValue').val(); - $('#ramValue').data('old-value', $('#ramValue').val()); - } - cardPricing[data].value = inputValue; + cardPricing[data].value = $('input[name=' + data + ']').val(); _fetchPricing(); }); } diff --git a/datacenterlight/templates/datacenterlight/cms/navbar.html b/datacenterlight/templates/datacenterlight/cms/navbar.html index 886a5009..ae6643aa 100644 --- a/datacenterlight/templates/datacenterlight/cms/navbar.html +++ b/datacenterlight/templates/datacenterlight/cms/navbar.html @@ -35,16 +35,14 @@ {% endif %} {% endif %} - {% if instance.show_login_option %} - {% if not request.user.is_authenticated %} -
  • - {% trans "Login" %}   -
  • - {% else %} -
  • - {% trans "Dashboard" %} -
  • - {% endif %} + {% if not request.user.is_authenticated %} +
  • + {% trans "Login" %}   +
  • + {% else %} +
  • + {% trans "Dashboard" %} +
  • {% endif %} {% comment %} diff --git a/datacenterlight/templates/datacenterlight/includes/_calculator_form.html b/datacenterlight/templates/datacenterlight/includes/_calculator_form.html index f9896f17..72ca5a05 100644 --- a/datacenterlight/templates/datacenterlight/includes/_calculator_form.html +++ b/datacenterlight/templates/datacenterlight/includes/_calculator_form.html @@ -9,14 +9,11 @@ window.ssdUnitPrice = {{vm_pricing.ssd_unit_price|default:0}}; window.hddUnitPrice = {{vm_pricing.hdd_unit_price|default:0}}; window.discountAmount = {{vm_pricing.discount_amount|default:0}}; - window.minRam = {{min_ram}}; - window.minRamErr = '{% blocktrans with min_ram=min_ram %}Please enter a value in range {{min_ram}} - 200.{% endblocktrans %}'; {% endif %}
    {% csrf_token %} -

    {% trans "VM hosting" %}

    @@ -57,8 +54,8 @@
    - + GB RAM
    @@ -94,12 +91,11 @@
    -
    + \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/landing_payment.html b/datacenterlight/templates/datacenterlight/landing_payment.html index fb6d51b0..4c43f41c 100644 --- a/datacenterlight/templates/datacenterlight/landing_payment.html +++ b/datacenterlight/templates/datacenterlight/landing_payment.html @@ -67,49 +67,36 @@
    - {% if generic_payment_form %} -

    {%trans "Make a payment" %}

    -
    -
    - {% csrf_token %} - - {% for field in generic_payment_form %} - {% bootstrap_field field type='fields'%} - {% endfor %} -

    {{generic_payment_form.non_field_errors|striptags}}

    -
    - {% else %} -

    {%trans "Your Order" %}

    -
    -
    -

    {% trans "Cores"%} {{request.session.specs.cpu|floatformat}}

    -
    -

    {% trans "Memory"%} {{request.session.specs.memory|floatformat}} GB

    -
    -

    {% trans "Disk space"%} {{request.session.specs.disk_size|floatformat}} GB

    -
    -

    {% trans "Configuration"%} {{request.session.template.name}}

    -
    -

    - {%trans "Total" %}   - - ({% if vm_pricing.vat_inclusive %}{%trans "including VAT" %}{% else %}{%trans "excluding VAT" %}{% endif %}) - - {{request.session.specs.price|intcomma}} CHF/{% trans "Month" %} -

    -
    - {% if vm_pricing.discount_amount %} -

    - {%trans "Discount" as discount_name %} - {{ vm_pricing.discount_name|default:discount_name }}   - - {{ vm_pricing.discount_amount }} CHF/{% trans "Month" %} -

    -

    - ({% trans "Will be applied at checkout" %}) -

    - {% endif %} -
    - {% endif %} +

    {%trans "Your Order" %}

    +
    +
    +

    {% trans "Cores"%} {{request.session.specs.cpu|floatformat}}

    +
    +

    {% trans "Memory"%} {{request.session.specs.memory|floatformat}} GB

    +
    +

    {% trans "Disk space"%} {{request.session.specs.disk_size|floatformat}} GB

    +
    +

    {% trans "Configuration"%} {{request.session.template.name}}

    +
    +

    + {%trans "Total" %}   + + ({% if vm_pricing.vat_inclusive %}{%trans "including VAT" %}{% else %}{%trans "excluding VAT" %}{% endif %}) + + {{request.session.specs.price|intcomma}} CHF/{% trans "Month" %} +

    +
    + {% if vm_pricing.discount_amount %} +

    + {%trans "Discount" as discount_name %} + {{ vm_pricing.discount_name|default:discount_name }}   + - {{ vm_pricing.discount_amount }} CHF/{% trans "Month" %} +

    +

    + ({% trans "Will be applied at checkout" %}) +

    + {% endif %} +
    diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 31933e12..49347ba2 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -47,88 +47,61 @@

    {% trans "Order summary" %}

    - {% if generic_payment_details %} +

    + {% trans "Product" %}:  + {{ request.session.template.name }} +

    +
    +

    - {% trans "Product" %}:  - {{ generic_payment_details.product_name }} + {% trans "Cores" %}: + {{vm.cpu|floatformat}}

    -
    -
    -

    - {% trans "Amount" %}: - CHF {{generic_payment_details.amount|floatformat:2|intcomma}} -

    - {% if generic_payment_details.description %} +

    + {% trans "Memory" %}: + {{vm.memory|intcomma}} GB +

    +

    + {% trans "Disk space" %}: + {{vm.disk_size|intcomma}} GB +

    +
    +
    +
    +
    + {% if vm.vat > 0 or vm.discount.amount > 0 %} +
    +
    + {% if vm.vat > 0 %}

    - {% trans "Description" %}: - {{generic_payment_details.description}} + {% trans "Subtotal" %} + {{vm.price|floatformat:2|intcomma}} CHF +

    +

    + {% trans "VAT" %} ({{ vm.vat_percent|floatformat:2|intcomma }}%) + {{vm.vat|floatformat:2|intcomma}} CHF

    {% endif %} - {% if generic_payment_details.recurring %} -

    - {% trans "Recurring" %}: - Yes + {% if vm.discount.amount > 0 %} +

    + {%trans "Discount" as discount_name %} + {{ vm.discount.name|default:discount_name }} + - {{ vm.discount.amount }} CHF

    {% endif %}
    - {% else %} -

    - {% trans "Product" %}:  - {{ request.session.template.name }} -

    -
    -
    -

    - {% trans "Cores" %}: - {{vm.cpu|floatformat}} -

    -

    - {% trans "Memory" %}: - {{vm.memory|intcomma}} GB -

    -

    - {% trans "Disk space" %}: - {{vm.disk_size|intcomma}} GB -

    -
    -
    -
    -
    - {% if vm.vat > 0 or vm.discount.amount > 0 %} -
    -
    - {% if vm.vat > 0 %} -

    - {% trans "Subtotal" %} - {{vm.price|floatformat:2|intcomma}} CHF -

    -

    - {% trans "VAT" %} ({{ vm.vat_percent|floatformat:2|intcomma }}%) - {{vm.vat|floatformat:2|intcomma}} CHF -

    - {% endif %} - {% if vm.discount.amount > 0 %} -

    - {%trans "Discount" as discount_name %} - {{ vm.discount.name|default:discount_name }} - - {{ vm.discount.amount }} CHF -

    - {% endif %} -
    -
    -
    -
    -
    - {% endif %} -
    -

    - {% trans "Total" %} - {{vm.total_price|floatformat:2|intcomma}} CHF -

    -
    +
    +
    {% endif %} +
    +

    + {% trans "Total" %} + {{vm.total_price|floatformat:2|intcomma}} CHF +

    +
    +

    @@ -136,15 +109,7 @@ {% csrf_token %}
    - {% if generic_payment_details %} - {% if generic_payment_details.recurring %} -
    {% blocktrans with total_price=generic_payment_details.amount|floatformat:2|intcomma %}By clicking "Place order" this plan will charge your credit card account with {{total_price}} CHF/month{% endblocktrans %}.
    - {% else %} -
    {% blocktrans with total_price=generic_payment_details.amount|floatformat:2|intcomma %}By clicking "Place order" this payment will charge your credit card account with a one time amount of {{total_price}} CHF{% endblocktrans %}.
    - {% endif %} - {% else %} -
    {% blocktrans with vm_total_price=vm.total_price|floatformat:2|intcomma %}By clicking "Place order" this plan will charge your credit card account with {{vm_total_price}} CHF/month{% endblocktrans %}.
    - {% endif %} +
    {% blocktrans with vm_total_price=vm.total_price|floatformat:2|intcomma %}By clicking "Place order" this plan will charge your credit card account with {{vm_total_price}} CHF/month{% endblocktrans %}.