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
142 lines (115 loc) · 4.51 KB
/
manage_list.html
File metadata and controls
142 lines (115 loc) · 4.51 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
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load bootstrap3 %}
{% load static %}
{% load misc_filters %}
{% block pagehead %}
{{ all_forms|merge_media:'css' }}
{% endblock %}
{% block title %}Manage {{ clist.long_name }}{% endblock %}
{% block content %}
{% origin %}
<h1>Manage {{ clist.long_name }}</h1>
<noscript>This page depends on Javascript being enabled to work properly.</noscript>
{% 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-default" 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-condensed table-striped">
<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 class="btn btn-danger btn-xs" 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 <span class="fa fa-bookmark-o"></span> 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 %}
<button class="btn btn-primary" name="action" value="add_documents">Add documents</button>
</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-condensed table-striped">
<thead>
<tr><th>Rule</th><th>Value</th><th>Documents</th><th></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 %}
{{ rule.person }}
{% elif "name_contains" in rule.rule_type %}
{{ rule.text }}
{% endif %}
</td>
<td>{{ rule.matching_documents_count }} match{{ rule.matching_documents_count|pluralize:"es" }}</td>
<td>
<form method="post">
{% csrf_token %}
<input type="hidden" name="rule" value="{{ rule.pk }}">
<button class="btn btn-danger btn-xs" 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-toggle="collapse" data-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 %}>
<h3>Add a new rule</h3>
<form method="post">
{% csrf_token %}
{% bootstrap_form rule_type_form %}
<div class="form-content-placeholder">
{% if rule_form %}
{% bootstrap_form rule_form %}
{% endif %}
</div>
{% buttons %}
<button type="submit" class="btn btn-primary" name="action" value="add_rule">Add rule</button>
{% endbuttons %}
</form>
<div class="empty-forms hide">
{% for rule_type, f in empty_rule_forms.items %}
<div class="rule-type {{ rule_type }}">
{% bootstrap_form f %}
</div>
{% endfor %}
</div>
</div>
{% endblock %}
{% block js %}
{{ all_forms|merge_media:'js' }}
<script src="{% static 'ietf/js/manage-community-list.js' %}"></script>
{% endblock %}