diff --git a/digitalglarus/migrations/0021_auto_20161017_1958.py b/digitalglarus/migrations/0021_auto_20161017_1958.py new file mode 100644 index 00000000..69b44dde --- /dev/null +++ b/digitalglarus/migrations/0021_auto_20161017_1958.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2016-10-17 19:58 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('digitalglarus', '0020_auto_20161013_0253'), + ] + + operations = [ + migrations.AddField( + model_name='membership', + name='end_date', + field=models.DateField(default=datetime.datetime(2016, 10, 17, 19, 58, 0, 209303, tzinfo=utc)), + preserve_default=False, + ), + migrations.AddField( + model_name='membership', + name='start_date', + field=models.DateField(default=datetime.datetime(2016, 10, 17, 19, 58, 7, 361473, tzinfo=utc)), + preserve_default=False, + ), + migrations.AddField( + model_name='membershiporder', + name='end_date', + field=models.DateField(default=datetime.datetime(2016, 10, 17, 19, 58, 15, 657240, tzinfo=utc)), + preserve_default=False, + ), + migrations.AddField( + model_name='membershiporder', + name='start_date', + field=models.DateField(default=datetime.datetime(2016, 10, 17, 19, 58, 16, 897120, tzinfo=utc)), + preserve_default=False, + ), + ] diff --git a/digitalglarus/models.py b/digitalglarus/models.py index 7ed0f53a..c809a8b5 100644 --- a/digitalglarus/models.py +++ b/digitalglarus/models.py @@ -62,6 +62,13 @@ class MembershipType(models.Model): class Membership(models.Model): type = models.ForeignKey(MembershipType) active = models.BooleanField(default=True) + start_date = models.DateField() + end_date = models.DateField() + + @classmethod + def get_by_user(cls, user): + return cls.objects.\ + filter(membershiporder__customer__user=user).last() @classmethod def create(cls, data): @@ -79,6 +86,11 @@ class Membership(models.Model): return cls.objects.filter(has_order_past_month | has_order_current_month).\ filter(active_membership).exists() + def update_dates(self, start_date, end_date): + self.start_date = start_date + self.end_date = end_date + self.save() + def deactivate(self): self.active = False self.save() @@ -86,17 +98,19 @@ class Membership(models.Model): class MembershipOrder(Ordereable, models.Model): membership = models.ForeignKey(Membership) + start_date = models.DateField() + end_date = models.DateField() @classmethod def current_membership(cls, user): - last_payment = cls.objects.\ + last_membership_payment = cls.objects.\ filter(customer__user=user).last() - start_date = last_payment.created_at - _, days_in_month = calendar.monthrange(start_date.year, - start_date.month) - start_date.replace(day=1) - end_date = start_date + timedelta(days=days_in_month) - return start_date, end_date + # start_date = last_payment.created_at + # _, days_in_month = calendar.monthrange(start_date.year, + # start_date.month) + # start_date.replace(day=1) + # end_date = start_date + timedelta(days=days_in_month) + return last_membership_payment.start_date, last_membership_payment.end_date def first_membership_range_date(self): start_date = self.created_at diff --git a/digitalglarus/static/digitalglarus/css/agency.css b/digitalglarus/static/digitalglarus/css/agency.css index 39289c6e..67154295 100755 --- a/digitalglarus/static/digitalglarus/css/agency.css +++ b/digitalglarus/static/digitalglarus/css/agency.css @@ -1172,11 +1172,11 @@ footer { } .map-caption{ - text-transform: none; + text-transform:uppercase; + font-size: 13px; font-family:"Montserrat","Helvetica Neue",Helvetica, Arial,sans-serif; font-weight: 400; color: #ffffff; - font-size: 14px; letter-spacing: 1px; text-align:center; } diff --git a/digitalglarus/static/digitalglarus/js/utils.js b/digitalglarus/static/digitalglarus/js/utils.js index d780fc25..e824dafc 100644 --- a/digitalglarus/static/digitalglarus/js/utils.js +++ b/digitalglarus/static/digitalglarus/js/utils.js @@ -18,4 +18,6 @@ $( document ).ready(function() { }); + + }); \ No newline at end of file diff --git a/digitalglarus/templates/digitalglarus/booking_orders_detail.html b/digitalglarus/templates/digitalglarus/booking_orders_detail.html index f3d7b049..006c6568 100644 --- a/digitalglarus/templates/digitalglarus/booking_orders_detail.html +++ b/digitalglarus/templates/digitalglarus/booking_orders_detail.html @@ -55,8 +55,13 @@

Total

{{final_price|floatformat}}CHF

-
+
+ +

+ View my bookings Go to my page +

+
diff --git a/digitalglarus/templates/digitalglarus/booking_orders_list.html b/digitalglarus/templates/digitalglarus/booking_orders_list.html index 9fa3d793..426fcea1 100644 --- a/digitalglarus/templates/digitalglarus/booking_orders_list.html +++ b/digitalglarus/templates/digitalglarus/booking_orders_list.html @@ -24,6 +24,7 @@ # Booking dates Days + Membership Required Months Invoice @@ -33,6 +34,7 @@ {{order.id}} {{order.booking.start_date}}-{{order.booking.end_date}} {{order.booking_days}} + {{order.membership_required_months}} View {% endfor %} diff --git a/digitalglarus/templates/digitalglarus/booking_payment.html b/digitalglarus/templates/digitalglarus/booking_payment.html index 43137b46..07a7739f 100644 --- a/digitalglarus/templates/digitalglarus/booking_payment.html +++ b/digitalglarus/templates/digitalglarus/booking_payment.html @@ -18,6 +18,10 @@ padding: .5em; padding-right: 1.5em } + + .order-bottom-text a{ + margin-left: 0px; + }
@@ -140,9 +144,10 @@

Booking Summary

-

Dates {{start_date}} - {{end_date}}

-
- +

Dates {{start_date}} - {{end_date}}

+

+ Change dates +


Total days: {{booking_days}}

{{original_price|floatformat}}CHF

@@ -168,7 +173,7 @@
- +
diff --git a/digitalglarus/templates/digitalglarus/membership_deactivated.html b/digitalglarus/templates/digitalglarus/membership_deactivated.html index 7ce1137f..0f30a1ba 100644 --- a/digitalglarus/templates/digitalglarus/membership_deactivated.html +++ b/digitalglarus/templates/digitalglarus/membership_deactivated.html @@ -3,6 +3,15 @@ {% block title %}crowdfunding{% endblock %} {% block content %} + + +
diff --git a/digitalglarus/templates/digitalglarus/membership_orders_detail.html b/digitalglarus/templates/digitalglarus/membership_orders_detail.html index 2f1ef140..c8c5018c 100644 --- a/digitalglarus/templates/digitalglarus/membership_orders_detail.html +++ b/digitalglarus/templates/digitalglarus/membership_orders_detail.html @@ -17,7 +17,7 @@