Permalink
Browse files

Merge branch 'release/2.0.6' of github.com:akvo/akvo-rsr into release…

…/2.0.6
  • Loading branch information...
kardan committed May 28, 2012
2 parents 2cfcf1d + ffdc14a commit 82307b8db8b1be3710f70e724f7e3d20d6a88c4f
Showing with 1,763 additions and 1,505 deletions.
  1. +7 −2 akvo/rsr/admin.py
  2. +1 −2 akvo/rsr/forms.py
  3. +35 −10 ...ate_featured.py → 0014_auto__add_field_project_budget__add_field_project_funds__add_field_pro.py}
  4. +345 −0 akvo/rsr/migrations/0015_populate_denorm_project_fields.py
  5. +11 −0 ...ult_language.py → 0016_auto__del_field_projectupdate_featured__add_field_partnersite_default_.py}
  6. +303 −196 akvo/rsr/models.py
  7. +19 −0 akvo/rsr/signals.py
  8. +15 −17 akvo/rsr/templatetags/rsr_tags.py
  9. +4 −0 akvo/rsr/utils.py
  10. +27 −88 akvo/rsr/views.py
  11. +6 −56 akvo/rsr/views_partner_sites/__init__.py
  12. +8 −24 akvo/rsr/views_partner_sites/base.py
  13. +2 −0 akvo/settings/20-default.conf
  14. +1 −1 akvo/templates/admin/rsr/organisation/change_form.html
  15. +4 −6 akvo/templates/inclusion_tags/counter_badge.html
  16. +8 −8 akvo/templates/inclusion_tags/funding_box.html
  17. +9 −9 akvo/templates/inclusion_tags/funding_box_narrow.html
  18. +6 −6 akvo/templates/inclusion_tags/funding_box_narrow2.html
  19. +2 −2 akvo/templates/inclusion_tags/funding_box_wide.html
  20. +7 −7 akvo/templates/inclusion_tags/funding_project.html
  21. +7 −7 akvo/templates/inclusion_tags/funding_table.html
  22. +4 −4 akvo/templates/inclusion_tags/project_budget.html
  23. +5 −5 akvo/templates/partner_sites/home.html
  24. +8 −8 akvo/templates/partner_sites/inclusion_tags/partner_sites_funding_box.html
  25. +10 −14 akvo/templates/partner_sites/partners/partner_main.html
  26. +3 −3 akvo/templates/partner_sites/project/project_funding.html
  27. +1 −1 akvo/templates/partner_sites/project/project_main.html
  28. +1 −1 akvo/templates/partner_sites/project/update_main.html
  29. +1 −9 akvo/templates/partner_sites/widgets/projects_map.html
  30. +4 −6 akvo/templates/rsr/akvo_at_a_glance.html
  31. +2 −2 akvo/templates/rsr/index.html
  32. +263 −265 akvo/templates/rsr/organisation/organisation.html
  33. +30 −33 akvo/templates/rsr/organisation/organisation_directory.html
  34. +1 −19 akvo/templates/rsr/project/project_base.html
  35. +2 −9 akvo/templates/rsr/project/project_comments.html
  36. +6 −6 akvo/templates/rsr/project/project_directory.html
  37. +5 −12 akvo/templates/rsr/project/project_funding.html
  38. +2 −7 akvo/templates/rsr/project/project_main.html
  39. +3 −10 akvo/templates/rsr/project/project_partners.html
  40. +2 −9 akvo/templates/rsr/project/project_update.html
  41. +1 −11 akvo/templates/rsr/project/project_updates.html
  42. +1 −1 akvo/templates/rsr/project/update_form.html
  43. +1 −1 akvo/templates/rsr/sign_in.html
  44. +55 −65 akvo/templates/widgets/base_widget.html
  45. +147 −154 akvo/templates/widgets/cobranded_banner.html
  46. +137 −144 akvo/templates/widgets/cobranded_leader.html
  47. +1 −1 akvo/templates/widgets/cobranded_narrow.html
  48. +1 −1 akvo/templates/widgets/cobranded_short.html
  49. +1 −1 akvo/templates/widgets/feature_side.html
  50. +1 −1 akvo/templates/widgets/project_contribute.html
  51. +145 −153 akvo/templates/widgets/project_list.html
  52. +25 −34 akvo/templates/widgets/project_map.html
  53. +1 −1 akvo/templates/widgets/project_narrow.html
  54. +60 −66 akvo/templates/widgets/project_small.html
  55. +1 −2 akvo/templates/widgets/project_updates.html
  56. +5 −5 akvo/urls/partner_sites.py
