diff --git a/.travis.yml b/.travis.yml index c306c1f9..6a3cca25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: # - "3.6" env: - - DJANGO_SECRET_KEY=0 OPENNEBULA_USERNAME='test' OPENNEBULA_PASSWORD='test' OPENNEBULA_PROTOCOL='http' OPENNEBULA_DOMAIN='test_domain' OPENNEBULA_PORT='2633' OPENNEBULA_ENDPOINT='/RPC2' DCL_TEXT='Data Center Light' CELERY_MAX_RETRIES=0 + - DJANGO_SECRET_KEY=0 OPENNEBULA_USERNAME='test' OPENNEBULA_PASSWORD='test' OPENNEBULA_PROTOCOL='http' OPENNEBULA_DOMAIN='test_domain' OPENNEBULA_PORT='2633' OPENNEBULA_ENDPOINT='/RPC2' DCL_TEXT='Data Center Light' CELERY_MAX_RETRIES=0 UNGLEICH_SITE_CONFIGS='{"localhost":{"MULTISITE_CMS_URL":"dynamicweb.urls"}}' # install dependencies install: "pip install -r requirements.txt" script: diff --git a/Changelog b/Changelog index debfb974..b48cadd5 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,12 @@ Next: + * #3798: [dg] Redirect user to digital glarus on clicking logo in the email + * #3554: [dcl] Remove beta access resources + * #4166: [glasfaser] heading text not to be blocked by topnav on mobile after navbar menu click +1.4: 2018-02-22 + * #4104: [cms, nuglarus] Multisite and access control of cms pages per user +1.3.3: 2018-02-21 + * Add ALLOWED_HOST nüglarus.ch IDN + * #4105: [cms] Add cms footer plugin * #4049: [blog] Replace header background image * #3670: [hosting] Shorten ssh key name * #4046: [hosting] Add sdd_size, hdd_size to VirtualMachineSerializer (No visual change) diff --git a/datacenterlight/admin.py b/datacenterlight/admin.py deleted file mode 100644 index 7a846c71..00000000 --- a/datacenterlight/admin.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.contrib import admin - -from .models import BetaAccess, BetaAccessVMType, BetaAccessVM -# Register your models here. - - -admin.site.register(BetaAccess) -admin.site.register(BetaAccessVMType) -admin.site.register(BetaAccessVM) diff --git a/datacenterlight/forms.py b/datacenterlight/forms.py index 3ffe403c..b697f694 100644 --- a/datacenterlight/forms.py +++ b/datacenterlight/forms.py @@ -1,26 +1,9 @@ from django import forms -from .models import BetaAccess, ContactUs - - -class BetaAccessForm(forms.ModelForm): - email = forms.CharField(widget=forms.EmailInput()) - - class Meta: - fields = ['name', 'email'] - model = BetaAccess +from .models import ContactUs class ContactForm(forms.ModelForm): - class Meta: fields = ['name', 'email', 'message'] model = ContactUs - - -# class BetaAccessVMForm(forms.ModelForm): -# type = forms.CharField(widget=forms.EmailInput()) - -# class Meta: -# fields = ['email'] -# model = BetaAccessVM diff --git a/datacenterlight/migrations/0011_auto_20180220_1423.py b/datacenterlight/migrations/0011_auto_20180220_1423.py new file mode 100644 index 00000000..d436981e --- /dev/null +++ b/datacenterlight/migrations/0011_auto_20180220_1423.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-02-20 14:23 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('datacenterlight', '0010_merge'), + ] + + operations = [ + migrations.RemoveField( + model_name='betaaccessvm', + name='access', + ), + migrations.RemoveField( + model_name='betaaccessvm', + name='type', + ), + migrations.DeleteModel( + name='BetaAccess', + ), + migrations.DeleteModel( + name='BetaAccessVM', + ), + migrations.DeleteModel( + name='BetaAccessVMType', + ), + ] diff --git a/datacenterlight/models.py b/datacenterlight/models.py index e2de41e1..2fbed5c8 100644 --- a/datacenterlight/models.py +++ b/datacenterlight/models.py @@ -1,56 +1,6 @@ from django.db import models -class BetaAccessVMType(models.Model): - ssd = models.IntegerField() - ram = models.IntegerField() - cpu = models.IntegerField() - price = models.FloatField() - - 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) - - -class BetaAccess(models.Model): - email = models.CharField(max_length=250) - name = models.CharField(max_length=250) - - # vm = models.ForeignKey(BetaAccessVM) - - def __str__(self): - vms = self.betaaccessvm_set.all() - rep = "Email: %s " % self.email - for vm in vms: - rep += "(vm:%s - amount:%s) - " % (vm.type.id, vm.amount) - return rep - - -class BetaAccessVM(models.Model): - type = models.ForeignKey(BetaAccessVMType) - access = models.ForeignKey(BetaAccess) - amount = models.IntegerField() - - @classmethod - def create(cls, data): - VM_KEY_ID = 0 - VM_AMOUNT = 1 - ZERO = 0 - email = data.get('email') - beta_access = BetaAccess.objects.create(email=email) - vm_data = [(key, value) for key, value in data.items() if 'vm' in key] - created_vms = [] - for vm in vm_data: - if int(vm[VM_AMOUNT]) == ZERO: - continue - vm_id = vm[VM_KEY_ID].split('-').pop() - vm_type = BetaAccessVMType.objects.get(id=vm_id) - created_vms.append(cls.objects.create(access=beta_access, - 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() diff --git a/datacenterlight/static/datacenterlight/img/beta-img.png b/datacenterlight/static/datacenterlight/img/beta-img.png deleted file mode 100644 index 76a3983f..00000000 Binary files a/datacenterlight/static/datacenterlight/img/beta-img.png and /dev/null differ diff --git a/datacenterlight/static/datacenterlight/js/beta.js b/datacenterlight/static/datacenterlight/js/beta.js deleted file mode 100644 index 7fd84acf..00000000 --- a/datacenterlight/static/datacenterlight/js/beta.js +++ /dev/null @@ -1,55 +0,0 @@ -(function($){ - 'use strict'; // Start of use strict - - - - $(document).ready(function(){ - verifiedUrl(); - init_options_interested(); - init_nav(); - change_values(); - }); - - function verifiedUrl(){ - if(window.location.href.indexOf('#success') > -1){ - form_success(); - } - } - - function init_options_interested(){ - $('.row-vms').click(function(){ - $('.row-vms').removeClass('row-vms__active'); - $(this).addClass('row-vms__active'); - var number = $('.row-vms__active input').val(); - var price = $('.row-vms__active input').data('price'); - _calculate(number, price); - }); - } - - function init_nav(){ - - $('.nav-local').click(function(){ - $('html, body').animate({ - scrollTop: $('#'+$(this).data('href')).offset().top - }); - }); - - } - - function change_values(){ - $('.number-vms').keyup(function () { - var number = $(this).val(); - var price = $(this).data('price'); - _calculate(number, price); - }); - - } - function form_success(){ - $('#sucessModal').modal('show'); - } - function _calculate(numbers, price){ - $('#valueTotal').text(numbers*price*31); - } - - -})(jQuery); // End of use strict diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 4c50702e..9d8285b8 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -107,7 +107,7 @@ $('.navbar-collapse').addClass('collapsing'); if ($(href).length) { $('html, body').animate({ - scrollTop: $(href).offset().top + scrollTop: $(href).offset().top - 50 }, 1000); } }); diff --git a/datacenterlight/templates/datacenterlight/beta_access.html b/datacenterlight/templates/datacenterlight/beta_access.html deleted file mode 100644 index 7a694611..00000000 --- a/datacenterlight/templates/datacenterlight/beta_access.html +++ /dev/null @@ -1,27 +0,0 @@ -{% load i18n %} - -
- {% csrf_token %} - {{ form.non_field_errors }} -
- {% for message in messages %} - {{ message }} - {% endfor %} -
-
-
- - {{ form.name.errors|striptags}} -
-
- - {{ form.email.errors|striptags}} -
-
- -
- \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/beta_success.html b/datacenterlight/templates/datacenterlight/beta_success.html deleted file mode 100644 index 60df607c..00000000 --- a/datacenterlight/templates/datacenterlight/beta_success.html +++ /dev/null @@ -1,47 +0,0 @@ - -{% load i18n %} - - - - \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html deleted file mode 100644 index be8479d9..00000000 --- a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.html +++ /dev/null @@ -1,176 +0,0 @@ -{% load static from staticfiles %} -{% load i18n %} - - - - - - - {{dcl_text}} - - - - - - - - - - - - - -
-
- - - - -
- -
- - - - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {% block email_head %} - {% endblock %} -
-

