Changed donations.html table style, Added pagination to donations list view. Hiding donate now button if the user is logged in and already has a donation.Handled the case when an user has not donations yet in donations.html view. Fixed bug on donation signup
This commit is contained in:
parent
c370863c56
commit
5fce858923
8 changed files with 34 additions and 6 deletions
|
@ -5,6 +5,7 @@ from . import views
|
||||||
from .views import ContactView, IndexView, AboutView
|
from .views import ContactView, IndexView, AboutView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
url(_(r'^$'), IndexView.as_view(), name='contact'),
|
||||||
url(_(r'contact/?$'), ContactView.as_view(), name='contact'),
|
url(_(r'contact/?$'), ContactView.as_view(), name='contact'),
|
||||||
url(_(r'supporters/?$'), views.supporters, name='supporters'),
|
url(_(r'supporters/?$'), views.supporters, name='supporters'),
|
||||||
url(r'calendar_api/(?P<month>\d+)/(?P<year>\d+)?$', views.CalendarApi.as_view(),name='calendar_api_1'),
|
url(r'calendar_api/(?P<month>\d+)/(?P<year>\d+)?$', views.CalendarApi.as_view(),name='calendar_api_1'),
|
||||||
|
|
|
@ -20,6 +20,7 @@ from membership.models import Calendar as CalendarModel
|
||||||
import json
|
import json
|
||||||
from django.contrib.auth import logout
|
from django.contrib.auth import logout
|
||||||
|
|
||||||
|
|
||||||
class CalendarApi(View):
|
class CalendarApi(View):
|
||||||
def get(self,request,month,year):
|
def get(self,request,month,year):
|
||||||
calendar = BookCalendar(request.user,requested_month=month).formatmonth(int(year),int(month))
|
calendar = BookCalendar(request.user,requested_month=month).formatmonth(int(year),int(month))
|
||||||
|
|
|
@ -26,7 +26,7 @@ class LoginForm(forms.Form):
|
||||||
def login(self,request):
|
def login(self,request):
|
||||||
username = self.cleaned_data.get('email')
|
username = self.cleaned_data.get('email')
|
||||||
password = self.cleaned_data.get('password')
|
password = self.cleaned_data.get('password')
|
||||||
user = authenticate(email=username,password=password)
|
user = authenticate(email=username, password=password)
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
form{
|
||||||
|
|
||||||
|
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.donation-container {
|
||||||
|
|
||||||
|
margin-top:0% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.donations-container {
|
.donations-container {
|
||||||
|
|
||||||
top:30% !important;
|
top:30% !important;
|
||||||
|
|
|
@ -37,7 +37,9 @@ $( document ).ready(function() {
|
||||||
|
|
||||||
var PublishableKey = window.stripeKey;
|
var PublishableKey = window.stripeKey;
|
||||||
Stripe.setPublishableKey(PublishableKey);
|
Stripe.setPublishableKey(PublishableKey);
|
||||||
|
console.log('form',$form);
|
||||||
Stripe.card.createToken($form, function stripeResponseHandler(status, response) {
|
Stripe.card.createToken($form, function stripeResponseHandler(status, response) {
|
||||||
|
console.log('response',response);
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
/* Visual feedback */
|
/* Visual feedback */
|
||||||
$form.find('[type=submit]').html('Try again');
|
$form.find('[type=submit]').html('Try again');
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
<!-- Credit card form -->
|
<!-- Credit card form -->
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<div class="header-content">
|
<div class="header-content donation-container">
|
||||||
<div class="header-content-inner">
|
<div class="header-content-inner ">
|
||||||
|
|
||||||
<div class="container payment-container">
|
<div class="container">
|
||||||
<form role="form" id="donation-form" name="donation-form" method="post" action="{% url 'nosystemd:make_donation' %}" novalidate>
|
<form role="form" id="donation-form" name="donation-form" method="post" action="{% url 'nosystemd:make_donation' %}" novalidate>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-4 col-md-offset-3" >
|
<div class="col-xs-12 col-md-4 col-md-offset-3" >
|
||||||
|
@ -53,9 +53,18 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-9 col-md-12">
|
<div class="col-xs-9 col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label" for="cardNumber">CARD NUMBER</label>
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" name="cardNumber" placeholder="Valid Card Number" required autofocus data-stripe="number" />
|
<input type="text" class="form-control" name="cardName" placeholder="Name on card" required autofocus data-stripe="name" />
|
||||||
|
<span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-9 col-md-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control" name="cardNumber" placeholder="Valid Card Number" required data-stripe="number" />
|
||||||
<span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
|
<span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<h2 class="post-title">
|
<h2 class="post-title">
|
||||||
{{ post.title }}
|
{{ post.title }}
|
||||||
</h2>
|
</h2>
|
||||||
|
<img src="{% thumbnail post.main_image 630x200 crop upscale subject_location=post.main_image.subject_location %}"/>
|
||||||
<h3 class="post-subtitle">
|
<h3 class="post-subtitle">
|
||||||
{% if not TRUNCWORDS_COUNT %}
|
{% if not TRUNCWORDS_COUNT %}
|
||||||
{% render_model post "abstract" %}
|
{% render_model post "abstract" %}
|
||||||
|
|
|
@ -22,6 +22,7 @@ class PostListViewUngleichTest(BaseTestCase):
|
||||||
self.url = reverse('ungleich:post-list')
|
self.url = reverse('ungleich:post-list')
|
||||||
self.view = PostListViewUngleich
|
self.view = PostListViewUngleich
|
||||||
self.expected_template = 'djangocms_blog/post_list_ungleich.html'
|
self.expected_template = 'djangocms_blog/post_list_ungleich.html'
|
||||||
|
activate(self.EN_LANGUAGE_CODE)
|
||||||
en_post_titles = ['post-title-1', 'post-title-2']
|
en_post_titles = ['post-title-1', 'post-title-2']
|
||||||
self.en_posts = [mommy.make(Post, title=x, publish=True) for x in en_post_titles]
|
self.en_posts = [mommy.make(Post, title=x, publish=True) for x in en_post_titles]
|
||||||
# activate DE language in order to create DE POSTS
|
# activate DE language in order to create DE POSTS
|
||||||
|
|
Loading…
Reference in a new issue