From e26eecf2eb05729a7f6e740f7b2a6b375b295874 Mon Sep 17 00:00:00 2001 From: Levi Date: Thu, 19 May 2016 01:47:16 -0430 Subject: [PATCH] Changed offers in VM pricing, Fixed pricing error changing disk size, VM footer dead links, Added logged out message --- dynamicweb/settings/base.py | 8 ++- .../management/commands/create_vm_types.py | 46 +++++++++--------- .../0017_virtualmachinetype_location.py | 21 ++++++++ hosting/models.py | 9 ++++ hosting/static/hosting/css/pricing.css | 12 ++++- hosting/static/hosting/img/CH_flag.png | Bin 0 -> 841 bytes hosting/static/hosting/img/DE_flag.png | Bin 0 -> 376 bytes hosting/static/hosting/js/pricing.js | 4 ++ hosting/templates/hosting/base_short.html | 23 ++++----- .../templates/hosting/includes/_pricing.html | 26 +++++++--- hosting/templates/hosting/login.html | 11 +++++ hosting/urls.py | 2 +- hosting/views.py | 6 ++- 13 files changed, 124 insertions(+), 44 deletions(-) create mode 100644 hosting/migrations/0017_virtualmachinetype_location.py create mode 100644 hosting/static/hosting/img/CH_flag.png create mode 100644 hosting/static/hosting/img/DE_flag.png diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 755969c8..de339f86 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -443,6 +443,12 @@ PARLER_LANGUAGES = {1: ({'code': 'en-us'}, {'code': 'de'},)} AUTH_USER_MODEL = 'membership.CustomUser' + +ALLOWED_HOSTS = [ + "*" + ] + + # PAYMENT STRIPE_DESCRIPTION_ON_PAYMENT = "Payment for ungleich GmbH services" @@ -455,7 +461,7 @@ REGISTRATION_MESSAGE = {'subject': "Validation mail", STRIPE_API_PRIVATE_KEY = env('STRIPE_API_PRIVATE_KEY') STRIPE_API_PUBLIC_KEY = env('STRIPE_API_PUBLIC_KEY') -DEBUG = False +DEBUG = True if DEBUG: from .local import * diff --git a/hosting/management/commands/create_vm_types.py b/hosting/management/commands/create_vm_types.py index 44995634..493e9e82 100644 --- a/hosting/management/commands/create_vm_types.py +++ b/hosting/management/commands/create_vm_types.py @@ -12,39 +12,41 @@ class Command(BaseCommand): 'core_price': 10, 'memory_price': 5, 'disk_size_price': 1, - 'description': 'VM auf einzelner HW, Raid1, kein HA' + 'description': 'VM auf einzelner HW, Raid1, kein HA', + 'location':'DE' } return { - 'hetzner_nug': { - 'base_price': 5, - 'memory_price': 2, - 'core_price': 2, - 'disk_size_price': 0.5, - 'description': 'VM ohne Uptime Garantie' - }, + # 'hetzner_nug': { + # 'base_price': 5, + # 'memory_price': 2, + # 'core_price': 2, + # 'disk_size_price': 0.5, + # 'description': 'VM ohne Uptime Garantie' + # }, 'hetzner': hetzner, - 'hetzner_raid6': { - 'base_price': hetzner['base_price']*1.2, - 'core_price': hetzner['core_price']*1.2, - 'memory_price': hetzner['memory_price']*1.2, - 'disk_size_price': hetzner['disk_size_price']*1.2, - 'description': 'VM auf einzelner HW, Raid1, kein HA' + # 'hetzner_raid6': { + # 'base_price': hetzner['base_price']*1.2, + # 'core_price': hetzner['core_price']*1.2, + # 'memory_price': hetzner['memory_price']*1.2, + # 'disk_size_price': hetzner['disk_size_price']*1.2, + # 'description': 'VM auf einzelner HW, Raid1, kein HA' - }, - 'hetzner_glusterfs': { - 'base_price': hetzner['base_price']*1.4, - 'core_price': hetzner['core_price']*1.4, - 'memory_price': hetzner['memory_price']*1.4, - 'disk_size_price': hetzner['disk_size_price']*1.4, - 'description': 'VM auf einzelner HW, Raid1, kein HA' - }, + # }, + # 'hetzner_glusterfs': { + # 'base_price': hetzner['base_price']*1.4, + # 'core_price': hetzner['core_price']*1.4, + # 'memory_price': hetzner['memory_price']*1.4, + # 'disk_size_price': hetzner['disk_size_price']*1.4, + # 'description': 'VM auf einzelner HW, Raid1, kein HA' + # }, 'bern': { 'base_price': 12, 'core_price': 25, 'memory_price': 7, 'disk_size_price': 0.70, 'description': "VM in Bern, HA Setup ohne HA Garantie", + 'location':'CH', } } diff --git a/hosting/migrations/0017_virtualmachinetype_location.py b/hosting/migrations/0017_virtualmachinetype_location.py new file mode 100644 index 00000000..445ff4f0 --- /dev/null +++ b/hosting/migrations/0017_virtualmachinetype_location.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-05-19 04:14 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hosting', '0016_delete_railsbetauser'), + ] + + operations = [ + migrations.AddField( + model_name='virtualmachinetype', + name='location', + field=models.CharField(choices=[('DE', 'Germany'), ('CH', 'Switzerland')], default='DE', max_length=3), + preserve_default=False, + ), + ] diff --git a/hosting/models.py b/hosting/models.py index 8b26189a..e2775fc4 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -17,6 +17,8 @@ class VirtualMachineType(models.Model): HETZNER_R6 = 'hetzner_raid6' HETZNER_G = 'hetzner_glusterfs' BERN = 'bern' + DE_LOCATION = 'DE' + CH_LOCATION = 'CH' HOSTING_TYPES = ( (HETZNER_NUG, 'Hetzner No Uptime Guarantee'), @@ -26,12 +28,17 @@ class VirtualMachineType(models.Model): (BERN, 'Bern'), ) + LOCATIONS_CHOICES = ( + (DE_LOCATION, 'Germany'), + (CH_LOCATION, 'Switzerland'), + ) description = models.TextField() base_price = models.FloatField() memory_price = models.FloatField() core_price = models.FloatField() disk_size_price = models.FloatField() hosting_company = models.CharField(max_length=30, choices=HOSTING_TYPES) + location = models.CharField(max_length=3, choices=LOCATIONS_CHOICES) def __str__(self): return "%s" % (self.get_hosting_company_display()) @@ -65,6 +72,8 @@ class VirtualMachineType(models.Model): 'hosting_company_name': self.get_hosting_company_display(), 'hosting_company': self.hosting_company, 'default_price': self.defeault_price(), + 'location_code': self.location, + 'location': self.get_location_display(), 'id': self.id, } diff --git a/hosting/static/hosting/css/pricing.css b/hosting/static/hosting/css/pricing.css index 7fb6f51f..227be49d 100644 --- a/hosting/static/hosting/css/pricing.css +++ b/hosting/static/hosting/css/pricing.css @@ -33,7 +33,7 @@ .pricing li.type { list-style: none; padding: 13px; - height: 200px; + height: 150px; } .pricing big { @@ -72,6 +72,16 @@ box-shadow: inset 0px 2px 2px rgba(0, 0, 0, 0.1); } /* pricing color */ + +.p-black big, +.p-black h3 { + color: black; +} + +.p-black button { + background: black; +} + .p-green big, .p-green h3 { color: #4c7737; diff --git a/hosting/static/hosting/img/CH_flag.png b/hosting/static/hosting/img/CH_flag.png new file mode 100644 index 0000000000000000000000000000000000000000..340a398a87e2fa92e78dd46788295f1f5e04f808 GIT binary patch literal 841 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k4M?tyST_$yu@pObhHwBu4M$1`kk47*5n0T@ zz;qOZ89T4lzXu9RmbgZg1m~xflqVLYGL)B>>t*I;7bhncr0V4trO$q6BL!4_%+tj& zq+-t7y9Ya!0wvroK2Kn1OJI|2YD>y!3u?O{8NxBQaqo+%Juy;g4A zyMIf3XSDg6{*9p`m8nrdfP?zPhWWM+bYt|AW%@UV+eBSATzCDZwpsr3Q*Y}x=p@ha z0}AfCd(2{f`uZC-{yH?UADgE(?Cvj|Z~I7p`swrAMdjs_W%z*3`1MQb@#o@iUH5m# z)$bGE40QI&$AvwYGrx7^TFY$v%0E5zThnrzjS3trO%7Bi_B`u7R4V(pZ1&zq-(^1j zDSvHMeK2@^<BUr1z@sg@O1TaS?83{1OUQW^F;sv literal 0 HcmV?d00001 diff --git a/hosting/static/hosting/img/DE_flag.png b/hosting/static/hosting/img/DE_flag.png new file mode 100644 index 0000000000000000000000000000000000000000..d4f4526e9e00847d0f5bcd13b4d270453cbe2f43 GIT binary patch literal 376 zcmeAS@N?(olHy`uVBq!ia0vp^CxEz>g9%7Z{G(6}q}Y|gW!U_%O^81FzR}` zIEGZrd3)87x5a^h<=}1ZXCI4%{FwO)4$AvnxS0~XG(m3e84LRl``*7{T;my`(&Fkw z2O=rv_Z!YN8F!8Y$rGZJ1jINKC(@kgeEWUAEh8|Pu!9G+{MUD}IjZ?`{Rb)VboFyt I=akR{0M-L+MgRZ+ literal 0 HcmV?d00001 diff --git a/hosting/static/hosting/js/pricing.js b/hosting/static/hosting/js/pricing.js index 814b4aa9..113439a6 100644 --- a/hosting/static/hosting/js/pricing.js +++ b/hosting/static/hosting/js/pricing.js @@ -49,5 +49,9 @@ $( document ).ready(function() { $('.disk-space-selector').on('change',change_attribute); + //Disable input + $('.disk-space-selector').keypress(function(event){ + event.preventDefault(); + }); }); \ No newline at end of file diff --git a/hosting/templates/hosting/base_short.html b/hosting/templates/hosting/base_short.html index 339020de..8b3f0dbb 100644 --- a/hosting/templates/hosting/base_short.html +++ b/hosting/templates/hosting/base_short.html @@ -81,23 +81,23 @@ {% else %}
  • - How it works + How it works
  • - Your infrastructure + Your infrastructure
  • - Our inftrastructure + Our inftrastructure
  • - Pricing + Pricing
  • - Contact + Contact
  • Login -
  • + {% endif %} @@ -123,21 +123,22 @@
  • - How it works + How it works
  • - Your infrastructure
  • + Your infrastructure
  • - Our infrastructure
  • + Our infrastructure
  • - Pricing + Pricing
  • - Contact + Contact
  • + diff --git a/hosting/templates/hosting/includes/_pricing.html b/hosting/templates/hosting/includes/_pricing.html index 98e90196..1f4e308e 100644 --- a/hosting/templates/hosting/includes/_pricing.html +++ b/hosting/templates/hosting/includes/_pricing.html @@ -1,3 +1,4 @@ +{% load staticfiles %}
    @@ -6,7 +7,6 @@

    Hosting Price

    -

    Here are samples of our {{ hosting_long }} hosting offers, suited for different projects. Our offer examples come in different size, speed, and storage.

    @@ -17,17 +17,31 @@
    -
    +
    {% for vm in vm_types %} -
    +
    {% csrf_token %} -
      + + +
      • {{vm.hosting_company_name}}

        +
        + + +
      • +
      • + +
        +
        + + {{vm.location}} +
        +
      • @@ -64,7 +78,7 @@
        - + GiB
        @@ -75,7 +89,7 @@ per month
      • - +
      diff --git a/hosting/templates/hosting/login.html b/hosting/templates/hosting/login.html index 4521553c..0c772da6 100644 --- a/hosting/templates/hosting/login.html +++ b/hosting/templates/hosting/login.html @@ -5,6 +5,17 @@