- {% block email_body %} - {% endblock %} -

  -
-
-
-
- - - - -
{% trans 'Your Data Center Light Team' %} -
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt b/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt deleted file mode 100644 index 46fd0730..00000000 --- a/datacenterlight/templates/datacenterlight/emails/base_email_datacenterlight.txt +++ /dev/null @@ -1,7 +0,0 @@ -{% load static from staticfiles %} -{% load i18n %} -{% block email_head %} -{% endblock %} -{% block email_body %} -{% endblock %} -{% trans 'Your Data Center Light Team' %} diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html deleted file mode 100644 index 2f71944f..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.html +++ /dev/null @@ -1,129 +0,0 @@ -{% load static from staticfiles %} -{% load i18n%} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {% trans "Thank you for your request." %} -
-

{% trans "You are one step away from being our beta tester!" %}

- {% trans "Currently we are running our tests to make sure everything runs perfectly." %}
- {% trans "In the meantime, we would like to ask you a little patience
until our team contacts you with beta access." %}
- {% trans "Thank you!" %}

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.txt b/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.txt deleted file mode 100644 index e96a8ef1..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_confirmation.txt +++ /dev/null @@ -1,129 +0,0 @@ -{% load static from staticfiles %} -{% load i18n%} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- {% trans "Thank you for your request." %} -
-

{% trans "You are one step away from being our beta tester!" %}

- {% trans "Currently we are running our tests to make sure everything runs perfectly." %}
- {% trans "In the meantime, we would like to ask you a little patience
until our team contacts you with beta access." %}
- {% trans "Thank you!" %}

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html b/datacenterlight/templates/datacenterlight/emails/request_access_notification.html deleted file mode 100644 index 095c917e..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_notification.html +++ /dev/null @@ -1,125 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access -
-

User {{email}} requested beta access

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_access_notification.txt b/datacenterlight/templates/datacenterlight/emails/request_access_notification.txt deleted file mode 100644 index 09531ba6..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_access_notification.txt +++ /dev/null @@ -1,125 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access -
-

User {{email}} requested beta access

 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html deleted file mode 100644 index c6f3033e..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.html +++ /dev/null @@ -1,131 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access - - -
-

User {{email}} requested beta access

- {% for vm in vms %} - Type: {{vm.type}} - Amount: {{vm.amount}} - {% endfor %} -
 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt b/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt deleted file mode 100644 index 92a03a99..00000000 --- a/datacenterlight/templates/datacenterlight/emails/request_beta_access_notification.txt +++ /dev/null @@ -1,131 +0,0 @@ -{% load static from staticfiles %} - - - - - - -Oxygen Invoice - - - - - - - - - - - - - -
-
- - -
- -
- - - -
- logo - -
-
- -
-
-
-
- - - - - - - - - - -
- An user requested a beta access - - -
-

User {{email}} requested beta access

- {% for vm in vms %} - Type: {{vm.type}} - {% endfor %} -
 
-
-
-
- - -
Your data center light team
-
-
-
- - - diff --git a/datacenterlight/templates/datacenterlight/index.html b/datacenterlight/templates/datacenterlight/index.html index f8ac4419..3d430342 100755 --- a/datacenterlight/templates/datacenterlight/index.html +++ b/datacenterlight/templates/datacenterlight/index.html @@ -136,7 +136,6 @@
-
{% include "datacenterlight/calculator_form.html" %}
diff --git a/datacenterlight/templates/datacenterlight/success.html b/datacenterlight/templates/datacenterlight/success.html deleted file mode 100644 index ff553f3c..00000000 --- a/datacenterlight/templates/datacenterlight/success.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends "datacenterlight/base.html" %} -{% load staticfiles i18n %} -{% block content %} - -
- -
-

{% trans "Thank you for order! Our team will contact you via email" %}

- {% if LANGUAGE_CODE == 'en-us'%} -

{% trans "as soon as possible!" %}

- {% endif %} -
- -
- - - -{% endblock %} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/whydatacenterlight.html b/datacenterlight/templates/datacenterlight/whydatacenterlight.html index c54156b6..eef33b8a 100644 --- a/datacenterlight/templates/datacenterlight/whydatacenterlight.html +++ b/datacenterlight/templates/datacenterlight/whydatacenterlight.html @@ -135,7 +135,6 @@
-
{% include "datacenterlight/calculator_form.html" %}
diff --git a/datacenterlight/urls.py b/datacenterlight/urls.py index 2cd0723f..a93a24d0 100644 --- a/datacenterlight/urls.py +++ b/datacenterlight/urls.py @@ -1,13 +1,10 @@ from django.conf.urls import url - -from .views import ( - IndexView, BetaProgramView, LandingProgramView, BetaAccessView, - SuccessView, PaymentOrderView, OrderConfirmationView, - WhyDataCenterLightView, ContactUsView -) - from django.views.generic import TemplateView +from .views import ( + IndexView, LandingProgramView, PaymentOrderView, OrderConfirmationView, + WhyDataCenterLightView, ContactUsView +) urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), @@ -17,15 +14,11 @@ urlpatterns = [ url(r'^l/$', IndexView.as_view(), name='index_l'), url(r'^whydatacenterlight/?$', WhyDataCenterLightView.as_view(), name='whydatacenterlight'), - url(r'^beta-program/?$', BetaProgramView.as_view(), name='beta'), url(r'^landing/?$', LandingProgramView.as_view(), name='landing'), url(r'^payment/?$', PaymentOrderView.as_view(), name='payment'), url(r'^order-confirmation/?$', OrderConfirmationView.as_view(), name='order_confirmation'), - url(r'^order-success/?$', SuccessView.as_view(), name='order_success'), - url(r'^beta_access?$', BetaAccessView.as_view(), name='beta_access'), url(r'^contact/?$', ContactUsView.as_view(), name='contact_us'), - url(r'glasfaser/?$', TemplateView.as_view(template_name='ungleich_page/glasfaser.html'), name='glasfaser'), diff --git a/datacenterlight/views.py b/datacenterlight/views.py index fda8c9c9..25374dfb 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -1,5 +1,5 @@ -import logging import json +import logging from django import forms from django.conf import settings @@ -14,19 +14,18 @@ from django.views.decorators.cache import cache_control from django.views.generic import FormView, CreateView, TemplateView, DetailView from datacenterlight.tasks import create_vm_task -from hosting.models import HostingOrder from hosting.forms import HostingUserLoginForm +from hosting.models import HostingOrder from membership.models import CustomUser, StripeCustomer from opennebula_api.serializers import VMTemplateSerializer from utils.forms import ( BillingAddressForm, BillingAddressFormSignup ) from utils.hosting_utils import get_vm_price -from utils.mailer import BaseEmail from utils.stripe_utils import StripeUtils from utils.tasks import send_plain_email_task -from .forms import BetaAccessForm, ContactForm -from .models import BetaAccess, BetaAccessVMType, BetaAccessVM, VMTemplate +from .forms import ContactForm +from .models import VMTemplate logger = logging.getLogger(__name__) @@ -79,128 +78,8 @@ class LandingProgramView(TemplateView): template_name = "datacenterlight/landing.html" -class SuccessView(TemplateView): - template_name = "datacenterlight/success.html" - - def get(self, request, *args, **kwargs): - if 'specs' not in request.session or 'user' not in request.session: - return HttpResponseRedirect(reverse('datacenterlight:index')) - elif 'token' not in request.session: - return HttpResponseRedirect(reverse('datacenterlight:payment')) - elif 'order_confirmation' not in request.session: - return HttpResponseRedirect( - reverse('datacenterlight:order_confirmation')) - else: - for session_var in ['specs', 'user', 'template', 'billing_address', - 'billing_address_data', - 'token', 'customer']: - if session_var in request.session: - del request.session[session_var] - return render(request, self.template_name) - - -class BetaAccessView(FormView): - template_name = "datacenterlight/beta_access.html" - form_class = BetaAccessForm - success_message = "Thank you, we will contact you as soon as possible" - - def form_valid(self, form): - context = { - 'base_url': "{0}://{1}".format(self.request.scheme, - self.request.get_host()) - } - - email_data = { - 'subject': 'DatacenterLight Beta Access Request', - 'from_address': '(datacenterlight) datacenterlight Support ', - 'to': form.cleaned_data.get('email'), - 'from': '(datacenterlight) DatacenterLight Support support@datacenterlight.ch', - 'context': context, - 'template_name': 'request_access_confirmation', - 'template_path': 'datacenterlight/emails/' - } - email = BaseEmail(**email_data) - email.send() - - context.update({ - 'email': form.cleaned_data.get('email') - }) - - email_data = { - 'subject': 'DatacenterLight Beta Access Request', - 'from_address': '(datacenterlight) datacenterlight Support ', - 'to': 'info@ungleich.ch', - 'context': context, - 'template_name': 'request_access_notification', - 'template_path': 'datacenterlight/emails/' - } - email = BaseEmail(**email_data) - email.send() - - messages.add_message(self.request, messages.SUCCESS, - self.success_message) - return render(self.request, 'datacenterlight/beta_success.html', {}) - - -class BetaProgramView(CreateView): - template_name = "datacenterlight/beta.html" - model = BetaAccessVM - fields = '__all__' - # form_class = BetaAccessForm - # success_url = "/datacenterlight#requestform" - success_message = "Thank you, we will contact you as soon as possible" - - def get_success_url(self): - success_url = reverse('datacenterlight:beta') - success_url += "#success" - return success_url - - def get_context_data(self, **kwargs): - vms = BetaAccessVMType.objects.all() - context = super(BetaProgramView, self).get_context_data(**kwargs) - - # templates = OpenNebulaManager().get_templates() - # data = VirtualMachineTemplateSerializer(templates, many=True).data - - context.update({ - 'base_url': "{0}://{1}".format(self.request.scheme, - self.request.get_host()), - 'vms': vms - }) - return context - - def post(self, request, *args, **kwargs): - data = request.POST - vms = BetaAccessVM.create(data) - - context = { - 'base_url': "{0}://{1}".format(self.request.scheme, - self.request.get_host()), - 'email': data.get('email'), - 'name': data.get('name'), - 'vms': vms - } - - email_data = { - 'subject': 'DatacenterLight Beta Access Request', - 'from_address': '(datacenterlight) datacenterlight Support ', - 'to': 'info@ungleich.ch', - 'context': context, - 'template_name': 'request_beta_access_notification', - 'template_path': 'datacenterlight/emails/' - } - email = BaseEmail(**email_data) - email.send() - - messages.add_message(self.request, messages.SUCCESS, - self.success_message) - return HttpResponseRedirect(self.get_success_url()) - - class IndexView(CreateView): template_name = "datacenterlight/index.html" - model = BetaAccess - form_class = BetaAccessForm success_url = "/datacenterlight#requestform" success_message = "Thank you, we will contact you as soon as possible" @@ -292,48 +171,9 @@ class IndexView(CreateView): }) return context - def form_valid(self, form): - - context = { - 'base_url': "{0}://{1}".format(self.request.scheme, - self.request.get_host()) - } - - email_data = { - 'subject': 'DatacenterLight Beta Access Request', - 'from_address': '(datacenterlight) datacenterlight Support ', - 'to': form.cleaned_data.get('email'), - 'from': '(datacenterlight) DatacenterLight Support support@datacenterlight.ch', - 'context': context, - 'template_name': 'request_access_confirmation', - 'template_path': 'datacenterlight/emails/' - } - email = BaseEmail(**email_data) - email.send() - - context.update({ - 'email': form.cleaned_data.get('email') - }) - - email_data = { - 'subject': 'DatacenterLight Beta Access Request', - 'from_address': '(datacenterlight) datacenterlight Support ', - 'to': 'info@ungleich.ch', - 'context': context, - 'template_name': 'request_access_notification', - 'template_path': 'datacenterlight/emails/' - } - email = BaseEmail(**email_data) - email.send() - - messages.add_message(self.request, messages.SUCCESS, - self.success_message) - return super(IndexView, self).form_valid(form) - class WhyDataCenterLightView(IndexView): template_name = "datacenterlight/whydatacenterlight.html" - model = BetaAccess class PaymentOrderView(FormView): diff --git a/digitalglarus/templates/digitalglarus/emails/membership_charge.html b/digitalglarus/templates/digitalglarus/emails/membership_charge.html index e890a8c5..e5de2491 100644 --- a/digitalglarus/templates/digitalglarus/emails/membership_charge.html +++ b/digitalglarus/templates/digitalglarus/emails/membership_charge.html @@ -74,7 +74,7 @@
diff --git a/digitalglarus/templates/digitalglarus/emails/membership_monthly_charge.html b/digitalglarus/templates/digitalglarus/emails/membership_monthly_charge.html index 4a962c41..a30e93a0 100644 --- a/digitalglarus/templates/digitalglarus/emails/membership_monthly_charge.html +++ b/digitalglarus/templates/digitalglarus/emails/membership_monthly_charge.html @@ -74,7 +74,7 @@
- logo + logo
diff --git a/digitalglarus/urls.py b/digitalglarus/urls.py index 92cd8e11..64a63303 100644 --- a/digitalglarus/urls.py +++ b/digitalglarus/urls.py @@ -14,7 +14,8 @@ from .views import ContactView, IndexView, HistoryView, LoginView, SignupView,\ # from membership.views import LoginRegistrationView urlpatterns = [ - url(_(r'booking/payment/edit/?$'), EditCreditCardView.as_view(), name='edit_credit_card'), + url(_(r'booking/payment/edit/?$'), + EditCreditCardView.as_view(), name='edit_credit_card'), url(_(r'^$'), IndexView.as_view(), name='landing'), # url(_(r'new_credit_card/?$'), TermsAndConditions, name='TermsAndConditions'), url(_(r'support-us/?$'), SupportusView.as_view(), name='supportus'), @@ -30,14 +31,16 @@ urlpatterns = [ url(_(r'users/billing_address/?$'), UserBillingAddressView.as_view(), name='user_billing_address'), url(_(r'booking/?$'), BookingSelectDatesView.as_view(), name='booking'), - url(_(r'booking/payment/?$'), BookingPaymentView.as_view(), name='booking_payment'), + url(_(r'booking/payment/?$'), + BookingPaymentView.as_view(), name='booking_payment'), url(_(r'booking/orders/(?P\d+)/?$'), OrdersBookingDetailView.as_view(), name='booking_orders_detail'), # url(_(r'booking/orders/(?P\d+)/cancel/?$'), BookingCancelView.as_view(), # name='booking_orders_cancel'), url(_(r'booking/orders/?$'), BookingOrdersListView.as_view(), name='booking_orders_list'), - url(_(r'membership/payment/?$'), MembershipPaymentView.as_view(), name='membership_payment'), + url(_(r'membership/payment/?$'), + MembershipPaymentView.as_view(), name='membership_payment'), url(_(r'membership/activated/?$'), MembershipActivatedView.as_view(), name='membership_activated'), url(_(r'membership/deactivate/?$'), MembershipDeactivateView.as_view(), @@ -53,7 +56,7 @@ urlpatterns = [ url(_(r'membership/orders/?$'), MembershipOrdersListView.as_view(), name='membership_orders_list'), url(_(r'supporters/?$'), views.supporters, name='supporters'), - # url(_(r'support-us/?$'), views.support, name='support'), + url(_(r'support-us/?$'), views.support, name='support'), url(r'^blog/(?P\w[-\w]*)/$', views.blog_detail, name='blog-detail'), url(r'blog/$', views.blog, name='blog'), ] diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 47534585..b3bb0d20 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -5,6 +5,7 @@ Copyright 2015 ungleich. # -*- coding: utf-8 -*- # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os +import json from django.utils.translation import ugettext_lazy as _ @@ -54,7 +55,8 @@ PROJECT_DIR = os.path.abspath( # load .env file dotenv.read_dotenv("{0}/.env".format(PROJECT_DIR)) -SITE_ID = 1 +from multisite import SiteID +SITE_ID = SiteID(default=1) APP_ROOT_ENDPOINT = "/" APPEND_SLASH = True @@ -76,6 +78,7 @@ SECRET_KEY = env('DJANGO_SECRET_KEY') INSTALLED_APPS = ( # 1st migrate 'membership', + 'djangocms_admin_style', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -83,6 +86,8 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', + 'multisite', + 'djangocms_multisite', 'easy_thumbnails', 'utils', 'stored_messages', @@ -124,7 +129,6 @@ INSTALLED_APPS = ( # 'djangocms_teaser', 'djangocms_page_meta', 'djangocms_text_ckeditor', - 'djangocms_admin_style', 'cmsplugin_filer_file', 'cmsplugin_filer_folder', 'cmsplugin_filer_link', @@ -163,6 +167,8 @@ MIDDLEWARE_CLASSES = ( 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware', 'cms.middleware.language.LanguageCookieMiddleware', + 'multisite.middleware.DynamicSiteMiddleware', + 'djangocms_multisite.middleware.CMSMultiSiteMiddleware', ) CSRF_FAILURE_VIEW = 'hosting.views.forbidden_view' @@ -328,6 +334,8 @@ CMS_PLACEHOLDER_CONF = { }, } +CMS_PERMISSION=True + CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache', @@ -507,6 +515,36 @@ STRIPE_API_PRIVATE_KEY_TEST = env('STRIPE_API_PRIVATE_KEY_TEST') ANONYMOUS_USER_NAME = 'anonymous@ungleich.ch' GUARDIAN_GET_INIT_ANONYMOUS_USER = 'membership.models.get_anonymous_user_instance' +UNGLEICH_SITE_CONFIGS = env('UNGLEICH_SITE_CONFIGS') + +MULTISITE_CMS_URLS = {} +if UNGLEICH_SITE_CONFIGS == "": + raise Exception("Please define UNGLEICH_SITE_CONFIGS in your .env") +else: + try: + configs_dict=json.loads(UNGLEICH_SITE_CONFIGS) + except ValueError as verr: + raise Exception("UNGLEICH_SITE_CONFIGS is not a valid JSON: {}".format( + str(verr) + )) + else: + MULTISITE_CMS_URLS = { + k:v['MULTISITE_CMS_URL'] for (k,v) in configs_dict.items() + } + +MULTISITE_CMS_ALIASES = { +} +MULTISITE_CMS_FALLBACK = env('MULTISITE_CMS_FALLBACK') +if MULTISITE_CMS_FALLBACK == '': + MULTISITE_CMS_FALLBACK = 'datacenterlight.ch' +MULTISITE_FALLBACK = 'django.views.generic.base.RedirectView' +MULTISITE_FALLBACK_KWARGS = { + 'url': 'https://{}/'.format(MULTISITE_CMS_FALLBACK), 'permanent': False +} + +FILER_ENABLE_PERMISSIONS = True + + ############################################# # configurations for opennebula-integration # ############################################# diff --git a/dynamicweb/settings/local.py b/dynamicweb/settings/local.py index 1b03f3fe..4ea3dc7e 100644 --- a/dynamicweb/settings/local.py +++ b/dynamicweb/settings/local.py @@ -19,5 +19,6 @@ MIDDLEWARE_CLASSES += ("debug_toolbar.middleware.DebugToolbarMiddleware",) INSTALLED_APPS += ( 'django_extensions', - 'debug_toolbar' + # debug_toolbar seems to conflict with multisite (and djangocms_multisite) + # 'debug_toolbar' ) diff --git a/dynamicweb/settings/prod.py b/dynamicweb/settings/prod.py index 6cc872d5..12a1f349 100644 --- a/dynamicweb/settings/prod.py +++ b/dynamicweb/settings/prod.py @@ -31,5 +31,6 @@ ALLOWED_HOSTS = [ ".ipv6onlyhosting.com", ".ipv6onlyhosting.net", ".digitalglarus.ch", - ".hack4glarus.ch" + ".hack4glarus.ch", + ".xn--nglarus-n2a.ch" ] diff --git a/dynamicweb/urls_multi.py b/dynamicweb/urls_multi.py new file mode 100644 index 00000000..752c353e --- /dev/null +++ b/dynamicweb/urls_multi.py @@ -0,0 +1,17 @@ +from django.conf import settings +from django.conf.urls import include, url +from django.conf.urls.i18n import i18n_patterns +from django.contrib import admin +from django.views import static as static_view + +urlpatterns = i18n_patterns( + url(r'^admin/', include(admin.site.urls)), + url(r'^cms/', include('cms.urls')), +) + +urlpatterns += [ + url(r'^media/(?P.*)$', + static_view.serve, { + 'document_root': settings.MEDIA_ROOT, + }), +] diff --git a/hosting/static/hosting/img/Beta.png b/hosting/static/hosting/img/Beta.png deleted file mode 100644 index 76a3983f..00000000 Binary files a/hosting/static/hosting/img/Beta.png and /dev/null differ diff --git a/hosting/templates/hosting/beta.html b/hosting/templates/hosting/beta.html deleted file mode 100644 index bdf37f58..00000000 --- a/hosting/templates/hosting/beta.html +++ /dev/null @@ -1,147 +0,0 @@ -{% load staticfiles %} - - - - - - - - - - - - - Rails Hosting.ch - Ruby on Rails as easy as possible - - - - - - - - - - - - - - - - - - - {% include 'google_analytics.html' %} - - - - - - - - - - - - -
-
-
- -
-

Thank you for your interest in joining Rails-Hosting Beta.
-     We will come back to you shortly to give you access to our  infrastructure. -

-
-
    - -
-
-
-
- -
- - - - - - - - - - - - - - - - - diff --git a/hosting/templates/hosting/includes/_header.html b/hosting/templates/hosting/includes/_header.html index 9e609816..6f9b4a5c 100644 --- a/hosting/templates/hosting/includes/_header.html +++ b/hosting/templates/hosting/includes/_header.html @@ -7,7 +7,6 @@
-

{{ domain }}

{{ hosting_long }} as easy as possible


diff --git a/membership/admin.py b/membership/admin.py index f69ccbef..3aefa780 100644 --- a/membership/admin.py +++ b/membership/admin.py @@ -1,20 +1,103 @@ +from django import forms from django.contrib import admin +from django.contrib.auth.admin import UserAdmin as BaseUserAdmin +from django.contrib.auth.forms import ReadOnlyPasswordHashField + from .models import CustomUser, StripeCustomer -from django.contrib.auth.hashers import make_password -class CustomUserAdmin(admin.ModelAdmin): - fields = ('password', 'user_permissions', 'email', 'is_admin') +# Refer https://docs.djangoproject.com/en/2.0/topics/auth/customizing/ +# for understanding custom auth user model - def save_model(self, request, obj, form, change): - password = form.cleaned_data.get('password') - if not change: - obj.validation_slug = make_password(None) +class UserCreationForm(forms.ModelForm): + """A form for creating new users. Includes all the required + fields, plus a repeated password.""" + password1 = forms.CharField(label='Password', widget=forms.PasswordInput) + password2 = forms.CharField(label='Password confirmation', + widget=forms.PasswordInput) - obj.set_password(password) - obj.save() - return obj + class Meta: + model = CustomUser + fields = ('email', 'user_permissions', 'email', 'is_admin') + + def clean_password2(self): + # Check that the two password entries match + password1 = self.cleaned_data.get("password1") + password2 = self.cleaned_data.get("password2") + if password1 and password2 and password1 != password2: + raise forms.ValidationError("Passwords don't match") + return password2 + + def save(self, commit=True): + # Save the provided password in hashed format + user = super().save(commit=False) + user.set_password(self.cleaned_data["password1"]) + if commit: + user.save() + return user + + +class UserChangeForm(forms.ModelForm): + """A form for updating users. Includes all the fields on + the user, but replaces the password field with admin's + password hash display field. + """ + password = ReadOnlyPasswordHashField( + label="Password", + help_text=( + "Raw passwords are not stored, so there is no way to see " + "this user's password, but you can change the password " + "using this form.") + ) + + class Meta: + model = CustomUser + fields = ('email', 'password', 'is_admin') + + def clean_password(self): + # Regardless of what the user provides, return the initial value. + # This is done here, rather than on the field, because the + # field does not have access to the initial value + return self.initial["password"] + + +class CustomUserAdmin(BaseUserAdmin): + # The forms to add and change user instances + form = UserChangeForm + add_form = UserCreationForm + + # The fields to be used in displaying the User model. + # These override the definitions on the base UserAdmin + # that reference specific fields on auth.User. + list_display = ( + 'email', 'is_admin', 'is_superuser' + ) + list_filter = () + fieldsets = ( + (None, {'fields': ('email',)}), + ('Change Password', + {'fields': ('password',), + 'description': "Raw passwords are not stored, so there is no way to " + "see this user's password, but you can change the " + "password using this " + "form." + } + ), + ('Permissions', {'fields': ('is_admin', 'user_permissions', + 'groups')}), + ) + # add_fieldsets is not a standard ModelAdmin attribute. UserAdmin + # overrides get_fieldsets to use this attribute when creating a user. + add_fieldsets = ( + (None, { + 'classes': ('wide',), + 'fields': ('email', 'password1', 'password2')} + ), + ) + search_fields = ('email',) + ordering = ('email',) + filter_horizontal = () admin.site.register(CustomUser, CustomUserAdmin) diff --git a/membership/migrations/0007_auto_20180213_0128.py b/membership/migrations/0007_auto_20180213_0128.py new file mode 100644 index 00000000..0dd7b54a --- /dev/null +++ b/membership/migrations/0007_auto_20180213_0128.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-02-13 01:28 +from __future__ import unicode_literals + +from django.db import migrations, models +import membership.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('membership', '0006_auto_20160526_0445'), + ] + + operations = [ + migrations.AlterField( + model_name='customuser', + name='validation_slug', + field=models.CharField(db_index=True, default=membership.models.get_validation_slug, max_length=50, unique=True), + ), + ] diff --git a/membership/models.py b/membership/models.py index 73804008..b3cbcd91 100644 --- a/membership/models.py +++ b/membership/models.py @@ -59,6 +59,10 @@ class MyUserManager(BaseUserManager): return user +def get_validation_slug(): + return make_password(None) + + class CustomUser(AbstractBaseUser, PermissionsMixin): VALIDATED_CHOICES = ((0, 'Not validated'), (1, 'Validated')) site = models.ForeignKey(Site, default=1) @@ -66,8 +70,12 @@ class CustomUser(AbstractBaseUser, PermissionsMixin): email = models.EmailField(unique=True) validated = models.IntegerField(choices=VALIDATED_CHOICES, default=0) - validation_slug = models.CharField(db_index=True, unique=True, - max_length=50) + # By default, we initialize the validation_slug with appropriate value + # This is required for User(page) admin + validation_slug = models.CharField( + db_index=True, unique=True, max_length=50, + default=get_validation_slug + ) is_admin = models.BooleanField( _('staff status'), default=False, @@ -171,6 +179,10 @@ class CustomUser(AbstractBaseUser, PermissionsMixin): # Simplest possible answer: All admins are staff return self.is_admin + @is_staff.setter + def is_staff(self, value): + self._is_staff = value + class StripeCustomer(models.Model): user = models.OneToOneField(CustomUser) diff --git a/opennebula_api/serializers.py b/opennebula_api/serializers.py index 07506a8b..cc52a15e 100644 --- a/opennebula_api/serializers.py +++ b/opennebula_api/serializers.py @@ -50,7 +50,7 @@ class VirtualMachineSerializer(serializers.Serializer): disk_size = serializers.SerializerMethodField() hdd_size = serializers.SerializerMethodField() - sdd_size = serializers.SerializerMethodField() + ssd_size = serializers.SerializerMethodField() ipv4 = serializers.SerializerMethodField() ipv6 = serializers.SerializerMethodField() vm_id = serializers.IntegerField(read_only=True, source='id') @@ -90,7 +90,9 @@ class VirtualMachineSerializer(serializers.Serializer): ssh_key=ssh_key, specs=specs) except OpenNebulaException as err: - raise serializers.ValidationError("OpenNebulaException occured. {0}".format(err)) + raise serializers.ValidationError( + "OpenNebulaException occured. {0}".format(err) + ) return manager.get_vm(opennebula_id) @@ -104,7 +106,7 @@ class VirtualMachineSerializer(serializers.Serializer): disk_size += int(disk.size) return disk_size / 1024 - def get_sdd_size(self, obj): + def get_ssd_size(self, obj): template = obj.template disk_size = 0 for disk in template.disks: @@ -165,7 +167,9 @@ class VirtualMachineSerializer(serializers.Serializer): class VMTemplateSerializer(serializers.Serializer): """Serializer to map the VMTemplate instance into JSON format.""" - id = serializers.IntegerField(read_only=True, source='opennebula_vm_template_id') + id = serializers.IntegerField( + read_only=True, source='opennebula_vm_template_id' + ) name = serializers.CharField(read_only=True) diff --git a/requirements.txt b/requirements.txt index 7a325357..85a41841 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,6 +34,7 @@ django-meta==1.2 django-meta-mixin==0.3.0 django-model-utils==2.5 django-mptt==0.8.4 +django-multisite==1.4.1 django-parler==1.6.3 django-phonenumber-field==1.1.0 django-polymorphic==0.9.2 @@ -97,3 +98,4 @@ billiard==3.5.0.3 amqp==2.2.1 vine==1.1.4 cdist==4.7.0 +git+https://github.com/ungleich/djangocms-multisite.git#egg=djangocms_multisite diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 47f296aa..660a363a 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -8,6 +8,7 @@ from .models import ( UngleichCustomerItem, UngleichHTMLOnly, UngleichHeaderWithBackgroundImageSlider, UngleichHeaderWithBackgroundVideoSliderItem, + UngleichFooter ) @@ -295,3 +296,18 @@ class UngleichHTMLPlugin(CMSPluginBase): ) context['instance'] = instance return context + + +@plugin_pool.register_plugin +class UngleichFooterPlugin(CMSPluginBase): + name = "ungleich Footer Plugin" + model = UngleichFooter + render_template = "ungleich_page/ungleich/_footer.html" + cache = False + + def render(self, context, instance, placeholder): + context = super(UngleichFooterPlugin, self).render( + context, instance, placeholder + ) + context['instance'] = instance + return context diff --git a/ungleich_page/migrations/0018_ungleichfooter.py b/ungleich_page/migrations/0018_ungleichfooter.py new file mode 100644 index 00000000..37c33003 --- /dev/null +++ b/ungleich_page/migrations/0018_ungleichfooter.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-02-08 15:49 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0017_auto_20171219_1856'), + ('cms', '0014_auto_20160404_1908'), + ] + + operations = [ + migrations.CreateModel( + name='UngleichFooter', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('copyright_label', models.CharField(blank=True, default='', + help_text='Name of the company alongside the copyright year', max_length=100)), + ('link_text', models.CharField( + blank=True, help_text='Text for the link on the right part of footer', max_length=100, null=True)), + ('link_url', models.URLField(blank=True, + help_text='Url to the link in footer', null=True)), + ('twitter_url', models.URLField( + blank=True, help_text='If empty, twitter btn will not be visible', null=True)), + ('linkedin_url', models.URLField( + blank=True, help_text='If empty, linkedin btn will not be visible', null=True)), + ('github_url', models.URLField( + blank=True, help_text='If empty, github btn will not be visible', null=True)), + ('facebook_url', models.URLField( + blank=True, help_text='If empty, facebook btn will not be visible', null=True)), + ('youtube_url', models.URLField( + blank=True, help_text='If empty, youtube btn will not be visible', null=True)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] diff --git a/ungleich_page/migrations/0019_merge.py b/ungleich_page/migrations/0019_merge.py new file mode 100644 index 00000000..1cd6b7f9 --- /dev/null +++ b/ungleich_page/migrations/0019_merge.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-02-08 20:10 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0018_ungleichfooter'), + ('ungleich_page', '0018_auto_20180105_1826'), + ] + + operations = [ + ] diff --git a/ungleich_page/models.py b/ungleich_page/models.py index b96afcb1..4ffd1a33 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -169,3 +169,38 @@ class UngleichHTMLOnly(CMSPlugin): def __str__(self): return self.name + + +class UngleichFooter(CMSPlugin): + copyright_label = models.CharField( + max_length=100, default='', blank=True, + help_text='Name of the company alongside the copyright year' + ) + link_text = models.CharField( + max_length=100, blank=True, null=True, + help_text='Text for the link on the right part of footer' + ) + link_url = models.URLField( + blank=True, null=True, + help_text='Url to the link in footer' + ) + twitter_url = models.URLField( + blank=True, null=True, + help_text='If empty, twitter btn will not be visible' + ) + linkedin_url = models.URLField( + blank=True, null=True, + help_text='If empty, linkedin btn will not be visible' + ) + github_url = models.URLField( + blank=True, null=True, + help_text='If empty, github btn will not be visible' + ) + facebook_url = models.URLField( + blank=True, null=True, + help_text='If empty, facebook btn will not be visible' + ) + youtube_url = models.URLField( + blank=True, null=True, + help_text='If empty, youtube btn will not be visible' + ) diff --git a/ungleich_page/static/ungleich_page/css/glasfaser.css b/ungleich_page/static/ungleich_page/css/glasfaser.css index 0508bad1..490d600e 100644 --- a/ungleich_page/static/ungleich_page/css/glasfaser.css +++ b/ungleich_page/static/ungleich_page/css/glasfaser.css @@ -12,20 +12,35 @@ .navbar-default .navbar-nav>li>a { text-transform: uppercase; font-weight: 400; - letter-spacing: 1px; + letter-spacing: 0.5px; color: #777; } .navbar-transparent .navbar-nav>li>a { color: #fff; } -.navbar-transparent .navbar-nav>li>a:hover, -.navbar-transparent .navbar-nav>li>a:focus, -.navbar-transparent .navbar-nav>li>a:focus:active { - color: #fed136; +.navbar-default .navbar-nav>li>a:focus, +.navbar-default .navbar-nav>li>a:hover, +.navbar-default .navbar-nav>li>a:active { + color: #333; +} + +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; +} + +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background: #ddd; } @media (min-width: 768px) { + .navbar-transparent .navbar-nav>li>a:focus, + .navbar-transparent .navbar-nav>li>a:hover, + .navbar-transparent .navbar-nav>li>a:active { + color: #e5e6e7; + } + .navbar-transparent { border-color: transparent; } diff --git a/ungleich_page/templates/ungleich_page/glasfaser.html b/ungleich_page/templates/ungleich_page/glasfaser.html index a1a01716..a8f11bd0 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser.html +++ b/ungleich_page/templates/ungleich_page/glasfaser.html @@ -57,13 +57,13 @@ @@ -312,7 +312,6 @@ - diff --git a/ungleich_page/templates/ungleich_page/ungleich/_footer.html b/ungleich_page/templates/ungleich_page/ungleich/_footer.html new file mode 100644 index 00000000..f8770e57 --- /dev/null +++ b/ungleich_page/templates/ungleich_page/ungleich/_footer.html @@ -0,0 +1,47 @@ +
+
+
+
+ Copyright © {{instance.copyright_label}} {% now "Y" %} +
+
+ +
+
+ {% if instance.link_text %} + + {% endif %} +
+
+
+
\ No newline at end of file diff --git a/ungleich_page/templates/ungleich_page/ungleich_cms_page.html b/ungleich_page/templates/ungleich_page/ungleich_cms_page.html index 707d0dab..f8d32f07 100644 --- a/ungleich_page/templates/ungleich_page/ungleich_cms_page.html +++ b/ungleich_page/templates/ungleich_page/ungleich_cms_page.html @@ -41,7 +41,9 @@ {% placeholder 'Ungleich Page Contents' %} - {% include "ungleich_page/includes/_footer.html" %} + {% placeholder 'Footer' or %} + {% include "ungleich_page/includes/_footer.html" %} + {% endplaceholder %}
- logo + logo