mango r273 - in branches/django: . mango www



Author: ovitters
Date: Fri Jun 27 22:36:25 2008
New Revision: 273
URL: http://svn.gnome.org/viewvc/mango?rev=273&view=rev

Log:
	* mango/models.py (Foundationmembers.need_to_renew): Don't fail when
	last_renewed_on is false (new foundation members).
	* mango/urls.py: Add URL for new add_foundationmember view.
	* mango/views.py (add_foundationmember): Allow creation of new
	foundation members.
	* www/list_foundationmembers.xsl: Correct link to add_foundationmember
	view.
	* www/new_foundationmember.xsl: Correct link to view.


Modified:
   branches/django/   (props changed)
   branches/django/ChangeLog
   branches/django/mango/models.py
   branches/django/mango/urls.py
   branches/django/mango/views.py
   branches/django/www/list_foundationmembers.xsl
   branches/django/www/new_foundationmember.xsl

Modified: branches/django/mango/models.py
==============================================================================
--- branches/django/mango/models.py	(original)
+++ branches/django/mango/models.py	Fri Jun 27 22:36:25 2008
@@ -67,6 +67,9 @@
 
     @property
     def need_to_renew(self):
+        if self.last_renewed_on is None:
+            return False # New addition
+
         diff = datetime.date.today() - self.last_renewed_on
         return diff.days >= 700
 

Modified: branches/django/mango/urls.py
==============================================================================
--- branches/django/mango/urls.py	(original)
+++ branches/django/mango/urls.py	Fri Jun 27 22:36:25 2008
@@ -17,6 +17,7 @@
     (r'^%smirrors/edit/(?P<pk>\d+)/$' % mango.settings.SITE_ROOT, view.edit_mirror),
     (r'^%smodules/$' % mango.settings.SITE_ROOT, view.list_modules),
     (r'^%sfoundationmembers/$' % mango.settings.SITE_ROOT, view.list_foundationmembers),
+    (r'^%sfoundationmembers/add/$' % mango.settings.SITE_ROOT, view.add_foundationmember),
     (r'^%sfoundationmembers/edit/(?P<pk>\d+)/$' % mango.settings.SITE_ROOT, view.edit_foundationmember),
     # Example:
     # (r'^mango/', include('mango.foo.urls')),

Modified: branches/django/mango/views.py
==============================================================================
--- branches/django/mango/views.py	(original)
+++ branches/django/mango/views.py	Fri Jun 27 22:36:25 2008
@@ -317,6 +317,21 @@
 
     return get_xmlresponse(doc, "update_foundationmember.xsl")
 
+def add_foundationmember(request):
+    doc, pagenode = get_xmldoc('Add Foundation Member', request, 'newfoundationmember')
+
+    f = None
+
+    if request.method == 'POST':
+        f = models.FoundationmembersForm(request.POST)
+        if add_form_errors_to_xml(pagenode, f):
+            member = f.save()
+            return HttpResponseRedirect(u'../edit/%s' % unicode(member.id))
+
+    add_foundationmember_to_xml(pagenode, form=f)
+
+    return get_xmlresponse(doc, "new_foundationmember.xsl")
+
 def list_modules(request):
     doc, pagenode = get_xmldoc('List Modules', request, 'listmodules')
 

Modified: branches/django/www/list_foundationmembers.xsl
==============================================================================
--- branches/django/www/list_foundationmembers.xsl	(original)
+++ branches/django/www/list_foundationmembers.xsl	Fri Jun 27 22:36:25 2008
@@ -41,7 +41,7 @@
       </form>
       </td>
       <td align="center">
-       <a class="button" href="new_foundationmember.php?reload=true">New Member</a>
+      <a class="button" href="add/">New Member</a>
       </td>
       <td align="right">
        <xsl:if test="boolean(foundationmember)">

Modified: branches/django/www/new_foundationmember.xsl
==============================================================================
--- branches/django/www/new_foundationmember.xsl	(original)
+++ branches/django/www/new_foundationmember.xsl	Fri Jun 27 22:36:25 2008
@@ -7,7 +7,7 @@
 
   <xsl:include href="common.xsl" />
 
-  <xsl:variable name="script" select="'new_foundationmember.php'"/>
+  <xsl:variable name="script" select="'.'"/>
 
 <xsl:template match="newfoundationmember">  
 	<xsl:apply-templates select="error"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]