From fe52e616686f2d97fdaa322d9d863554925ffc53 Mon Sep 17 00:00:00 2001 From: Levi Date: Thu, 4 Aug 2016 01:07:41 -0500 Subject: [PATCH] Configured django-filer plugin. Added thumbnail of 630x200 to each post in post list view. Now when the user click on digitalglarus on contact form in ungleich landing page, he is redirected to digitalglarus home.Started to change index digitalglarus styleChanged ungleich css. Fixed image thumbnail on post item list . Added email template after an user has been charge for his monthly donation. Fixed command to make donations charge, if there is any error with one donator, it skip him and go on to the next.Added new header to digitalglarus page. Added menu to new digitalglarus landing --- digitalglarus/templates/base_glarus.html | 6 +- .../templates/digitalglarus/index.html | 2 +- digitalglarus/templates/new_base_glarus.html | 245 ++++++++++++++++++ digitalglarus/urls.py | 2 +- .../commands/make_donation_charges.py | 19 ++ .../djangocms_blog/includes/blog_item.html | 70 +++-- .../ungleich_page/includes/_contact_us.html | 2 +- 7 files changed, 314 insertions(+), 32 deletions(-) create mode 100644 digitalglarus/templates/new_base_glarus.html diff --git a/digitalglarus/templates/base_glarus.html b/digitalglarus/templates/base_glarus.html index a87e157e..4e0bc1d1 100644 --- a/digitalglarus/templates/base_glarus.html +++ b/digitalglarus/templates/base_glarus.html @@ -1,3 +1,5 @@ + + {% load staticfiles cms_tags menu_tags sekizai_tags menu_tags %} @@ -37,8 +39,8 @@ + + + + + + + +{% cms_toolbar %} + + + + + + + + +
+
+
+


+ WELCOME TO +
+ + Digital Glarus + +
+ By + ungleich gmbh + + +
+
+
+ + + + + +{% include "ungleich_page/includes/_header.html" %} + + + +{% include "ungleich_page/includes/_services.html" %} + + +{% include "ungleich_page/includes/_portfolio.html" %} + + + +{% include "ungleich_page/includes/_about.html" %}$ + + +{% include "ungleich_page/includes/_team.html" %} + + +{% include "ungleich_page/includes/_softwares.html" %} + + +{% include "ungleich_page/includes/_contact_us.html" %} + + +{% include "ungleich_page/includes/_footer.html" %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/digitalglarus/urls.py b/digitalglarus/urls.py index b25fa273..b465da78 100644 --- a/digitalglarus/urls.py +++ b/digitalglarus/urls.py @@ -5,7 +5,7 @@ from . import views from .views import ContactView, IndexView, AboutView urlpatterns = [ - url(_(r'^$'), IndexView.as_view(), name='contact'), + url(_(r'^$'), IndexView.as_view(), name='landing'), url(_(r'contact/?$'), ContactView.as_view(), name='contact'), url(_(r'supporters/?$'), views.supporters, name='supporters'), url(r'calendar_api/(?P\d+)/(?P\d+)?$', views.CalendarApi.as_view(),name='calendar_api_1'), diff --git a/nosystemd/management/commands/make_donation_charges.py b/nosystemd/management/commands/make_donation_charges.py index 70f95d64..12f4e884 100644 --- a/nosystemd/management/commands/make_donation_charges.py +++ b/nosystemd/management/commands/make_donation_charges.py @@ -4,10 +4,12 @@ from datetime import datetime from utils.stripe_utils import StripeUtils +from utils.mailer import BaseEmail from nosystemd.models import DonatorStatus, Donation from nosystemd.forms import DonationForm + class Command(BaseCommand): help = 'Make the monthly stripe charge to all donators' CURRENCY = 'usd' @@ -48,6 +50,7 @@ class Command(BaseCommand): print("--------- STRIPE PAYMENT ERROR ---------") print(context) print("-------------------------") + continue # Create a donation charge = charge_response.get('response_object') donation_data = { @@ -61,6 +64,22 @@ class Command(BaseCommand): donation_form = DonationForm(donation_data) if donation_form.is_valid(): donation = donation_form.save() + + context = { + 'donation': donation, + 'base_url': "{0}://{1}".format('https', 'dynamicweb.ungleich.ch') + + } + email_data = { + 'subject': 'Your donation have been charged', + 'to': donation.donator.user.email, + 'context': context, + 'template_name': 'donation_charge', + 'template_path': 'nosystemd/emails/' + } + email = BaseEmail(**email_data) + email.send() + print("--------- PAYMENT DONATION SUCCESSFULL ---------") print("Donator: %s" % donation.donator.user.email) print("Amount: %s %s" % (donation.donation, self.CURRENCY)) diff --git a/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html b/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html index 9825fe92..0c683d9f 100644 --- a/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html +++ b/ungleich/templates/ungleich/djangocms_blog/includes/blog_item.html @@ -1,32 +1,48 @@ {% load i18n thumbnail cms_tags %}
- -

- {{ post.title }} -

- -

- {% if not TRUNCWORDS_COUNT %} - {% render_model post "abstract" %} - {% else %} - {% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %} - {% endif %} -

-
- + + +
+
+ + + +
+
+ +

+ {{ post.title }} +

+
+ + +

+ {% if not TRUNCWORDS_COUNT %} + {% render_model post "abstract" %} + {% else %} + {% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %} + {% endif %} +

+ + + +
+
+ +

diff --git a/ungleich_page/templates/ungleich_page/includes/_contact_us.html b/ungleich_page/templates/ungleich_page/includes/_contact_us.html index 8c21634c..146a6f18 100644 --- a/ungleich_page/templates/ungleich_page/includes/_contact_us.html +++ b/ungleich_page/templates/ungleich_page/includes/_contact_us.html @@ -16,7 +16,7 @@

{% trans "Join us at" %} {% trans "Digital Glarus" %}, + href="{% url 'digitalglarus:landing' %}">{% trans "Digital Glarus" %}, {% trans "a great co-working space in the middle of Alps!" %}

{% trans "You can contact us at" %}

info@ungleich.ch