View
@@ -451,6 +451,10 @@ class ProjectAdmin(admin.ModelAdmin):
),
'fields': ('currency', 'date_request_posted', 'date_complete', ),
}),
+ (_(u'Aggregates'), {
+ 'description': u'<p style="margin-left:0; padding-left:0; margin-top:1em; width:75%%;">%s</p>' % _('Aggregate financial data'),
+ 'fields': (('funds', 'funds_needed',), ),
+ }),
(_(u'Goals'), {
'description': u'<p style="margin-left:0; padding-left:0; margin-top:1em; width:75%%;">%s</p>' % _(
u'Describe what the project hopes to accomplish. Keep in mind the SMART criteria: '
@@ -463,7 +467,9 @@ class ProjectAdmin(admin.ModelAdmin):
)
list_display = ('id', 'title', 'status', 'project_plan_summary', 'latest_update', 'show_current_image', 'is_published',)
list_filter = ('currency', 'status', )
-# form = ProjectAdminForm
+ readonly_fields = ('budget', 'funds', 'funds_needed',)
+ #form = ProjectAdminForm
+
def get_actions(self, request):
""" Remove delete admin action for "non certified" users"""
actions = super(ProjectAdmin, self).get_actions(request)
@@ -911,7 +917,6 @@ def __init__(self, model, admin_site):
"""
self.formfield_overrides = {ImageWithThumbnailsField: {'widget': widgets.AdminFileWidget},}
super(ProjectUpdateAdmin, self).__init__(model, admin_site)
-
admin.site.register(get_model('rsr', 'projectupdate'), ProjectUpdateAdmin)
View
@@ -238,9 +238,8 @@ class Meta:
def clean(self):
cd = self.cleaned_data
- funding_needed = self.project.funding_still_needed()
if 'amount' in cd:
- if cd['amount'] > funding_needed:
+ if cd['amount'] > self.project.funds_needed:
raise forms.ValidationError(_('You cannot donate more than the project actually needs!'))
if 'email' in cd and 'email2' in cd:
if cd['email'] != cd['email2']:
@@ -1,22 +1,43 @@
-# encoding: utf-8
+# -*- 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):
-
- # Deleting field 'ProjectUpdate.featured'
- db.delete_column('rsr_projectupdate', 'featured')
+ # Adding field 'Project.budget'
+ db.add_column(
+ 'rsr_project', 'budget',
+ self.gf('django.db.models.fields.DecimalField')(default=0, null=True, max_digits=10, decimal_places=2, blank=True),
+ keep_default=False
+ )
+
+ # Adding field 'Project.funds'
+ db.add_column(
+ 'rsr_project', 'funds',
+ self.gf('django.db.models.fields.DecimalField')(default=0, null=True, max_digits=10, decimal_places=2, blank=True),
+ keep_default=False
+ )
+ # Adding field 'Project.funds_needed'
+ db.add_column(
+ 'rsr_project', 'funds_needed',
+ self.gf('django.db.models.fields.DecimalField')(default=0, null=True, max_digits=10, decimal_places=2, blank=True),
+ keep_default=False
+ )
def backwards(self, orm):
-
- # Adding field 'ProjectUpdate.featured'
- db.add_column('rsr_projectupdate', 'featured', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)
+ # Deleting field 'Project.budget'
+ db.delete_column('rsr_project', 'budget')
+
+ # Deleting field 'Project.funds'
+ db.delete_column('rsr_project', 'funds')
+ # Deleting field 'Project.funds_needed'
+ db.delete_column('rsr_project', 'funds_needed')
models = {
'auth.group': {
@@ -61,7 +82,7 @@ def backwards(self, orm):
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'message': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'msg_id': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
- 'name': ('django.db.models.fields.SlugField', [], {'max_length': '30', 'db_index': 'True'}),
+ 'name': ('django.db.models.fields.SlugField', [], {'max_length': '30'}),
'receiver': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'send_path': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'sender': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
@@ -122,7 +143,7 @@ def backwards(self, orm):
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
'link_to': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
- 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'})
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
},
'rsr.goal': {
'Meta': {'object_name': 'Goal'},
@@ -254,13 +275,16 @@ def backwards(self, orm):
'rsr.project': {
'Meta': {'ordering': "['-id']", 'object_name': 'Project'},
'background': ('akvo.rsr.fields.ProjectLimitedTextField', [], {'blank': 'True'}),
+ 'budget': ('django.db.models.fields.DecimalField', [], {'default': '0', 'null': 'True', 'max_digits': '10', 'decimal_places': '2', 'blank': 'True'}),
'categories': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'projects'", 'symmetrical': 'False', 'to': "orm['rsr.Category']"}),
'currency': ('django.db.models.fields.CharField', [], {'default': "'EUR'", 'max_length': '3'}),
'current_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
'current_image_caption': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
'current_status': ('akvo.rsr.fields.ProjectLimitedTextField', [], {'blank': 'True'}),
'date_complete': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'date_request_posted': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ 'funds': ('django.db.models.fields.DecimalField', [], {'default': '0', 'null': 'True', 'max_digits': '10', 'decimal_places': '2', 'blank': 'True'}),
+ 'funds_needed': ('django.db.models.fields.DecimalField', [], {'default': '0', 'null': 'True', 'max_digits': '10', 'decimal_places': '2', 'blank': 'True'}),
'goals_overview': ('akvo.rsr.fields.ProjectLimitedTextField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
@@ -283,6 +307,7 @@ def backwards(self, orm):
},
'rsr.projectupdate': {
'Meta': {'ordering': "['-id']", 'object_name': 'ProjectUpdate'},
+ 'featured': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'photo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
'photo_caption': ('django.db.models.fields.CharField', [], {'max_length': '75', 'blank': 'True'}),
@@ -322,4 +347,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['rsr']
+ complete_apps = ['rsr']
Oops, something went wrong.

0 comments on commit 82307b8

Please sign in to comment.