Skip to content

Commit f12bc99

Browse files
committed
Fix timelines
- Legacy-Id: 19591
1 parent 72569dd commit f12bc99

12 files changed

Lines changed: 101 additions & 32 deletions

ietf/static/css/ietf.scss

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,55 @@ body {
8888
.ietflogo {
8989
width: 75%;
9090
max-width: 300px;
91+
}
92+
93+
// Styles for d3.js graphical SVG timelines
94+
#timeline {
95+
font-size: small;
96+
}
97+
98+
#timeline .axis path,
99+
#timeline .axis line {
100+
fill: none;
101+
stroke: black;
102+
}
103+
104+
#timeline .axis.y path,
105+
#timeline .axis.y line {
106+
stroke: none;
107+
}
108+
109+
#timeline .axis.x text {
110+
dominant-baseline: central;
111+
}
112+
113+
#timeline .bar text {
114+
fill: white;
115+
dominant-baseline: central;
116+
pointer-events: none;
117+
}
118+
119+
120+
$timeline-odd-color: $primary;
121+
$timeline-odd-hover-color: shift-color($timeline-odd-color, $link-shade-percentage) !default;
122+
123+
#timeline .bar:nth-child(odd) rect {
124+
fill: $timeline-odd-color;
125+
}
126+
127+
#timeline .bar:nth-child(odd) rect:hover,
128+
#timeline .bar:nth-child(odd) rect:focus {
129+
fill: $timeline-odd-hover-color;
130+
}
131+
132+
$timeline-even-color: $success;
133+
$timeline-even-hover-color: shift-color($timeline-even-color, $link-shade-percentage) !default;
134+
135+
#timeline .bar:nth-child(even) rect {
136+
fill: $timeline-even-color;
137+
}
138+
139+
#timeline .bar:nth-child(even) rect:hover,
140+
#timeline .bar:nth-child(even) rect:focus {
141+
fill: $timeline-even-hover-color;
91142
}

