# HG changeset patch # User Brian Neal # Date 1243990757 0 # Node ID c018872385ea5d7c72003a09471235ead1d33cd3 # Parent 07da6967fc4050aa0efd8bc001e4c456d5f7cd87 Slideshow for home page; Initial checkin for the donations application. diff -r 07da6967fc40 -r c018872385ea gpp/donations/admin.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/donations/admin.py Wed Jun 03 00:59:17 2009 +0000 @@ -0,0 +1,10 @@ +""" +This file contains the admin definitions for the donations application. +""" +from django.contrib import admin +from donations.models import Donation + +class DonationAdmin(admin.ModelAdmin): + raw_id_fields = ('user', ) + +admin.site.register(Donation, DonationAdmin) diff -r 07da6967fc40 -r c018872385ea gpp/donations/models.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/donations/models.py Wed Jun 03 00:59:17 2009 +0000 @@ -0,0 +1,36 @@ +""" +Models for the donations application. +""" +from django.db import models +from django.contrib import auth + +class Donation(models.Model): + """Model to represent a donation to the website.""" + + user = models.ForeignKey(auth.models.User, null=True, blank=True) + is_anonymous = models.BooleanField() + test_ipn = models.BooleanField(default=False, verbose_name="Test IPN") + txn_id = models.CharField(max_length=20, verbose_name="Txn ID") + txn_type = models.CharField(max_length=64) + first_name = models.CharField(max_length=64, blank=True) + last_name = models.CharField(max_length=64, blank=True) + payer_email = models.EmailField(max_length=127, blank=True) + payer_id = models.CharField(max_length=13, blank=True, verbose_name="Payer ID") + mc_fee = models.DecimalField(max_digits=8, decimal_places=2, verbose_name="Fee") + mc_gross = models.DecimalField(max_digits=8, decimal_places=2, verbose_name="Gross") + memo = models.TextField(blank=True) + payer_status = models.CharField(max_length=10, blank=True) + payment_date = models.DateTimeField() + + class Meta: + ordering = ('-payment_date', ) + + def __unicode__(self): + if self.user: + return u'%s from %s' % (self.mc_gross, self.user.username) + return u'%s from %s %s' % (self.mc_gross, self.first_name, self.last_name) + + def save(self, *args, **kwargs): + if self.user is None: + self.is_anonymous = True + super(Donation, self).save(*args, **kwargs) diff -r 07da6967fc40 -r c018872385ea gpp/donations/tests.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/donations/tests.py Wed Jun 03 00:59:17 2009 +0000 @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff -r 07da6967fc40 -r c018872385ea gpp/donations/views.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/donations/views.py Wed Jun 03 00:59:17 2009 +0000 @@ -0,0 +1,1 @@ +# Create your views here. diff -r 07da6967fc40 -r c018872385ea gpp/settings.py --- a/gpp/settings.py Tue May 05 00:56:18 2009 +0000 +++ b/gpp/settings.py Wed Jun 03 00:59:17 2009 +0000 @@ -106,6 +106,7 @@ 'comments', 'contact', 'core', + 'donations', 'downloads', 'gcalendar', 'irc', diff -r 07da6967fc40 -r c018872385ea gpp/templates/home.html --- a/gpp/templates/home.html Tue May 05 00:56:18 2009 +0000 +++ b/gpp/templates/home.html Wed Jun 03 00:59:17 2009 +0000 @@ -7,8 +7,21 @@ {% block custom_css %} {% endblock %} +{% block custom_js %} + +{% endblock %} {% block content %}

Welcome to SurfGuitar101!

+
+
+ Slideshow Image 1 + Slideshow Image 2 + Slideshow Image 3 + Slideshow Image 4 + Slideshow Image 5 +
+
+

You are looking at a test version of the new SurfGuitar101 website, dubbed SG101 2.0. All major functionality is here except for the forums (which are still in development). The purpose of this test site is to test the new site software, to get feedback from the user base, and @@ -17,6 +30,7 @@ to sign up here and give the new site a test drive. Any and all feedback is appreciated! Thank you for helping to make this site be the best home on the web for fans and friends of surf music!

+

Remember that this is a test site, and not everything is going to work. Nothing here is permanent. The site (content, user accounts, etc.) may be wiped at any time while we fix bugs and add features. Also, I hope that the look and feel of this site can be greatly improved to something really cool! I'll need diff -r 07da6967fc40 -r c018872385ea media/css/base.css --- a/media/css/base.css Tue May 05 00:56:18 2009 +0000 +++ b/media/css/base.css Wed Jun 03 00:59:17 2009 +0000 @@ -131,3 +131,22 @@ ul.icon-list li { list-style-type: none; } +#slideshow { + position:relative; + left:15px; + height:240px; +} +#slideshow img { + position:absolute; + top:0; + left:0; + z-index:8; + opacity:0.0; +} +#slideshow img.active { + z-index:10; + opacity:1.0; +} +#slideshow img.last-active { + z-index:9; +}