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. a


From: Sylvain Beucler
Subject: [Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. abdb1145a454ad1ae41c9f6391b9bec1778d4a1e
Date: Sun, 25 Jul 2010 08:00:33 +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  abdb1145a454ad1ae41c9f6391b9bec1778d4a1e (commit)
      from  49a071857c2e36449643a3683cf6d019a921bce3 (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=abdb1145a454ad1ae41c9f6391b9bec1778d4a1e

commit abdb1145a454ad1ae41c9f6391b9bec1778d4a1e
Author: Sylvain Beucler <address@hidden>
Date:   Sun Jul 25 09:59:57 2010 +0200

    Rework title/icon template infrastructure

diff --git a/savane/svmain/models.py b/savane/svmain/models.py
index 66531c4..cf41348 100644
--- a/savane/svmain/models.py
+++ b/savane/svmain/models.py
@@ -480,6 +480,12 @@ class SvGroupInfo(models.Model):
     #patch_private_exclude_address text
     #cookbook_private_exclude_address text
 
+    def full_name_display(self):
+        if self.full_name != "":
+            return self.full_name
+        else:
+            return self.group.name
+
     @staticmethod
     def query_active_groups_raw(conn, fields):
         """
diff --git a/savane/svmain/templatetags/svpagemenu.py 
b/savane/svmain/templatetags/svtopmenu.py
similarity index 87%
rename from savane/svmain/templatetags/svpagemenu.py
rename to savane/svmain/templatetags/svtopmenu.py
index d859202..460d8b6 100644
--- a/savane/svmain/templatetags/svpagemenu.py
+++ b/savane/svmain/templatetags/svtopmenu.py
@@ -23,11 +23,15 @@ from django.conf import settings
 
 register = template.Library()
 
address@hidden('svmain/svpagemenu.html', takes_context=True)
-def svpagemenu(context, menu_name):
address@hidden('svmain/svtopmenu.html', takes_context=True)
+def svtopmenu(context, menu_name):
     """
     Return info to build the top menu, including menu structure and
     page icon.
+
+    TODO: use context['request'].PATH_INFO to determine if a link is
+    the current URL, and mark it so we can apply a different CSS style
+    on it.
     """
     icon = 'main'
     entries = []
@@ -59,12 +63,7 @@ def svpagemenu(context, menu_name):
         pass
 
     context = {
-        'title' : context['title'],
         'menu_name' : menu_name,
         'entries' : entries,
-        'icon' : icon,
-        # STATIC_MEDIA_URL is not available in inclusion tags, because
-        # RequestContext is not used; let's work around that lack:
-        'STATIC_MEDIA_URL' : settings.STATIC_MEDIA_URL,
         }
     return context
diff --git a/savane/svmain/urls.py b/savane/svmain/urls.py
index 593a620..0d62b8a 100644
--- a/savane/svmain/urls.py
+++ b/savane/svmain/urls.py
@@ -83,8 +83,11 @@ urlpatterns += patterns ('',
   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,
-      { 'extra_context' : { 'title' : 'Project administration' }, },
+      { 'extra_context' : { 'title' : 'Administration Summary' }, },
       name='savane.svmain.group_admin'),
+  url(r'^p/(?P<slug>[-\w]+)/admin/members/$', views.group_admin_members,
+      { 'extra_context' : { 'title' : 'Administration Summary: Manage Members' 
}, },
+      name='savane.svmain.group_admin_members'),
 
   url(r'^license/$', 'django.views.generic.list_detail.object_list',
       { 'queryset' : svmain_models.License.objects.all(),
diff --git a/savane/svmain/views.py b/savane/svmain/views.py
index efa2650..aa5233c 100644
--- a/savane/svmain/views.py
+++ b/savane/svmain/views.py
@@ -51,3 +51,15 @@ def group_admin(request, slug, extra_context={}):
         }
     context.update(extra_context)
     return context
+
address@hidden('svmain/group_admin_members.html', mimetype=None)
+def group_admin_members(request, slug, extra_context={}):
+    group = get_object_or_404(auth_models.Group, name=slug)
+    members = group.user_set.all()
+
+    context = {
+        'group' : group,
+        'members' : members,
+        }
+    context.update(extra_context)
+    return context
diff --git a/static_media/savane/css/Savannah.css 
b/static_media/savane/css/Savannah.css
index 6400580..cfacb57 100644
--- a/static_media/savane/css/Savannah.css
+++ b/static_media/savane/css/Savannah.css
@@ -903,6 +903,7 @@ a:active { color: #ff0000; }
 /* <h1> Page title */
 h1 {
        text-indent: 0.3em;
+       font-size: 1.5em;
 }
 /* <h3> Section title */
 h3 {
diff --git a/templates/base.html b/templates/base.html
index 886a609..a5c3085 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -36,16 +36,18 @@
       </ul>
 
       <div class="main"><a name="top"></a>
-       {% block pagemenu %}
-       <h1><img 
src="{{STATIC_MEDIA_URL}}savane/images/common/contexts1/main.orig.png"
+       {% block top %}{% comment %} top's purpose is to be emptied in 
index.html {% endcomment %}
+       <h1><img src="{{STATIC_MEDIA_URL}}savane/images/common/contexts1/{% 
block icon %}main{% endblock %}.orig.png"
                 width="48" height="48" alt="" class="pageicon" />{% include 
"title.html" %}</h1>
+       {% block topmenu %}{% comment %} topmenu is usually overriden with a 
block containing a call to "{% svtopmenu ... %}" {% endcomment %}
        <div class="topmenu" id="topmenu"></div>
        {% endblock %}
+       {% endblock %}
 
         <div class="content">
-        {% if messages %}
-        <ul class="messagelist">{% for message in messages %}<li>{{ message 
}}</li>{% endfor %}</ul>
-        {% endif %}
+          {% if messages %}
+          <ul class="messagelist">{% for message in messages %}<li>{{ message 
}}</li>{% endfor %}</ul>
+          {% endif %}
 
           {% block content %}
           {% endblock %}
diff --git a/templates/index.html b/templates/index.html
index d4072b4..26c146d 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,6 +1,6 @@
 {%  extends "base.html" %}
 
-{% block pagemenu %}{% endblock %}
+{% block top %}{% endblock %}
 
 {% block content %}
 <div class="intro">
diff --git a/templates/svmain/group_admin.html 
b/templates/svmain/group_admin.html
index 71be791..7a42a6a 100644
--- a/templates/svmain/group_admin.html
+++ b/templates/svmain/group_admin.html
@@ -1,16 +1,18 @@
 {% extends "base.html" %}
 {% load i18n %}
-{% load svpagemenu %}
+{% load svtopmenu %}
 
-{% block pagemenu %}
-  {% svpagemenu "group" %}
+{% block title %}
+{{group.svgroupinfo.full_name_display}} - {{title}}
 {% endblock %}
 
-{% block content %}
+{% block icon %}preferences{% endblock %}
+
+{% block topmenu %}
+  {% svtopmenu "group" %}
+{% endblock %}
 
-<p>
-Project: {{group.name}}<br />
-</p>
+{% block content %}
 
 <ul>
 <li><a href="members/">Manage members</a></li>
diff --git a/templates/svmain/group_admin.html 
b/templates/svmain/group_admin_members.html
similarity index 52%
copy from templates/svmain/group_admin.html
copy to templates/svmain/group_admin_members.html
index 71be791..66980fe 100644
--- a/templates/svmain/group_admin.html
+++ b/templates/svmain/group_admin_members.html
@@ -1,20 +1,19 @@
 {% extends "base.html" %}
 {% load i18n %}
-{% load svpagemenu %}
+{% load svtopmenu %}
 
-{% block pagemenu %}
-  {% svpagemenu "group" %}
+{% block title %}
+{{group.svgroupinfo.full_name_display}} - {{title}}
 {% endblock %}
 
-{% block content %}
+{% block icon %}preferences{% endblock %}
+
+{% block topmenu %}
+  {% svtopmenu "group" %}
+{% endblock %}
 
-<p>
-Project: {{group.name}}<br />
-</p>
+{% block content %}
 
-<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 0ed523d..ae90bee 100644
--- a/templates/svmain/group_detail.html
+++ b/templates/svmain/group_detail.html
@@ -1,9 +1,9 @@
 {% extends "base.html" %}
 {% load i18n %}
-{% load svpagemenu %}
+{% load svtopmenu %}
 
-{% block pagemenu %}
-  {% svpagemenu "group" %}
+{% block topmenu %}
+  {% svtopmenu "group" %}
 {% endblock %}
 
 {% block content %}
diff --git a/templates/svmain/svpagemenu.html b/templates/svmain/svtopmenu.html
similarity index 78%
rename from templates/svmain/svpagemenu.html
rename to templates/svmain/svtopmenu.html
index ca429dd..ab75e21 100644
--- a/templates/svmain/svpagemenu.html
+++ b/templates/svmain/svtopmenu.html
@@ -1,6 +1,3 @@
-<h1><img 
src="{{STATIC_MEDIA_URL}}savane/images/common/contexts1/{{icon}}.orig.png"
-        width="48" height="48" alt="" class="pageicon" />{% include 
"title.html" %}</h1>
-
 <ul class="topmenu" id="topmenu">
 {% for l1 in entries %}
   <li class="topmenuitemmainitem">
diff --git a/templates/title.html b/templates/title.html
index 9093d57..4cedf5a 100644
--- a/templates/title.html
+++ b/templates/title.html
@@ -1,3 +1,9 @@
 {% load i18n %}
 
 {% block title %}{% if title %}{{ title }}{% else %}{% trans 'Welcome' %}{% 
endif %}{% endblock %}
+
+{% comment %}
+The title can be defined in either the 'title' context variable, or by
+overriding the 'title' block (useful when relying on 3rd-party views
+that we cannot add context variables to).
+{% endcomment %}

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

Summary of changes:
 savane/svmain/models.py                            |    6 ++++++
 .../templatetags/{svpagemenu.py => svtopmenu.py}   |   13 ++++++-------
 savane/svmain/urls.py                              |    5 ++++-
 savane/svmain/views.py                             |   12 ++++++++++++
 static_media/savane/css/Savannah.css               |    1 +
 templates/base.html                                |   12 +++++++-----
 templates/index.html                               |    2 +-
 templates/svmain/group_admin.html                  |   16 +++++++++-------
 .../{group_admin.html => group_admin_members.html} |   19 +++++++++----------
 templates/svmain/group_detail.html                 |    6 +++---
 .../svmain/{svpagemenu.html => svtopmenu.html}     |    3 ---
 templates/title.html                               |    6 ++++++
 12 files changed, 64 insertions(+), 37 deletions(-)
 rename savane/svmain/templatetags/{svpagemenu.py => svtopmenu.py} (87%)
 copy templates/svmain/{group_admin.html => group_admin_members.html} (52%)
 rename templates/svmain/{svpagemenu.html => svtopmenu.html} (78%)


hooks/post-receive
-- 
Savane-cleanup framework



reply via email to

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