ietf/static/js/d3.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import * as d3 from "d3";
2+
3+
global.d3 = d3;
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ function draw_timeline() {
191191
.attr({
192192
height: bar_height,
193193
width: bar_width,
194+
class: "btn",
195+
type: "button",
194196
mask: function(d, i) {
195197
// apply gradient if the document is a draft and expired
196198
if (d.name.match(/^draft-/) &&
@@ -264,4 +266,4 @@ $(window).on({
264266
resize: function() {
265267
update_timeline();
266268
}
267-
});
269+
});

ietf/templates/doc/document_bofreq.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
{% load ietf_filters %}
66
{% load person_filters %}
77

8-
{% block pagehead %}
9-
<script src="{% static 'd3/d3.min.js' %}"></script>
10-
<script src="{% static 'jquery/jquery.min.js' %}"></script>
11-
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
12-
{% endblock %}
13-
148
{% block title %}{{ doc.title }}{% endblock %}
159

1610
{% block content %}
@@ -178,3 +172,8 @@
178172
</div>
179173

180174
{% endblock %}
175+
176+
{% block js %}
177+
<script src="{% static 'ietf/js/d3.js' %}"></script>
178+
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
179+
{% endblock %}

ietf/templates/doc/document_charter.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
{% block pagehead %}
88
<link rel="alternate" type="application/atom+xml" href="/feed/group-changes/{{ group.acronym }}/">
9-
<script src="{% static 'd3/d3.min.js' %}"></script>
10-
<script src="{% static 'jquery/jquery.min.js' %}"></script>
11-
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
129
{% endblock %}
1310

1411
{% block title %}{{ doc.title }}{% endblock %}
@@ -238,3 +235,8 @@ <h2>Proposed milestones</h2>
238235
{% endif %}
239236

240237
{% endblock %}
238+
239+
{% block js %}
240+
<script src="{% static 'ietf/js/d3.js' %}"></script>
241+
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
242+
{% endblock %}

ietf/templates/doc/document_conflict_review.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
{% load static %}
55
{% load ietf_filters %}
66

7-
{% block pagehead %}
8-
<script src="{% static 'd3/d3.min.js' %}"></script>
9-
<script src="{% static 'jquery/jquery.min.js' %}"></script>
10-
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
11-
{% endblock %}
12-
137
{% block title %}{{ doc.title }}{% endblock %}
148

159
{% block content %}
@@ -144,3 +138,8 @@ <h2>Conflict review<br><small>{{ conflictdoc.name }}-{{ conflictdoc.rev }}</smal
144138
<pre> {{ content|sanitize|maybewordwrap|safe }}</pre>
145139
{% endif %}
146140
{% endblock %}
141+
142+
{% block js %}
143+
<script src="{% static 'ietf/js/d3.js' %}"></script>
144+
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
145+
{% endblock %}

ietf/templates/doc/document_draft.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
{% block pagehead %}
99
<link rel="alternate" type="application/atom+xml" title="Document changes" href="/feed/document-changes/{{ name }}/">
1010
<meta name="description" content="{{ doc.title }} {% if doc.get_state_slug == "rfc" and not snapshot %}(RFC {{ rfc_number }}{% if published %}, {{ published.time|date:"F Y" }}{% endif %}{% if obsoleted_by %}; obsoleted by {{ obsoleted_by|join:", " }}{% endif %}){% else %}(Internet-Draft, {{ doc.time|date:"Y" }}){% endif %}">
11-
<script src="{% static 'd3/d3.min.js' %}"></script>
12-
<script src="{% static 'jquery/jquery.min.js' %}"></script>
13-
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
1411
{% endblock %}
1512

1613
{% block morecss %}
@@ -759,3 +756,8 @@ <h4>Authors</h4>
759756
</div>
760757
{% endif %}
761758
{% endblock %}
759+
760+
{% block js %}
761+
<script src="{% static 'ietf/js/d3.js' %}"></script>
762+
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
763+
{% endblock %}

ietf/templates/doc/document_material.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
{% load static %}
55
{% load ietf_filters %}
66

7-
{% block pagehead %}
8-
<script src="{% static 'd3/d3.min.js' %}"></script>
9-
<script src="{% static 'jquery/jquery.min.js' %}"></script>
10-
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
11-
{% endblock %}
12-
137
{% block title %}{{ doc.title }}{% endblock %}
148

159
{% block content %}
@@ -156,3 +150,8 @@ <h2>{% if doc.meeting_related %}Meeting{% endif %} {{ doc.type.name }}<br><small
156150
{% endif %}
157151
</div>
158152
{% endblock %}
153+
154+
{% block js %}
155+
<script src="{% static 'ietf/js/d3.js' %}"></script>
156+
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
157+
{% endblock %}

ietf/templates/doc/document_status_change.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
{% load static %}
55
{% load ietf_filters %}
66

7-
{% block pagehead %}
8-
<script src="{% static 'd3/d3.min.js' %}"></script>
9-
<script src="{% static 'jquery/jquery.min.js' %}"></script>
10-
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
11-
{% endblock %}
12-
137
{% block title %}{{ doc.title }}{% endblock %}
148

159
{% block content %}
@@ -159,3 +153,8 @@
159153
{% endif %}
160154

161155
{% endblock %}
156+
157+
{% block js %}
158+
<script src="{% static 'ietf/js/d3.js' %}"></script>
159+
<script src="{% static 'ietf/js/document_timeline.js' %}"></script>
160+
{% endblock %}

ietf/templates/meeting/proceedings/material_details.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ <h1>{{ meeting }} : Proceedings Materials</h1>
8383

8484
{% comment %}{% block js %}
8585
{% if can_manage_materials %}
86-
<script type="text/javascript" src="{% static 'jquery/jquery.min.js' %}"></script>
8786
<script type="text/javascript" src="{% static 'js-cookie/src/js.cookie.js' %}"></script>
8887
<script type="text/javascript" src={% static 'Sortable/Sortable.min.js' %}></script>
8988

0 commit comments

Comments
 (0)