Skip to content

Commit e254103

Browse files
committed
More bs5 changes
- Legacy-Id: 19725
1 parent 448c6db commit e254103

15 files changed

Lines changed: 343 additions & 237 deletions

ietf/static/js/ietf.js

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ $(document)
108108
// Automatically add a navigation pane to long pages
109109
$(document)
110110
.ready(function () {
111-
112111
var headings = $("#content")
113112
.find("h1, h2, h3, h4, h5, h6");
114113

@@ -123,11 +122,6 @@ $(document)
123122
var last_level;
124123
var nav;
125124

126-
$("body")
127-
.attr("data-bs-spy", "scroll")
128-
.attr("data-bs-target", "#righthand-nav")
129-
.scrollspy("refresh");
130-
131125
$("#content")
132126
.attr("data-bs-offset", 0)
133127
.attr("tabindex", 0)
@@ -185,5 +179,52 @@ $(document)
185179
item[0].scrollIntoView({ block: "center" });
186180
}
187181
});
182+
183+
$("body")
184+
.attr("data-bs-spy", "scroll")
185+
.attr("data-bs-target", "#righthand-nav")
186+
.scrollspy("refresh");
187+
188+
$(window)
189+
.on("activate.bs.scrollspy", function () {
190+
console.log("X");
191+
});
188192
}
193+
});
194+
195+
// Replace track/untrack functionality with js.
196+
$(document)
197+
.ready(function () {
198+
$('.review-wish-add-remove-doc.ajax, .track-untrack-doc')
199+
.click(function (e) {
200+
e.preventDefault();
201+
var trigger = $(this);
202+
$.ajax({
203+
url: trigger.attr('href'),
204+
type: 'POST',
205+
cache: false,
206+
dataType: 'json',
207+
success: function (response) {
208+
if (response.success) {
209+
trigger.parent()
210+
.find(".track-untrack-doc")
211+
.tooltip("hide");
212+
trigger.addClass("visually-hidden");
213+
214+
var target_unhide = null;
215+
if (trigger.hasClass('review-wish-add-remove-doc')) {
216+
target_unhide = '.review-wish-add-remove-doc';
217+
} else if (trigger.hasClass('track-untrack-doc')) {
218+
target_unhide = '.track-untrack-doc';
219+
}
220+
if (target_unhide) {
221+
trigger.parent()
222+
.find(target_unhide)
223+
.not(trigger)
224+
.removeClass("visually-hidden");
225+
}
226+
}
227+
}
228+
});
229+
});
189230
});
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
$(document)
2+
.ready(function () {
3+
$("[name=rule_type]")
4+
.on("click change keypress", function () {
5+
var form = $(this)
6+
.closest("form");
7+
var ruleType = $(this)
8+
.val();
9+
var emptyForms = $(".empty-forms");
10+
11+
var currentFormContent = form.find(".form-content-placeholder .rule-type");
12+
if (!ruleType || !currentFormContent.hasClass(ruleType)) {
13+
// move previous back into the collection
14+
if (currentFormContent.length > 0)
15+
emptyForms.append(currentFormContent);
16+
else
17+
currentFormContent.html(""); // make sure it's empty
18+
19+
// insert new
20+
if (ruleType)
21+
form.find(".form-content-placeholder")
22+
.append(emptyForms.find("." + ruleType));
23+
}
24+
});
25+
26+
$("[name=rule_type]")
27+
.each(function () {
28+
// don't trigger the handler if we have a form with errors
29+
var placeholderContent = $(this)
30+
.closest("form")
31+
.find(".form-content-placeholder >");
32+
if (placeholderContent.length == 0 || placeholderContent.hasClass("rule-type"))
33+
$(this)
34+
.trigger("change");
35+
});
36+
});
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1+
{# bs5ok #}
12
{# Copyright The IETF Trust 2007, All Rights Reserved #}
23
{% extends "base.html" %}
34
{% block title %}OpenID Connect Issuer{% endblock %}
4-
55
{% block content %}
6-
7-
<h2>OpenID Connect Issuer</h2>
6+
<h1>OpenID Connect Issuer</h1>
87
<p>
98
This is the IETF Datatracker's OpenID Connect Issuer endpoint.
109
The OpenID Connect provider info is at
1110
<code>
12-
<a href="{% url 'oidc_provider:provider-info' %}">{% url 'oidc_provider:provider-info' %}"</a>
11+
<a href="{% url 'oidc_provider:provider-info' %}">{% url 'oidc_provider:provider-info' %}</a>
1312
</code>
1413
</p>
15-
16-
{% endblock %}
17-
14+
{% endblock %}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1+
{# bs5ok #}
12
{# Copyright The IETF Trust 2015, All Rights Reserved #}
2-
33
{% load origin %}
44
{% origin %}
5-
65
<ul class="dropdown-menu {% if flavor == 'top' %}mt-n1{% else %}ms-n1{% endif %}">
76
{% for p in parents %}
87
<li>
9-
<a class="dropdown-item {% if flavor != 'top' %}text-wrap{% endif %}" href="{{ p.menu_url }}">Active {{ p.name }}s</a>
8+
<a class="dropdown-item {% if flavor != 'top' %}text-wrap{% endif %}"
9+
href="{{ p.menu_url }}">Active {{ p.name }}s</a>
1010
</li>
1111
{% endfor %}
1212
{% for o in others %}
1313
<li>
14-
<a class="dropdown-item {% if flavor != 'top' %}text-wrap{% endif %}" href="{{o.menu_url}}">{{ o.acronym|upper }}</a>
14+
<a class="dropdown-item {% if flavor != 'top' %}text-wrap{% endif %}"
15+
href="{{ o.menu_url }}">{{ o.acronym|upper }}</a>
1516
</li>
1617
{% endfor %}
1718
</ul>

ietf/templates/base/menu_wg.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
{# bs5ok #}
12
{# Copyright The IETF Trust 2015, All Rights Reserved #}
2-
33
{% load origin %}
44
{% origin %}
5-
65
{% for p in parents %}
76
<li class="dropend group-menu group-parent-{{ p.id }}">
8-
<a class="dropdown-item dropdown-toggle {% if flavor != 'top' %}text-wrap link-primary{% endif %}" href="{{ p.menu_url }}">
7+
<a class="dropdown-item dropdown-toggle {% if flavor != 'top' %}text-wrap link-primary{% endif %}"
8+
href="{{ p.menu_url }}">
99
{{ p.short_name }}
1010
</a>
1111
</li>
Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
1-
<ul class="list-inline text-end pt-4">
2-
<li class="list-inline-item">
3-
<label id="list-feeds">Atom feed:</label>
4-
<div class="btn-group" role="group" aria-labelledby="list-feeds">
5-
<a class="btn btn-primary" title="Feed of all changes" href="{% if clist.group %}{% url "ietf.community.views.feed" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.feed" username=clist.user.username %}{% endif %}">
6-
<i class="bi bi-rss"></i> All changes
7-
</a>
8-
<a class="btn btn-primary" title="Feed of only significant state changes" href="{% if clist.group %}{% url "ietf.community.views.feed" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.feed" username=clist.user.username %}{% endif %}?significant=1">
9-
<i class="bi bi-rss"></i> Significant
10-
</a>
11-
</div>
12-
</li>
13-
1+
{# bs5ok #}
2+
<div class="text-end">
3+
<label id="list-feeds">Atom feed:</label>
4+
<div class="btn-group" role="group" aria-labelledby="list-feeds">
5+
<a class="btn btn-primary"
6+
title="Feed of all changes"
7+
href="{% if clist.group %}{% url "ietf.community.views.feed" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.feed" username=clist.user.username %}{% endif %}">
8+
<i class="bi bi-rss"></i> All changes
9+
</a>
10+
<a class="btn btn-primary"
11+
title="Feed of only significant state changes"
12+
href="{% if clist.group %}{% url "ietf.community.views.feed" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.feed" username=clist.user.username %}{% endif %}?significant=1">
13+
<i class="bi bi-rss"></i> Significant
14+
</a>
15+
</div>
1416
{% if clist.pk != None %}
15-
<li class="list-inline-item"><a class="btn btn-primary" href="{% if clist.group %}{% url "ietf.community.views.subscription" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.subscription" username=clist.user.username %}{% endif %}">
17+
<a class="btn btn-primary"
18+
href="{% if clist.group %}{% url "ietf.community.views.subscription" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.subscription" username=clist.user.username %}{% endif %}">
1619
<i class="bi bi-envelope"></i>
1720
{% if subscribed %}
1821
Change subscription
1922
{% else %}
2023
Subscribe to changes
2124
{% endif %}
22-
</a></li>
25+
</a>
2326
{% endif %}
24-
25-
<li class="list-inline-item">
26-
<a class="btn btn-primary" href="{% if clist.group %}{% url "ietf.community.views.export_to_csv" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.export_to_csv" username=clist.user.username %}{% endif %}"
27-
><i class="bi bi-file-ruled"></i> Export as CSV</a>
28-
</li>
29-
</ul>
27+
<a class="btn btn-primary"
28+
href="{% if clist.group %}{% url "ietf.community.views.export_to_csv" acronym=clist.group.acronym %}{% else %}{% url "ietf.community.views.export_to_csv" username=clist.user.username %}{% endif %}">
29+
<i class="bi bi-file-ruled"></i> Export as CSV
30+
</a>
31+
</div>

0 commit comments

Comments
 (0)