Skip to content

Commit 82ce984

Browse files
committed
update tmplates
1 parent ffc190b commit 82ce984

8 files changed

Lines changed: 28 additions & 16 deletions

File tree

‎apps/agreements/templates/agreements/_actions.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
{% include "agreements/_record.html" %}
1818

19-
{% if is_staff and agreement.status == "executed" %}
19+
{% if is_administrator and agreement.status == "executed" %}
2020
<form method="post" action="{% url 'agreements:resend_executed_copy' agreement.pk %}" class="sign-form">
2121
{% csrf_token %}
2222
{% if next %}<input type="hidden" name="next" value="{{ next }}">{% endif %}
@@ -117,7 +117,7 @@ <h2 id="offline-title">{% if sign_form %}Or sign outside python.org{% else %}Sig
117117
</section>
118118
{% endif %}
119119

120-
{% if is_staff and agreement.status == "offered" %}
120+
{% if is_administrator and agreement.status == "offered" %}
121121
<section class="staff-panel" aria-labelledby="staff-title">
122122
<h2 id="staff-title">PSF staff</h2>
123123
<p class="actions">

‎apps/agreements/templates/agreements/base.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends "base.html" %}
2-
{% load static sitetree %}
2+
{% load static sitetree agreements %}
33

44
{% block page_title %}{% block title %}Agreements{% endblock %} | Python Software Foundation{% endblock %}
55
{% block og_title %}PSF Agreements{% endblock %}
@@ -28,7 +28,7 @@
2828
{% block left_sidebar %}
2929
<aside class="left-sidebar">
3030
{% block sidebar %}{% endblock %}
31-
{% if perms.agreements.manage_agreement %}
31+
{% if user|can_prepare_agreements %}
3232
<div class="section-navigation sidebar-widget">
3333
<ul class="section-nav menu" role="menu">
3434
<li class="{% if nav == 'queue' %}current_item selected{% endif %}" role="menuitem"><a href="{% url 'agreements:queue' %}">Agreements</a></li>

‎apps/agreements/templates/agreements/custom_detail.html‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ <h1 class="page-title">{{ contract.title }}</h1>
1919

2020
<div class="agreement-scroll" tabindex="0" aria-label="Preview"><div class="agreement-text">{{ html|safe }}</div></div>
2121

22+
{% if user|is_agreements_administrator %}
2223
<p>Making it ready to sign fixes this text as revision 1. You can then send a signing link, record a signed copy, or {% if contract.counterparty_account %}let {{ contract.counterparty_account.email }} sign on python.org{% else %}name an account that signs online{% endif %}, and still edit it until it is signed.</p>
24+
{% endif %}
2325
<div class="actions">
26+
{% if user|is_agreements_administrator %}
2427
<form method="post" action="{% url 'agreements:custom_offer' contract.pk %}">
2528
{% csrf_token %}
2629
<button type="submit">Make ready to sign</button>
2730
</form>
31+
{% endif %}
2832
<form method="post" action="{% url 'agreements:custom_delete' contract.pk %}" class="discard-form">
2933
{% csrf_token %}
3034
<button type="submit">Discard draft</button>

‎apps/agreements/templates/agreements/detail.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block title %}{{ agreement.title }}: {{ agreement.counterparty_name }}{% endblock %}
44

55
{% block crumbs %}
6-
{% if is_staff %}<li><a href="{% url 'agreements:queue' %}">Agreements</a><span class="prompt">&gt;&gt;&gt;</span></li>{% endif %}
6+
{% if can_prepare %}<li><a href="{% url 'agreements:queue' %}">Agreements</a><span class="prompt">&gt;&gt;&gt;</span></li>{% endif %}
77
<li>{{ agreement.counterparty_name }}</li>
88
{% endblock %}
99

‎apps/agreements/templates/agreements/orders/base.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends "agreements/base.html" %}
2-
{% load static %}
2+
{% load static agreements %}
33

44
{% block title %}Service orders{% endblock %}
55
{% block body_attributes %}class="psf agreements agreement-orders"{% endblock %}
@@ -13,7 +13,7 @@
1313
<li class="{% if nav == 'programs' %}current_item selected{% endif %}"><a href="{% url 'agreements:program_list' %}">Programs</a></li>
1414
{% if user.is_authenticated %}
1515
<li class="{% if nav == 'orders' %}current_item selected{% endif %}"><a href="{% url 'agreements:order_list' %}">Your orders</a></li>
16-
{% if perms.agreements.manage_agreement %}
16+
{% if user|can_prepare_agreements %}
1717
<li class="{% if nav == 'staff' %}current_item selected{% endif %}"><a href="{% url 'agreements:staff_orders' %}">All orders</a></li>
1818
<li><a href="{% url 'agreements:queue' %}">Agreements to countersign</a></li>
1919
{% endif %}

‎apps/agreements/templates/agreements/orders/order_detail.html‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<header class="article-header">
1818
<h1 class="page-title">{{ order.legal_name }}</h1>
1919
</header>
20-
<p class="order-meta">{% status_badge order.status %} {{ order.program_title }} order · Reference <code>{{ order.reference }}</code>{% if order.agreement and order.agreement.revision > 1 %} · Order Form revision {{ order.agreement.revision }}{% endif %}{% if is_staff and order.agreement %} · <a href="{{ order.agreement.get_absolute_url }}">Agreement record</a>{% endif %}</p>
20+
<p class="order-meta">{% status_badge order.status %} {{ order.program_title }} order · Reference <code>{{ order.reference }}</code>{% if order.agreement and order.agreement.revision > 1 %} · Order Form revision {{ order.agreement.revision }}{% endif %}{% if can_prepare and order.agreement %} · <a href="{{ order.agreement.get_absolute_url }}">Agreement record</a>{% endif %}</p>
2121

