~benoit.pierre/sloecode/incubation

« back to all changes in this revision

Viewing changes to sloecode/templates/macros/nav.html

  • Committer: Benoît PIERRE
  • Date: 2011-09-22 18:30:08 UTC
  • Revision ID: benoit.pierre@gmail.com-20110922183008-effqtg7e2bq347vl
Add support for public projects.

A public project will automatically be read-only accessible by all users,
without the need to manually add them as observers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
            class='yui3-menuitem-content') }}
32
32
      </li>
33
33
 
34
 
      {% if user_details.projects|length %}
 
34
      {% set projects = h.public_projects() + user_details.projects %}
 
35
      {% if projects|length %}
35
36
      <li>
36
37
        <a class="yui3-menu-label" href="#proj_list">
37
38
          <em>Projects</em>
41
42
          <div class="yui3-menu-content">
42
43
            <ul>
43
44
              {# List of projects that this user is in #}
44
 
              {% for membership in user_details.projects %}
 
45
              {% for project in projects %}
45
46
              <li class="yui3-menuitem">
46
 
                {{ h.link_to(membership.project.name,
 
47
                {{ h.link_to(project.name,
47
48
                        h.url(controller='project',
48
 
                        project_name=membership.project.name),
 
49
                        project_name=project.name),
49
50
                        class='yui3-menuitem-content'
50
51
                ) }}
51
52
              </li>