diff --git a/digitalglarus/static/digitalglarus/js/payment.js b/digitalglarus/static/digitalglarus/js/payment.js
index d9c6e0f7..3179f721 100644
--- a/digitalglarus/static/digitalglarus/js/payment.js
+++ b/digitalglarus/static/digitalglarus/js/payment.js
@@ -24,6 +24,10 @@ $( document ).ready(function() {
}
});
+ //Acept term and conditions button
+
+
+
var submit_form_btn = $('#payment_button');
submit_form_btn.on('click', submit_payment);
@@ -41,6 +45,12 @@ $( document ).ready(function() {
console.log("submiting");
e.preventDefault();
+ if (!$('.agree-terms').is(':checked')){
+ alert("You must accept terms and conditions.");
+ return;
+ }
+
+
/* Visual feedback */
$form.find('[type=submit]').html('Validating ');
@@ -119,7 +129,7 @@ $( document ).ready(function() {
} else {
return false;
}
- }
+ };
$form.find('[type=submit]').prop('disabled', true);
var readyInterval = setInterval(function() {
@@ -129,5 +139,7 @@ $( document ).ready(function() {
}
}, 250);
+
+
});
diff --git a/digitalglarus/static/digitalglarus/js/utils.js b/digitalglarus/static/digitalglarus/js/utils.js
index e824dafc..65584778 100644
--- a/digitalglarus/static/digitalglarus/js/utils.js
+++ b/digitalglarus/static/digitalglarus/js/utils.js
@@ -19,5 +19,4 @@ $( document ).ready(function() {
});
-
});
\ No newline at end of file
diff --git a/digitalglarus/templates/digitalglarus/booking_payment.html b/digitalglarus/templates/digitalglarus/booking_payment.html
index 1b465282..2f57361e 100644
--- a/digitalglarus/templates/digitalglarus/booking_payment.html
+++ b/digitalglarus/templates/digitalglarus/booking_payment.html
@@ -162,14 +162,14 @@
-
+
I accept the Digital Glarus Terms and Conditions , Community Guidelines and Privacy Policy
diff --git a/digitalglarus/templates/digitalglarus/emails/booking_order_email.html b/digitalglarus/templates/digitalglarus/emails/booking_order_email.html
new file mode 100644
index 00000000..d45bcc72
--- /dev/null
+++ b/digitalglarus/templates/digitalglarus/emails/booking_order_email.html
@@ -0,0 +1,136 @@
+{% load static from staticfiles %}
+
+
+
+
+
+
+
Oxygen Invoice
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Your booking order from {{booking.start_date|date}} to {{booking.end_date|date}} has been placed. You can view your invoice clicking on the button below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/digitalglarus/templates/digitalglarus/emails/booking_order_email.txt b/digitalglarus/templates/digitalglarus/emails/booking_order_email.txt
new file mode 100644
index 00000000..5a414ae4
--- /dev/null
+++ b/digitalglarus/templates/digitalglarus/emails/booking_order_email.txt
@@ -0,0 +1,136 @@
+{% load static from staticfiles %}
+
+
+
+
+
+
+
Oxygen Invoice
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Your booking order from {{booking.start_date|date}} to {{booking.end_date|date}} has been placed. You can view your invoice clicking on the button below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/digitalglarus/templates/digitalglarus/emails/membership_charge.html b/digitalglarus/templates/digitalglarus/emails/membership_charge.html
index d2d3971f..a6af3443 100644
--- a/digitalglarus/templates/digitalglarus/emails/membership_charge.html
+++ b/digitalglarus/templates/digitalglarus/emails/membership_charge.html
@@ -65,7 +65,7 @@
-
+
diff --git a/digitalglarus/templates/digitalglarus/membership_payment.html b/digitalglarus/templates/digitalglarus/membership_payment.html
index 0aa1c7ee..6f5dd384 100644
--- a/digitalglarus/templates/digitalglarus/membership_payment.html
+++ b/digitalglarus/templates/digitalglarus/membership_payment.html
@@ -93,13 +93,13 @@
diff --git a/digitalglarus/templates/digitalglarus/membership_pricing.html b/digitalglarus/templates/digitalglarus/membership_pricing.html
index 13349b22..1c2d02a4 100644
--- a/digitalglarus/templates/digitalglarus/membership_pricing.html
+++ b/digitalglarus/templates/digitalglarus/membership_pricing.html
@@ -21,16 +21,6 @@
The membership fee is a monthly subscription and
with every payment you help us to create a better
workspace.
- You want to work more than 2 days per month in our
- coworking space? Great! It's only
15CHF
- per additional day.
- You want more? That's really cool!
- If you work 17 days a month or EVERY DAY of a month,
- you can do so for
290CHF /month..
- And the best? The discount is
- applied automatically!
- Just become a member, book your
- working day and we will take care of the rest.
become a member
@@ -60,7 +50,6 @@
Access to any of our great workshops
Special invitation to our fondue nights, cooking & hacking sessions, coworking & cohiking, and many more cool stuff.
-
diff --git a/digitalglarus/urls.py b/digitalglarus/urls.py
index 6ed5271a..4b00fbf3 100644
--- a/digitalglarus/urls.py
+++ b/digitalglarus/urls.py
@@ -20,7 +20,8 @@ urlpatterns = [
url(r'reset-password-confirm/(?P[0-9A-Za-z]+)-(?P.+)/$',
PasswordResetConfirmView.as_view(), name='reset_password_confirm'),
url(_(r'history/?$'), HistoryView.as_view(), name='history'),
- url(_(r'users/billing_address/?$'), UserBillingAddressView.as_view(), name='user_billing_address'),
+ 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/orders/(?P\d+)/?$'), OrdersBookingDetailView.as_view(),
diff --git a/digitalglarus/views.py b/digitalglarus/views.py
index 73af4ca2..3a0d0780 100644
--- a/digitalglarus/views.py
+++ b/digitalglarus/views.py
@@ -255,6 +255,22 @@ class BookingPaymentView(LoginRequiredMixin, MembershipRequiredMixin, FormView):
}
order = BookingOrder.create(order_data)
+ context = {
+ 'booking': booking,
+ 'order': order,
+ 'base_url': "{0}://{1}".format(self.request.scheme, self.request.get_host())
+ }
+
+ email_data = {
+ 'subject': 'Your booking order has been placed',
+ 'to': self.request.user.email,
+ 'context': context,
+ 'template_name': 'booking_order_email',
+ 'template_path': 'digitalglarus/emails/'
+ }
+ email = BaseEmail(**email_data)
+ email.send()
+
return HttpResponseRedirect(self.get_success_url(order.id))
diff --git a/utils/forms.py b/utils/forms.py
index 80b6186b..e8580f9d 100644
--- a/utils/forms.py
+++ b/utils/forms.py
@@ -116,7 +116,7 @@ class UserBillingAddressForm(forms.ModelForm):
model = UserBillingAddress
fields = ['street_address', 'city', 'postal_code', 'country', 'user']
labels = {
- 'street_address': _('Street Address'),
+ 'street_address': _('Street Building'),
'city': _('City'),
'postal_code': _('Postal Code'),
'Country': _('Country'),