Merge pull request #613 from pcoder/bugfix/footer_links

Bugfix/footer links
This commit is contained in:
Arvind Tiwari 2018-04-09 03:27:09 +05:30 committed by GitHub
commit f30719f320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 13 deletions

View file

@ -4,15 +4,15 @@
<div class="container">
<ul class="list-inline">
<li>
<a class="url-init" href="{% url 'datacenterlight:index' %}">{% trans "Home" %}</a>
<a class="url-init" href="https://{{MULTISITE_CMS_FALLBACK}}">{% trans "Home" %}</a>
</li>
<li class="footer-menu-divider">&sdot;</li>
<li>
<a class="url-init" href="{% url 'datacenterlight:index' %}#contact">{% trans "Contact" %}</a>
<a class="url-init" href="https://{{MULTISITE_CMS_FALLBACK}}#contact">{% trans "Contact" %}</a>
</li>
<li class="footer-menu-divider">&sdot;</li>
<li>
<a class="url-init" href="/cms/terms-of-service">{% trans "Terms of Service" %}</a>
<a class="url-init" href="https://{{MULTISITE_CMS_FALLBACK}}/cms/terms-of-service">{% trans "Terms of Service" %}</a>
</li>
</ul>

View file

@ -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'),

View file

@ -1,4 +1,5 @@
from django.shortcuts import redirect
from django.conf import settings
from django.core.urlresolvers import reverse
from opennebula_api.serializers import VirtualMachineTemplateSerializer
@ -24,3 +25,10 @@ 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['MULTISITE_CMS_FALLBACK'] = settings.MULTISITE_CMS_FALLBACK
return context

View file

@ -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(SignupValidateView, HostingContextMixin):
template_name = "hosting/signup_validate.html"
def get_context_data(self, **kwargs):
@ -307,7 +307,7 @@ class SignupValidatedView(SignupValidateView):
email.send()
else:
home_url = '<a href="' + \
reverse('datacenterlight:index') + \
reverse('datacenterlight:cms_index') + \
'">Data Center Light</a>'
message = '{sorry_message} <br />{go_back_to} {hurl}'.format(
sorry_message=_("Sorry. Your request is invalid."),
@ -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')