Skip to content

Commit 81f7330

Browse files
committed
Show various edit buttons only to ADs/secretariat
- Legacy-Id: 1921
1 parent 1242b37 commit 81f7330

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

ietf/templates/idrfc/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
{% block pagehead %}{% endblock %}
4646
<script type="text/javascript">
4747
IETF = {};
48+
IETF.user_groups = { {% for group in user.groups.all %}"{{group}}":true{% if not forloop.last %}, {%endif%}{%endfor%} };
4849
</script>
4950
</head>
5051
<body class="yui-skin-sam" {% block bodyAttrs %}{%endblock%}>

ietf/templates/idrfc/doc_main.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ <h1 style="margin-top:0;">{% block doc_h1 %}{% endblock %}</h1>
103103
<div id="ballot">
104104
<div id="ballot_content">
105105
{% if ballot %}
106+
{% if user|in_group:"Area_Director,Secretariat" %}
106107
<div style="position:absolute;right:0px;">
107108
<span id="doc_ballot_button" class="yui-button yui-link-button"><span class="first-child">
108109
<a href="https://datatracker.ietf.org/cgi-bin/idtracker.cgi?command=open_ballot&amp;id_document_tag={% if info.is_rfc %}{{doc.rfc_number}}{% else %}{{doc.tracker_id}}{% endif %}">Edit position</a>
109-
</span></span>
110-
</div>
110+
</span></span></div>
111+
{% endif %}{# user in_group #}
111112
{% include "idrfc/doc_ballot.html" %}
112113
{% endif %}
113114
</div>
@@ -116,10 +117,12 @@ <h1 style="margin-top:0;">{% block doc_h1 %}{% endblock %}</h1>
116117
<div id="writeup">
117118
<div id="writeup_content">
118119
{% if doc.in_ietf_process and doc.ietf_process.has_iesg_ballot %}
120+
{% if user|in_group:"Area_Director,Secretariat" %}
119121
<div style="position:absolute;right:0px;">
120122
<span id="doc_writeup_edit_button" class="yui-button yui-link-button"><span class="first-child">
121123
<a href="https://datatracker.ietf.org/cgi-bin/idtracker.cgi?command=ballot_writeup&amp;ballot_id={{doc.ietf_process.iesg_ballot.ballot_id}}">Edit writeups</a>
122124
</span></span></div>
125+
{% endif %}{# user in_group #}
123126
---- following is a DRAFT of message to be sent AFTER approval ---
124127
<pre>
125128
{{ doc.ietf_process.iesg_ballot.approval_text|escape|urlize }}

ietf/templates/idrfc/doc_main_id.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@
7272
<span class="mybutton"><a href="http://www.fenron.net/~fenner/ietf/deps/index.cgi?dep={{doc.draft_name}}" rel="nofollow" target="_blank">Dependencies to this draft</a></span> &nbsp;
7373
<span class="mybutton"><a href="https://datatracker.ietf.org/ipr/search/?option=document_search&amp;id_document_tag={{doc.tracker_id}}" rel="nofollow" target="_blank">IPR Disclosures</a></span> &nbsp;
7474
<span class="mybutton"><a href="http://tools.ietf.org/idnits?url=http://tools.ietf.org/id/{{doc.draft_name_and_revision}}.txt" rel="nofollow" target="_blank">Check nits</a></span> &nbsp;
75+
{% if user|in_group:"Area_Director,Secretariat" %}
7576
{% if doc.in_ietf_process %}
7677
<span class="mybutton"><a href="https://datatracker.ietf.org/cgi-bin/idtracker.cgi?command=view_id&amp;dTag={{doc.tracker_id}}" rel="nofollow" target="_blank">Edit state (IESG Tracker)</a></span>
7778
{% else %}
7879
<span class="mybutton"><a href="https://datatracker.ietf.org/cgi-bin/idtracker.cgi?command=add_id_confirm&amp;dTag={{doc.tracker_id}}&amp;rfc_flag=0&amp;ballot_id=0" rel="nofollow" target="_blank">Add to IESG Tracker</a></span>
7980
{% endif %}
81+
{% endif %}{# if user in group #}
8082
</div> <!-- tools div -->
8183
{% endblock %}{# doc_meta #}
8284

static/js/base.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ function showBallot(draftName, trackerId) {
4848
document.getElementById("db-extras").appendChild(el);
4949

5050
var buttons = [{text:"Close", handler:handleClose, isDefault:true}];
51-
buttons.unshift({text:"Edit Position", handler:handleEditPosition});
51+
if (("Area_Director" in IETF.user_groups) ||
52+
("Secretariat" in IETF.user_groups)) {
53+
buttons.unshift({text:"Edit Position", handler:handleEditPosition});
54+
}
5255
var kl = [new YAHOO.util.KeyListener(document, {keys:27}, handleClose)]
5356
IETF.ballotDialog = new YAHOO.widget.Dialog("doc_ballot_dialog", {
5457
visible:false, draggable:false, close:true, modal:true,

0 commit comments

Comments
 (0)