From ffe4eb41239a019b9a90d9f3eecce9a66baffa2e Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Apr 2018 10:25:21 +0200 Subject: [PATCH 01/20] Use REDIRECT_TO_CMS and MULTISITE_CMS_FALLBACK to construct /hosting footer urls --- .../templates/datacenterlight/includes/_footer.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html index 7d27eaef..4be5b928 100644 --- a/datacenterlight/templates/datacenterlight/includes/_footer.html +++ b/datacenterlight/templates/datacenterlight/includes/_footer.html @@ -4,15 +4,15 @@
From 399c91d636dbe775ccdc00614a74484c6d7dd91c Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Apr 2018 12:51:40 +0200 Subject: [PATCH 02/20] Add HostingContextMixin that sets the REDIRECT_TO_CMS and MULTISITE_CMS_FALLBACK urls --- hosting/mixins.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hosting/mixins.py b/hosting/mixins.py index 666cbcbe..7ef05581 100644 --- a/hosting/mixins.py +++ b/hosting/mixins.py @@ -1,4 +1,7 @@ +from cms.models.pagemodel import Page from django.shortcuts import redirect +from django.conf import settings +from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from opennebula_api.serializers import VirtualMachineTemplateSerializer @@ -24,3 +27,17 @@ class ProcessVMSelectionMixin(object): request.session['next'] = reverse('hosting:payment') return redirect(reverse('hosting:login')) return redirect(reverse('hosting:payment')) + + +class HostingContextMixin(object): + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['REDIRECT_TO_CMS'] = (Page + .objects + .filter(site_id=Site + .objects + .get_current() + .id) + .count()) + context['MULTISITE_CMS_FALLBACK'] = settings.MULTISITE_CMS_FALLBACK + return context From f911d6b4035e068701d4563025811ee5cb68eb64 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Apr 2018 12:53:53 +0200 Subject: [PATCH 03/20] Add HostingContextMixin to various hosting views --- hosting/views.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 8e7380fb..7c11e1f6 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -54,7 +54,7 @@ from .forms import ( HostingUserSignupForm, HostingUserLoginForm, UserHostingKeyForm, generate_ssh_key_name ) -from .mixins import ProcessVMSelectionMixin +from .mixins import ProcessVMSelectionMixin, HostingContextMixin from .models import ( HostingOrder, HostingBill, HostingPlan, UserHostingKey, VMDetail ) @@ -213,13 +213,13 @@ class IndexView(View): return render(request, self.template_name, context) -class LoginView(LoginViewMixin): +class LoginView(HostingContextMixin, LoginViewMixin): template_name = "hosting/login.html" form_class = HostingUserLoginForm success_url = reverse_lazy('hosting:dashboard') -class SignupView(CreateView): +class SignupView(HostingContextMixin, CreateView): template_name = 'hosting/signup.html' form_class = HostingUserSignupForm model = CustomUser @@ -248,7 +248,7 @@ class SignupView(CreateView): return super(SignupView, self).get(request, *args, **kwargs) -class SignupValidateView(TemplateView): +class SignupValidateView(HostingContextMixin, TemplateView): template_name = "hosting/signup_validate.html" def get_context_data(self, **kwargs): @@ -272,7 +272,7 @@ class SignupValidateView(TemplateView): return context -class SignupValidatedView(SignupValidateView): +class SignupValidatedView(HostingContextMixin, SignupValidateView): template_name = "hosting/signup_validate.html" def get_context_data(self, **kwargs): @@ -325,7 +325,8 @@ class SignupValidatedView(SignupValidateView): return super(SignupValidatedView, self).get(request, *args, **kwargs) -class ResendActivationEmailView(ResendActivationLinkViewMixin): +class ResendActivationEmailView(HostingContextMixin, + ResendActivationLinkViewMixin): template_name = 'hosting/resend_activation_link.html' form_class = ResendActivationEmailForm success_url = reverse_lazy('hosting:login') @@ -333,7 +334,7 @@ class ResendActivationEmailView(ResendActivationLinkViewMixin): email_template_name = 'user_activation' -class PasswordResetView(PasswordResetViewMixin): +class PasswordResetView(HostingContextMixin, PasswordResetViewMixin): site = 'dcl' template_name = 'hosting/reset_password.html' form_class = PasswordResetRequestForm @@ -341,7 +342,8 @@ class PasswordResetView(PasswordResetViewMixin): template_email_path = 'hosting/emails/' -class PasswordResetConfirmView(PasswordResetConfirmViewMixin): +class PasswordResetConfirmView(HostingContextMixin, + PasswordResetConfirmViewMixin): template_name = 'hosting/confirm_reset_password.html' success_url = reverse_lazy('hosting:login') From c6e3963303728b98ac2b4dcf1fd30ca7d7c164d4 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Apr 2018 12:55:32 +0200 Subject: [PATCH 04/20] Update footer links in dcl _footer.html --- .../templates/datacenterlight/includes/_footer.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html index 4be5b928..1fb1b963 100644 --- a/datacenterlight/templates/datacenterlight/includes/_footer.html +++ b/datacenterlight/templates/datacenterlight/includes/_footer.html @@ -4,11 +4,11 @@
  • - {% trans "Home" %} + {% trans "Home" %}
  • - {% trans "Contact" %} + {% trans "Contact" %}
  • From 178ff8da382b687046a3581f83e381442c1be7ea Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Apr 2018 13:13:53 +0200 Subject: [PATCH 05/20] CMS home page can now be accessed at /cms/ for all sites --- datacenterlight/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/urls.py b/datacenterlight/urls.py index af8e76f2..006e7fc3 100644 --- a/datacenterlight/urls.py +++ b/datacenterlight/urls.py @@ -13,7 +13,7 @@ urlpatterns = [ url(r'^g/$', IndexView.as_view(), name='index_g'), url(r'^f/$', IndexView.as_view(), name='index_f'), url(r'^l/$', IndexView.as_view(), name='index_l'), - url(r'^new/$', RedirectView.as_view(url='/cms/datacenterlight/'), + url(r'^new/$', RedirectView.as_view(url='/cms/'), name='cms_index'), url(r'^whydatacenterlight/?$', WhyDataCenterLightView.as_view(), name='whydatacenterlight'), From 7b1cb975df344c8739b3c86ccf3c0621cee09847 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Apr 2018 13:15:44 +0200 Subject: [PATCH 06/20] Fix Method Resolution Order --- hosting/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index 7c11e1f6..59239b96 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -272,7 +272,7 @@ class SignupValidateView(HostingContextMixin, TemplateView): return context -class SignupValidatedView(HostingContextMixin, SignupValidateView): +class SignupValidatedView(SignupValidateView, HostingContextMixin): template_name = "hosting/signup_validate.html" def get_context_data(self, **kwargs): From 698cf7f1ee3190ca7213607add6b4f58ff77ba67 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 7 Apr 2018 13:16:36 +0200 Subject: [PATCH 07/20] Fix link in signup message --- hosting/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index 59239b96..6e143760 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -307,7 +307,7 @@ class SignupValidatedView(SignupValidateView, HostingContextMixin): email.send() else: home_url = 'Data Center Light' message = '{sorry_message}
    {go_back_to} {hurl}'.format( sorry_message=_("Sorry. Your request is invalid."), From c3dff3155e13b9cbc4df5318069dcd5a67171af3 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 8 Apr 2018 00:29:39 +0200 Subject: [PATCH 08/20] Redirect the contact link to dcl always --- datacenterlight/templates/datacenterlight/includes/_footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html index 1fb1b963..9583271e 100644 --- a/datacenterlight/templates/datacenterlight/includes/_footer.html +++ b/datacenterlight/templates/datacenterlight/includes/_footer.html @@ -8,7 +8,7 @@
  • - {% trans "Contact" %} + {% trans "Contact" %}
  • From 30d7785700c597507327e5914f5fa8230325b101 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 8 Apr 2018 08:36:00 +0200 Subject: [PATCH 09/20] Redirect to DCL home on hosting footer for all domains --- datacenterlight/templates/datacenterlight/includes/_footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html index 9583271e..c4950807 100644 --- a/datacenterlight/templates/datacenterlight/includes/_footer.html +++ b/datacenterlight/templates/datacenterlight/includes/_footer.html @@ -4,7 +4,7 @@
    • - {% trans "Home" %} + {% trans "Home" %}
    • From fb7ccff5847658a6fd6b25b57c8f3ddb5f08c172 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 9 Apr 2018 01:11:45 +0530 Subject: [PATCH 10/20] remove old migrations from squashed migration --- datacenterlight/migrations/0018_auto_20180403_1930.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/datacenterlight/migrations/0018_auto_20180403_1930.py b/datacenterlight/migrations/0018_auto_20180403_1930.py index 5c418898..a894c66b 100644 --- a/datacenterlight/migrations/0018_auto_20180403_1930.py +++ b/datacenterlight/migrations/0018_auto_20180403_1930.py @@ -8,8 +8,6 @@ import django.db.models.deletion class Migration(migrations.Migration): - replaces = [('datacenterlight', '0018_auto_20180403_1930'), ('datacenterlight', '0019_auto_20180403_2054')] - dependencies = [ ('datacenterlight', '0017_auto_20180329_0056'), ('sites', '0002_alter_domain_unique'), From ff1908d2e6de295d121f4f0b94f156fa12897be2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 9 Apr 2018 01:52:49 +0530 Subject: [PATCH 11/20] added navbar-transparent styles to glasfaser.css --- datacenterlight/static/datacenterlight/css/common.css | 5 ++++- .../static/datacenterlight/css/landing-page.css | 4 ---- ungleich_page/static/ungleich_page/css/glasfaser.css | 8 +++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/common.css b/datacenterlight/static/datacenterlight/css/common.css index 88db9376..895256ef 100644 --- a/datacenterlight/static/datacenterlight/css/common.css +++ b/datacenterlight/static/datacenterlight/css/common.css @@ -74,6 +74,10 @@ a.list-group-item-danger.active:focus { padding: 10px; } +.navbar-brand > img { + height: 100%; +} + #logoWhite, .navbar-transparent #logoBlack { display: none; @@ -82,7 +86,6 @@ a.list-group-item-danger.active:focus { #logoBlack, .navbar-transparent #logoWhite { display: block; - width: 220px; } @media (min-width: 768px) { diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 41c5a42f..33bf6425 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -89,10 +89,6 @@ textarea { border-radius: 6px; } -.navbar-brand > img { - max-height: 30px; -} - @media (max-width: 767px) { .navbar-default .navbar-nav>li>a{ font-weight: 400; diff --git a/ungleich_page/static/ungleich_page/css/glasfaser.css b/ungleich_page/static/ungleich_page/css/glasfaser.css index b9062087..a3262aaf 100644 --- a/ungleich_page/static/ungleich_page/css/glasfaser.css +++ b/ungleich_page/static/ungleich_page/css/glasfaser.css @@ -1,9 +1,11 @@ -.topnav img { - height: 100%; +#logoWhite, +.navbar-transparent #logoBlack { + display: none; } +#logoBlack, .navbar-transparent #logoWhite { - width: 140px; + display: block; } .navbar-default { From e6629a1357a14e8e097332dbc3301e8e2c909efa Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 9 Apr 2018 02:00:42 +0530 Subject: [PATCH 12/20] update changelog --- Changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog b/Changelog index 49459422..a325a822 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +next: + * #4327: [dcl] fix navbar logo repeat + * bgfix: [dcl] remove ghost migrations from squashed migration 1.6.4: 2018-04-06 * #4362: [cms] Fix the need of dummy home page for different CMS-based sites 1.6.3: 2018-04-05 From f4b6949d3922496cd5f2225c8205abb71c706d98 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Mon, 9 Apr 2018 02:16:57 +0530 Subject: [PATCH 13/20] corrected favicon link on pages --- .../templates/new_base_glarus_c.html | 26 +++++++++---------- .../cms/ungleichch/base_ungleich.html | 2 ++ .../templates/ungleich_page/404.html | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/digitalglarus/templates/new_base_glarus_c.html b/digitalglarus/templates/new_base_glarus_c.html index edef1751..918b27b0 100644 --- a/digitalglarus/templates/new_base_glarus_c.html +++ b/digitalglarus/templates/new_base_glarus_c.html @@ -57,7 +57,7 @@ ga('send', 'pageview'); - +