diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js
index 79422844..c508d76d 100644
--- a/datacenterlight/static/datacenterlight/js/main.js
+++ b/datacenterlight/static/datacenterlight/js/main.js
@@ -86,6 +86,20 @@
}
function _initNavUrl() {
+ $('.url-init').each(function(idx, el) {
+ var $this = $(el);
+ var currentPath = window.location.pathname;
+ var thisPaths = $this.attr('href').split('#')
+ if ($this.hasClass('dropdown-toggle') && window.matchMedia("(max-width: 767px)").matches) {
+ $this.removeClass('url-init');
+ $this.attr('href', '');
+ } else if ($('#'+thisPaths[1]).length) {
+ $this.removeClass('url-init').addClass('url');
+ $this.attr('href', '#' + thisPaths[1]);
+ } else {
+ $this.removeClass('url-init');
+ }
+ });
$('.url').click(function(event) {
event.preventDefault();
var href = $(this).attr('href');
@@ -95,8 +109,6 @@
$('html, body').animate({
scrollTop: $(href).offset().top
}, 1000);
- } else {
- window.location.href = '/datacenterlight' + href;
}
});
}
diff --git a/datacenterlight/templates/datacenterlight/includes/_footer.html b/datacenterlight/templates/datacenterlight/includes/_footer.html
index f77c3385..76c2c16e 100644
--- a/datacenterlight/templates/datacenterlight/includes/_footer.html
+++ b/datacenterlight/templates/datacenterlight/includes/_footer.html
@@ -2,52 +2,37 @@
{% get_current_language as LANGUAGE_CODE %}
diff --git a/datacenterlight/templates/datacenterlight/includes/_navbar.html b/datacenterlight/templates/datacenterlight/includes/_navbar.html
index 0cf4908e..3b8656ac 100644
--- a/datacenterlight/templates/datacenterlight/includes/_navbar.html
+++ b/datacenterlight/templates/datacenterlight/includes/_navbar.html
@@ -16,12 +16,11 @@
-
- {% trans "Highlights" %}
- {% trans "Highlights" %}
+ {% trans "Highlights" %}
-
diff --git a/datacenterlight/views.py b/datacenterlight/views.py
index 76da4b4e..b6a644e4 100644
--- a/datacenterlight/views.py
+++ b/datacenterlight/views.py
@@ -434,8 +434,8 @@ class PaymentOrderView(FormView):
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
def get(self, request, *args, **kwargs):
- # if 'specs' not in request.session or 'user' not in request.session:
- # return HttpResponseRedirect(reverse('datacenterlight:index'))
+ if 'specs' not in request.session or 'user' not in request.session:
+ return HttpResponseRedirect(reverse('datacenterlight:index'))
return self.render_to_response(self.get_context_data())
def post(self, request, *args, **kwargs):
@@ -554,7 +554,7 @@ class OrderConfirmationView(DetailView):
stripe_subscription_obj = subscription_result.get('response_object')
# Check if the subscription was approved and is active
if stripe_subscription_obj is None or \
- stripe_subscription_obj.status != 'active':
+ stripe_subscription_obj.status != 'active':
msg = subscription_result.get('error')
messages.add_message(self.request, messages.ERROR, msg,
extra_tags='failed_payment')
diff --git a/hosting/static/hosting/css/landing-page.css b/hosting/static/hosting/css/landing-page.css
index c0629480..1d61a2b4 100644
--- a/hosting/static/hosting/css/landing-page.css
+++ b/hosting/static/hosting/css/landing-page.css
@@ -107,7 +107,7 @@ h6 {
.navbar-right .highlights-dropdown .dropdown-menu > li > a{
font-size: 13px;
font-weight: 300;
- font-family: 'Lato-Light', sans-serif;
+ font-family: 'Lato', sans-serif;
padding: 1px 10px !important;
background: transparent;
color: #333;
diff --git a/hosting/static/hosting/js/initial.js b/hosting/static/hosting/js/initial.js
index f5a60bbe..4408a299 100644
--- a/hosting/static/hosting/js/initial.js
+++ b/hosting/static/hosting/js/initial.js
@@ -1,5 +1,32 @@
// also declared in datacenterlight/js/main.js
function _initNavUrl() {
+ // $('.url').click(function(event) {
+ // event.preventDefault();
+ // var href = $(this).attr('href');
+ // $('.navbar-collapse').removeClass('in');
+ // $('.navbar-collapse').addClass('collapsing');
+ // if ($(href).length) {
+ // $('html, body').animate({
+ // scrollTop: $(href).offset().top
+ // }, 1000);
+ // } else {
+ // window.location.href = '/datacenterlight' + href;
+ // }
+ // });
+ $('.url-init').each(function(idx, el) {
+ var $this = $(el);
+ var currentPath = window.location.pathname;
+ var thisPaths = $this.attr('href').split('#')
+ if ($this.hasClass('dropdown-toggle') && window.matchMedia("(max-width: 767px)").matches) {
+ $this.removeClass('url-init');
+ $this.attr('href', '');
+ } else if ($('#'+thisPaths[1]).length) {
+ $this.removeClass('url-init').addClass('url');
+ $this.attr('href', '#' + thisPaths[1]);
+ } else {
+ $this.removeClass('url-init');
+ }
+ });
$('.url').click(function(event) {
event.preventDefault();
var href = $(this).attr('href');
@@ -9,8 +36,6 @@ function _initNavUrl() {
$('html, body').animate({
scrollTop: $(href).offset().top
}, 1000);
- } else {
- window.location.href = '/datacenterlight' + href;
}
});
}