diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 3dcadbfc..ff67e0d6 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -70,7 +70,7 @@ def letscowork(request): def blog(request): tags = ["digitalglarus"] - posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags) + posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags, publish=True) context = { 'post_list': posts, } diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 84fd545a..de339f86 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -84,18 +84,18 @@ INSTALLED_APPS = ( 'djangocms_file', 'djangocms_picture', 'djangocms_video', - # 'djangocms_flash', - # 'djangocms_googlemap', - # 'djangocms_inherit', - # 'djangocms_link', - # 'djangocms_teaser', + 'djangocms_flash', + 'djangocms_googlemap', + 'djangocms_inherit', + 'djangocms_link', + 'djangocms_teaser', 'djangocms_page_meta', 'djangocms_text_ckeditor', 'djangocms_admin_style', 'cmsplugin_filer_file', 'cmsplugin_filer_folder', 'cmsplugin_filer_link', - # 'cmsplugin_filer_teaser', + 'cmsplugin_filer_teaser', 'cmsplugin_filer_video', # # blog @@ -103,7 +103,7 @@ INSTALLED_APPS = ( 'reversion', # ungleich 'ungleich', - 'ungleich_page', +# 'ungleich_page', 'hosting', 'digitalglarus', @@ -176,7 +176,7 @@ CMS_TEMPLATES = ( DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'app', + 'NAME': 'app_new', } } @@ -280,12 +280,12 @@ CACHES = { } } -if LOGIN_URL is None: - LOGIN_URL = APP_ROOT_ENDPOINT + 'login/' -if LOGOUT_URL is None: - LOGOUT_URL = APP_ROOT_ENDPOINT + 'logout/' -if LOGIN_REDIRECT_URL is None: - LOGIN_REDIRECT_URL = APP_ROOT_ENDPOINT +#if LOGIN_URL is None: +# LOGIN_URL = APP_ROOT_ENDPOINT + 'login/' +#if LOGOUT_URL is None: +# LOGOUT_URL = APP_ROOT_ENDPOINT + 'logout/' +#if LOGIN_REDIRECT_URL is None: +# LOGIN_REDIRECT_URL = APP_ROOT_ENDPOINT # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ @@ -302,7 +302,7 @@ META_SITE_PROTOCOL = 'http' META_USE_SITES = True MIGRATION_MODULES = { 'cms': 'cms.migrations', - # 'filer': 'filer.migrations_django', + #'filer': 'filer.migrations_django', # 'menus': 'menus.migrations_django', 'djangocms_flash': 'djangocms_flash.migrations_django', 'djangocms_googlemap': 'djangocms_googlemap.migrations_django', @@ -337,6 +337,7 @@ STATICFILES_FINDERS = ( THUMBNAIL_PROCESSORS = ( 'easy_thumbnails.processors.colorspace', 'easy_thumbnails.processors.autocrop', + #'easy_thumbnails.processors.scale_and_crop', 'filer.thumbnail_processors.scale_and_crop_with_subject_location', 'easy_thumbnails.processors.filters', ) @@ -442,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" diff --git a/dynamicweb/settings/prod.py b/dynamicweb/settings/prod.py index 1f21ca46..1588b5c3 100644 --- a/dynamicweb/settings/prod.py +++ b/dynamicweb/settings/prod.py @@ -3,10 +3,12 @@ from .base import * ADMINS = ( ('Nico Schottelius', 'nico.schottelius@ungleich.ch'), ('Raul Ascencio', 'raul.ascencio@yandex.com'), + ('Tomislav Rupcic','tmslav@gmail.com'), + ) # ('Sanghee Kim', 'sanghee.kim@ungleich.ch'), -MANAGERS = ADMINS +#MANAGERS = ADMINS REGISTRATION_MESSAGE['message'] = REGISTRATION_MESSAGE['message'].format(host='digitalglarus.ungleich.ch',slug='{slug}') diff --git a/hosting/admin.py b/hosting/admin.py index 84067ff9..70392113 100644 --- a/hosting/admin.py +++ b/hosting/admin.py @@ -1,6 +1,5 @@ from django.contrib import admin -from .models import RailsBetaUser, VirtualMachineType +from .models import VirtualMachineType -admin.site.register(RailsBetaUser) admin.site.register(VirtualMachineType) diff --git a/hosting/management/commands/create_vm_types.py b/hosting/management/commands/create_vm_types.py index 23961bae..493e9e82 100644 --- a/hosting/management/commands/create_vm_types.py +++ b/hosting/management/commands/create_vm_types.py @@ -10,41 +10,43 @@ class Command(BaseCommand): hetzner = { 'base_price': 10, 'core_price': 10, - 'memory_price': 10, - 'disk_size_price': 10, - 'description': 'VM auf einzelner HW, Raid1, kein HA' + 'memory_price': 5, + 'disk_size_price': 1, + '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/0015_auto_20160512_0448.py b/hosting/migrations/0015_auto_20160512_0448.py new file mode 100644 index 00000000..16380513 --- /dev/null +++ b/hosting/migrations/0015_auto_20160512_0448.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-05-12 04:48 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('hosting', '0014_auto_20160505_0541'), + ] + + operations = [ + migrations.RenameField( + model_name='hostingorder', + old_name='VMPlan', + new_name='vm_plan', + ), + ] diff --git a/hosting/migrations/0016_delete_railsbetauser.py b/hosting/migrations/0016_delete_railsbetauser.py new file mode 100644 index 00000000..8eb00622 --- /dev/null +++ b/hosting/migrations/0016_delete_railsbetauser.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-05-14 06:50 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('hosting', '0015_auto_20160512_0448'), + ] + + operations = [ + migrations.DeleteModel( + name='RailsBetaUser', + ), + ] 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 dd686312..e2775fc4 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -10,14 +10,6 @@ from utils.models import BillingAddress from .managers import VMPlansManager -class RailsBetaUser(models.Model): - email = models.EmailField(unique=True) - received_date = models.DateTimeField('date received') - - def __str__(self): - return "%s - %s" % (self.email, self.received_date) - - class VirtualMachineType(models.Model): HETZNER_NUG = 'hetzner_nug' @@ -25,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'), @@ -34,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()) @@ -73,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, } @@ -86,6 +87,9 @@ class VirtualMachinePlan(models.Model): objects = VMPlansManager() + def __str__(self): + return "%s" % (self.id) + @cached_property def hosting_company_name(self): return self.vm_type.get_hosting_company_display() @@ -106,7 +110,7 @@ class HostingOrder(models.Model): ORDER_APPROVED_STATUS = 'Approved' ORDER_DECLINED_STATUS = 'Declined' - VMPlan = models.ForeignKey(VirtualMachinePlan, related_name='hosting_orders') + vm_plan = models.ForeignKey(VirtualMachinePlan, related_name='hosting_orders') customer = models.ForeignKey(StripeCustomer) billing_address = models.ForeignKey(BillingAddress) created_at = models.DateTimeField(auto_now_add=True) @@ -115,13 +119,16 @@ class HostingOrder(models.Model): cc_brand = models.CharField(max_length=10) stripe_charge_id = models.CharField(max_length=100, null=True) + def __str__(self): + return "%s" % (self.id) + @cached_property def status(self): return self.ORDER_APPROVED_STATUS if self.approved else self.ORDER_DECLINED_STATUS @classmethod - def create(cls, VMPlan=None, customer=None, billing_address=None): - instance = cls.objects.create(VMPlan=VMPlan, customer=customer, + def create(cls, vm_plan=None, customer=None, billing_address=None): + instance = cls.objects.create(vm_plan=vm_plan, customer=customer, billing_address=billing_address) return instance 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 00000000..340a398a Binary files /dev/null and b/hosting/static/hosting/img/CH_flag.png differ diff --git a/hosting/static/hosting/img/DE_flag.png b/hosting/static/hosting/img/DE_flag.png new file mode 100644 index 00000000..d4f4526e Binary files /dev/null and b/hosting/static/hosting/img/DE_flag.png differ 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 %}
Copyright © ungleich GmbH {% now "Y" %}. All Rights Reserved
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 %}Here are samples of our {{ hosting_long }} hosting offers, suited for different projects. Our offer examples come in different size, speed, and storage.