forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocument_history.html
More file actions
136 lines (136 loc) · 6.02 KB
/
document_history.html
File metadata and controls
136 lines (136 loc) · 6.02 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
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load ietf_filters %}
{% load static %}
{% block title %}
History for {{ doc.name }}
{% if doc.rev %}-{{ doc.rev }}{% endif %}
{% endblock %}
{% block pagehead %}
<link rel="alternate"
type="application/atom+xml"
href="/feed/document-changes/{{ doc.name }}/">
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block content %}
{% origin %}
{{ top|safe }}
{% if diff_revisions and diff_revisions|length > 1 or doc.name|rfcbis %}
<h2 class="my-3">Revision differences</h2>
<form class="form-horizontal diff-form"
action="{{ rfcdiff_base_url }}"
method="get"
target="_blank">
<div class="row mb-3">
<label for="url1" class="col-form-label col-sm-2 fw-bold">From revision</label>
<div class="col-sm-10">
<select class="form-select select2-field" data-max-entries="1" data-minimum-input-length="0" id="url1" name="url1">
{% for name, rev, time, url in diff_revisions %}
<option value="{{ url }}"
{% if diff_revisions|length > 1 and forloop.counter == 2 %} selected="selected"{% endif %}>
{{ name }}
{% if rev %}-{{ rev }}{% endif %}
({{ time|date:"Y-m-d" }})
</option>
{% endfor %}
{% if doc.name|rfcbis %}
<option value="{{ doc.name|rfcbis }}"
{% if diff_revisions and diff_revisions|length == 1 %} selected="selected"{% endif %}>
{{ doc.name|rfcbis }}
</option>
{% endif %}
</select>
</div>
</div>
<div class="row mb-3">
<label for="url2" class="col-form-label col-sm-2 fw-bold">To revision</label>
<div class="col-sm-10">
<select class="form-select select2-field" data-max-entries="1" data-minimum-input-length="0" id="url2" name="url2">
{% for name, rev, time, url in diff_revisions %}
<option value="{{ url }}"
{% if forloop.counter == 1 %} selected="selected"{% endif %}>
{{ name }}
{% if rev %}-{{ rev }}{% endif %}
({{ time|date:"Y-m-d" }})
</option>
{% endfor %}
{% if doc.name|rfcbis %}
<option value="{{ doc.name|rfcbis }}">
{{ doc.name|rfcbis }}
</option>
{% endif %}
</select>
</div>
</div>
<div class="row mb-3">
<label class="col-form-label col-sm-2 fw-bold">Diff format</label>
<div class="col-sm-10">
<div class="btn-group" data-bs-toggle="buttons">
<input type="radio"
class="btn-check"
checked
name="difftype"
value="--html"
id="html">
<label for="html"class="btn btn-outline-primary">Side-by-side</label>
<input type="radio"
class="btn-check"
name="difftype"
value="--abdiff"
id="abdiff">
<label for="abdiff"class="btn btn-outline-primary">Before-after</label>
<input type="radio"
class="btn-check"
name="difftype"
value="--chbars"
id="chbars">
<label for="chbars"class="btn btn-outline-primary">Change bars</label>
<input type="radio"
class="btn-check"
name="difftype"
value="--hwdiff"
id="hwdiff">
<label for="hwdiff"class="btn btn-outline-primary">Wdiff</label>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary mb-3">Submit</button>
</form>
{% endif %}
<h2 class="my-3">Document history</h2>
{% if can_add_comment %}
<div class="buttonlist">
<a class="btn btn-primary"
href="{% url 'ietf.doc.views_doc.add_comment' name=doc.name %}">
<i class="bi bi-plus"></i>
Add comment
</a>
</div>
{% endif %}
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th data-sort="date">Date</th>
<th data-sort="rev">Rev.</th>
<th data-sort="by">By</th>
<th data-sort="action">Action</th>
</tr>
</thead>
<tbody>
{% for e in events %}
<tr id="history-{{ e.pk }}">
<td class="text-nowrap">
<div title="{{ e.time|date:'Y-m-d H:i:s O' }}">{{ e.time|date:"Y-m-d" }}</div>
</td>
<td class="text-end">{{ e.rev }}</td>
<td>{{ e.by|escape }}</td>
<td>{{ e.desc|format_history_text }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{% block js %}
<script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}