forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanage_list.html
More file actions
149 lines (149 loc) · 5.93 KB
/
Copy pathmanage_list.html
File metadata and controls
149 lines (149 loc) · 5.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load django_bootstrap5 %}
{% load static %}
{% load misc_filters person_filters %}
{% block pagehead %}
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{{ all_forms|merge_media:'css' }}
{% endblock %}
{% block title %}Manage {{ clist.long_name }}{% endblock %}
{% block content %}
{% origin %}
<h1>Manage {{ clist.long_name }}</h1>
{% bootstrap_messages %}
<p>
The list currently tracks
<a href="{{ clist.get_absolute_url }}">{{ total_count }} document{{ total_count|pluralize }}</a>.
</p>
<p>
<a class="btn btn-primary" href="{{ clist.get_absolute_url }}">Back to list</a>
</p>
<h2>Individual documents</h2>
{% if individually_added %}
<p>
The list tracks {{ individually_added|length }} individually added document{{ individually_added|length|pluralize }}:
</p>
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th scope="col" data-sort="doc">Document</th>
<th scope="col">Manage</th>
</tr>
</thead>
<tbody>
{% for d in individually_added %}
<tr>
<td>{{ d.name }}</td>
<td>
<form method="post" id="remove_document_{{ d.pk }}">
{% csrf_token %}
<input type="hidden" name="document" value="{{ d.pk }}">
<button type="submit" class="btn btn-danger btn-sm" name="action" value="remove_document">Remove</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>
The list does not track any individually added documents yet.
</p>
{% endif %}
{% if clist.group %}
<p>
Add individual documents here:
</p>
{% else %}
<p>
Conveniently track individual documents in your personal list with the track icon
<i class="bi bi-bookmark"></i>
in
<a href="/doc/search/">search results</a>.
</p>
<p>
You can also add documents here:
</p>
{% endif %}
<form class="form add-document" method="post" id="add_document">
{% csrf_token %}
{% bootstrap_field add_doc_form.documents show_label=False %}
{% bootstrap_button button_type="submit" name="action" value="add_documents" content="Add documents" %}
</form>
<h2>Search rules</h2>
<p>
You can track documents with a search rule. When a document fulfills the search criteria, it will automatically show up in the list.
</p>
{% if rules %}
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th scope="col" data-sort="rule">Rule</th>
<th scope="col" data-sort="value">Value</th>
<th scope="col" data-sort="num">Matching Documents</th>
<th scope="col">Manage</th>
</tr>
</thead>
<tbody>
{% for rule in rules %}
<tr id="r{{ rule.pk }}">
<td>{{ rule.get_rule_type_display }}</td>
<td>
{% if "group" in rule.rule_type or "area" in rule.rule_type %}
{{ rule.group.acronym }}
{% elif "state_" in rule.rule_type %}
{{ rule.state }}
{% elif "author" in rule.rule_type or rule.rule_type == "ad" or "shepherd" in rule.rule_type %}
{% person_link rule.person %}
{% elif "name_contains" in rule.rule_type %}
{{ rule.text }}
{% endif %}
</td>
<td>{{ rule.matching_documents_count }}</td>
<td>
<form method="post">
{% csrf_token %}
<input type="hidden" name="rule" value="{{ rule.pk }}">
<button type="submit" class="btn btn-danger btn-sm" name="action" value="remove_rule">Remove</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>
No rules defined.
</p>
{% endif %}
<div>
<a class="btn btn-primary"
data-bs-toggle="collapse"
data-bs-target="#add-new-rule">Add a new rule</a>
</div>
<div id="add-new-rule"
{% if not rule_type_form.errors and not rule_form %}class="collapse"{% endif %}>
<form method="post">
{% csrf_token %}
{% bootstrap_form rule_type_form layout="horizontal" %}
<div class="form-content-placeholder">
{% if rule_form %}
{% bootstrap_form rule_form layout="horizontal" %}
{% endif %}
</div>
<button type="submit" class="btn btn-primary" name="action" value="add_rule">Add rule</button>
</form>
<div class="empty-forms d-none">
{% for rule_type, f in empty_rule_forms.items %}
<div class="rule-type {{ rule_type }}">{% bootstrap_form f layout="horizontal" %}</div>
{% endfor %}
</div>
</div>
{% endblock %}
{% block js %}
{{ all_forms|merge_media:'js' }}
<script src="{% static "ietf/js/list.js" %}"></script>
<script src="{% static 'ietf/js/manage-community-list.js' %}"></script>
{% endblock %}