Skip to content

Commit 0e3de35

Browse files
committed
Merged [4213] from suresh.krishnan@ericsson.com:
Making doc writeup available as read-only text to regular users who are not shepherd/AD/Secretariat etc. Adding a link for viewing a writeup to the main datatracker page. - Legacy-Id: 4218 Note: SVN reference [4213] has been migrated to Git commit 19dbc6c
2 parents c39dff8 + 19dbc6c commit 0e3de35

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

ietf/ietfworkflows/templatetags/ietf_streams.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def edit_actions(context, wrapper):
8383

8484
if can_manage_writeup_of_a_document(user, draft):
8585
actions.append(("Change stream writeup", urlreverse('doc_managing_writeup', kwargs=dict(acronym=draft.group.acronym, name=draft.filename))))
86+
else:
87+
actions.append(("View writeup", urlreverse('doc_managing_writeup', kwargs=dict(acronym=draft.group.acronym, name=draft.filename))))
8688

8789
return dict(actions=actions)
8890

ietf/templates/wgchairs/edit_management_writeup.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{% extends "wginfo/wg_base.html" %}
22
{% load ietf_filters wgchairs_tags %}
33

4-
{% block title %}Change protocol write-up for {{ doc }}{% endblock %}
4+
{% block title %} {% if can_edit %} Change {% else %} View {% endif %} protocol write-up for {{ doc }}{% endblock %}
55

66
{% block wg_content %}
77

88
<p>
99
<a href="{% url manage_shepherds wg.group_acronym.acronym %}">Return to shepherd list</a>
1010
</p>
1111

12-
<h1>Change protocol write-up for {{ doc }}</h1>
12+
<h1> {% if can_edit %} Change {% else %} View {% endif %} protocol write-up for {{ doc }}</h1>
1313

1414
<table class="ietf-table" style="width: 100%;">
1515
<tr><th>Draft state</th><th>Actual protocol write-up</th><th>Last updated</th></tr>
@@ -50,6 +50,7 @@ <h1>Change protocol write-up for {{ doc }}</h1>
5050
</form>
5151
</td></tr></table>
5252
{% else %}
53+
{% if authorized_user %}
5354
<table class="ietf-table" style="width: 100%;">
5455
<tr><th>Edit protocol write-up</th></tr>
5556
<tr><td>
@@ -62,4 +63,5 @@ <h1>Change protocol write-up for {{ doc }}</h1>
6263
</td></tr>
6364
</table>
6465
{% endif %}
66+
{% endif %}
6567
{% endblock %}

ietf/wgchairs/views.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ def managing_writeup(request, acronym, name):
251251
wg = get_object_or_404(IETFWG, group_acronym__acronym=acronym, group_type=1)
252252
user = request.user
253253
doc = get_object_or_404(InternetDraft, filename=name)
254-
if not can_manage_writeup_of_a_document(user, doc):
255-
return HttpResponseForbidden('You do not have permission to access this page')
254+
authorized_user = can_manage_writeup_of_a_document_no_state(user, doc)
256255
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
257256
from ietf.doc.models import State
258257
state = doc.get_state("draft-stream-%s" % doc.stream_id)
@@ -293,6 +292,7 @@ def managing_writeup(request, acronym, name):
293292
form=form,
294293
writeup=writeup,
295294
can_edit=can_edit,
295+
authorized_user=authorized_user,
296296
),
297297
context_instance=RequestContext(request))
298298
elif valid and not error:
@@ -312,5 +312,6 @@ def managing_writeup(request, acronym, name):
312312
writeup=writeup,
313313
followup=followup,
314314
can_edit=can_edit,
315+
authorized_user=authorized_user,
315316
),
316317
context_instance=RequestContext(request))

0 commit comments

Comments
 (0)