2222
{% if configuration_error %}
2323
<div class="user-feedback level-error"><p>{{ configuration_error }}</p></div>
@@ -108,22 +108,24 @@ <h2 id="sign-title">Sign on python.org</h2>
108108
</section>
109109
{% endif %}
110110

111-
{% if can_edit %}
111+
{% if can_offer %}
112112
<section class="offline-signing" aria-labelledby="ready-title">
113113
<h2 id="ready-title">{% if draft_sign_form %}Or sign some other way{% else %}Prepare for signature{% endif %}</h2>
114-
<p>Making the Order Form ready to sign fixes its text. Then {% if is_staff %}the PSF can edit it for this customer, email a one-time signing link to anyone, or record a copy signed through DocuSign or on paper{% else %}you can download it to sign through DocuSign, your procurement system, or on paper, and upload the signed copy{% endif %}. It can be withdrawn and changed until it is signed.</p>
114+
<p>Making the Order Form ready to sign fixes its text. Then {% if is_administrator %}the PSF can edit it for this customer, email a one-time signing link to anyone, or record a copy signed through DocuSign or on paper{% else %}you can download it to sign through DocuSign, your procurement system, or on paper, and upload the signed copy{% endif %}. It can be withdrawn and changed until it is signed.</p>
115115
<div class="actions">
116116
<form method="post" action="{% url 'agreements:order_offer' order.pk %}">
117117
{% csrf_token %}
118118
<button type="submit">Make ready to sign</button>
119119
</form>
120-
<form method="post" action="{% url 'agreements:order_delete' order.pk %}" class="discard-form">
121-
{% csrf_token %}
122-
<button type="submit">Discard draft</button>
123-
</form>
124120
</div>
125121
</section>
126122
{% endif %}
123+
{% if can_edit %}
124+
<form method="post" action="{% url 'agreements:order_delete' order.pk %}" class="discard-form">
125+
{% csrf_token %}
126+
<button type="submit">Discard draft</button>
127+
</form>
128+
{% endif %}
127129
{% endif %}
128130
{% endif %}
129131
</article>

‎apps/agreements/templates/agreements/terms_edit.html‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends "agreements/base.html" %}
2+
{% load agreements %}
23
{% block title %}Edit: {{ terms.title }}{% endblock %}
34
{% block crumbs %}
45
<li><a href="{% url 'agreements:terms_list' %}">Terms</a><span class="prompt">&gt;&gt;&gt;</span></li>
@@ -16,15 +17,18 @@ <h1 class="page-title">Edit {{ terms.title }}</h1>
1617
{% csrf_token %}
1718
{{ form.non_field_errors }}
1819
{% include "agreements/_field.html" with field=form.markdown %}
20+
{% if user|is_agreements_administrator %}
1921
<label class="choice">{{ form.under_review }} <span>{{ form.under_review.label }}: show a notice wherever these terms appear.</span></label>
2022
<label class="choice">{{ form.is_public }} <span>{{ form.is_public.label }}. {{ form.is_public.help_text }}</span></label>
23+
{% endif %}
2124

2225
<p class="form-actions">
2326
<button type="submit" name="action" value="save" class="secondaryAction">Save draft</button>
2427
<button type="submit" name="preview" value="1" class="secondaryAction">Preview</button>
2528
<a href="{% url 'agreements:terms_list' %}">Cancel</a>
2629
</p>
2730

31+
{% if user|is_agreements_administrator %}
2832
<fieldset class="staff-panel">
2933
<legend>Publish as a new version</legend>
3034
<div class="field-row">
@@ -33,6 +37,7 @@ <h1 class="page-title">Edit {{ terms.title }}</h1>
3337
{% include "agreements/_field.html" with field=form.notes %}
3438
<button type="submit" name="action" value="publish">Publish</button>
3539
</fieldset>
40+
{% endif %}
3641
</form>
3742

3843
{% if preview %}

‎apps/agreements/templates/agreements/terms_list.html‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends "agreements/base.html" %}
2+
{% load agreements %}
23
{% block title %}Terms{% endblock %}
34
{% block crumbs %}<li><a href="{% url 'agreements:queue' %}">Agreements</a><span class="prompt">&gt;&gt;&gt;</span></li><li>Terms</li>{% endblock %}
45

@@ -23,10 +24,10 @@ <h1 class="page-title">Terms</h1>
2324
</tbody>
2425
</table>
2526
</div>
26-
{% if user.is_staff and perms.agreements.manage_agreement %}
27+
{% if user.is_staff and user|is_agreements_administrator %}
2728
<p class="help"><a href="{% url 'admin:agreements_terms_add' %}">Add a new set of terms in the admin</a>, then write and publish it here.</p>
2829
{% else %}
29-
<p class="help">Ask an administrator to create a new set of terms, then write and publish it here.</p>
30+
<p class="help">Ask an administrator to create new terms or publish your draft.</p>
3031
{% endif %}
3132
</article>
3233
{% endblock %}

0 commit comments

Comments
 (0)