2016-08-20 05:57:35 +00:00
|
|
|
import json
|
2015-05-02 18:41:11 +00:00
|
|
|
import datetime
|
2015-05-02 15:00:15 +00:00
|
|
|
|
2016-08-20 05:57:35 +00:00
|
|
|
from django.conf import settings
|
2015-05-02 17:00:38 +00:00
|
|
|
from django.shortcuts import get_object_or_404, render
|
2015-05-02 18:41:11 +00:00
|
|
|
from django.forms import ModelForm
|
|
|
|
from django.http import HttpResponseRedirect
|
2016-08-20 05:57:35 +00:00
|
|
|
from django.core.urlresolvers import reverse_lazy, reverse
|
2016-04-12 05:50:15 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2016-04-13 05:31:19 +00:00
|
|
|
from django.views.generic import TemplateView
|
2016-08-20 05:57:35 +00:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
2015-09-08 04:23:32 +00:00
|
|
|
from django.utils.translation import get_language
|
|
|
|
from djangocms_blog.models import Post
|
2016-04-07 05:26:50 +00:00
|
|
|
from django.contrib import messages
|
2016-04-23 17:00:20 +00:00
|
|
|
from django.http import JsonResponse
|
2016-09-06 00:45:45 +00:00
|
|
|
from django.views.generic import View, DetailView, ListView
|
2015-05-02 15:42:04 +00:00
|
|
|
|
2016-04-10 21:12:43 +00:00
|
|
|
from .models import Supporter
|
|
|
|
from utils.forms import ContactUsForm
|
2016-04-07 05:26:50 +00:00
|
|
|
from django.views.generic.edit import FormView
|
2016-04-23 17:00:20 +00:00
|
|
|
from membership.calendar.calendar import BookCalendar
|
2016-09-06 00:45:45 +00:00
|
|
|
from membership.models import Calendar as CalendarModel, StripeCustomer
|
2016-08-20 05:57:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
from utils.views import LoginViewMixin, SignupViewMixin, \
|
|
|
|
PasswordResetViewMixin, PasswordResetConfirmViewMixin
|
|
|
|
from utils.forms import PasswordResetRequestForm
|
|
|
|
from utils.stripe_utils import StripeUtils
|
|
|
|
|
|
|
|
|
2016-08-31 02:32:45 +00:00
|
|
|
from .forms import LoginForm, SignupForm, MembershipBillingForm, BookingDateForm,\
|
|
|
|
BookingBillingForm
|
|
|
|
|
|
|
|
from .models import MembershipType, Membership, MembershipOrder, Booking, BookingPrice,\
|
|
|
|
BookingOrder
|
2016-08-20 05:57:35 +00:00
|
|
|
|
2016-09-06 00:45:45 +00:00
|
|
|
from .mixins import MembershipRequired
|
|
|
|
|
2016-08-20 05:57:35 +00:00
|
|
|
|
|
|
|
class IndexView(TemplateView):
|
|
|
|
template_name = "digitalglarus/old_index.html"
|
|
|
|
|
|
|
|
|
|
|
|
class LoginView(LoginViewMixin):
|
|
|
|
template_name = "digitalglarus/login.html"
|
|
|
|
form_class = LoginForm
|
|
|
|
success_url = reverse_lazy('digitalglarus:landing')
|
|
|
|
|
|
|
|
|
|
|
|
class SignupView(SignupViewMixin):
|
|
|
|
template_name = "digitalglarus/signup.html"
|
|
|
|
form_class = SignupForm
|
|
|
|
success_url = reverse_lazy('digitalglarus:login')
|
|
|
|
|
|
|
|
|
|
|
|
class PasswordResetView(PasswordResetViewMixin):
|
|
|
|
template_name = 'digitalglarus/reset_password.html'
|
|
|
|
success_url = reverse_lazy('digitalglarus:login')
|
|
|
|
form_class = PasswordResetRequestForm
|
|
|
|
template_email_path = 'digitalglarus/emails/'
|
|
|
|
|
|
|
|
|
|
|
|
class PasswordResetConfirmView(PasswordResetConfirmViewMixin):
|
|
|
|
template_name = 'digitalglarus/confirm_reset_password.html'
|
|
|
|
success_url = reverse_lazy('digitalglarus:login')
|
|
|
|
|
|
|
|
|
|
|
|
class HistoryView(TemplateView):
|
|
|
|
template_name = "digitalglarus/history.html"
|
|
|
|
|
2016-08-31 02:32:45 +00:00
|
|
|
def get_context_data(self, *args, **kwargs):
|
2016-08-20 05:57:35 +00:00
|
|
|
context = super(HistoryView, self).get_context_data(**kwargs)
|
|
|
|
supporters = Supporter.objects.all()
|
|
|
|
context.update({
|
|
|
|
'supporters': supporters
|
|
|
|
})
|
|
|
|
return context
|
|
|
|
|
2016-04-23 17:00:20 +00:00
|
|
|
|
2016-09-06 00:45:45 +00:00
|
|
|
class BookingSelectDatesView(LoginRequiredMixin, MembershipRequired, FormView):
|
2016-08-31 02:32:45 +00:00
|
|
|
template_name = "digitalglarus/booking.html"
|
|
|
|
form_class = BookingDateForm
|
2016-09-06 00:45:45 +00:00
|
|
|
membership_redirect_url = reverse_lazy('digitalglarus:membership_pricing')
|
2016-08-31 02:32:45 +00:00
|
|
|
login_url = reverse_lazy('digitalglarus:login')
|
|
|
|
success_url = reverse_lazy('digitalglarus:booking_payment')
|
|
|
|
|
|
|
|
def form_valid(self, form):
|
|
|
|
user = self.request.user
|
|
|
|
start_date = form.cleaned_data.get('start_date')
|
|
|
|
end_date = form.cleaned_data.get('end_date')
|
2016-09-06 00:45:45 +00:00
|
|
|
booking_days = (end_date - start_date).days + 1
|
2016-08-31 02:32:45 +00:00
|
|
|
original_price, discount_price, free_days = Booking.\
|
|
|
|
booking_price(user, start_date, end_date)
|
|
|
|
self.request.session.update({
|
|
|
|
'original_price': original_price,
|
|
|
|
'discount_price': discount_price,
|
|
|
|
'booking_days': booking_days,
|
|
|
|
'free_days': free_days,
|
|
|
|
'start_date': start_date.strftime('%m/%d/%Y'),
|
|
|
|
'end_date': end_date.strftime('%m/%d/%Y'),
|
|
|
|
})
|
|
|
|
return super(BookingSelectDatesView, self).form_valid(form)
|
|
|
|
|
|
|
|
|
2016-09-06 00:45:45 +00:00
|
|
|
class BookingPaymentView(LoginRequiredMixin, MembershipRequired, FormView):
|
2016-08-31 02:32:45 +00:00
|
|
|
template_name = "digitalglarus/booking_payment.html"
|
|
|
|
form_class = BookingBillingForm
|
2016-09-06 00:45:45 +00:00
|
|
|
membership_redirect_url = reverse_lazy('digitalglarus:membership_pricing')
|
|
|
|
# success_url = reverse_lazy('digitalglarus:booking_payment')
|
2016-08-31 02:32:45 +00:00
|
|
|
booking_needed_fields = ['original_price', 'discount_price', 'booking_days', 'free_days',
|
|
|
|
'start_date', 'end_date']
|
|
|
|
|
|
|
|
def dispatch(self, request, *args, **kwargs):
|
|
|
|
from_booking = all(field in request.session.keys()
|
|
|
|
for field in self.booking_needed_fields)
|
|
|
|
if not from_booking:
|
|
|
|
return HttpResponseRedirect(reverse('digitalglarus:booking'))
|
|
|
|
|
|
|
|
return super(BookingPaymentView, self).dispatch(request, *args, **kwargs)
|
|
|
|
|
2016-09-06 00:45:45 +00:00
|
|
|
def get_success_url(self, order_id):
|
|
|
|
return reverse('digitalglarus:booking_orders_datail', kwargs={'pk': order_id})
|
|
|
|
|
2016-08-31 02:32:45 +00:00
|
|
|
def get_form_kwargs(self):
|
|
|
|
form_kwargs = super(BookingPaymentView, self).get_form_kwargs()
|
|
|
|
form_kwargs.update({
|
|
|
|
'initial': {
|
|
|
|
'start_date': self.request.session.get('start_date'),
|
|
|
|
'end_date': self.request.session.get('end_date'),
|
|
|
|
'price': self.request.session.get('discount_price'),
|
|
|
|
}
|
|
|
|
})
|
|
|
|
return form_kwargs
|
|
|
|
|
|
|
|
def get_context_data(self, *args, **kwargs):
|
|
|
|
context = super(BookingPaymentView, self).get_context_data(*args, **kwargs)
|
|
|
|
|
|
|
|
booking_data = {key: self.request.session.get(key)
|
|
|
|
for key in self.booking_needed_fields}
|
|
|
|
booking_price_per_day = BookingPrice.objects.get().price_per_day
|
|
|
|
total_discount = booking_price_per_day * booking_data.get('free_days')
|
|
|
|
booking_data.update({
|
|
|
|
'booking_price_per_day': booking_price_per_day,
|
|
|
|
'total_discount': total_discount,
|
|
|
|
'stripe_key': settings.STRIPE_API_PUBLIC_KEY
|
|
|
|
})
|
|
|
|
context.update(booking_data)
|
|
|
|
return context
|
|
|
|
|
|
|
|
def form_valid(self, form):
|
|
|
|
data = form.cleaned_data
|
|
|
|
context = self.get_context_data()
|
|
|
|
token = data.get('token')
|
|
|
|
start_date = data.get('start_date')
|
|
|
|
end_date = data.get('end_date')
|
|
|
|
|
2016-09-06 00:45:45 +00:00
|
|
|
normal_price, final_price, free_days = Booking.\
|
2016-08-31 02:32:45 +00:00
|
|
|
booking_price(self.request.user, start_date, end_date)
|
|
|
|
|
|
|
|
# Get or create stripe customer
|
|
|
|
customer = StripeCustomer.get_or_create(email=self.request.user.email,
|
|
|
|
token=token)
|
|
|
|
if not customer:
|
|
|
|
form.add_error("__all__", "Invalid credit card")
|
|
|
|
return self.render_to_response(self.get_context_data(form=form))
|
|
|
|
|
|
|
|
# Make stripe charge to a customer
|
|
|
|
stripe_utils = StripeUtils()
|
2016-09-06 00:45:45 +00:00
|
|
|
charge_response = stripe_utils.make_charge(amount=final_price,
|
2016-08-31 02:32:45 +00:00
|
|
|
customer=customer.stripe_id)
|
|
|
|
charge = charge_response.get('response_object')
|
|
|
|
|
|
|
|
# Check if the payment was approved
|
|
|
|
if not charge:
|
|
|
|
context.update({
|
|
|
|
'paymentError': charge_response.get('error'),
|
|
|
|
'form': form
|
|
|
|
})
|
|
|
|
return render(self.request, self.template_name, context)
|
|
|
|
|
|
|
|
charge = charge_response.get('response_object')
|
|
|
|
|
|
|
|
# Create Billing Address
|
|
|
|
billing_address = form.save()
|
|
|
|
|
|
|
|
# Create membership plan
|
|
|
|
booking_data = {
|
|
|
|
'start_date': start_date,
|
|
|
|
'end_date': end_date,
|
|
|
|
'start_date': start_date,
|
|
|
|
'free_days': free_days,
|
2016-09-06 00:45:45 +00:00
|
|
|
'price': normal_price,
|
|
|
|
'final_price': final_price,
|
2016-08-31 02:32:45 +00:00
|
|
|
}
|
|
|
|
booking = Booking.create(booking_data)
|
|
|
|
|
|
|
|
# Create membership order
|
|
|
|
order_data = {
|
|
|
|
'booking': booking,
|
|
|
|
'customer': customer,
|
|
|
|
'billing_address': billing_address,
|
|
|
|
'stripe_charge': charge
|
|
|
|
}
|
2016-09-06 00:45:45 +00:00
|
|
|
order = BookingOrder.create(order_data)
|
2016-08-31 02:32:45 +00:00
|
|
|
|
|
|
|
# request.session.update({
|
|
|
|
# 'membership_price': membership.type.first_month_price,
|
|
|
|
# 'membership_dates': membership.type.first_month_formated_range
|
|
|
|
# })
|
2016-09-06 00:45:45 +00:00
|
|
|
return HttpResponseRedirect(self.get_success_url(order.id))
|
2016-08-31 02:32:45 +00:00
|
|
|
return super(BookingPaymentView, self).form_valid(form)
|
|
|
|
# return HttpResponseRedirect(reverse('digitalglarus:membership_activated'))
|
|
|
|
|
|
|
|
|
|
|
|
class MembershipPricingView(TemplateView):
|
|
|
|
template_name = "digitalglarus/membership_pricing.html"
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
context = super(MembershipPricingView, self).get_context_data(**kwargs)
|
|
|
|
membership_type = MembershipType.objects.last()
|
|
|
|
context.update({
|
|
|
|
'membership_type': membership_type
|
|
|
|
})
|
|
|
|
return context
|
|
|
|
|
|
|
|
|
2016-08-20 05:57:35 +00:00
|
|
|
class MembershipPaymentView(LoginRequiredMixin, FormView):
|
|
|
|
template_name = "digitalglarus/membership_payment.html"
|
2016-08-31 02:32:45 +00:00
|
|
|
login_url = reverse_lazy('digitalglarus:signup')
|
2016-08-20 05:57:35 +00:00
|
|
|
form_class = MembershipBillingForm
|
2016-08-03 05:50:33 +00:00
|
|
|
|
2016-08-20 05:57:35 +00:00
|
|
|
def get_form_kwargs(self):
|
2016-08-22 07:52:29 +00:00
|
|
|
self.membership_type = MembershipType.objects.get(name='standard')
|
2016-08-20 05:57:35 +00:00
|
|
|
form_kwargs = super(MembershipPaymentView, self).get_form_kwargs()
|
|
|
|
form_kwargs.update({
|
2016-08-22 07:52:29 +00:00
|
|
|
'initial': {
|
|
|
|
'membership_type': self.membership_type.id
|
|
|
|
}
|
2016-08-20 05:57:35 +00:00
|
|
|
})
|
|
|
|
return form_kwargs
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
context = super(MembershipPaymentView, self).get_context_data(**kwargs)
|
|
|
|
context.update({
|
2016-08-22 07:52:29 +00:00
|
|
|
'stripe_key': settings.STRIPE_API_PUBLIC_KEY,
|
|
|
|
'membership_type': self.membership_type
|
2016-08-20 05:57:35 +00:00
|
|
|
})
|
|
|
|
return context
|
|
|
|
|
|
|
|
def post(self, request, *args, **kwargs):
|
|
|
|
form = self.get_form()
|
|
|
|
|
|
|
|
if form.is_valid():
|
|
|
|
data = form.cleaned_data
|
|
|
|
context = self.get_context_data()
|
|
|
|
token = data.get('token')
|
|
|
|
membership_type = data.get('membership_type')
|
|
|
|
|
|
|
|
# Get or create stripe customer
|
|
|
|
customer = StripeCustomer.get_or_create(email=self.request.user.email,
|
|
|
|
token=token)
|
|
|
|
if not customer:
|
|
|
|
form.add_error("__all__", "Invalid credit card")
|
|
|
|
return self.render_to_response(self.get_context_data(form=form))
|
|
|
|
|
|
|
|
# Make stripe charge to a customer
|
|
|
|
stripe_utils = StripeUtils()
|
2016-08-22 07:52:29 +00:00
|
|
|
charge_response = stripe_utils.make_charge(amount=membership_type.first_month_price,
|
2016-08-20 05:57:35 +00:00
|
|
|
customer=customer.stripe_id)
|
|
|
|
charge = charge_response.get('response_object')
|
|
|
|
|
|
|
|
# Check if the payment was approved
|
|
|
|
if not charge:
|
|
|
|
context.update({
|
|
|
|
'paymentError': charge_response.get('error'),
|
|
|
|
'form': form
|
|
|
|
})
|
|
|
|
return render(request, self.template_name, context)
|
|
|
|
|
|
|
|
charge = charge_response.get('response_object')
|
2016-08-22 07:52:29 +00:00
|
|
|
|
|
|
|
# Create Billing Address
|
|
|
|
billing_address = form.save()
|
|
|
|
|
|
|
|
# Create membership plan
|
|
|
|
membership_data = {'type': membership_type}
|
|
|
|
membership = Membership.create(membership_data)
|
|
|
|
|
|
|
|
# Create membership order
|
|
|
|
order_data = {
|
|
|
|
'membership': membership,
|
|
|
|
'customer': customer,
|
|
|
|
'billing_address': billing_address,
|
|
|
|
'stripe_charge': charge
|
|
|
|
}
|
|
|
|
MembershipOrder.create(order_data)
|
|
|
|
|
|
|
|
request.session.update({
|
|
|
|
'membership_price': membership.type.first_month_price,
|
|
|
|
'membership_dates': membership.type.first_month_formated_range
|
|
|
|
})
|
|
|
|
return HttpResponseRedirect(reverse('digitalglarus:membership_activated'))
|
|
|
|
|
2016-08-20 05:57:35 +00:00
|
|
|
else:
|
|
|
|
return self.form_invalid(form)
|
|
|
|
|
|
|
|
|
2016-08-22 07:52:29 +00:00
|
|
|
class MembershipActivatedView(TemplateView):
|
|
|
|
template_name = "digitalglarus/membership_activated.html"
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
context = super(MembershipActivatedView, self).get_context_data(**kwargs)
|
|
|
|
membership_price = self.request.session.get('membership_price')
|
|
|
|
membership_dates = self.request.session.get('membership_dates')
|
|
|
|
context.update({
|
|
|
|
'membership_price': membership_price,
|
|
|
|
'membership_dates': membership_dates,
|
|
|
|
})
|
|
|
|
return context
|
|
|
|
|
2016-08-20 05:57:35 +00:00
|
|
|
|
2016-09-06 00:45:45 +00:00
|
|
|
class OrdersBookingDetailView(LoginRequiredMixin, DetailView):
|
|
|
|
template_name = "digitalglarus/booking_orders_detail.html"
|
|
|
|
context_object_name = "order"
|
|
|
|
login_url = reverse_lazy('digitalglarus:login')
|
|
|
|
# permission_required = ['view_hostingorder']
|
|
|
|
model = BookingOrder
|
|
|
|
|
|
|
|
def get_context_data(self, *args, **kwargs):
|
|
|
|
|
|
|
|
context = super(OrdersBookingDetailView, self).get_context_data(**kwargs)
|
|
|
|
|
|
|
|
bookig_order = self.object
|
|
|
|
booking = bookig_order.booking
|
|
|
|
|
|
|
|
start_date = booking.start_date
|
|
|
|
end_date = booking.end_date
|
|
|
|
free_days = booking.free_days
|
|
|
|
|
|
|
|
booking_days = (end_date - start_date).days + 1
|
|
|
|
original_price = booking.price
|
|
|
|
final_price = booking.final_price
|
|
|
|
context.update({
|
|
|
|
'original_price': original_price,
|
|
|
|
'total_discount': original_price - final_price,
|
|
|
|
'final_price': final_price,
|
|
|
|
'booking_days': booking_days,
|
|
|
|
'free_days': free_days,
|
|
|
|
'start_date': start_date.strftime('%m/%d/%Y'),
|
|
|
|
'end_date': end_date.strftime('%m/%d/%Y'),
|
|
|
|
})
|
|
|
|
|
|
|
|
return context
|
|
|
|
|
|
|
|
|
|
|
|
class BookingOrdersListView(LoginRequiredMixin, ListView):
|
|
|
|
template_name = "digitalglarus/booking_orders_list.html"
|
|
|
|
context_object_name = "orders"
|
|
|
|
login_url = reverse_lazy('digitalglarus:login')
|
|
|
|
model = BookingOrder
|
|
|
|
paginate_by = 10
|
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
queryset = super(BookingOrdersListView, self).get_queryset()
|
|
|
|
queryset = queryset.filter(customer__user=self.request.user)
|
|
|
|
return queryset
|
|
|
|
|
|
|
|
|
2016-08-20 05:57:35 +00:00
|
|
|
############## OLD VIEWS
|
2016-04-23 17:00:20 +00:00
|
|
|
class CalendarApi(View):
|
|
|
|
def get(self,request,month,year):
|
|
|
|
calendar = BookCalendar(request.user,requested_month=month).formatmonth(int(year),int(month))
|
|
|
|
ret = {'calendar':calendar,'month':month,'year':year}
|
|
|
|
return JsonResponse(ret)
|
|
|
|
|
|
|
|
def post(self,request):
|
|
|
|
pd = json.loads(request.POST.get('data',''))
|
|
|
|
ret = {'status':'success'}
|
|
|
|
CalendarModel.add_dates(pd,request.user)
|
|
|
|
return JsonResponse(ret)
|
2015-05-02 15:42:04 +00:00
|
|
|
|
2016-04-07 05:26:50 +00:00
|
|
|
class ContactView(FormView):
|
|
|
|
template_name = 'contact.html'
|
|
|
|
form_class = ContactUsForm
|
2016-04-10 21:12:43 +00:00
|
|
|
success_url = reverse_lazy('digitalglarus:contact')
|
2016-04-07 05:26:50 +00:00
|
|
|
success_message = _('Message Successfully Sent')
|
|
|
|
|
|
|
|
def form_valid(self, form):
|
|
|
|
form.save()
|
|
|
|
form.send_email()
|
|
|
|
messages.add_message(self.request, messages.SUCCESS, self.success_message)
|
|
|
|
return super(ContactView, self).form_valid(form)
|
2015-05-02 20:42:08 +00:00
|
|
|
|
2015-05-02 15:42:04 +00:00
|
|
|
|
2016-08-09 05:54:25 +00:00
|
|
|
|
2016-04-13 05:31:19 +00:00
|
|
|
class AboutView(TemplateView):
|
2016-04-16 01:18:29 +00:00
|
|
|
template_name = "digitalglarus/about.html"
|
2016-04-13 05:31:19 +00:00
|
|
|
|
2015-05-02 17:00:38 +00:00
|
|
|
def detail(request, message_id):
|
|
|
|
p = get_object_or_404(Message, pk=message_id)
|
|
|
|
|
|
|
|
context = { 'message': p, }
|
2015-06-10 21:34:33 +00:00
|
|
|
return render(request, 'digitalglarus/detail.html', context)
|
2015-05-02 17:00:38 +00:00
|
|
|
|
2015-05-02 20:02:19 +00:00
|
|
|
def about(request):
|
2015-06-10 21:34:33 +00:00
|
|
|
return render(request, 'digitalglarus/about.html')
|
2015-05-02 18:41:11 +00:00
|
|
|
|
2015-09-20 14:37:54 +00:00
|
|
|
def home(request):
|
2016-04-04 01:39:57 +00:00
|
|
|
return render(request, 'index.html')
|
2015-05-02 20:42:08 +00:00
|
|
|
|
2015-09-20 14:37:54 +00:00
|
|
|
def letscowork(request):
|
|
|
|
return render(request, 'digitalglarus/letscowork.html')
|
2015-09-16 07:11:39 +00:00
|
|
|
|
2015-09-08 04:23:32 +00:00
|
|
|
|
|
|
|
def blog(request):
|
2015-09-26 19:42:46 +00:00
|
|
|
tags = ["digitalglarus"]
|
2016-06-24 02:32:51 +00:00
|
|
|
posts = Post.objects.filter(tags__name__in=tags, publish=True).translated(get_language())
|
|
|
|
# posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags, publish=True)
|
2015-09-08 04:23:32 +00:00
|
|
|
context = {
|
|
|
|
'post_list': posts,
|
|
|
|
}
|
|
|
|
return render(request, 'glarus_blog/post_list.html', context)
|
|
|
|
|
|
|
|
|
|
|
|
def blog_detail(request, slug):
|
2016-04-09 06:51:20 +00:00
|
|
|
# post = Post.objects.filter_by_language(get_language()).filter(slug=slug).first()
|
|
|
|
|
2016-07-01 05:40:39 +00:00
|
|
|
post = Post.objects.translated(get_language(), slug=slug).first()
|
2015-09-08 04:23:32 +00:00
|
|
|
context = {
|
|
|
|
'post': post,
|
|
|
|
}
|
2016-04-09 06:51:20 +00:00
|
|
|
return render(request, 'glarus_blog/post_detail.html', context)
|
2016-02-03 13:27:29 +00:00
|
|
|
|
2016-04-07 05:26:50 +00:00
|
|
|
|
2016-04-04 01:39:57 +00:00
|
|
|
def support(request):
|
2016-04-04 02:28:04 +00:00
|
|
|
return render(request, 'support.html')
|
2016-02-03 13:27:29 +00:00
|
|
|
|
2016-04-07 05:26:50 +00:00
|
|
|
|
2016-02-03 13:27:29 +00:00
|
|
|
def supporters(request):
|
|
|
|
context = {
|
|
|
|
'supporters': Supporter.objects.order_by('name')
|
|
|
|
}
|
2016-04-01 10:37:01 +00:00
|
|
|
return render(request, 'supporters.html', context)
|
2016-04-23 17:00:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|