Skip to content
Browse files

pledge to fight back

  • Loading branch information...
1 parent 93be408 commit 1272d1d4a6d7940f88bed423d3a790c566ed852a Justine Tunney committed
View
9 occupywallst/admin.py
@@ -37,6 +37,7 @@ def __init__(self, *args, **kwargs):
self.register(db.SpamText, admin.ModelAdmin)
self.register(db.List, ListAdmin)
self.register(db.ListMember, ListMemberAdmin)
+ self.register(db.Pledge, PledgeAdmin)
# message table intentionally excluded. i don't want to tempt
# myself or anyone else using the backend to read private
# conversations.
@@ -262,3 +263,11 @@ class ListMemberAdmin(GeoAdmin):
date_hierarchy = 'created'
list_display = ('email', 'mlist', 'created', 'ip')
list_filter = ('mlist__name',)
+
+
+class PledgeAdmin(admin.ModelAdmin):
+ list_filter = ['streets', 'meet', 'social', 'donate', 'strike', 'organize',
+ 'train', 'bank', 'occupy']
+ list_display = ['name', 'email', 'zipcode', 'ip', 'created'] + list_filter
+ search_fields = ['name', 'email', 'zipcode', 'ip']
+ ordering = ['-created']
View
18 occupywallst/forms.py
@@ -17,15 +17,6 @@
class ProfileForm(forms.Form):
email = forms.EmailField(required=False, help_text="""
We won't show it on the site or share it with anyone""")
- notify_message = forms.BooleanField(required=False, initial=True,
- label="Message Notifications",
- help_text="""
- Do you want to receive an email notification when you receive a
- private message or a comment response?""")
- notify_news = forms.BooleanField(required=False, initial=True,
- label="News Notifications",
- help_text="""
- Can we email you notifications about news relating to the protest?""")
info = forms.CharField(required=False, widget=forms.Textarea,
help_text="""
Say whatever you want about yourself here for others
@@ -45,8 +36,6 @@ def __init__(self, user, *args, **kwargs):
if user:
initial = {'email': user.email,
'info': user.userinfo.info,
- 'notify_news': user.userinfo.notify_news,
- 'notify_message': user.userinfo.notify_message,
'position_lat': user.userinfo.position_lat,
'position_lng': user.userinfo.position_lng,
'country': user.userinfo.country,
@@ -68,8 +57,6 @@ def save(self):
user = self.user
ui = user.userinfo
ui.info = self.cleaned_data.get('info')
- ui.notify_message = self.cleaned_data.get('notify_message')
- ui.notify_news = self.cleaned_data.get('notify_news')
position_lat = self.cleaned_data.get('position_lat')
position_lng = self.cleaned_data.get('position_lng')
if position_lat is not None and position_lng is not None:
@@ -144,3 +131,8 @@ def save(self, user, ride):
class SubscribeForm(forms.Form):
email = forms.EmailField()
+
+
+class PledgeForm(forms.ModelForm):
+ class Meta:
+ model = db.Pledge
View
263 occupywallst/migrations/0009_auto__add_pledge.py
@@ -0,0 +1,263 @@
+# -*- coding: utf-8 -*-
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Adding model 'Pledge'
+ db.create_table('occupywallst_pledge', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
+ ('email', self.gf('django.db.models.fields.EmailField')(max_length=75)),
+ ('zipcode', self.gf('django.db.models.fields.CharField')(max_length=10, blank=True)),
+ ('ip', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
+ ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
+ ('is_public', self.gf('django.db.models.fields.BooleanField')(default=True)),
+ ('streets', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('meet', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('social', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('donate', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('strike', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('organize', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('train', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('bank', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('occupy', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ))
+ db.send_create_signal('occupywallst', ['Pledge'])
+
+
+ def backwards(self, orm):
+ # Deleting model 'Pledge'
+ db.delete_table('occupywallst_pledge')
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'occupywallst.article': {
+ 'Meta': {'object_name': 'Article'},
+ 'allow_html': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
+ 'comment_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'is_deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_forum': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_visible': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'killed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'published': ('django.db.models.fields.DateTimeField', [], {}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+ },
+ 'occupywallst.articletranslation': {
+ 'Meta': {'unique_together': "(('article', 'language'),)", 'object_name': 'ArticleTranslation'},
+ 'article': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['occupywallst.Article']"}),
+ 'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'language': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+ },
+ 'occupywallst.carousel': {
+ 'Meta': {'object_name': 'Carousel'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'occupywallst.comment': {
+ 'Meta': {'object_name': 'Comment'},
+ 'article': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['occupywallst.Article']"}),
+ 'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'downs': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'is_deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_removed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'karma': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'parent_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'published': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'ups': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'})
+ },
+ 'occupywallst.commentvote': {
+ 'Meta': {'unique_together': "(('comment', 'user'),)", 'object_name': 'CommentVote'},
+ 'comment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['occupywallst.Comment']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+ 'vote': ('django.db.models.fields.IntegerField', [], {})
+ },
+ 'occupywallst.list': {
+ 'Meta': {'object_name': 'List'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
+ },
+ 'occupywallst.listconfirm': {
+ 'Meta': {'object_name': 'ListConfirm'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'mlist': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['occupywallst.List']"}),
+ 'token': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
+ },
+ 'occupywallst.listmember': {
+ 'Meta': {'unique_together': "(('mlist', 'email'),)", 'object_name': 'ListMember'},
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'mlist': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'members'", 'to': "orm['occupywallst.List']"})
+ },
+ 'occupywallst.message': {
+ 'Meta': {'object_name': 'Message'},
+ 'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'messages_sent'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_read': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'published': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'to_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'messages_recv'", 'to': "orm['auth.User']"})
+ },
+ 'occupywallst.notification': {
+ 'Meta': {'object_name': 'Notification'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_read': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'message': ('django.db.models.fields.TextField', [], {}),
+ 'published': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'url': ('django.db.models.fields.TextField', [], {}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+ },
+ 'occupywallst.photo': {
+ 'Meta': {'object_name': 'Photo'},
+ 'caption': ('django.db.models.fields.TextField', [], {}),
+ 'carousel': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['occupywallst.Carousel']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'original_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+ 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
+ },
+ 'occupywallst.pledge': {
+ 'Meta': {'object_name': 'Pledge'},
+ 'bank': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'donate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'ip': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'meet': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
+ 'occupy': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'organize': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'social': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'streets': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'strike': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'train': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'zipcode': ('django.db.models.fields.CharField', [], {'max_length': '10', 'blank': 'True'})
+ },
+ 'occupywallst.ride': {
+ 'Meta': {'unique_together': "(('user', 'title'),)", 'object_name': 'Ride'},
+ 'depart_time': ('django.db.models.fields.DateTimeField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'info': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'is_deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'published': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'ridetype': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
+ 'route': ('django.contrib.gis.db.models.fields.LineStringField', [], {'default': 'None', 'null': 'True'}),
+ 'route_data': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'seats_total': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+ 'waypoints': ('django.db.models.fields.TextField', [], {})
+ },
+ 'occupywallst.riderequest': {
+ 'Meta': {'unique_together': "(('ride', 'user'),)", 'object_name': 'RideRequest'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'info': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'is_deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'ride': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'requests'", 'to': "orm['occupywallst.Ride']"}),
+ 'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '32'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
+ },
+ 'occupywallst.spamtext': {
+ 'Meta': {'object_name': 'SpamText'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_regex': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'text': ('django.db.models.fields.TextField', [], {})
+ },
+ 'occupywallst.userinfo': {
+ 'Meta': {'object_name': 'UserInfo'},
+ 'address': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
+ 'attendance': ('django.db.models.fields.CharField', [], {'default': "'maybe'", 'max_length': '32'}),
+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '2', 'blank': 'True'}),
+ 'formatted_address': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'info': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'is_moderator': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_shadow_banned': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'karma': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+ 'need_ride': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'notify_message': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'notify_news': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'position': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}),
+ 'region': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
+ 'zipcode': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'})
+ },
+ 'occupywallst.verbiage': {
+ 'Meta': {'object_name': 'Verbiage'},
+ 'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'use_markdown': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'use_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
+ },
+ 'occupywallst.verbiagetranslation': {
+ 'Meta': {'unique_together': "(('verbiage', 'language'),)", 'object_name': 'VerbiageTranslation'},
+ 'content': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'language': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'verbiage': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'to': "orm['occupywallst.Verbiage']"})
+ }
+ }
+
+ complete_apps = ['occupywallst']
View
46 occupywallst/models.py
@@ -988,3 +988,49 @@ def fetch(cls, ride, user):
return cls.objects.get(ride=ride, user=user)
except ObjectDoesNotExist:
return None
+
+
+class Pledge(models.Model):
+ name = models.CharField(max_length=40)
+ email = models.EmailField()
+ zipcode = models.CharField(max_length=10, blank=True)
+ ip = models.CharField(max_length=255, blank=True)
+ created = models.DateTimeField(auto_now_add=True)
+ is_public = models.BooleanField(default=True)
+
+ streets = models.BooleanField()
+ meet = models.BooleanField()
+ social = models.BooleanField()
+ donate = models.BooleanField()
+ strike = models.BooleanField()
+ organize = models.BooleanField()
+ train = models.BooleanField()
+ bank = models.BooleanField()
+ occupy = models.BooleanField()
+
+ def clean(self):
+ """Used by admin to verify input data is correct"""
+ if not any([self.streets, self.meet, self.social, self.donate,
+ self.strike, self.organize, self.train, self.bank,
+ self.occupy]):
+ raise ValidationError('You need to pledge at least one thing')
+
+ def describe_pledges(self):
+ res = []
+ if self.donate: res.append('donate')
+ if self.occupy: res.append('start an occupation')
+ if self.organize: res.append('organize their workplace')
+ if self.meet: res.append('go to a meeting')
+ if self.streets: res.append('show up for an action')
+ if self.social: res.append('promote #occupy media')
+ if self.strike: res.append('not work during a general strike')
+ if self.train: res.append('attend a training')
+ if self.bank: res.append('join a credit union')
+ if not res:
+ return 'do nothing'
+ elif len(res) == 1:
+ return res[0]
+ elif len(res) == 2:
+ return ' and '.join(res)
+ else:
+ return '%s, and %s' % (", ".join(res[:-1]), res[-1])
View
99 occupywallst/templates/occupywallst/fightback.html
@@ -0,0 +1,99 @@
+{% extends base %}
+{% load ows i18n l10n %}
+{% block title %}Occupy's Pledge to Fight Back{% endblock title %}
+{% block description %}We didn't start the class war{% endblock description %}
+
+{% block content %}
+ <style>
+ #funtable td { vertical-align: top; }
+ .lefty h2 { margin-top: 0; color: #333; }
+ .lefty { padding-right: 1em; }
+ .choices p { margin-top: 5px; margin-bottom: 0; padding-left: 25px; text-indent: -25px; }
+ input[type="text"] { padding: 0.3em; }
+ h3 small { font-weight: normal; font-size: 14px; }
+ .formtbl { margin-top: 1em; }
+ .formtbl th { text-align: right; font-weight: bold; width: 120px; }
+ .formtbl th, .formtbl td { padding: 5px; }
+ input[type="submit"] { font-weight: bold; padding: 0.5em 1em; }
+ acronym { border-bottom: 1px dotted black; cursor: help; }
+ #pledges p { font-size: 12px; border-bottom: 1px solid #e9e9e9; padding: 0 0 0.5em 0; margin: 0 0 0.5em 0; }
+ #pledges p:last-child { border-bottom: none; }
+ #pledges p small { font-size: 9px; }
+ .thankyou {
+ line-height: 1.5;
+ margin: 0 0 1em 0;
+ text-align: center;
+ font-size: 16px;
+ font-weight: bold;
+ padding: 1em;
+ background-color: #DFF0D8;
+ border-color: #D6E9C6;
+ color: #468847;
+ border: 1px solid #FBEED5;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+ }
+ .thankyou big { font-size: 22px; }
+ </style>
+
+ <table id="funtable" width="100%">
+ <tr><td class="lefty">
+
+ {% if request.GET.thanks %}
+ <p class="thankyou"><big>Thank you for signing the pledge!</big><br/> You'll receive an email from us shortly</p>
+ {% endif %}
+
+ <h1>Occupy's Pledge to FIGHT BACK</h1>
+ <h2>We Didn’t Start the Class War</h2>
+ <p>The 1% have exploited their wealth to oppress the world. They’ve wrecked our economy, taken our jobs, taken our homes, and sentenced us to a lifetime of debt and war. We’ve petitioned our governments for change without redress, and fought tirelessly to elect politicians who’ve betrayed their promises. In a world where the 1% have usurped democracy and politicians refuse to serve the people, the people have but one choice—to fight back!</p>
+ <p>Electoral politics have failed. For thirty years there’s been a class war, and just now are the people starting to fight back. Revolution is coming, so it falls on each and every one of us to end injustice and build a better world. We’ve been deceived our whole lives into believing the only way to create change is by voting, but now we’re learning there’s another way. Therefore we will cast the vote of resistance each day by using direct action to fight back and work towards a system that operates in the interest of all people.</p>
+
+ <h3>Will you help us put a stop to this? <small>(Check off all that apply)</small></h3>
+
+ <form action="." method="post">
+ {{ form.non_field_errors }}
+
+ <div class="choices">
+ <p>{{ form.streets }} <label for="id_streets">I pledge to come out in the streets when #occupy calls for days of action.</label></p>
+ <p>{{ form.meet }} <label for="id_meet">I pledge to attend at least one meeting with my local #occupy group.</label><br/> <small><a href="http://occupytogether.org/">Click Here</a> to find one in your area</small></p>
+ <p>{{ form.social }} <label for="id_social">I pledge to help promote #occupy news and actions via social media.</label></p>
+ <p>{{ form.donate }} <label for="id_donate">I pledge to <strong>donate</strong> what I make in one hour to an #occupy related project.</label><br/> <small><a href="/donate/">Click Here</a> for our curated list of places to donate</small></p>
+ <p>{{ form.strike }} <label for="id_strike">I pledge to never go to work during a <a href="http://pink-scare.blogspot.com/2011/10/what-is-general-strike.html">general strike</a>.</label></p>
+ <p>{{ form.organize }} <label for="id_organize">I pledge to help organize my co-workers to make demands. It doesn’t matter if I’m behind a desk, a cash register, or a machine—my coworkers and I deserve better treatment.</label><br/> <small><a href="http://www.iww.org/en/organize">Click Here</a> to learn how</small></p>
+ <p>{{ form.train }} <label for="id_train">I pledge to attend a direct action / civil disobedience training session.</label><br/> <small><a title="Summer Disobedience School" href="http://www.facebook.com/SummerDisobedienceSchool">Click Here</a> for NYC Summer Disobedience School</small></p>
+ <p>{{ form.bank }} <label for="id_bank">I pledge to dump my bank and join a credit union.</label><br/> <small><a href="http://www.mycreditunion.gov/pages/mcu-map.aspx">Click Here</a> to find one in your area</small></p>
+ <p>{{ form.occupy }} <label for="id_occupy">I pledge to start an <a href="http://en.wikipedia.org/wiki/Affinity_group">affinity group</a> to <em>occupy</em> something.</label><br/> <small>Even if you only have five people, it can literally be <em>anything</em>. Like a park, <a href="http://www.takebackthetract.com/">a farm</a>, defending a foreclosed <a href="http://occupyourhomes.org/">home</a>, or holding a sit-in at your town hall or school. Issue demands if you like, and don't go home until they're met. You can even use <a href="http://occupywallst.org/media/pdf/blockadingforbegineers.pdf">blockading tactics</a> to make it extra hard for them to remove you. Occupying is a <em>militant nonviolent</em> direct action tactic to assert force over physical space for either disruption, or reclaiming it for a different purpose. You don't need a permit any more than <acronym title="Martin Luther King Jr.">MLK</acronym> needed permission to hold sit-ins at lunch counters. This is an act of civil disobedience, but that also means you might be risking arrest. How much does <em>change</em> mean to you?</small></p>
+ </div>
+
+ <table class="formtbl" width="100%"><tr>
+ <th><label for="id_name">Your Name</label></th>
+ <td>{{ form.name.errors }} {{ form.name }}</td>
+ </tr><tr>
+ <th></th>
+ <td>{{ form.is_public }} <label for="id_is_public">Allow others to see my name and what I pledged</label></td>
+ </tr><tr>
+ <th><label for="id_email">Email</label></th>
+ <td>{{ form.email.errors }} {{ form.email }}</td>
+ </tr><tr>
+ <th style="font-weight:normal"><label for="id_zipcode">Zip Code</label></th>
+ <td>{{ form.zipcode.errors }} {{ form.zipcode }}</td>
+ </tr><tr>
+ <th></th>
+ <td><input type="submit" value="Sign the Pledge"/></td>
+ </tr></table>
+ </form>
+
+ </td><td width="320" class="righty">
+
+ <img src="http://i.imgur.com/UVMC9m.jpg" width="320" height="212"/>
+ <h3>{{ count }} people have signed the pledge</h3>
+ <div id="pledges">
+ {% for signature in signatures %}
+ <p><strong>{{ signature.name }}</strong> pledged to {{ signature.describe_pledges }} <small>({{ signature.created|timesince_short }} ago)</small></p>
+ {% endfor %}
+ </div>
+
+ </td></tr></table>
+{% endblock content %}
View
10 occupywallst/templates/occupywallst/fightback_success.html
@@ -0,0 +1,10 @@
+{% extends base %}
+{% load ows i18n l10n %}
+{% block title %}Pledge to Fight Back{% endblock title %}
+{% block description %}We didn't start the class war{% endblock description %}
+
+{% block content %}
+ <h1>Occupy's Pledge to FIGHT BACK</h1>
+ <p><strong>Thank you</strong> {{ pledge.name }}, for promising to help us fight for change.</p>
+ <p><a href="/fightback/">Click Here</a> to go back to the pledge page</p>
+{% endblock content %}
View
1 occupywallst/urls.py
@@ -23,6 +23,7 @@
url(r'^(?P<prefix>archive/)((?P<month>[A-Za-z]{3,})-((?P<day>[1-3]?\d)-)?(?P<year>\d{4})/)?(page-(?P<page>\d+)/)?$', 'occupywallst.views.archive', {'is_forum': False, 'per_page': 10}),
url(r'^(?P<prefix>forum/archive/)((?P<month>[A-Za-z]{3,})-((?P<day>[1-3]?\d)-)?(?P<year>\d{4})/)?(page-(?P<page>\d+)/)?$', 'occupywallst.views.archive', {'is_forum': True, 'per_page': 50}),
url(r'^article/(?P<slug>[-_\d\w]+)/$', 'occupywallst.views.article', name='article'),
+ url(r'^fightback/$', 'occupywallst.views.fightback', name='fightback'),
url(r'^forum/$', 'occupywallst.views.forum', name='forum'),
url(r'^forum/search/$', 'occupywallst.views.forum_search', name='forum-search'),
url(r'^forum/comments/$', 'occupywallst.views.forum_comments', name='forum-comments'),
View
20 occupywallst/views.py
@@ -512,3 +512,23 @@ def confirm(request, token):
'occupywallst/subscribe_success.html', {"email": lc.email,
"mlist": lc.mlist},
context_instance=RequestContext(request))
+
+
+def fightback(request):
+ """Occupy's Pledge to FIGHT BACK"""
+ count = db.Pledge.objects.count()
+ signatures = (db.Pledge.objects
+ .filter(is_public=True)
+ .order_by('-created'))[:15]
+ if request.method == 'POST':
+ form = forms.PledgeForm(request.POST)
+ if form.is_valid():
+ pledge = form.save()
+ return HttpResponseRedirect('./?thanks=1')
+ else:
+ form = forms.PledgeForm()
+ return render_to_response(
+ 'occupywallst/fightback.html', {'form': form,
+ 'count': count,
+ 'signatures': signatures},
+ context_instance=RequestContext(request))
View
6 setup.py
@@ -22,11 +22,11 @@ def read(fname):
author = 'Justine Tunney',
author_email = 'jtunney@lobstertech.com',
license = 'GNU AGPL v3 or later',
- install_requires = ['Django>=1.4', 'python-memcached>=1.40', 'pytz',
+ install_requires = ['Django>=1.4', 'south>=0.7.5', 'pytz',
'markdown', 'twilio', 'django-debug-toolbar',
'recaptcha-client', 'gunicorn', 'django-rosetta',
- 'django-imagekit', 'south', 'Whoosh', 'redis',
- 'redisbayes', 'slimit', 'cssmin'],
+ 'django-imagekit', 'Whoosh', 'redis', 'redisbayes',
+ 'python-memcached>=1.40', 'slimit', 'cssmin'],
packages = find_packages(),
include_package_data = True,
zip_safe = False,

0 comments on commit 1272d1d

Please sign in to comment.
Something went wrong with that request. Please try again.