merged master
This commit is contained in:
commit
925252f1c9
44 changed files with 2581 additions and 1811 deletions
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-07-02 23:08+0530\n"
|
||||
"POT-Creation-Date: 2017-07-24 18:51+0300\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"
|
||||
|
|
@ -42,6 +42,70 @@ msgstr ""
|
|||
"Vielen dank für Ihre Anmeldung. Sie erhalten in kürze eine Bestätigungsmail "
|
||||
"von unserem Team"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:5
|
||||
#: templates/datacenterlight/pricing.html:22
|
||||
msgid "VM hosting"
|
||||
msgstr ""
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:9
|
||||
msgid "month"
|
||||
msgstr "Monat"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:11
|
||||
#: templates/datacenterlight/pricing.html:28
|
||||
msgid "VAT included"
|
||||
msgstr "MwSt. inklusive"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:16
|
||||
#: templates/datacenterlight/pricing.html:33
|
||||
msgid "Hosted in Switzerland"
|
||||
msgstr "Standort: Schweiz"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:21
|
||||
msgid "Please enter a value in range 1 - 48."
|
||||
msgstr "Bitte gib einen Wert von 1 bis 48 ein."
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:30
|
||||
msgid "Please enter a value in range 2 - 200."
|
||||
msgstr "Bitte gib einen Wert von 2 bis 200 ein."
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:39
|
||||
msgid "Please enter a value in range 10 - 2000."
|
||||
msgstr "Bitte gib einen Wert von 10 bis 200 ein."
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:40
|
||||
#: templates/datacenterlight/pricing.html:50
|
||||
msgid "GB Storage (SSD)"
|
||||
msgstr "GB Storage (SSD)"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:59
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:60
|
||||
msgid "Your Name"
|
||||
msgstr "Dein Name"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:60
|
||||
msgid "Please enter your name."
|
||||
msgstr "Bitte gib Deinen Namen ein."
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:74
|
||||
msgid "Email"
|
||||
msgstr "E-Mail-Adresse"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:75
|
||||
msgid "Your Email"
|
||||
msgstr "Deine E-Mail"
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:75
|
||||
msgid "Please enter a valid email address."
|
||||
msgstr "Bitte gib eine gültige E-Mailadresse ein."
|
||||
|
||||
#: templates/datacenterlight/calculator_form.html:88
|
||||
msgid "Continue"
|
||||
msgstr "Weiter"
|
||||
|
||||
#: templates/datacenterlight/emails/request_access_confirmation.html:99
|
||||
#: templates/datacenterlight/emails/request_access_confirmation.txt:99
|
||||
msgid "Thank you for your request."
|
||||
|
|
@ -129,27 +193,28 @@ msgstr ""
|
|||
#: templates/datacenterlight/includes/_footer.html:11
|
||||
#: templates/datacenterlight/includes/_footer.html:31
|
||||
#: templates/datacenterlight/includes/_navbar.html:27
|
||||
#: templates/datacenterlight/index.html:20
|
||||
#: templates/datacenterlight/index.html:47
|
||||
#: templates/datacenterlight/includes/_navbar.html:28
|
||||
#: templates/datacenterlight/index.html:19
|
||||
#: templates/datacenterlight/index.html:46
|
||||
msgid "Highlights"
|
||||
msgstr ""
|
||||
|
||||
#: templates/datacenterlight/includes/_footer.html:14
|
||||
#: templates/datacenterlight/includes/_footer.html:34
|
||||
#: templates/datacenterlight/includes/_navbar.html:30
|
||||
#: templates/datacenterlight/index.html:86
|
||||
#: templates/datacenterlight/index.html:85
|
||||
msgid "Scale out"
|
||||
msgstr "Skalierung"
|
||||
|
||||
#: templates/datacenterlight/includes/_footer.html:17
|
||||
#: templates/datacenterlight/includes/_footer.html:37
|
||||
#: templates/datacenterlight/includes/_navbar.html:33
|
||||
#: templates/datacenterlight/index.html:112
|
||||
#: templates/datacenterlight/includes/_navbar.html:31
|
||||
#: templates/datacenterlight/index.html:111
|
||||
msgid "Reliable and light"
|
||||
msgstr "Zuverlässig und leicht"
|
||||
|
||||
#: templates/datacenterlight/includes/_footer.html:20
|
||||
#: templates/datacenterlight/includes/_navbar.html:36
|
||||
#: templates/datacenterlight/includes/_navbar.html:32
|
||||
msgid "Order VM"
|
||||
msgstr "VM bestellen"
|
||||
|
||||
|
|
@ -167,28 +232,33 @@ msgstr "Home"
|
|||
msgid "Pricing"
|
||||
msgstr "Preise"
|
||||
|
||||
#: templates/datacenterlight/index.html:16
|
||||
#: templates/datacenterlight/includes/_navbar.html:36
|
||||
#: templates/datacenterlight/whydatacenterlight.html:12
|
||||
msgid "Why Data Center Light?"
|
||||
msgstr "Warum Data Center Light?"
|
||||
|
||||
#: templates/datacenterlight/index.html:15
|
||||
msgid "Finally, an affordable VM hosting in Switzerland!"
|
||||
msgstr "Endlich: bezahlbares VM Hosting in der Schweiz"
|
||||
|
||||
#: templates/datacenterlight/index.html:23
|
||||
#: templates/datacenterlight/index.html:22
|
||||
msgid "I want it!"
|
||||
msgstr "Das will ich haben!"
|
||||
|
||||
#: templates/datacenterlight/index.html:53
|
||||
#: templates/datacenterlight/index.html:52
|
||||
msgid ""
|
||||
"Reuses existing factory halls instead of building a new expensive building."
|
||||
msgstr ""
|
||||
"Verwendet ehemalige Fabrikhallen anstatt ein neues, teures Gebäude zu "
|
||||
"errichten.
"
|
||||
|
||||
#: templates/datacenterlight/index.html:58
|
||||
#: templates/datacenterlight/index.html:57
|
||||
msgid "Only wants you to pay for what you actually need."
|
||||
msgstr ""
|
||||
"Möchte, dass du nur bezahlst, was du auch wirklich brauchst: Wähle deine "
|
||||
"Ressourcen individuell aus!
"
|
||||
|
||||
#: templates/datacenterlight/index.html:62
|
||||
#: templates/datacenterlight/index.html:61
|
||||
msgid ""
|
||||
"Is creative, using a modern and alternative design for a data center in "
|
||||
"order to make it more sustainable and affordable at the same time."
|
||||
|
|
@ -197,7 +267,7 @@ msgstr ""
|
|||
"macht um Nachhaltigkeit zu fördern und somit erschwingliche Preise bieten zu "
|
||||
"können.
"
|
||||
|
||||
#: templates/datacenterlight/index.html:66
|
||||
#: templates/datacenterlight/index.html:65
|
||||
msgid ""
|
||||
"Cuts down the costs for you by using FOSS (Free Open Source Software) "
|
||||
"exclusively, wherefore we can save money from paying licenses."
|
||||
|
|
@ -206,7 +276,7 @@ msgstr ""
|
|||
"mit FOSS (Free Open Source Software) arbeitet und wir daher auf "
|
||||
"Lizenzgebühren verzichten können.
"
|
||||
|
||||
#: templates/datacenterlight/index.html:89
|
||||
#: templates/datacenterlight/index.html:88
|
||||
msgid ""
|
||||
"We don't use special hardware. We use commodity hardware: we buy computers "
|
||||
"that you buy. Just many more and put them in a cozy home for computers "
|
||||
|
|
@ -216,7 +286,7 @@ msgstr ""
|
|||
"erschwingliche Systeme. Bei grösserer Auslastung werden mehr "
|
||||
"Standardkomponenten hinzugekauft und skalieren so das Datencenter."
|
||||
|
||||
#: templates/datacenterlight/index.html:115
|
||||
#: templates/datacenterlight/index.html:114
|
||||
msgid ""
|
||||
"Our VMs are located in Switzerland, with reliable power supply and fast "
|
||||
"internet connection. Our VM costs less thanks to our featherlight "
|
||||
|
|
@ -226,91 +296,26 @@ msgstr ""
|
|||
"Energieversorgung, sowie schneller Internetverbindung ausgestattet. Unser "
|
||||
"Angebot ist aufgrund unserer leichten Infrastruktur überaus kostengünstig."
|
||||
|
||||
#: templates/datacenterlight/index.html:133
|
||||
#: templates/datacenterlight/index.html:132
|
||||
#: templates/datacenterlight/pricing.html:86
|
||||
msgid "Simple and affordable: Try our virtual machine with featherlight price."
|
||||
msgstr ""
|
||||
"Einfach und bezahlbar: Teste nun unsere virtuellen Maschinen mit "
|
||||
"federleichten Preisen."
|
||||
|
||||
#: templates/datacenterlight/index.html:134
|
||||
#: templates/datacenterlight/index.html:133
|
||||
msgid "Affordable VM hosting based in Switzerland"
|
||||
msgstr "Bezahlbares VM Hosting in der Schweiz"
|
||||
|
||||
#: templates/datacenterlight/index.html:145
|
||||
#: templates/datacenterlight/pricing.html:22
|
||||
msgid "VM hosting"
|
||||
msgstr ""
|
||||
|
||||
#: templates/datacenterlight/index.html:149
|
||||
msgid "month"
|
||||
msgstr "Monat"
|
||||
|
||||
#: templates/datacenterlight/index.html:151
|
||||
#: templates/datacenterlight/pricing.html:28
|
||||
msgid "VAT included"
|
||||
msgstr "MwSt. inklusive"
|
||||
|
||||
#: templates/datacenterlight/index.html:156
|
||||
#: templates/datacenterlight/pricing.html:33
|
||||
msgid "Hosted in Switzerland"
|
||||
msgstr "Standort: Schweiz"
|
||||
|
||||
#: templates/datacenterlight/index.html:161
|
||||
msgid "Please enter a value greater than or equal to 1."
|
||||
msgstr "Bitte gib einen Wert größer oder gleich 1 ein."
|
||||
|
||||
#: templates/datacenterlight/index.html:170
|
||||
msgid "Please enter a value greater than or equal to 2."
|
||||
msgstr "Bitte gib einen Wert größer oder gleich 2 ein."
|
||||
|
||||
#: templates/datacenterlight/index.html:179
|
||||
msgid "Please enter a value greater than or equal to 10."
|
||||
msgstr "Bitte gib einen Wert größer oder gleich 10 ein"
|
||||
|
||||
#: templates/datacenterlight/index.html:180
|
||||
#: templates/datacenterlight/pricing.html:50
|
||||
msgid "GB Storage (SSD)"
|
||||
msgstr "GB Storage (SSD)"
|
||||
|
||||
#: templates/datacenterlight/index.html:199
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: templates/datacenterlight/index.html:200
|
||||
msgid "Your Name"
|
||||
msgstr "Dein Name"
|
||||
|
||||
#: templates/datacenterlight/index.html:200
|
||||
msgid "Please enter your name"
|
||||
msgstr "Bitte gib Deinen Namen ein"
|
||||
|
||||
#: templates/datacenterlight/index.html:214
|
||||
msgid "Email"
|
||||
msgstr "E-Mail-Adresse"
|
||||
|
||||
#: templates/datacenterlight/index.html:215
|
||||
msgid "Your Email"
|
||||
msgstr "Deine E-Mail"
|
||||
|
||||
#: templates/datacenterlight/index.html:215
|
||||
msgid "Please enter a valid email address"
|
||||
msgstr "Bitte gib eine gültige E-Mailadresse ein"
|
||||
|
||||
#: templates/datacenterlight/index.html:228
|
||||
#: templates/datacenterlight/pricing.html:79
|
||||
msgid "Order Now!"
|
||||
msgstr "Bestelle jetzt!"
|
||||
|
||||
#: templates/datacenterlight/index.html:254
|
||||
#: templates/datacenterlight/index.html:166
|
||||
msgid "Switzerland "
|
||||
msgstr "Schweiz"
|
||||
|
||||
#: templates/datacenterlight/index.html:271
|
||||
#: templates/datacenterlight/index.html:183
|
||||
msgid "Questions?"
|
||||
msgstr "Fragen?"
|
||||
|
||||
#: templates/datacenterlight/index.html:271
|
||||
#: templates/datacenterlight/index.html:183
|
||||
msgid "Contact us!"
|
||||
msgstr "Kontaktiere uns!"
|
||||
|
||||
|
|
@ -319,46 +324,46 @@ msgid "Confirm Order"
|
|||
msgstr "Bestellung Bestätigen"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:30
|
||||
msgid "Billed To:"
|
||||
msgstr "Rechnungsadresse"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:39
|
||||
msgid "Date"
|
||||
msgstr "Datum"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:48
|
||||
#: templates/datacenterlight/order_detail.html:36
|
||||
msgid "Billed To:"
|
||||
msgstr "Rechnungsadresse"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:47
|
||||
msgid "Payment Method:"
|
||||
msgstr "Bezahlmethode"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:49
|
||||
#: templates/datacenterlight/order_detail.html:48
|
||||
msgid "ending"
|
||||
msgstr "endend in"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:59
|
||||
#: templates/datacenterlight/order_detail.html:58
|
||||
msgid "Order summary"
|
||||
msgstr "Bestellungsübersicht"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:63
|
||||
#: templates/datacenterlight/order_detail.html:62
|
||||
msgid "Cores"
|
||||
msgstr "Prozessorkerne"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:65
|
||||
#: templates/datacenterlight/order_detail.html:64
|
||||
msgid "Memory"
|
||||
msgstr "Arbeitsspeicher"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:67
|
||||
#: templates/datacenterlight/order_detail.html:66
|
||||
msgid "Disk space"
|
||||
msgstr "Festplattenkapazität"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:69
|
||||
#: templates/datacenterlight/order_detail.html:68
|
||||
msgid "Configuration"
|
||||
msgstr "Konfiguration"
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:71
|
||||
#: templates/datacenterlight/order_detail.html:70
|
||||
msgid "Total"
|
||||
msgstr ""
|
||||
|
||||
#: templates/datacenterlight/order_detail.html:78
|
||||
#: templates/datacenterlight/order_detail.html:77
|
||||
msgid "Place order"
|
||||
msgstr "Bestellen"
|
||||
|
||||
|
|
@ -366,6 +371,10 @@ msgstr "Bestellen"
|
|||
msgid "We are cutting down the costs significantly!"
|
||||
msgstr "Wir sorgen dafür, dass die Kosten für Dich signifikant abnehmen"
|
||||
|
||||
#: templates/datacenterlight/pricing.html:79
|
||||
msgid "Order Now!"
|
||||
msgstr "Bestelle jetzt!"
|
||||
|
||||
#: templates/datacenterlight/pricing.html:89
|
||||
msgid ""
|
||||
"Our VMs are hosted in Glarus, Switzerland, and our website is currently "
|
||||
|
|
@ -392,14 +401,115 @@ msgstr ""
|
|||
msgid "as soon as possible!"
|
||||
msgstr ""
|
||||
|
||||
#: views.py:234
|
||||
#: templates/datacenterlight/whydatacenterlight.html:26
|
||||
msgid "Tech Stack"
|
||||
msgstr "Tech Stack"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:29
|
||||
msgid "We are seriously open source."
|
||||
msgstr "Wir sind vollends opensource."
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:30
|
||||
msgid ""
|
||||
" Our full software stack is open source – We don't use anything that isn't "
|
||||
"open source. <br>Yes, we are that cool. "
|
||||
msgstr ""
|
||||
"Unser gesamter Softwaresstack ist Open-Source – Wir verwenden nichts, das "
|
||||
"nicht Open-Source ist.<br/>Yep, so cool sind wir."
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:37
|
||||
msgid "Our services run on"
|
||||
msgstr "Unsere Dienste läuft auf"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:41
|
||||
msgid "Our monitoring"
|
||||
msgstr "Unser Monitoring"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:45
|
||||
msgid "Our storage layer"
|
||||
msgstr "Unser Storage-Layer"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:49
|
||||
msgid "Our web frontend"
|
||||
msgstr "Unser Web-Frontend"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:53
|
||||
msgid "Our cloud"
|
||||
msgstr "Unsere Cloud"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:57
|
||||
msgid "Our configuration management system"
|
||||
msgstr "Unser Konfigurationsmanagementsystem"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:61
|
||||
msgid "Our awesome juice"
|
||||
msgstr "Unser Treibstoff"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:65
|
||||
msgid "Our NAT64 gateway"
|
||||
msgstr "Unser NAT64 Gateway"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:90
|
||||
msgid "We believe in giving back to the FOSS community."
|
||||
msgstr "Wir unterstützen die FOSS Community."
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:91
|
||||
msgid ""
|
||||
"Data Center Light is the child of free and open source software (FOSS) "
|
||||
"movement. <br>We grew up with it, live by it, and believe in it.<br> The "
|
||||
"more we work on our data center,<br> the more we contribute back to the FOSS "
|
||||
"community."
|
||||
msgstr ""
|
||||
"Data Center Light ist ein Teil der Free und Opens Source Software (FOSS) "
|
||||
"Bewegung.<br/> Wir sind damit gross geworden, leben damit und glauben daran."
|
||||
"<br/> Je weiter wir mit unserem Data Center Light vorankommen, desto mehr "
|
||||
"können wir etwas an die FOSS Community zurückgeben."
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:104
|
||||
msgid "We bring the future to you."
|
||||
msgstr "Wir bringen die Zukunft zu dir."
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:107
|
||||
msgid ""
|
||||
" Data Center Light uses the most modern technologies out there.<br>\n"
|
||||
" Your VM needs only IPv6. Data Center Light "
|
||||
"provides<br> transparent two-way IPv6/IPv4 translation.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
"Data Center Light verwendet die zur Zeit modernsten Technologien.<br/>Deine "
|
||||
"VM läuft mit IPv6. Data Center Light bietet eine transparente IPv6/IPv4-"
|
||||
"Zweiweglösung."
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:122
|
||||
msgid ""
|
||||
" No more spinning metal plates! Data Center Light uses only SSDs. We keep "
|
||||
"things faster and lighter. "
|
||||
msgstr ""
|
||||
"Keine drehenden Metallplatten mehr! Data Center Light verwendet "
|
||||
"ausschliesslich SSDs. Wir halten die Dinge schnell, leicht und effizient."
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:138
|
||||
msgid "Starting from only 15CHF per month. Try now."
|
||||
msgstr "Unser Angebot beginnt bei 15 CHF pro Monat. Probier's jetzt aus!"
|
||||
|
||||
#: templates/datacenterlight/whydatacenterlight.html:139
|
||||
msgid "Actions speak louder than words. Let's do it, try our VM now."
|
||||
msgstr "Tagen sagen mehr als Worte – Teste jetzt unsere VM!"
|
||||
|
||||
#: views.py:235
|
||||
msgid "is not a proper name"
|
||||
msgstr "ist kein gültiger Name"
|
||||
|
||||
#: views.py:241
|
||||
#: views.py:242
|
||||
msgid "is not a proper email"
|
||||
msgstr "ist keine gültige E-Mailadresse"
|
||||
|
||||
#~ msgid "Please enter a value greater than or equal to 1."
|
||||
#~ msgstr "Bitte gib einen Wert größer oder gleich 1 ein."
|
||||
|
||||
#~ msgid "Please enter a value greater than or equal to 10."
|
||||
#~ msgstr "Bitte gib einen Wert größer oder gleich 10 ein"
|
||||
|
||||
#~ msgid "Buy VM"
|
||||
#~ msgstr "VM Kaufen"
|
||||
|
||||
|
|
|
|||
29
datacenterlight/management/commands/fetchvmtemplates.py
Normal file
29
datacenterlight/management/commands/fetchvmtemplates.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
from opennebula_api.models import OpenNebulaManager
|
||||
from datacenterlight.models import VMTemplate
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Fetches the VM templates from OpenNebula and populates the dcl VMTemplate model'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
try:
|
||||
manager = OpenNebulaManager()
|
||||
templates = manager.get_templates()
|
||||
dcl_vm_templates = []
|
||||
for template in templates:
|
||||
template_name = template.name.strip('public-')
|
||||
template_id = template.id
|
||||
dcl_vm_template = VMTemplate.create(template_name, template_id)
|
||||
dcl_vm_templates.append(dcl_vm_template)
|
||||
|
||||
old_vm_templates = VMTemplate.objects.all()
|
||||
old_vm_templates.delete()
|
||||
|
||||
for dcl_vm_template in dcl_vm_templates:
|
||||
dcl_vm_template.save()
|
||||
except Exception as e:
|
||||
logger.error('Error connecting to OpenNebula. Error Details: {err}'.format(err=str(e)))
|
||||
|
|
@ -9,12 +9,13 @@ class BetaAccessVMType(models.Model):
|
|||
|
||||
def __str__(self):
|
||||
return "ID: %s - SSD %s - RAM %s - CPU %s - Price %s " % \
|
||||
(self.id, str(self.ssd), self.ram, self.cpu, self.price)
|
||||
(self.id, str(self.ssd), self.ram, self.cpu, self.price)
|
||||
|
||||
|
||||
class BetaAccess(models.Model):
|
||||
email = models.CharField(max_length=250)
|
||||
name = models.CharField(max_length=250)
|
||||
|
||||
# vm = models.ForeignKey(BetaAccessVM)
|
||||
|
||||
def __str__(self):
|
||||
|
|
@ -48,3 +49,13 @@ class BetaAccessVM(models.Model):
|
|||
amount=vm[VM_AMOUNT], type=vm_type))
|
||||
|
||||
return created_vms
|
||||
|
||||
|
||||
class VMTemplate(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
opennebula_vm_template_id = models.IntegerField()
|
||||
|
||||
@classmethod
|
||||
def create(cls, name, opennebula_vm_template_id):
|
||||
vm_template = cls(name=name, opennebula_vm_template_id=opennebula_vm_template_id)
|
||||
return vm_template
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 6 KiB |
|
|
@ -1,22 +1,22 @@
|
|||
(function($){
|
||||
(function($) {
|
||||
"use strict"; // Start of use strict
|
||||
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------
|
||||
Scripts initialization
|
||||
--------------------------------------------- */
|
||||
var cardPricing ={
|
||||
var cardPricing = {
|
||||
'cpu': {
|
||||
'id': 'coreValue',
|
||||
'value': 1,
|
||||
'min':1,
|
||||
'min': 1,
|
||||
'max': 48,
|
||||
'interval': 1
|
||||
},
|
||||
'ram': {
|
||||
'id': 'ramValue',
|
||||
'value': 2,
|
||||
'min':2,
|
||||
'min': 2,
|
||||
'max': 200,
|
||||
'interval': 1
|
||||
},
|
||||
|
|
@ -24,131 +24,141 @@
|
|||
'id': 'storageValue',
|
||||
'value': 10,
|
||||
'min': 10,
|
||||
'max': 500,
|
||||
'max': 2000,
|
||||
'interval': 10
|
||||
}
|
||||
}
|
||||
$(window).load(function(){
|
||||
|
||||
|
||||
};
|
||||
$(window).load(function() {
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$(document).ready(function() {
|
||||
verifiedUrl();
|
||||
_navScroll();
|
||||
_initScroll();
|
||||
_initNavUrl();
|
||||
_initPricing();
|
||||
|
||||
_navScroll();
|
||||
_initScroll();
|
||||
_initNavUrl();
|
||||
_initPricing();
|
||||
|
||||
});
|
||||
|
||||
$(window).resize(function(){
|
||||
|
||||
|
||||
|
||||
|
||||
$(window).resize(function() {
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------
|
||||
Nav panel classic
|
||||
--------------------------------------------- */
|
||||
if (window.matchMedia("(min-width: 767px)").matches) {
|
||||
$('ul.nav li.dropdown').hover(function() {
|
||||
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
|
||||
}, function() {
|
||||
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
|
||||
});
|
||||
} else {
|
||||
/* the viewport is less than 400 pixels wide */
|
||||
}
|
||||
|
||||
|
||||
|
||||
function _initScroll(){
|
||||
$(window).scroll(function(){
|
||||
_navScroll();
|
||||
if (window.matchMedia("(min-width: 767px)").matches) {
|
||||
$('ul.nav li.dropdown').hover(function() {
|
||||
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
|
||||
}, function() {
|
||||
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
|
||||
});
|
||||
|
||||
} else {
|
||||
/* the viewport is less than 400 pixels wide */
|
||||
}
|
||||
|
||||
function _navScroll(){
|
||||
if($(window).scrollTop() > 10 ){
|
||||
|
||||
|
||||
function _initScroll() {
|
||||
$(window).scroll(function() {
|
||||
_navScroll();
|
||||
});
|
||||
}
|
||||
|
||||
function _navScroll() {
|
||||
if ($(window).scrollTop() > 10) {
|
||||
$(".navbar").removeClass("navbar-transparent");
|
||||
$(".navbar-default .btn-link").css("color", "#777");
|
||||
$(".dropdown-menu").removeClass("navbar-transparent");
|
||||
$(".dropdown-menu > li > a").css("color", "#777");
|
||||
}else{
|
||||
} else {
|
||||
$(".navbar").addClass("navbar-transparent");
|
||||
$(".navbar-default .btn-link").css("color", "#fff");
|
||||
$(".dropdown-menu").addClass("navbar-transparent");
|
||||
$(".dropdown-menu > li > a").css("color", "#fff");
|
||||
}
|
||||
}
|
||||
function _initNavUrl(){
|
||||
$('.url').click(function(){
|
||||
var href = $(this).attr('data-url');
|
||||
$('.navbar-collapse').removeClass('in');
|
||||
$('.navbar-collapse').addClass('collapsing');
|
||||
$('html, body').animate({
|
||||
scrollTop: $(href).offset().top
|
||||
}, 1000);
|
||||
|
||||
function _initNavUrl() {
|
||||
$('.url').click(function(event) {
|
||||
event.preventDefault();
|
||||
var href = $(this).attr('data-url');
|
||||
$('.navbar-collapse').removeClass('in');
|
||||
$('.navbar-collapse').addClass('collapsing');
|
||||
var url = window.location.pathname;
|
||||
var urlSplit = url.split('/');
|
||||
if (urlSplit.length === 3 && urlSplit[2] === 'datacenterlight') {
|
||||
$('html, body').animate({
|
||||
scrollTop: $(href).offset().top
|
||||
}, 1000);
|
||||
} else {
|
||||
var allUrl = window.location.href;
|
||||
var redirect = allUrl.split('whydatacenterlight')
|
||||
window.location.href = '/en-us/datacenterlight' + href;
|
||||
}
|
||||
});
|
||||
}
|
||||
function verifiedUrl(){
|
||||
if(window.location.href.indexOf('#success') > -1){
|
||||
|
||||
function verifiedUrl() {
|
||||
if (window.location.href.indexOf('#success') > -1) {
|
||||
form_success();
|
||||
console.log('epa');
|
||||
}
|
||||
}
|
||||
|
||||
function _initPricing(){
|
||||
function _initPricing() {
|
||||
_fetchPricing();
|
||||
|
||||
$('.fa-minus-circle.left').click(function(event){
|
||||
$('.fa-minus-circle.left').click(function(event) {
|
||||
var data = $(this).data('minus');
|
||||
|
||||
if(cardPricing[data].value > cardPricing[data].min){
|
||||
|
||||
if (cardPricing[data].value > cardPricing[data].min) {
|
||||
cardPricing[data].value = Number(cardPricing[data].value) - cardPricing[data].interval;
|
||||
}
|
||||
_fetchPricing();
|
||||
});
|
||||
$('.fa-plus-circle.right').click(function(event){
|
||||
$('.fa-plus-circle.right').click(function(event) {
|
||||
var data = $(this).data('plus');
|
||||
if(cardPricing[data].value < cardPricing[data].max){
|
||||
if (cardPricing[data].value < cardPricing[data].max) {
|
||||
cardPricing[data].value = Number(cardPricing[data].value) + cardPricing[data].interval;
|
||||
}
|
||||
_fetchPricing();
|
||||
});
|
||||
|
||||
$('.input-price').change(function(){
|
||||
$('.input-price').change(function() {
|
||||
var data = $(this).attr("name");
|
||||
cardPricing[data].value = $('input[name='+data+']').val();
|
||||
cardPricing[data].value = $('input[name=' + data + ']').val();
|
||||
_fetchPricing();
|
||||
});
|
||||
}
|
||||
function _fetchPricing(){
|
||||
Object.keys(cardPricing).map(function(element){
|
||||
|
||||
function _fetchPricing() {
|
||||
Object.keys(cardPricing).map(function(element) {
|
||||
//$('#'+cardPricing[element].id).val(cardPricing[element].value);
|
||||
$('input[name='+element+']').val(cardPricing[element].value);
|
||||
$('input[name=' + element + ']').val(cardPricing[element].value);
|
||||
});
|
||||
_calcPricing();
|
||||
}
|
||||
|
||||
function _calcPricing(){
|
||||
var total = (cardPricing['cpu'].value * 5) + (2* cardPricing['ram'].value) + (0.6* cardPricing['storage'].value);
|
||||
function _calcPricing() {
|
||||
var total = (cardPricing['cpu'].value * 5) + (2 * cardPricing['ram'].value) + (0.6 * cardPricing['storage'].value);
|
||||
total = parseFloat(total.toFixed(2));
|
||||
|
||||
$("#total").text(total);
|
||||
$('input[name=total]').val(total);
|
||||
}
|
||||
function form_success(){
|
||||
|
||||
function form_success() {
|
||||
$('#sucessModal').modal('show');
|
||||
}
|
||||
function _calculate(numbers, price){
|
||||
$('#valueTotal').text(numbers*price*31);
|
||||
|
||||
function _calculate(numbers, price) {
|
||||
$('#valueTotal').text(numbers * price * 31);
|
||||
}
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
|||
|
|
@ -3,65 +3,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{LANGUAGE_CODE}}">
|
||||
|
||||
<head>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Data Center Light by ungleich">
|
||||
<meta name="author" content="ungleich GmbH">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Data Center Light by ungleich">
|
||||
<meta name="author" content="ungleich GmbH">
|
||||
|
||||
<title>Data Center Light -
|
||||
{% block title %}VM hosting made in Switzerland{% endblock %}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'datacenterlight/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
<title>Data Center Light -
|
||||
{% block title %}VM hosting made in Switzerland{% endblock %}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'datacenterlight/css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<!--Import Google Icon Font-->
|
||||
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href="{% static 'datacenterlight/font-awesome/css/font-awesome.min.css' %}" rel="stylesheet" type="text/css">
|
||||
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
|
||||
<link rel="shortcut icon" href="{% static 'datacenterlight/img/favicon.ico' %}" type="image/x-icon" />
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.min.css" rel="stylesheet">
|
||||
<!-- Custom Fonts -->
|
||||
<!--Import Google Icon Font-->
|
||||
<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href="{% static 'datacenterlight/font-awesome/css/font-awesome.min.css' %}" rel="stylesheet" type="text/css">
|
||||
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
|
||||
<link rel="shortcut icon" href="{% static 'datacenterlight/img/favicon.ico' %}" type="image/x-icon" />
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="{% static 'datacenterlight/css/landing-page.css' %}" rel="stylesheet">
|
||||
<!-- Custom CSS -->
|
||||
<link href="{% static 'datacenterlight/css/landing-page.css' %}" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!-- Google analytics -->
|
||||
{% include "google_analytics.html" %}
|
||||
<!-- End Google Analytics -->
|
||||
</head>
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!-- Google analytics -->
|
||||
{% include "google_analytics.html" %}
|
||||
<!-- End Google Analytics -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body>
|
||||
|
||||
<!-- Navigation -->
|
||||
{% include "datacenterlight/includes/_navbar.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
{% include "datacenterlight/includes/_footer.html" %}
|
||||
<!-- Footer -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{% static 'datacenterlight/js/jquery.js' %}"></script>
|
||||
<!-- Navigation -->
|
||||
{% include "datacenterlight/includes/_navbar.html" %}
|
||||
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.js"></script>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="{% static 'datacenterlight/js/bootstrap.min.js' %}"></script>
|
||||
<script src="{% static 'datacenterlight/js/main.js' %}"></script>
|
||||
<!-- Load form js -->
|
||||
<script src="{% static 'datacenterlight/js/form.js' %}"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.9/validator.min.js"></script>
|
||||
{% include "datacenterlight/includes/_footer.html" %}
|
||||
<!-- Footer -->
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{% static 'datacenterlight/js/jquery.js' %}"></script>
|
||||
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.js"></script>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="{% static 'datacenterlight/js/bootstrap.min.js' %}"></script>
|
||||
<script src="{% static 'datacenterlight/js/main.js' %}"></script>
|
||||
<!-- Load form js -->
|
||||
<script src="{% static 'datacenterlight/js/form.js' %}"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.9/validator.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
123
datacenterlight/templates/datacenterlight/calculator_form.html
Normal file
123
datacenterlight/templates/datacenterlight/calculator_form.html
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
{% load staticfiles i18n%}
|
||||
<form id="order_form" method="POST" action="" data-toggle="validator" role="form">
|
||||
{% csrf_token %}
|
||||
<div class="title">
|
||||
<h3>{% trans "VM hosting" %} </h3>
|
||||
</div>
|
||||
<div class="price">
|
||||
<span id="total">15</span>
|
||||
<span>CHF/{% trans "month" %}</span>
|
||||
<div class="price-text">
|
||||
<p>{% trans "VAT included" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptions">
|
||||
<div class="description form-group">
|
||||
<p>{% trans "Hosted in Switzerland" %}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="cpu" aria-hidden="true"></i>
|
||||
<input class="input-price select-number" type="number" min="1" max="48" id="coreValue" name="cpu"
|
||||
data-error="{% trans 'Please enter a value in range 1 - 48.' %}" required>
|
||||
<span> Core</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="cpu" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'cores' in message.tags %}
|
||||
<ul class="list-unstyled"><li>
|
||||
{{ message|safe }}
|
||||
</li></ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="ram" aria-hidden="true"></i>
|
||||
<input id="ramValue" class="input-price select-number" type="number" min="2" max="200" name="ram"
|
||||
data-error="{% trans 'Please enter a value in range 2 - 200.' %}" required>
|
||||
<span> GB RAM</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="ram" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'memory' in message.tags %}
|
||||
<ul class="list-unstyled"><li>
|
||||
{{ message|safe }}
|
||||
</li></ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="storage" aria-hidden="true"></i>
|
||||
<input id="storageValue" class="input-price select-number" type="number" min="10" max="2000" step="10"
|
||||
name="storage" data-error="{% trans 'Please enter a value in range 10 - 2000.' %}" required>
|
||||
<span>{% trans "GB Storage (SSD)" %}</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="storage" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'storage' in message.tags %}
|
||||
<ul class="list-unstyled"><li>
|
||||
{{ message|safe }}
|
||||
</li></ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="description select-configuration input form-group justify-center">
|
||||
<label for="config">OS</label>
|
||||
<select name="config" id="">
|
||||
{% for template in templates %}
|
||||
<option value="{{template.opennebula_vm_template_id}}">{{template.name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="total">
|
||||
<!--<div class="description check-ip">
|
||||
<input type="checkbox" name="ipv6"> Ipv6 Only<br>
|
||||
</div>-->
|
||||
<div class="form-group">
|
||||
<div class="description input justify-center">
|
||||
<label for="name" class="control-label">{% trans "Name"%}</label>
|
||||
<input type="text" name="name" class="form-control" placeholder="{% trans 'Your Name'%}"
|
||||
data-minlength="3" data-error="{% trans 'Please enter your name.' %}" required>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'name' in message.tags %}
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
{{ message|safe }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input justify-center">
|
||||
<label for="email" class="control-label">{% trans "Email"%}</label>
|
||||
<input name="email" type="email" pattern="^[^@\s]+@([^@\s]+\.)+[^@\s]+$" class="form-control"
|
||||
placeholder="{% trans 'Your Email' %}"
|
||||
data-error="{% trans 'Please enter a valid email address.' %}" required>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'email' in message.tags %}
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
{{ message|safe }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" class="btn btn-primary disabled" value="{% trans 'Continue' %}"></input>
|
||||
</form>
|
||||
|
|
@ -12,28 +12,28 @@
|
|||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
{% if request.resolver_match.url_name == "index" or request.resolver_match.url_name == "whydatacenterlight" %}
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav url" data-url="#home"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav url" data-url="#home"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav" data-url="#home"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav" data-url="#home"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
|
||||
{% else %}
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav url"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav url"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoBlack" class="navbar-brand topnav"><img src="{% static 'datacenterlight/img/logo_black.svg' %}"></a>
|
||||
<a href="{% url 'datacenterlight:index' %}" id="logoWhite" class="navbar-brand topnav"><img src="{% static 'datacenterlight/img/logo_white.svg' %}"></a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"><!-- Start Navbar collapse-->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
{% if request.resolver_match.url_name == "index" or request.resolver_match.url_name == "whydatacenterlight" %}
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle visible-mobile" href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %}<span class="caret"></span></a>
|
||||
<a class="dropdown-toggle url disabled visible-desktop" href="{% url 'datacenterlight:index' %}#how" data-url="#how" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %}<span class="caret"></span></a>
|
||||
<a class="dropdown-toggle url disabled visible-desktop menu-url" data-url="#how" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %}<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="url" href="{% url 'datacenterlight:index' %}#your" data-url="#your" >{% trans "Scale out" %}</a></li>
|
||||
<li><a class="url" href="{% url 'datacenterlight:index' %}#our" data-url="#our">{% trans "Reliable and light" %}</a></li>
|
||||
<li> <a class="url" href="{% url 'datacenterlight:index' %}#price" data-url="#price" >{% trans "Order VM" %}</a></li>
|
||||
</ul>
|
||||
<li><a class="url menu-url" data-url="#your" href="#your">{% trans "Scale out" %}</a></li>
|
||||
<li><a class="url menu-url" data-url="#our" href="#our">{% trans "Reliable and light" %}</a></li>
|
||||
<li> <a class="url menu-url" data-url="#price" href="#price">{% trans "Order VM" %}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a class="url" href="{% url 'datacenterlight:index' %}/whydatacenterlight" >{% trans "Why Data Center Light?" %}</a>
|
||||
<a href="{% url 'datacenterlight:index' %}/whydatacenterlight" >{% trans "Why Data Center Light?" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="url" href="{% url 'datacenterlight:index' %}#contact" data-url="#contact" >{% trans "Contact" %}</a>
|
||||
|
|
@ -41,18 +41,19 @@
|
|||
{% endif %}
|
||||
<li class="nav-language">
|
||||
<div class="select-language">
|
||||
{% if LANGUAGE_CODE == 'en-us'%}
|
||||
{% if LANGUAGE_CODE == 'en-us'%}
|
||||
<span>English</span>
|
||||
{% else %}
|
||||
<span>Deutsch</span>
|
||||
{% endif %}
|
||||
<i class="fa fa-globe" aria-hidden="true"></i>
|
||||
</div>
|
||||
|
||||
<div class="drop-language">
|
||||
{% if LANGUAGE_CODE == 'en-us'%}
|
||||
<a class="url" href="{% change_lang 'de' %}">Deutsch</a>
|
||||
{% if LANGUAGE_CODE == 'en-us'%}
|
||||
<a href="{% change_lang 'de' %}">Deutsch</a>
|
||||
{% else %}
|
||||
<a class="url" href="{% change_lang 'en-us' %}" >English</a>
|
||||
<a href="{% change_lang 'en-us' %}" >English</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "datacenterlight/base.html" %}
|
||||
{% load staticfiles i18n%}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
|
@ -10,7 +9,7 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
|
||||
<div class="intro-message">
|
||||
<h1>Data Center Light</h1>
|
||||
<h3>{% trans "Finally, an affordable VM hosting in Switzerland!" %}</h3>
|
||||
|
|
@ -60,13 +59,13 @@
|
|||
<li>
|
||||
<i class="fa-li fa fa-check-square-o fa-lg"></i>
|
||||
<p class="lead">{% trans "Is creative, using a modern and alternative design for a data center in order to make it more sustainable and affordable at the same time." %}</p>
|
||||
</li>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa-li fa fa-check-square-o fa-lg"></i>
|
||||
<p class="lead">{% trans "Cuts down the costs for you by using FOSS (Free Open Source Software) exclusively, wherefore we can save money from paying licenses." %}</p>
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -87,7 +86,7 @@
|
|||
</div>
|
||||
<div class="split-description">
|
||||
<p class="lead">{% trans "We don't use special hardware. We use commodity hardware: we buy computers that you buy. Just many more and put them in a cozy home for computers called data center." %}</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -112,8 +111,8 @@
|
|||
<h2>{% trans "Reliable and light" %}</h2>
|
||||
</div>
|
||||
<div class="split-description">
|
||||
<p class="lead">{% trans "Our VMs are located in Switzerland, with reliable power supply and fast internet connection. Our VM costs less thanks to our featherlight infrastructure." %}</p>
|
||||
|
||||
<p class="lead">{% trans "Our VMs are located in Switzerland, with reliable power supply and fast internet connection. Our VM costs less thanks to our featherlight infrastructure." %}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -122,7 +121,7 @@
|
|||
<!-- /.container -->
|
||||
<!-- /.option 1 -->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- /.content-section-b -->
|
||||
<div class="content-section-a pricing-section" id="price">
|
||||
|
||||
|
|
@ -131,7 +130,7 @@
|
|||
<div class="row text-center">
|
||||
<div class="col-xs-12 col-md-6 text">
|
||||
<h2 class="section-heading">{% trans "Simple and affordable: Try our virtual machine with featherlight price." %}</h2>
|
||||
<p class="lead">{% trans "Affordable VM hosting based in Switzerland" %}</p>
|
||||
<p class="lead new-lead">{% trans "Affordable VM hosting based in Switzerland" %}</p>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6 hero-feature">
|
||||
|
|
@ -139,94 +138,7 @@
|
|||
<div class="landing card">
|
||||
<img class="img-beta" src="{% static 'datacenterlight/img/beta-img.png' %}" alt="">
|
||||
<div class="caption">
|
||||
<form id="order_form" method="POST" action="" data-toggle="validator" role="form">
|
||||
{% csrf_token %}
|
||||
<div class="title">
|
||||
<h3>{% trans "VM hosting" %} </h3>
|
||||
</div>
|
||||
<div class="price">
|
||||
<span id="total">15</span>
|
||||
<span>CHF/{% trans "month" %}</span>
|
||||
<div class="price-text">
|
||||
<p>{% trans "VAT included" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptions">
|
||||
<div class="description form-group">
|
||||
<p>{% trans "Hosted in Switzerland" %}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="cpu" aria-hidden="true"></i>
|
||||
<input class="input-price select-number" type="number" min="1" max="42" id="coreValue" name="cpu" data-error="{% trans 'Please enter a value greater than or equal to 1.' %}" required>
|
||||
<span> Core</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="cpu" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="ram" aria-hidden="true"></i>
|
||||
<input id="ramValue" class="input-price select-number" type="number" min="2" max="200" name="ram" data-error="{% trans 'Please enter a value greater than or equal to 2.' %}" required>
|
||||
<span> GB RAM</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="ram" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="storage" aria-hidden="true"></i>
|
||||
<input id="storageValue" class="input-price select-number" type="number" min="10" max="500" step="10" name="storage" data-error="{% trans 'Please enter a value greater than or equal to 10.' %}" required>
|
||||
<span>{% trans "GB Storage (SSD)" %}</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="storage" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="description select-configuration input form-group justify-center">
|
||||
<label for="config">OS</label>
|
||||
<select name="config" id="">
|
||||
{% for template in templates %}
|
||||
<option value="{{template.id}}">{{template.name}} </option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="total">
|
||||
<!--<div class="description check-ip">
|
||||
<input type="checkbox" name="ipv6"> Ipv6 Only<br>
|
||||
</div>-->
|
||||
<div class="form-group">
|
||||
<div class="description input justify-center">
|
||||
<label for="name" class="control-label">{% trans "Name"%}</label>
|
||||
<input type="text" name="name" class="form-control" placeholder="{% trans 'Your Name'%}" data-minlength="3" data-error="{% trans 'Please enter your name' %}" required>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'name' in message.tags %}
|
||||
<ul class="list-unstyled"><li>
|
||||
{{ message|safe }}
|
||||
</li></ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input justify-center">
|
||||
<label for="email" class="control-label">{% trans "Email"%}</label>
|
||||
<input name="email" type="email" pattern="^[^@\s]+@([^@\s]+\.)+[^@\s]+$" class="form-control" placeholder="{% trans 'Your Email' %}" data-error="{% trans 'Please enter a valid email address' %}" required>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'email' in message.tags %}
|
||||
<ul class="list-unstyled"><li>
|
||||
{{ message|safe }}
|
||||
</li></ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" class="btn btn-primary" value="{% trans 'Order Now!' %}"></input>
|
||||
</form>
|
||||
{% include "datacenterlight/calculator_form.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -242,7 +154,7 @@
|
|||
<div class="intro-header-2 contact-section" id="contact">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="subtitle">
|
||||
|
|
@ -254,15 +166,9 @@
|
|||
<p>{% trans "Switzerland " %}</p>
|
||||
</div>
|
||||
<div class="social">
|
||||
<a target="_blank" class="" href="https://twitter.com/datacenterlight">
|
||||
<i class="fa fa-twitter fa-fw"></i>
|
||||
</a>
|
||||
<a target="_blank" class="" href="https://github.com/ungleich">
|
||||
<i class="fa fa-github fa-fw"></i>
|
||||
</a>
|
||||
<a target="_blank" class="" href="https://www.facebook.com/ungleich.ch/">
|
||||
<i class="fa fa-facebook fa-fw"></i>
|
||||
</a>
|
||||
<a target="_blank" class="" href="https://twitter.com/datacenterlight"><i class="fa fa-twitter fa-fw"></i></a>
|
||||
<a target="_blank" class="" href="https://github.com/ungleich"><i class="fa fa-github fa-fw"></i></a>
|
||||
<a target="_blank" class="" href="https://www.facebook.com/ungleich.ch/"><i class="fa fa-facebook fa-fw"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -275,7 +181,7 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /.banner -->
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -4,94 +4,93 @@
|
|||
{% load custom_tags %}
|
||||
{% block content %}
|
||||
|
||||
<div class="order-detail-container">
|
||||
{% if messages %}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-8 col-md-offset-2">
|
||||
<br/>
|
||||
<div class="alert alert-warning">
|
||||
{% for message in messages %}
|
||||
<span>{{ message }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not error %}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-8 col-md-offset-2">
|
||||
<div class="invoice-title">
|
||||
<h2>{% trans "Confirm Order"%}</h2>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="order-detail-container">
|
||||
{% if messages %}
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<address>
|
||||
<h3><b>{% trans "Billed To:"%}</b></h3>
|
||||
{% with request.session.billing_address_data as billing_address %}
|
||||
{{request.session.user.name}}<br> {{billing_address|get_value_from_dict:'street_address'}}, {{billing_address|get_value_from_dict:'postal_code'}}<br>
|
||||
{{billing_address|get_value_from_dict:'city'}}, {{billing_address|get_value_from_dict:'country'}}.
|
||||
{% endwith %}
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-xs-6 text-right">
|
||||
<address>
|
||||
<strong>{% trans "Date"%}:</strong><br>
|
||||
<span id="order-created_at">{% now "Y-m-d H:i" %}</span><br><br>
|
||||
</address>
|
||||
|
||||
<div class="col-xs-12 col-md-8 col-md-offset-2">
|
||||
<br/>
|
||||
<div class="alert alert-warning">
|
||||
{% for message in messages %}
|
||||
<span>{{ message }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not error %}
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<address>
|
||||
<strong>{% trans "Payment Method:"%}</strong><br>
|
||||
{{cc_brand}} {% trans "ending" %} **** {{cc_last4}}<br>
|
||||
{{request.session.user.email}}
|
||||
</address>
|
||||
<div class="col-xs-12 col-md-8 col-md-offset-2">
|
||||
<div class="invoice-title">
|
||||
<h2>{% trans "Confirm Order"%}</h2>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6 pull-right order-confirm-date">
|
||||
<address>
|
||||
<strong>{% trans "Date"%}:</strong><br>
|
||||
<span id="order-created_at">{% now "Y-m-d H:i" %}</span><br><br>
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<address>
|
||||
<h3><b>{% trans "Billed To:"%}</b></h3>
|
||||
{% with request.session.billing_address_data as billing_address %}
|
||||
{{billing_address|get_value_from_dict:'cardholder_name'}}<br> {{billing_address|get_value_from_dict:'street_address'}}, {{billing_address|get_value_from_dict:'postal_code'}}<br>
|
||||
{{billing_address|get_value_from_dict:'city'}}, {{billing_address|get_value_from_dict:'country'}}.
|
||||
{% endwith %}
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<address>
|
||||
<strong>{% trans "Payment Method:"%}</strong><br>
|
||||
{{cc_brand}} {% trans "ending" %} **** {{cc_last4}}<br>
|
||||
{{request.session.user.email}}
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<h3><b>{% trans "Order summary"%}</b></h3>
|
||||
<hr>
|
||||
<div class="content">
|
||||
{% with request.session.specs as vm %}
|
||||
<p><b>{% trans "Cores"%}</b> <span class="pull-right">{{vm.cpu}}</span></p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<h3><b>{% trans "Order summary"%}</b></h3>
|
||||
<hr>
|
||||
<p><b>{% trans "Memory"%}</b> <span class="pull-right">{{vm.memory}} GB</span></p>
|
||||
<hr>
|
||||
<p><b>{% trans "Disk space"%}</b> <span class="pull-right">{{vm.disk_size}} GB</span></p>
|
||||
<hr>
|
||||
<p><b>{% trans "Configuration"%}</b> <span class="pull-right">{{request.session.template.name}}</span></p>
|
||||
<hr>
|
||||
<h4>{% trans "Total"%}<p class="pull-right"><b>{{vm.price}} CHF</b></p></h4>
|
||||
{% endwith %}
|
||||
<div class="content">
|
||||
{% with request.session.specs as vm %}
|
||||
<p><b>{% trans "Cores"%}</b> <span class="pull-right">{{vm.cpu}}</span></p>
|
||||
<hr>
|
||||
<p><b>{% trans "Memory"%}</b> <span class="pull-right">{{vm.memory}} GB</span></p>
|
||||
<hr>
|
||||
<p><b>{% trans "Disk space"%}</b> <span class="pull-right">{{vm.disk_size}} GB</span></p>
|
||||
<hr>
|
||||
<p><b>{% trans "Configuration"%}</b> <span class="pull-right">{{request.session.template.name}}</span></p>
|
||||
<hr>
|
||||
<h4>{% trans "Total"%}<p class="pull-right"><b>{{vm.price}} CHF</b></p></h4>
|
||||
{% endwith %}
|
||||
</div>
|
||||
<br/>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class=" content pull-right">
|
||||
<a href="{{next_url}}" ><button class="btn btn-info">{% trans "Place order"%}</button></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class=" content pull-right">
|
||||
<a href="{{next_url}}" ><button class="btn btn-info">{% trans "Place order"%}</button></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
|
||||
window.onload = function () {
|
||||
var locale_date = moment.utc(document.getElementById("order-created_at").textContent,'YYYY-MM-DD HH:mm').toDate();
|
||||
locale_date = moment(locale_date).format("YYYY-MM-DD h:mm:ss a");
|
||||
document.getElementById('order-created_at').innerHTML = locale_date;
|
||||
window.onload = function () {
|
||||
var locale_date = moment.utc(document.getElementById("order-created_at").textContent,'YYYY-MM-DD HH:mm').toDate();
|
||||
locale_date = moment(locale_date).format("YYYY-MM-DD h:mm:ss a");
|
||||
document.getElementById('order-created_at').innerHTML = locale_date;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
</script>
|
||||
</script>
|
||||
{%endblock%}
|
||||
|
|
|
|||
|
|
@ -13,73 +13,73 @@
|
|||
|
||||
<div class="price-calc-section">
|
||||
<div class="card">
|
||||
<img class="img-beta" src="{% static 'datacenterlight/img/beta-img.png' %}" alt="">
|
||||
<div class="caption">
|
||||
<form method="POST" action="">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="title">
|
||||
<h3>{% trans "VM hosting" %} </h3>
|
||||
</div>
|
||||
<div class="price">
|
||||
<span id="total">15</span>
|
||||
<span>CHF</span>
|
||||
<div class="price-text">
|
||||
<p>{% trans "VAT included" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptions">
|
||||
<div class="description">
|
||||
<p>{% trans "Hosted in Switzerland" %}</p>
|
||||
</div>
|
||||
<div class="description">
|
||||
<i class="fa fa-minus-circle left" data-minus="cpu" aria-hidden="true"></i>
|
||||
<input class="input-price" type="number" min="1" max="42" id="coreValue" name="cpu">
|
||||
<span> Core</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="cpu" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="description">
|
||||
<i class="fa fa-minus-circle left" data-minus="ram" aria-hidden="true"></i>
|
||||
<input id="ramValue" class="input-price" type="number" min="2" max="200" name="ram">
|
||||
<span> GB RAM</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="ram" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="description">
|
||||
<i class="fa fa-minus-circle left" data-minus="storage" aria-hidden="true"></i>
|
||||
<input id="storageValue" class="input-price" type="number" min="10" max="500" step="10" name="storage">
|
||||
<span>{% trans "GB Storage (SSD)" %}</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="storage" aria-hidden="true"></i>
|
||||
</div>
|
||||
<img class="img-beta" src="{% static 'datacenterlight/img/beta-img.png' %}" alt="">
|
||||
<div class="caption">
|
||||
<form method="POST" action="">
|
||||
{% csrf_token %}
|
||||
|
||||
|
||||
|
||||
<div class="description select-configuration input">
|
||||
<label for="name">OS</label>
|
||||
<select name="config" id="">
|
||||
{% for template in templates %}
|
||||
<option value="{{template.id}}">{{template.name}} </option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="title">
|
||||
<h3>{% trans "VM hosting" %} </h3>
|
||||
</div>
|
||||
<div class="price">
|
||||
<span id="total">15</span>
|
||||
<span>CHF</span>
|
||||
<div class="price-text">
|
||||
<p>{% trans "VAT included" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="total">
|
||||
|
||||
<!-- <div class="description input">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" name="name" placeholder="Your Name">
|
||||
</div>
|
||||
<div class="description input">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" name="email" placeholder="Your Email">
|
||||
</div> -->
|
||||
|
||||
<!--<div class="description check-ip">
|
||||
<input type="checkbox" name="ipv6"> Ipv6 Only<br>
|
||||
</div>-->
|
||||
</div>
|
||||
<input type="submit" class="btn btn-primary" value="{% trans 'Order Now!' %}"></input>
|
||||
<div class="descriptions">
|
||||
<div class="description">
|
||||
<p>{% trans "Hosted in Switzerland" %}</p>
|
||||
</div>
|
||||
<div class="description">
|
||||
<i class="fa fa-minus-circle left" data-minus="cpu" aria-hidden="true"></i>
|
||||
<input class="input-price" type="number" min="1" max="42" id="coreValue" name="cpu">
|
||||
<span> Core</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="cpu" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="description">
|
||||
<i class="fa fa-minus-circle left" data-minus="ram" aria-hidden="true"></i>
|
||||
<input id="ramValue" class="input-price" type="number" min="2" max="200" name="ram">
|
||||
<span> GB RAM</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="ram" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="description">
|
||||
<i class="fa fa-minus-circle left" data-minus="storage" aria-hidden="true"></i>
|
||||
<input id="storageValue" class="input-price" type="number" min="10" max="500" step="10" name="storage">
|
||||
<span>{% trans "GB Storage (SSD)" %}</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="storage" aria-hidden="true"></i>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="description select-configuration input">
|
||||
<label for="name">OS</label>
|
||||
<select name="config" id="">
|
||||
{% for template in templates %}
|
||||
<option value="{{template.id}}">{{template.name}} </option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="total">
|
||||
|
||||
<!-- <div class="description input">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" name="name" placeholder="Your Name">
|
||||
</div>
|
||||
<div class="description input">
|
||||
<label for="email">Email</label>
|
||||
<input type="email" name="email" placeholder="Your Email">
|
||||
</div> -->
|
||||
|
||||
<!--<div class="description check-ip">
|
||||
<input type="checkbox" name="ipv6"> Ipv6 Only<br>
|
||||
</div>-->
|
||||
</div>
|
||||
<input type="submit" class="btn btn-primary" value="{% trans 'Order Now!' %}"></input>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text">
|
||||
|
|
|
|||
|
|
@ -12,29 +12,21 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<script src="{% static 'datacenterlight/js/jquery.js' %}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onload=function(){
|
||||
$('.selectpicker').selectpicker({
|
||||
style: 'btn-link',
|
||||
windowPadding: 10,
|
||||
});
|
||||
<script type="text/javascript">
|
||||
window.onload=function(){
|
||||
$('.selectpicker').selectpicker({
|
||||
style: 'btn-link',
|
||||
windowPadding: 10,
|
||||
});
|
||||
|
||||
var hash = window.location.hash.substr(1);
|
||||
console.log(hash);
|
||||
if (hash == 'requestform'){
|
||||
$('#reques-success-message').modal('show');
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.5.4/bootstrap-select.js"></script>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="{% static 'datacenterlight/js/bootstrap.min.js' %}"></script>
|
||||
<script src="{% static 'datacenterlight/js/main.js' %}"></script>
|
||||
var hash = window.location.hash.substr(1);
|
||||
console.log(hash);
|
||||
if (hash == 'requestform'){
|
||||
$('#reques-success-message').modal('show');
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -1,22 +1,19 @@
|
|||
{% extends "datacenterlight/base.html" %}
|
||||
{% load staticfiles i18n%}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
<!-- Why Data Center Light? -->
|
||||
<div class="full-whydcl-sec">
|
||||
<div class="whydcl-header whydcl-section" id="why_dcl">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<div class="single-heading">
|
||||
<h2>{% trans "Why Data Center Light?" %}</h2>
|
||||
<div class="whydcl-header whydcl-section" id="why_dcl">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<div class="single-heading">
|
||||
<h2>{% trans "Why Data Center Light?" %}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="split-section left" id="tech_stack">
|
||||
|
|
@ -35,39 +32,39 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive btm-space" src="{% static 'datacenterlight/img/devuan.png' %}" alt="Devuan">
|
||||
<span class="logo-caption">{% trans "Our services run on" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/prometheus.png' %}" alt="Prometheus">
|
||||
<span class="logo-caption">{% trans "Our monitoring" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive btm-space" src="{% static 'datacenterlight/img/Ceph_Logo.png' %}" alt="Ceph">
|
||||
<span class="logo-caption">{% trans "Our storage layer" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/django.png' %}" alt="Django">
|
||||
<span class="logo-caption">{% trans "Our web frontend" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive btm-space" src="{% static 'datacenterlight/img/opennebula.png' %}" alt="Opennebula">
|
||||
<span class="logo-caption">{% trans "Our cloud" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/cdistbyungleich.png' %}" alt="Cdist by ungleich">
|
||||
<span class="logo-caption">{% trans "Our configuration management system" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/python-logo.png' %}" alt="Python">
|
||||
<span class="logo-caption">{% trans "Our awesome juice" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/tayga.png' %}" alt="Tayga">
|
||||
<span class="logo-caption">{% trans "Our NAT64 gateway" %}</span>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive btm-space" src="{% static 'datacenterlight/img/devuan.png' %}" alt="Devuan">
|
||||
<span class="logo-caption">{% trans "Our services run on" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/prometheus.png' %}" alt="Prometheus">
|
||||
<span class="logo-caption">{% trans "Our monitoring" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive btm-space" src="{% static 'datacenterlight/img/Ceph_Logo.png' %}" alt="Ceph">
|
||||
<span class="logo-caption">{% trans "Our storage layer" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/django.png' %}" alt="Django">
|
||||
<span class="logo-caption">{% trans "Our web frontend" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive btm-space" src="{% static 'datacenterlight/img/opennebula.png' %}" alt="Opennebula">
|
||||
<span class="logo-caption">{% trans "Our cloud" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/cdistbyungleich.png' %}" alt="Cdist by ungleich">
|
||||
<span class="logo-caption">{% trans "Our configuration management system" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/python-logo.png' %}" alt="Python">
|
||||
<span class="logo-caption">{% trans "Our awesome juice" %}</span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6 col-md-6 logo-wrap">
|
||||
<img class="img-responsive btm-space-tayga" src="{% static 'datacenterlight/img/tayga.png' %}" alt="Tayga">
|
||||
<span class="logo-caption">{% trans "Our NAT64 gateway" %}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -77,21 +74,21 @@
|
|||
<div class=" space">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-4 col-md-5 ">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-md-6 logo-wrap-1">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/opennebula.png' %}" alt="Opennebula">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-md-6 logo-wrap-1">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/cdistbyungleich.png' %}" alt="Cdist byu ngleich">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-md-6 logo-wrap-1">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/prometheus.png' %}" alt="Prometheus">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-5 ">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-md-6 logo-wrap-1">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/opennebula.png' %}" alt="Opennebula">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-md-6 logo-wrap-1">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/cdistbyungleich.png' %}" alt="Cdist byu ngleich">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-md-6 logo-wrap-1">
|
||||
<img class="img-responsive" src="{% static 'datacenterlight/img/prometheus.png' %}" alt="Prometheus">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-md-7 text-right">
|
||||
<div class="tech-sub-sec">
|
||||
<h2>{% trans "We believe in giving back to the FOSS community." %}</h2>
|
||||
<p class="lead">{% blocktrans %}Data Center Light is the child of free and open source software (FOSS). <br>We grew up with it, live by it, and believe in it.<br> The more we work on our data center,<br> the more we contribute back to the FOSS community.{% endblocktrans %}</p>
|
||||
<p class="lead new-lead">{% blocktrans %}Data Center Light is the child of free and open source software (FOSS) movement. <br>We grew up with it, live by it, and believe in it.<br> The more we work on our data center,<br> the more we contribute back to the FOSS community.{% endblocktrans %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -102,33 +99,30 @@
|
|||
<div class="space">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 tech-sub-sec">
|
||||
<h2>{% trans "We bring the future to you." %}</h2>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-7 col-md-8 col-lg-8 text-left tech-sub-sec landscape-xs-6">
|
||||
<p class="lead">{% blocktrans %} Data Center Light uses the most modern technologies out there.<br>
|
||||
Your VM needs only IPv6. Data Center Light provides<br> transparent two-way IPv6/IPv4 translation.
|
||||
{% endblocktrans %}</p>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5 col-md-4 col-lg-4 percent-text text-right landscape-xs-6">
|
||||
100% <strong>IPv6</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 space-block"></div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="col-xs-12 col-sm-7 col-md-8 col-lg-8 percent-text landscape-xs-8">
|
||||
<span class="pull-left space-middle"> 100% <strong>SSD</strong></span> <span class="pull-left ssdimg"><img class="img-responsive" src="{% static 'datacenterlight/img/ssd.jpg' %}" alt="SSD"></span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5 col-md-4 col-lg-4 text-right tech-sub-sec padding-vertical landscape-xs-4">
|
||||
<div>
|
||||
<p class="lead">{% blocktrans %} No more spinning metal plates! Data Center Light uses only SSDs. We keep things faster and lighter. {% endblocktrans %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 tech-sub-sec">
|
||||
<h2>{% trans "We bring the future to you." %}</h2>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-7 col-md-8 col-lg-8 text-left tech-sub-sec landscape-xs-6">
|
||||
<p class="lead new-lead">{% blocktrans %} Data Center Light uses the most modern technologies out there.<br>
|
||||
Your VM needs only IPv6. Data Center Light provides<br> transparent two-way IPv6/IPv4 translation.
|
||||
{% endblocktrans %}</p>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5 col-md-4 col-lg-4 percent-text text-right landscape-xs-6">
|
||||
100% <strong>IPv6</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 space-block"></div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="col-xs-12 col-sm-7 col-md-8 col-lg-8 percent-text landscape-xs-8">
|
||||
<span class="pull-left space-middle"> 100% <strong>SSD</strong></span> <span class="pull-left ssdimg"><img class="img-responsive" src="{% static 'datacenterlight/img/ssd.jpg' %}" alt="SSD"></span>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5 col-md-4 col-lg-4 text-right tech-sub-sec padding-vertical landscape-xs-4">
|
||||
<div>
|
||||
<p class="lead new-lead">{% blocktrans %} No more spinning metal plates! Data Center Light uses only SSDs. We keep things faster and lighter. {% endblocktrans %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -142,7 +136,7 @@
|
|||
<div class="row text-center">
|
||||
<div class="col-xs-12 col-md-6 text">
|
||||
<h2 class="section-heading">{% trans "Starting from only 15CHF per month. Try now." %}</h2>
|
||||
<p class="lead">{% trans "Actions speak louder than words. Let's do it, try our VM now." %}</p>
|
||||
<p class="lead new-lead">{% trans "Actions speak louder than words. Let's do it, try our VM now." %}</p>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6 hero-feature">
|
||||
|
|
@ -150,94 +144,7 @@
|
|||
<div class="landing card">
|
||||
<img class="img-beta" src="{% static 'datacenterlight/img/beta-img.png' %}" alt="">
|
||||
<div class="caption">
|
||||
<form id="order_form" method="POST" action="" data-toggle="validator" role="form">
|
||||
{% csrf_token %}
|
||||
<div class="title">
|
||||
<h3>{% trans "VM hosting" %} </h3>
|
||||
</div>
|
||||
<div class="price">
|
||||
<span id="total">15</span>
|
||||
<span>CHF/{% trans "month" %}</span>
|
||||
<div class="price-text">
|
||||
<p>{% trans "VAT included" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptions">
|
||||
<div class="description form-group">
|
||||
<p>{% trans "Hosted in Switzerland" %}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="cpu" aria-hidden="true"></i>
|
||||
<input class="input-price select-number" type="number" min="1" max="42" id="coreValue" name="cpu" data-error="{% trans 'Please enter a value greater than or equal to 1.' %}" required>
|
||||
<span> Core</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="cpu" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="ram" aria-hidden="true"></i>
|
||||
<input id="ramValue" class="input-price select-number" type="number" min="2" max="200" name="ram" data-error="{% trans 'Please enter a value greater than or equal to 2.' %}" required>
|
||||
<span> GB RAM</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="ram" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input">
|
||||
<i class="fa fa-minus-circle left" data-minus="storage" aria-hidden="true"></i>
|
||||
<input id="storageValue" class="input-price select-number" type="number" min="10" max="500" step="10" name="storage" data-error="{% trans 'Please enter a value greater than or equal to 10.' %}" required>
|
||||
<span>{% trans "GB Storage (SSD)" %}</span>
|
||||
<i class="fa fa-plus-circle right" data-plus="storage" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="description select-configuration input form-group justify-center">
|
||||
<label for="config">OS</label>
|
||||
<select name="config" id="">
|
||||
{% for template in templates %}
|
||||
<option value="{{template.id}}">{{template.name}} </option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="total">
|
||||
<!--<div class="description check-ip">
|
||||
<input type="checkbox" name="ipv6"> Ipv6 Only<br>
|
||||
</div>-->
|
||||
<div class="form-group">
|
||||
<div class="description input justify-center">
|
||||
<label for="name" class="control-label">{% trans "Name"%}</label>
|
||||
<input type="text" name="name" class="form-control" placeholder="{% trans 'Your Name'%}" data-minlength="3" data-error="{% trans 'Please enter your name' %}" required>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'name' in message.tags %}
|
||||
<ul class="list-unstyled"><li>
|
||||
{{ message|safe }}
|
||||
</li></ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="description input justify-center">
|
||||
<label for="email" class="control-label">{% trans "Email"%}</label>
|
||||
<input name="email" type="email" pattern="^[^@\s]+@([^@\s]+\.)+[^@\s]+$" class="form-control" placeholder="{% trans 'Your Email' %}" data-error="{% trans 'Please enter a valid email address' %}" required>
|
||||
</div>
|
||||
<div class="help-block with-errors">
|
||||
{% for message in messages %}
|
||||
{% if 'email' in message.tags %}
|
||||
<ul class="list-unstyled"><li>
|
||||
{{ message|safe }}
|
||||
</li></ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" class="btn btn-primary" value="{% trans 'Order Now!' %}"></input>
|
||||
</form>
|
||||
{% include "datacenterlight/calculator_form.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -249,6 +156,4 @@
|
|||
</div>
|
||||
|
||||
<!-- End Why Data Center Light? -->
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from django.views.generic import FormView, CreateView, TemplateView, DetailView
|
||||
from django.http import HttpResponseRedirect
|
||||
from .forms import BetaAccessForm
|
||||
from .models import BetaAccess, BetaAccessVMType, BetaAccessVM
|
||||
from .models import BetaAccess, BetaAccessVMType, BetaAccessVM, VMTemplate
|
||||
from django.contrib import messages
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.core.mail import EmailMessage
|
||||
|
|
@ -21,7 +21,7 @@ from datetime import datetime
|
|||
from membership.models import CustomUser, StripeCustomer
|
||||
from oca.pool import WrongIdError
|
||||
from opennebula_api.models import OpenNebulaManager
|
||||
from opennebula_api.serializers import VirtualMachineTemplateSerializer, VirtualMachineSerializer
|
||||
from opennebula_api.serializers import VirtualMachineTemplateSerializer, VirtualMachineSerializer, VMTemplateSerializer
|
||||
|
||||
|
||||
class LandingProgramView(TemplateView):
|
||||
|
|
@ -195,42 +195,69 @@ class IndexView(CreateView):
|
|||
success_url = "/datacenterlight#requestform"
|
||||
success_message = "Thank you, we will contact you as soon as possible"
|
||||
|
||||
def validate_cores(self, value):
|
||||
if (value > 48) or (value < 1):
|
||||
raise ValidationError(_('Not a proper cores number'))
|
||||
|
||||
def validate_memory(self, value):
|
||||
if (value > 200) or (value < 2):
|
||||
raise ValidationError(_('Not a proper ram number'))
|
||||
|
||||
def validate_storage(self, value):
|
||||
if (value > 2000) or (value < 10):
|
||||
raise ValidationError(_('Not a proper storage number'))
|
||||
|
||||
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
||||
for session_var in ['specs', 'user', 'billing_address_data']:
|
||||
if session_var in request.session:
|
||||
del request.session[session_var]
|
||||
try:
|
||||
manager = OpenNebulaManager()
|
||||
templates = manager.get_templates()
|
||||
context = {
|
||||
'templates': VirtualMachineTemplateSerializer(templates, many=True).data
|
||||
}
|
||||
except:
|
||||
messages.error(request,
|
||||
'We have a temporary problem to connect to our backend. \
|
||||
Please try again in a few minutes'
|
||||
)
|
||||
context = {
|
||||
'error': 'connection'
|
||||
}
|
||||
|
||||
vm_templates = VMTemplate.objects.all()
|
||||
context = {
|
||||
'templates': vm_templates
|
||||
}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
def post(self, request):
|
||||
cores = request.POST.get('cpu')
|
||||
cores_field = forms.IntegerField(validators=[self.validate_cores])
|
||||
memory = request.POST.get('ram')
|
||||
memory_field = forms.IntegerField(validators=[self.validate_memory])
|
||||
storage = request.POST.get('storage')
|
||||
storage_field = forms.IntegerField(validators=[self.validate_storage])
|
||||
price = request.POST.get('total')
|
||||
template_id = int(request.POST.get('config'))
|
||||
manager = OpenNebulaManager()
|
||||
template = manager.get_template(template_id)
|
||||
template_data = VirtualMachineTemplateSerializer(template).data
|
||||
template = VMTemplate.objects.filter(opennebula_vm_template_id=template_id).first()
|
||||
template_data = VMTemplateSerializer(template).data
|
||||
|
||||
name = request.POST.get('name')
|
||||
email = request.POST.get('email')
|
||||
name_field = forms.CharField()
|
||||
email_field = forms.EmailField()
|
||||
|
||||
try:
|
||||
cores = cores_field.clean(cores)
|
||||
except ValidationError as err:
|
||||
msg = '{} : {}.'.format(cores, str(err))
|
||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='cores')
|
||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||
|
||||
try:
|
||||
memory = memory_field.clean(memory)
|
||||
except ValidationError as err:
|
||||
msg = '{} : {}.'.format(memory, str(err))
|
||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='memory')
|
||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||
|
||||
try:
|
||||
storage = storage_field.clean(storage)
|
||||
except ValidationError as err:
|
||||
msg = '{} : {}.'.format(storage, str(err))
|
||||
messages.add_message(self.request, messages.ERROR, msg, extra_tags='storage')
|
||||
return HttpResponseRedirect(reverse('datacenterlight:index') + "#order_form")
|
||||
|
||||
try:
|
||||
name = name_field.clean(name)
|
||||
except ValidationError as err:
|
||||
|
|
@ -315,25 +342,6 @@ class WhyDataCenterLightView(IndexView):
|
|||
template_name = "datacenterlight/whydatacenterlight.html"
|
||||
model = BetaAccess
|
||||
|
||||
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||
def get(self, request, *args, **kwargs):
|
||||
try:
|
||||
manager = OpenNebulaManager()
|
||||
templates = manager.get_templates()
|
||||
context = {
|
||||
'templates': VirtualMachineTemplateSerializer(templates, many=True).data,
|
||||
}
|
||||
except:
|
||||
messages.error(
|
||||
request,
|
||||
'We have a temporary problem to connect to our backend. \
|
||||
Please try again in a few minutes'
|
||||
)
|
||||
context = {
|
||||
'error': 'connection'
|
||||
}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class PaymentOrderView(FormView):
|
||||
template_name = 'hosting/payment.html'
|
||||
|
|
@ -345,6 +353,7 @@ class PaymentOrderView(FormView):
|
|||
if billing_address_data:
|
||||
form_kwargs.update({
|
||||
'initial': {
|
||||
'cardholder_name': billing_address_data['cardholder_name'],
|
||||
'street_address': billing_address_data['street_address'],
|
||||
'city': billing_address_data['city'],
|
||||
'postal_code': billing_address_data['postal_code'],
|
||||
|
|
@ -465,9 +474,9 @@ class OrderConfirmationView(DetailView):
|
|||
template_id=vm_template_id,
|
||||
specs=specs,
|
||||
vm_name="{email}-{template_name}-{date}".format(
|
||||
email=user.get('email'),
|
||||
template_name=template.get('name'),
|
||||
date=int(datetime.now().strftime("%s")))
|
||||
email=user.get('email'),
|
||||
template_name=template.get('name'),
|
||||
date=int(datetime.now().strftime("%s")))
|
||||
)
|
||||
|
||||
# Create a Hosting Order
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue