From ae0c40495179b3c21bec38ffd492fc9e39b0c521 Mon Sep 17 00:00:00 2001
From: Tomislav R
Date: Sat, 23 Apr 2016 19:00:20 +0200
Subject: [PATCH] digitalglarus booking update
---
design_membership/calendar/stylesheet.css | 2 +-
design_membership/login.html | 6 +-
digitalglarus/models.py | 1 +
.../static/digitalglarus/css/login.css | 71 +
digitalglarus/templates/base_glarus.html | 22 +-
digitalglarus/urls.py | 2 +
digitalglarus/views.py | 32 +-
dynamicweb/settings/base.py | 4 +-
dynamicweb/urls.py | 2 +-
membership/calendar/__init__.py | 1 +
membership/calendar/calendar.py | 136 +
.../migrations/0003_auto_20160422_1002.py | 35 +
membership/models.py | 31 +-
membership/static/membership.css | 8644 ++++++++++-------
membership/static/stylesheet.css | 168 +
membership/templates/calendar/calendar.html | 112 +
membership/templates/error.html | 2 +-
membership/templates/login.html | 6 +-
membership/templates/membership.html | 434 +-
membership/templates/success.html | 2 +-
membership/urls.py | 3 +-
membership/views.py | 13 +-
22 files changed, 5935 insertions(+), 3794 deletions(-)
create mode 100644 digitalglarus/static/digitalglarus/css/login.css
create mode 100644 membership/calendar/__init__.py
create mode 100644 membership/calendar/calendar.py
create mode 100644 membership/migrations/0003_auto_20160422_1002.py
create mode 100644 membership/static/stylesheet.css
create mode 100644 membership/templates/calendar/calendar.html
diff --git a/design_membership/calendar/stylesheet.css b/design_membership/calendar/stylesheet.css
index 25861a58..b5902a87 100644
--- a/design_membership/calendar/stylesheet.css
+++ b/design_membership/calendar/stylesheet.css
@@ -84,7 +84,7 @@ table {
/*select date*/
.calendar tbody td:hover {
- background: #8BC4C9;
+ background: #347D80;
color: #f9f9f9;
/*border: .1px solid #8BC4C9;*/
diff --git a/design_membership/login.html b/design_membership/login.html
index 6f796f06..5c9d5461 100644
--- a/design_membership/login.html
+++ b/design_membership/login.html
@@ -15,15 +15,15 @@
- Brand
+ Digital Glarus
diff --git a/digitalglarus/models.py b/digitalglarus/models.py
index 19962a2f..3939dac1 100644
--- a/digitalglarus/models.py
+++ b/digitalglarus/models.py
@@ -1,6 +1,7 @@
from django.db import models
from cms.models import CMSPlugin
from filer.fields.image import FilerImageField
+from django.core.urlresolvers import reverse
class Supporter(models.Model):
diff --git a/digitalglarus/static/digitalglarus/css/login.css b/digitalglarus/static/digitalglarus/css/login.css
new file mode 100644
index 00000000..f0cd3326
--- /dev/null
+++ b/digitalglarus/static/digitalglarus/css/login.css
@@ -0,0 +1,71 @@
+.user {
+ padding-right: 2%;
+ background-position: 6px 7px;
+ background-repeat: no-repeat;
+ background-color: white;
+ padding: 5px 8px 4px 8px;
+ -webkit-border-radius: 0px 0px 8px 8px;
+ -moz-border-radius: 0px 0px 8px 8px;
+ border-radius: 1px 1px 1px 1px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ margin-left: 8px;
+ background-color: #333;
+ padding: 4px 4px 0px 4px;
+ -webkit-border-radius: 0px 0px 10px 10px;
+ -moz-border-radius: 0px 0px 10px 10px;
+ border-radius: 0px 0px 10px 10px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #794646;
+ background-color: #fff;
+
+}
+
+.user_loggedin{
+ padding-bottom: 2%;
+ padding-right: 2%;
+ background-position: 6px 7px;
+ background-repeat: no-repeat;
+ background-color: white;
+ padding: 5px 8px 4px 8px;
+ -webkit-border-radius: 0px 0px 8px 8px;
+ -moz-border-radius: 0px 0px 8px 8px;
+ border-radius: 1px 1px 1px 1px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ float: left;
+ margin-left: 8px;
+ background-color: #333;
+ padding: 4px 4px 0px 4px;
+ -webkit-border-radius: 0px 0px 10px 10px;
+ -moz-border-radius: 0px 0px 10px 10px;
+ border-radius: 0px 0px 10px 10px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #777;
+ background-color: #fff;
+}
+
+.user > span {
+ width: 100%;
+}
+
+.u_P {
+ background-color: #fffcfc;
+ text-transform: uppercase;
+ padding-right: 2%;
+ padding-left:2%;
+ padding-bottom:0.5%;
+ margin-right: 1%;
+}
+.u_P a{
+ margin-bottom: 1%;
+ color: #777;
+}
+.u_P a:hover{
+ text-decoration: None;
+ color: #000;
+}
diff --git a/digitalglarus/templates/base_glarus.html b/digitalglarus/templates/base_glarus.html
index 36a86190..b1d57293 100644
--- a/digitalglarus/templates/base_glarus.html
+++ b/digitalglarus/templates/base_glarus.html
@@ -21,12 +21,15 @@
+
+
{% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %}
{% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %}
@@ -37,6 +40,7 @@
+
+
+
diff --git a/membership/templates/error.html b/membership/templates/error.html
index 7e7ce023..c697ef87 100644
--- a/membership/templates/error.html
+++ b/membership/templates/error.html
@@ -36,7 +36,7 @@
diff --git a/membership/templates/login.html b/membership/templates/login.html
index fc795325..d199f601 100644
--- a/membership/templates/login.html
+++ b/membership/templates/login.html
@@ -20,15 +20,15 @@
- Brand
+ Digital Glarus
diff --git a/membership/templates/membership.html b/membership/templates/membership.html
index a0c5468c..335bc847 100644
--- a/membership/templates/membership.html
+++ b/membership/templates/membership.html
@@ -1,196 +1,252 @@
-
+
+
-
-
-
+
+
+
{% load static %}
-
-
-
+
+
+
+
+
+
+
+ {% if request.user.is_authenticated %}
+
{{ request.user.name }} (
Logout )
+ {% else %}
+
Login
+ {% endif %}
+
-
- {% load static %}
-
-
-
-
-
-
When do you want to cowork?
-
Pick a date!
-
Calender
-
-
-
-
-
-
-
-
-
-
Become our member of Digital Glarus!
-
-
-
-
-
-
-
-
-
-
-
-
The Spontaneous
-
35CHF/Month (1 day pass included)
-
Do you dream of having a place to be inspired in the middle of the Alps?
- With only 35CHF a month, you can enjoy the full benefit of a Digital Chalet
- Schwanden membership! You can enjoy high speed network connection and comfortable
- working desks where you can come up with best ideas for your project surrounded
- by friendly coworkers. And if your work gets too productive to leave, you
- can crash on our guest bed for the night, the house has everything a coworker
- needs from an equipped kitchen to a shower. The Spontaneous includes 1
- day pass included, it is perfect for you if you are planning a retreat
- month of a coworking in the nature, or coming for a limited period to Switzerland
- for coworking. It is a perfect try-out package!
-
-
-
Buy Now
-
-
-
-
-
-
-
-
-
The Committed
-
360CHF/Year (2 free day per month included)
-
Be a regular coworker in our Digital Chalet Schwanden! With only 360CHF,
- you can enjoy the full coworking space for the whole year, with additional
- 2 free day passes for each month. It is an ideal deal for our busy and
- active coworkers who would like to save time(and nerve)for requesting new
- membership every month. Signifiantly discounted price is applied for yearly
- membership.
-
-
-
Buy Now
-
-
-
-
-
-
-
-
-
-
-
-
A Quick Glance..
-
A short guide for membership features.
-
-
-
-
-
-
-
-
- The Spontaneous
- The Committed
-
-
-
-
- Includes
- 1 work day included
- 2 free work days per month
-
-
- Fits for
- Great for trial, see how it goes
- Perfect for coworking with great price
-
-
- Price
- Decicde every month
- Pay once per year
-
-
- Membership price
- 35CHF/Month
- 360CHF/Year
-
-
- Price per additional day
- 20 CHF
- 15 CHF
-
-
-
-
-
-
-
-
-
-
-
-
Digital Glarus
-
In der Au 7 8762 Schwanden
- Copyright © ungleich GmbH 2016
-
-
-
-
-
+
+
+
+ Home
+
+
+ Contacts
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+ {% load static %}
+
+
+
+
+
+
When do you want to cowork?
+
+
Pick a date!
+
Calender
+
+
+
+
+
+
+
+ {% include 'calendar/calendar.html' %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Become our member of Digital Glarus!
+
+
+
+
+
+
+
+
+
+
+
+
The Spontaneous
+
+
35CHF/Month (1 day pass included)
+
+
Do you dream of having a place to be inspired in the middle of the Alps?
+ With only 35CHF a month, you can enjoy the full benefit of a Digital Chalet
+ Schwanden membership! You can enjoy high speed network connection and comfortable
+ working desks where you can come up with best ideas for your project surrounded
+ by friendly coworkers. And if your work gets too productive to leave, you
+ can crash on our guest bed for the night, the house has everything a coworker
+ needs from an equipped kitchen to a shower. The Spontaneous includes 1
+ day pass included, it is perfect for you if you are planning a retreat
+ month of a coworking in the nature, or coming for a limited period to Switzerland
+ for coworking. It is a perfect try-out package!
+
+
+
Buy Now
+
+
+
+
+
+
+
+
+
The Committed
+
+
360CHF/Year (2 free day per month included)
+
+
Be a regular coworker in our Digital Chalet Schwanden! With only 360CHF,
+ you can enjoy the full coworking space for the whole year, with additional
+ 2 free day passes for each month. It is an ideal deal for our busy and
+ active coworkers who would like to save time(and nerve)for requesting new
+ membership every month. Signifiantly discounted price is applied for yearly
+ membership.
+
+
+
Buy Now
+
+
+
+
+
+
+
+
+
+
+
+
A Quick Glance..
+
+
A short guide for membership features.
+
+
+
+
+
+
+
+
+ The Spontaneous
+ The Committed
+
+
+
+
+ Includes
+ 1 work day included
+ 2 free work days per month
+
+
+ Fits for
+ Great for trial, see how it goes
+ Perfect for coworking with great price
+
+
+ Price
+ Decicde every month
+ Pay once per year
+
+
+ Membership price
+ 35CHF/Month
+ 360CHF/Year
+
+
+ Price per additional day
+ 20 CHF
+ 15 CHF
+
+
+
+
+
+
+
+
+
+
+
+
Digital Glarus
+
+
In der Au 7 8762 Schwanden
+ Copyright © ungleich GmbH 2016
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/membership/templates/success.html b/membership/templates/success.html
index ed64b8ec..88cb2256 100644
--- a/membership/templates/success.html
+++ b/membership/templates/success.html
@@ -19,7 +19,7 @@
Check your email to activate your account.
diff --git a/membership/urls.py b/membership/urls.py
index d1d1c474..65be6868 100644
--- a/membership/urls.py
+++ b/membership/urls.py
@@ -5,9 +5,10 @@ from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = (
- url(r"^$", views.LoginRegistrationView.as_view(), name='login'),
+ url(r"^$", views.LoginRegistrationView.as_view(), name='login_glarus'),
url(r"^validate/(?P.*)/$", views.validate_email),
url(r"^membership/$", login_required(views.MembershipView.as_view()), name='membership'),
+ url(r'logout/?$',views.logout_glarus,name='logout_glarus'),
url(r"^buy/(?P\w+)/$", login_required(views.CreditCardView.as_view()), name='payment'),
url(r'^buy/(?P\w+)/reset',login_required(views.reset),name='reset')
)
diff --git a/membership/views.py b/membership/views.py
index 5c73fab0..23f08ede 100644
--- a/membership/views.py
+++ b/membership/views.py
@@ -4,6 +4,10 @@ from django.contrib.auth import authenticate, login
from django.views.decorators.cache import cache_control
from django.conf import settings
from django.db.models import Q
+from django.utils.translation import get_language
+from django.contrib.auth import logout
+from django.http import HttpResponseRedirect
+from django.core.urlresolvers import reverse_lazy,reverse
from .models import CustomUser
from .forms import (LoginForm, RegisterForm, PaymentForm)
@@ -105,9 +109,14 @@ class LoginRegistrationView(View):
class MembershipView(View):
def get(self, request):
- #if the user has payed allready
+ #if the user has payed already
member_payed = request.user.creditcards_set.filter(Q(payment_type='month') | Q(payment_type='year'))
if member_payed:
return redirect('/')
request.session['next'] = 0
- return render(request, 'templates/membership.html')
+ language = get_language()
+ return render(request, 'templates/membership.html',context={'language_code':language})
+
+def logout_glarus(request):
+ logout(request)
+ return HttpResponseRedirect('/digitalglarus')
\ No newline at end of file