savannah-cvs
[Top][All Lists]
Advanced

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

[Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. 5


From: Sylvain Beucler
Subject: [Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. 56849b30c1c6c3dfcd935a071e51d0296ff0c70f
Date: Sat, 24 Jul 2010 15:49:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Savane-cleanup framework".

The branch, master has been updated
       via  56849b30c1c6c3dfcd935a071e51d0296ff0c70f (commit)
       via  0137ef64dbcc90e25e425e92dc6a01ffddf00801 (commit)
      from  c4ceff7901173a6cffecebade6b626daeeff6609 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=56849b30c1c6c3dfcd935a071e51d0296ff0c70f

commit 56849b30c1c6c3dfcd935a071e51d0296ff0c70f
Author: Sylvain Beucler <address@hidden>
Date:   Sat Jul 24 17:49:08 2010 +0200

    Simplify {% svpagemenu %} call

diff --git a/savane/svmain/templatetags/svpagemenu.py 
b/savane/svmain/templatetags/svpagemenu.py
index 5c8a3bb..74b8c54 100644
--- a/savane/svmain/templatetags/svpagemenu.py
+++ b/savane/svmain/templatetags/svpagemenu.py
@@ -18,21 +18,26 @@
 
 from django import template
 from django.core.urlresolvers import reverse
+import savane.svmain.models as svmain_models
 
 register = template.Library()
 
 @register.inclusion_tag('svmain/svpagemenu.html', takes_context=True)
-def svpagemenu(context):
-    if context['menu_name'] == 'group':
+def svpagemenu(context, menu_name):
+    if menu_name == 'group':
         entries = []
         entry_home = { 'text' : 'Home',
-                   'href' : reverse('savane.svmain.group_detail', 
args=[context['group']]),
+                   'href' : reverse('savane.svmain.group_detail', 
args=[context['group'].name]),
                    'title': "Project Main Page at %s" % 'this website'}
         entry_home['children'] = []
         entry_home['children'].append({'text' : 1.1, 'href' : 1.1, 'title': 
1.1 })
         if (context['user'].groups.filter(name=context['group']).count()):
             entry_home['children'].append({'separator' : True })
             entry_home['children'].append({'text' : "I'm a member", 'href' : 
1.2, 'title': 1.2 })
+        if (svmain_models.Membership.objects.filter(user=context['user'], 
group=context['group'], admin_flags='A').count()):
+            entry_home['children'].append({'separator' : True })
+            entry_home['children'].append({'text' : "I'm an admin",
+                                           'href' : 
reverse('savane.svmain.group_admin', args=[context['group'].name]) })
 
         entry_test = {
                     'text' : 2, 'href' : 2, 'title': 2, 'children':
@@ -43,12 +48,12 @@ def svpagemenu(context):
         entries.append(entry_home)
         entries.append(entry_test)
         return { 'entries' : entries,
-                 'menu_name': context['menu_name'],
+                 'menu_name': menu_name,
         }
-    elif context['menu_name'] == 'my':
+    elif menu_name == 'my':
         return {
             'entries':
             [
             ],
-            'menu_name': context['menu_name'],
+            'menu_name': menu_name,
         }
diff --git a/savane/svmain/urls.py b/savane/svmain/urls.py
index 1b7c62c..593a620 100644
--- a/savane/svmain/urls.py
+++ b/savane/svmain/urls.py
@@ -76,12 +76,15 @@ urlpatterns += patterns ('',
       { 'queryset' : auth_models.Group.objects.all(),
         'slug_field' : 'name',
         'extra_context' : { 'title' : 'Project summary' },
-        'template_name' : 'svmain/group_detail.html', },
+        'template_name' : 'svmain/group_detail.html',
+        'template_object_name' : 'group', },
       name='savane.svmain.group_detail'),
   url(r'^pr/(?P<slug>[-\w]+)/$', views.group_redir),
   url(r'^projects/(?P<slug>[-\w]+)/$', views.group_redir),
   url(r'^p/(?P<slug>[-\w]+)/join/$', views.group_join),
-  url(r'^p/(?P<slug>[-\w]+)/admin/$', views.group_admin),
+  url(r'^p/(?P<slug>[-\w]+)/admin/$', views.group_admin,
+      { 'extra_context' : { 'title' : 'Project administration' }, },
+      name='savane.svmain.group_admin'),
 
   url(r'^license/$', 'django.views.generic.list_detail.object_list',
       { 'queryset' : svmain_models.License.objects.all(),
diff --git a/templates/svmain/group_admin.html 
b/templates/svmain/group_admin.html
index 521b226..71be791 100644
--- a/templates/svmain/group_admin.html
+++ b/templates/svmain/group_admin.html
@@ -3,18 +3,18 @@
 {% load svpagemenu %}
 
 {% block pagemenu %}
-  {% with "group" as menu_name %}
-  {% svpagemenu %}
-  {% endwith %}
+  {% svpagemenu "group" %}
 {% endblock %}
 
 {% block content %}
 
 <p>
-Group: {{group.name}}<br />
+Project: {{group.name}}<br />
 </p>
 
-<p>Manage members</p>
+<ul>
+<li><a href="members/">Manage members</a></li>
+</ul>
 
 {% endblock %}
 
diff --git a/templates/svmain/group_detail.html 
b/templates/svmain/group_detail.html
index 6b1a8d0..0ed523d 100644
--- a/templates/svmain/group_detail.html
+++ b/templates/svmain/group_detail.html
@@ -1,19 +1,24 @@
 {% extends "base.html" %}
 {% load i18n %}
+{% load svpagemenu %}
+
+{% block pagemenu %}
+  {% svpagemenu "group" %}
+{% endblock %}
 
 {% block content %}
 
 <p>
-Name: {{object.name}}<br />
-License: <a 
href="{{object.svgroupinfo.license.get_absolute_url}}">{{object.svgroupinfo.license.name}}</a><br
 />
-Development status: {{object.svgroupinfo.devel_status}}<br />
+Name: {{group.name}}<br />
+License: <a 
href="{{group.svgroupinfo.license.get_absolute_url}}">{{group.svgroupinfo.license.name}}</a><br
 />
+Development status: {{group.svgroupinfo.devel_status}}<br />
 </p>
 
 <p>Members:</p>
 
-{% if object.user_set.all %}
+{% if group.user_set.all %}
 <ul>
-  {% for user in object.user_set.all %}
+  {% for user in group.user_set.all %}
   <li><a href="{% url savane.svmain.user_detail user.username %}">{{ 
user.username }}</a></li>
   {% endfor %}
   </ul>

http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=0137ef64dbcc90e25e425e92dc6a01ffddf00801

commit 0137ef64dbcc90e25e425e92dc6a01ffddf00801
Author: Sylvain Beucler <address@hidden>
Date:   Sat Jul 24 17:11:32 2010 +0200

    INSTALL doc fixes

diff --git a/INSTALL b/INSTALL
index 6f16c9f..f21893e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -5,14 +5,14 @@
 
   echo 'from settings_default import *' > settings.py
 
-- Modify if necessary, e.g.: DATABASE_PASSWORD='...'
+- Modify if necessary, e.g.: DATABASES = {...}
 
 
 * Directory Description
 
-- 'savane/' directory containts all the python(django) code.
+- 'savane/' directory contains all the python(django) code.
 
-- 'media/' all the css and images
+- 'static_media/' all the css and images
 
 - 'templates/' all the templates that are necessary to run savane
 
@@ -36,9 +36,8 @@ You will need to create the mysql user:
   mysql -e "CREATE DATABASE savane DEFAULT CHARACTER SET utf8;"
   mysql -e "GRANT ALL PRIVILEGES ON savane.* TO 'savane' IDENTIFIED BY 
'yourpass';"
 
-Edit the the file savane/settings.py and edit:
-DATABASE_USER, DATABASE_PASSWORD, DATABASE_HOST to the proper data
-needed to connect to the MySQL database.
+Edit the the file savane/settings.py and edit the DATABASES block with
+the proper credentials for your MySQL database.
 
 Initialize the database::
 
@@ -49,6 +48,7 @@ Initialize the database::
 * Run for testing:
 
 You can test your install using:
+ $ ./manage.py loaddata savane/svmain/fixtures/demo/*.yaml
  $ ./manage.py runserver
 
 

-----------------------------------------------------------------------

Summary of changes:
 INSTALL                                  |   12 ++++++------
 savane/svmain/templatetags/svpagemenu.py |   17 +++++++++++------
 savane/svmain/urls.py                    |    7 +++++--
 templates/svmain/group_admin.html        |   10 +++++-----
 templates/svmain/group_detail.html       |   15 ++++++++++-----
 5 files changed, 37 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
Savane-cleanup framework



reply via email to

[Prev in Thread] Current Thread [Next in Thread]