From 35bd78a78b0d43963a1398ad9ea09ec4a72545bc Mon Sep 17 00:00:00 2001 From: Levi Date: Tue, 18 Oct 2016 23:29:07 -0500 Subject: [PATCH] =?UTF-8?q?Fixed=20#2652:=20Order=20confirmation=20page=20?= =?UTF-8?q?needs=20buttons=20for=20next=20action.=20Fixed=C2=A0#2653:=20ca?= =?UTF-8?q?ncel=20subscription=20modal=20position=20adjustment.=20Fixed=20?= =?UTF-8?q?#2658:=20Billing=20address=20info=20change=20page.=20Fixed=20#2?= =?UTF-8?q?659:=20order=20history=20page=20booking=20history=20list.=20Iss?= =?UTF-8?q?ue=20#2659=20Added=20start=20date=20and=20end=20=5Fdate=20to=20?= =?UTF-8?q?membership=20model=20attributes.=20Fixed=20membership=20creatin?= =?UTF-8?q?g=20process=20in=20order=20to=20set=20start=20and=20end=20membe?= =?UTF-8?q?rship=20dates.=20Fixed=20start=20date=20and=20end=20date=20in?= =?UTF-8?q?=20membership=20detail=20view=20and=20orders=20list=20in=20orde?= =?UTF-8?q?r=20to=20use=20new=20membership=20attributes=20model.=20Adding?= =?UTF-8?q?=20membership=20order=20after=20booking.=20Fixed=20Membership?= =?UTF-8?q?=20creation=20when=20an=20booking=20is=20placed.Fixed=20#2661?= =?UTF-8?q?=20=20:=20move=20DG=20terms=20and=20condition=20text+=20checkbo?= =?UTF-8?q?x=20in=20order=20page.Fixed=20=202663:=20DG=20pricing=20page=20?= =?UTF-8?q?column=20width=20fix.Fixed=20#2660:=20DG=20footer=20style=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0021_auto_20161017_1958.py | 41 +++++ digitalglarus/models.py | 28 +++- .../static/digitalglarus/css/agency.css | 4 +- .../static/digitalglarus/js/utils.js | 2 + .../digitalglarus/booking_orders_detail.html | 7 +- .../digitalglarus/booking_orders_list.html | 2 + .../digitalglarus/membership_deactivated.html | 11 +- .../digitalglarus/membership_orders_list.html | 2 +- .../digitalglarus/membership_payment.html | 13 +- .../digitalglarus/membership_pricing.html | 6 +- .../digitalglarus/user_billing_address.html | 5 +- digitalglarus/views.py | 149 +++++++++++------- 12 files changed, 189 insertions(+), 81 deletions(-) create mode 100644 digitalglarus/migrations/0021_auto_20161017_1958.py 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/membership_deactivated.html b/digitalglarus/templates/digitalglarus/membership_deactivated.html index acc92078..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_list.html b/digitalglarus/templates/digitalglarus/membership_orders_list.html index 8247835a..5fc92329 100644 --- a/digitalglarus/templates/digitalglarus/membership_orders_list.html +++ b/digitalglarus/templates/digitalglarus/membership_orders_list.html @@ -14,7 +14,7 @@

Member Name

{{request.user.name}}


-

Active Membership

+

Current Membership

{{membership_start_date|date}}-{{membership_end_date|date}}


Orders history

diff --git a/digitalglarus/templates/digitalglarus/membership_payment.html b/digitalglarus/templates/digitalglarus/membership_payment.html index 824d46a9..0aa1c7ee 100644 --- a/digitalglarus/templates/digitalglarus/membership_payment.html +++ b/digitalglarus/templates/digitalglarus/membership_payment.html @@ -91,6 +91,13 @@
+ +
@@ -132,12 +139,6 @@

Total

{{membership_type.first_month_price|floatformat}}CHF

-
diff --git a/digitalglarus/templates/digitalglarus/membership_pricing.html b/digitalglarus/templates/digitalglarus/membership_pricing.html index fec32399..13349b22 100644 --- a/digitalglarus/templates/digitalglarus/membership_pricing.html +++ b/digitalglarus/templates/digitalglarus/membership_pricing.html @@ -5,8 +5,8 @@ {% block content %}
-
-
+
+

Digital Glarus Membership

@@ -39,7 +39,7 @@
-
+
diff --git a/digitalglarus/templates/digitalglarus/user_billing_address.html b/digitalglarus/templates/digitalglarus/user_billing_address.html index 138dc8ab..691ad57f 100644 --- a/digitalglarus/templates/digitalglarus/user_billing_address.html +++ b/digitalglarus/templates/digitalglarus/user_billing_address.html @@ -24,7 +24,7 @@