Merge lp:~salgado/offspring/acl-sidebar into lp:~linaro-automation/offspring/linaro

Proposed by Guilherme Salgado
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 80
Merge reported by: Guilherme Salgado
Merged at revision: not available
Proposed branch: lp:~salgado/offspring/acl-sidebar
Merge into: lp:~linaro-automation/offspring/linaro
Prerequisite: lp:~salgado/offspring/acl-editor
Diff against target: 96 lines (+48/-1)
3 files modified
lib/offspring/web/queuemanager/views.py (+2/-0)
lib/offspring/web/templates/base.html (+7/-1)
lib/offspring/web/templates/queuemanager/project_details.html (+39/-0)
To merge this branch: bzr merge lp:~salgado/offspring/acl-sidebar
Reviewer Review Type Date Requested Status
James Tunnicliffe (community) Approve
Review via email: mp+78885@code.launchpad.net

Description of the change

Show a padlock on the heading of private project/build pages and also list the users who are allowed to see a given project, followed by a link to edit that list.

To post a comment you must log in.
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

I haven't tested it, but it looks fine. Not sure if we need the "you can't see this page, but these people can" bit, but I think it should be left in while we get things running and demo it for the users. If they want to take it out, it should be simple enough.

review: Approve
Revision history for this message
Guilherme Salgado (salgado) wrote :

On Wed, 2011-10-12 at 15:34 +0000, James Tunnicliffe wrote:
> Review: Approve
>
> I haven't tested it, but it looks fine. Not sure if we need the "you can't see this page, but these people can" bit, but I think it should be left in while we get things running and demo it for the users. If they want to take it out, it should be simple enough.

Oh, but that's not shown if you don't have the rights to see the
project. If you don't have the rights all you get is HTTP 404 (one of my
previous branches do that) as if the project didn't exist.

Revision history for this message
Guilherme Salgado (salgado) wrote :

In fact this was merged into our integration branch (lp:~linaro-infrastructure/offspring/private-builds)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'lib/offspring/web/media/images/padlock.png'
2Binary files lib/offspring/web/media/images/padlock.png 1970-01-01 00:00:00 +0000 and lib/offspring/web/media/images/padlock.png 2011-10-10 20:45:29 +0000 differ
3=== modified file 'lib/offspring/web/queuemanager/views.py'
4--- lib/offspring/web/queuemanager/views.py 2011-10-10 20:45:29 +0000
5+++ lib/offspring/web/queuemanager/views.py 2011-10-10 20:45:29 +0000
6@@ -146,6 +146,7 @@
7 'upcoming_milestones' : LaunchpadProjectMilestone.upcoming_milestones(),
8 'recent_milestones' : LaunchpadProjectMilestone.recent_milestones(),
9 'project' : b.project,
10+ 'is_private': b.is_private,
11 'build' : b
12 }
13 return render_to_response(
14@@ -253,6 +254,7 @@
15 'include_sources_list': config.web('archive_uri', None) is not None,
16 'pillar' : 'projects',
17 'project' : p,
18+ 'is_private': p.is_private,
19 'project_build_results' : project_build_results,
20 'releases_url': releases_url,
21 }
22
23=== modified file 'lib/offspring/web/templates/base.html'
24--- lib/offspring/web/templates/base.html 2011-08-13 06:30:36 +0000
25+++ lib/offspring/web/templates/base.html 2011-10-10 20:45:29 +0000
26@@ -56,7 +56,13 @@
27 <div id="content">
28 <div class="post greenbox">
29 <div class="page_title">
30- <h1>{% block title %}{% endblock %}</h1>
31+ <h1>{% block title %}{% endblock %}
32+ {% if is_private %}
33+ <img style="float: right"
34+ src="/assets/images/padlock.png"
35+ title="The information on this page is private" />
36+ {% endif %}
37+ </h1>
38 </div>
39 <div class="entry" id="entry" style="padding-bottom: 0px">{% block content %}{% endblock %}</div>
40 <div class="btm" id="btm">
41
42=== modified file 'lib/offspring/web/templates/queuemanager/project_details.html'
43--- lib/offspring/web/templates/queuemanager/project_details.html 2011-02-17 09:03:04 +0000
44+++ lib/offspring/web/templates/queuemanager/project_details.html 2011-10-10 20:45:29 +0000
45@@ -426,6 +426,11 @@
46 </dl>
47
48 <dl>
49+ <dt>Owner:</dt>
50+ <dd>{{project.owner.get_full_name}}</dd>
51+</dl>
52+
53+<dl>
54 <dt>Group:</dt>
55 <dd>{%if project.project_group%} <a href="{{ project.project_group.get_absolute_url }}">{{project.project_group.title}}</a>{%else%}None{%endif%}</dd>
56 </dl>
57@@ -465,6 +470,40 @@
58 <dd>{{ project.config_url }}</a></dd>
59 </dl>
60
61+{% if project.is_private %}
62+ <dl style="width: 96%;" >
63+ {% if project.access_groups.all.count %}
64+ <dt>This project is visible only to its owner and the following
65+ users:</dt>
66+ <dd>
67+ <ul>
68+ {% for user in project.access_groups.all.0.members.all %}
69+ <li>
70+ {% if user.get_full_name %}
71+ {{ user.get_full_name }}
72+ {% else %}
73+ {{ user.username }}
74+ {% endif %}
75+ ({{ user.email }})
76+ </li>
77+ {% endfor %}
78+ </ul>
79+ <p>
80+ <a href="{% url offspring.web.queuemanager.views.project_acl project.name %}"
81+ >Allow more users to see this project</a>
82+ </p>
83+ </dd>
84+ {% else %}
85+ <dt>This project is visible only to its owner.</dt>
86+ <dd>
87+ <p>
88+ <a href="{% url offspring.web.queuemanager.views.project_acl project.name %}"
89+ >Allow more users to see this project</a>
90+ </p>
91+ {% endif %}
92+ </dl>
93+{% endif %}
94+
95 <div style="clear: both;"></div>
96 </div>
97

Subscribers

People subscribed via source and target branches