Skip to content

Commit

Permalink
#61 Replace occurrences of "data-*" HTML attributes with "data-bs-*" …
Browse files Browse the repository at this point in the history
…to comply with bs5 breaking change
  • Loading branch information
skivinen committed Jan 22, 2021
1 parent cff297f commit 7d5ecf8
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ $(document).ready(function () {
renumberForm(newForm, '__prefix__', totalForms.value);
// Make it able to delete itself.
newForm
.querySelector('[data-formset-remove-form]')
.querySelector('[data-bs-formset-remove-form]')
.addEventListener('click', removeForm);
// Append the new form to the formsList.
formsList.insertAdjacentElement('beforeend', newForm);
Expand Down Expand Up @@ -200,7 +200,7 @@ $(document).ready(function () {
}

element
.querySelector('[data-formset-add-form]')
.querySelector('[data-bs-formset-add-form]')
.addEventListener('click', addForm);
element.formset = this;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<fieldset disabled class="empty-form d-none">
<fieldset>
{% include "form_kulukorvaus_kulu.html" with form=formset_kulu.empty_form %}
<button type="button" data-formset-remove-form class="btn-remove btn btn-default">
<button type="button" data-bs-formset-remove-form class="btn-remove btn btn-default">
<span class="mr-1 fa fa-minus"></span>
{% trans "Remove reimbursement" %}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>

<div class="my-4">
<button type="button" data-formset-add-form class="add-kulukorvaus btn-add btn btn-default">
<button type="button" data-bs-formset-add-form class="add-kulukorvaus btn-add btn btn-default">
<span class="mr-1 fa fa-plus"></span>
{% trans add_reimbursement %}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% include "libraries/bootstrap-js.html" %}
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip({
$('[data-bs-toggle="tooltip"]').tooltip({
html: true,
title: "<span> \
HUOM! JOS LATAAT USEITA PÖYTÄKIRJOJA LATAUKSESSA SAATTAA KESTÄÄ JOPA MINUUTTI! <br /><br /> \
Expand Down Expand Up @@ -42,7 +42,7 @@
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissable fade show" role="alert" style="margin-top:0.5rem;margin-bottom:0.5rem;">
{{ message }}
<a type="button" class="close" data-dismiss="alert"><i class="fas fa-times"></i></a>
<a type="button" class="close" data-bs-dismiss="alert"><i class="fas fa-times"></i></a>
</div>
{% endfor %}
</ul>
Expand All @@ -67,7 +67,7 @@
</a>
</li>
<li>
<a id="download-instructions" href="#" data-toggle="tooltip" data-placement="bottom">
<a id="download-instructions" href="#" data-bs-toggle="tooltip" data-bs-placement="bottom">
{% trans how_does_it_work %}
<i class="ml-2 fas fa-question"></i>
</a>
Expand Down
2 changes: 1 addition & 1 deletion prodekoorg/app_poytakirjat/templates/documents.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="col-md-9">
<div id="documents-container">
{% for year, doclist in context.items %}
<a class="btn btn-primary w-100 text-left mb-2 {% if not forloop.first %}collapsed{% endif %}" data-toggle="collapse" href="#collapse-{{ year }}">
<a class="btn btn-primary w-100 text-left mb-2 {% if not forloop.first %}collapsed{% endif %}" data-bs-toggle="collapse" href="#collapse-{{ year }}">
{{ year }}
<i class="fa fa-fw {% if forloop.first %}fa-chevron-down{% endif %} pt-1"></i>
</a>
Expand Down
2 changes: 1 addition & 1 deletion prodekoorg/app_toimarit/templates/old_boards.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="col-md-9">
<div id="officials-container">
{% for year, boardmembers in context.items %}
<a class="btn btn-primary w-100 text-left mb-2 {% if not forloop.first %}collapsed{% endif %}" data-toggle="collapse" href="#collapse-{{ year }}">
<a class="btn btn-primary w-100 text-left mb-2 {% if not forloop.first %}collapsed{% endif %}" data-bs-toggle="collapse" href="#collapse-{{ year }}">
{{ year }}
<i class="fa fa-fw fa-chevron-down pt-1"></i>
</a>
Expand Down
2 changes: 1 addition & 1 deletion prodekoorg/app_toimarit/templates/old_guildofficials.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="col-md-9">
<div id="officials-container">
{% for year, sections in context.items %}
<a class="btn btn-primary w-100 text-left mb-2 {% if not forloop.first %}collapsed{% endif %}" data-toggle="collapse" href="#collapse-{{ year }}">
<a class="btn btn-primary w-100 text-left mb-2 {% if not forloop.first %}collapsed{% endif %}" data-bs-toggle="collapse" href="#collapse-{{ year }}">
{{ year }}
<i class="fa fa-fw fa-chevron-down pt-1"></i>
</a>
Expand Down
8 changes: 4 additions & 4 deletions prodekoorg/app_vaalit/static/js/app_vaalit-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $(document).ready(function() {
if ($("#vaalitNav").length > 0) {
if (selectedTab_id != null && selectedTab_id != "null") {
elem = $(
'.list-group-root a[data-toggle="tab"][href="' + selectedTab_id + '"] .virka-name'
'.list-group-root a[data-bs-toggle="tab"][href="' + selectedTab_id + '"] .virka-name'
);
elem2 = $(selectedTab_id);
elem2.addClass("active show");
Expand Down Expand Up @@ -85,9 +85,9 @@ $(document).ready(function() {
openFrontPage();
})

$('.list-group-root a[data-toggle="tab"]').click(function(e) {
$('.list-group-root a[data-bs-toggle="tab"]').click(function(e) {
var id = $(e.delegateTarget).attr("href");
var virka = $('.list-group-root a[data-toggle="tab"][href="' + id + '"] .virka-name')
var virka = $('.list-group-root a[data-bs-toggle="tab"][href="' + id + '"] .virka-name')
.text()
.trim();
checkBtnHaeVirkaanVisibility(virka);
Expand Down Expand Up @@ -218,7 +218,7 @@ $(document).ready(function() {
}

function markReadSuccess(virka_id) {
$('.list-group-root a[data-toggle="tab"][href="' + "#_" + virka_id + '"] .virka-unread').fadeOut(200, function() {
$('.list-group-root a[data-bs-toggle="tab"][href="' + "#_" + virka_id + '"] .virka-unread').fadeOut(200, function() {
$(this).remove();
})
}
Expand Down
2 changes: 1 addition & 1 deletion prodekoorg/app_vaalit/templates/vaalit_ehdokas.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<p class="mb-0">{{ ehdokas.name }}</p>
</div>
<div>
<a href="#hakijaModal_{{ehdokas.pk}}" data-toggle="modal" data-target="#hakijaModal_{{ehdokas.pk}}">{% trans read_application %}</a>
<a href="#hakijaModal_{{ehdokas.pk}}" data-bs-toggle="modal" data-bs-target="#hakijaModal_{{ehdokas.pk}}">{% trans read_application %}</a>
{% include "vaalit_modal_ehdokas_description.html" %}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</p>
</div>
<div class="modal-footer m-auto">
<button type="button" class="btn btn-outline-secondary btn-sm" data-dismiss="modal">{% trans close %}</button>
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-dismiss="modal">{% trans close %}</button>
<form id="formDeleteEhdokas" method="post">
{% csrf_token %}
<button type="submit" class="btn btn-danger btn-sm"><i class="fas fa-times mr-2"></i>{% trans delete %}</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header d-flex flex-column">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<div class="img-container mx-auto mt-3 mb-1">
Expand All @@ -20,7 +20,7 @@ <h5 class="modal-title m-auto" id="hakijaModalLongTitle">{{ ehdokas.name }}</h5>
{% autoescape off %}{{ ehdokas.introduction }}{% endautoescape %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">{% trans close %}</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">{% trans close %}</button>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h4 class="modal-title">{% trans crop_image %}</h4>
<i class="fas fa-search-minus"></i>
</button>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal">
<button type="button" class="btn btn-default" data-bs-dismiss="modal">
{% trans close %}
</button>
<button type="button" class="btn btn-primary js-crop-and-upload">
Expand Down
8 changes: 4 additions & 4 deletions prodekoorg/app_vaalit/templates/vaalit_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<strong>{% trans elections_information %}</strong>
</a>
<br/>
<a href="#hallitusList" class="list-group-item list-group-item-action" data-toggle="collapse">
<a href="#hallitusList" class="list-group-item list-group-item-action" data-bs-toggle="collapse">
<i class="fa fa-fw fa-chevron-down"></i>
<strong>{% trans board %}</strong>
<span class="badge badge-primary badge-pill">{{ count_ehdokkaat_hallitus }}</span>
</a>
<div class="list-group collapse show" id="hallitusList" role="tablist">
{% for virka in virat %}
{% if virka.is_hallitus %}
<a href="#_{{ virka.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" data-toggle="tab">
<a href="#_{{ virka.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" data-bs-toggle="tab">
<span class="virka-name">{{ virka.name }}</span>
{% if not request.user in virka.read_by.all %}
<span class="virka-unread">{% trans new %}</span>
Expand All @@ -27,15 +27,15 @@
{% endif %}
{% endfor %}
</div>
<a href="#toimaritList" class="list-group-item list-group-item-action" data-toggle="collapse">
<a href="#toimaritList" class="list-group-item list-group-item-action" data-bs-toggle="collapse">
<i class="fa fa-fw fa-chevron-down"></i>
<strong>{% trans officials %}</strong>
<span class="badge badge-primary badge-pill">{{ count_ehdokkaat_toimarit }}</span>
</a>
<div class="list-group collapse show" id="toimaritList" role="tablist">
{% for virka in virat %}
{% if not virka.is_hallitus %}
<a href="#_{{ virka.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" data-toggle="tab">
<a href="#_{{ virka.pk }}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center" data-bs-toggle="tab">
<span class="virka-name">{{ virka.name }}</span>
{% if not request.user in virka.read_by.all %}
<span class="virka-unread">{% trans new %}</span>
Expand Down
2 changes: 1 addition & 1 deletion prodekoorg/app_vaalit/templates/vaalit_question.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% load sekizai_tags %}
<li id="kysymys_{{ question.pk }}" class="list-group-item align-items-start mb-2 no-border">
<a href="#vastaukset_{{ question.pk }}" class="list-group-item list-group-item-action questionBox" data-toggle="collapse" aria-expanded="false" aria-controls="vastaukset_1">
<a href="#vastaukset_{{ question.pk }}" class="list-group-item list-group-item-action questionBox" data-bs-toggle="collapse" aria-expanded="false" aria-controls="vastaukset_1">
<div class="row">
<div class="col-md-12 pl-0 ml-2">
<div class="questionHeader">
Expand Down
2 changes: 1 addition & 1 deletion prodekoorg/static/scss/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
color: black;
}

[data-toggle~='collapse'] {
[data-bs-toggle~='collapse'] {
cursor: pointer;
}

Expand Down
4 changes: 2 additions & 2 deletions prodekoorg/templates/layout-components/navbar-full.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% for child in children %}
{% if child.get_descendants %}
<li class="nav-item dropdown mr-3">
<a class="nav-link" id="navbarDropdown-{{ forloop.counter }}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<a class="nav-link" id="navbarDropdown-{{ forloop.counter }}" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ child.get_menu_title }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown-{{ forloop.counter }}">
Expand All @@ -32,7 +32,7 @@
{% endfor %}
</ul>
{% if user.is_authenticated %}
<a href="{% url 'auth_prodeko:profile' %}" class="profile-icon mr-4" data-trigger="hover" data-content="{% trans profile %}">
<a href="{% url 'auth_prodeko:profile' %}" class="profile-icon mr-4" data-bs-trigger="hover" data-bs-content="{% trans profile %}">
<i class="fas fa-user-circle"></i>
</a>
{% endif %}
Expand Down
10 changes: 5 additions & 5 deletions prodekoorg/templates/layout-components/navbar-mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a class="navbar-brand" href="/">
<img id="navbar-logo" src="{% static 'images/logos/prodeko-logo-text-blue.png' %}" />
</a>
<button class="navbar-toggler hamburger hamburger--minus" type="button" data-toggle="collapse" data-target="#navbarMobile" aria-controls="navbarMobile" aria-expanded="false"aria-label="Toggle navigation">
<button class="navbar-toggler hamburger hamburger--minus" type="button" data-bs-toggle="collapse" data-bs-target="#navbarMobile" aria-controls="navbarMobile" aria-expanded="false"aria-label="Toggle navigation">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
Expand All @@ -19,21 +19,21 @@
<div id="navAccordion">
{% for child in children %}
{% if child.get_descendants %}
<div id="heading-{{forloop.counter}}-{{child.level}}" class="my-3 caret-container collapsed" role="button" data-toggle="collapse" data-target="#collapse-{{forloop.counter}}-{{child.level}}" aria-expanded="false" aria-controls="collapse-{{forloop.counter}}-{{child.level}}">
<div id="heading-{{forloop.counter}}-{{child.level}}" class="my-3 caret-container collapsed" role="button" data-bs-toggle="collapse" data-bs-target="#collapse-{{forloop.counter}}-{{child.level}}" aria-expanded="false" aria-controls="collapse-{{forloop.counter}}-{{child.level}}">
<h5 class="ml-2 uppercase">
{{ child.get_menu_title }}
<span class="fa fa-caret-up float-right mr-3"></span>
</h5>
</div>
<div id="collapse-{{forloop.counter}}-{{child.level}}" class="collapse text-center" aria-labelledby="heading-{{forloop.counter}}-{{child.level}}" data-parent="#navAccordion">
<div id="collapse-{{forloop.counter}}-{{child.level}}" class="collapse text-center" aria-labelledby="heading-{{forloop.counter}}-{{child.level}}" data-bs-parent="#navAccordion">
<ul class="list-group list-group-flush">
{% for kid in child.get_descendants %}
{% if not kid.is_leaf_node %}
<li id="navAccordion-{{forloop.counter}}" class="list-group-item">
<div id="heading-{{forloop.counter}}-{{kid.level}}" class="submenu-heading collapsed" role="button" data-toggle="collapse" data-target="#collapse-{{forloop.counter}}-{{kid.level}}" aria-expanded="false" aria-controls="collapse-{{forloop.counter}}-{{kid.level}}">
<div id="heading-{{forloop.counter}}-{{kid.level}}" class="submenu-heading collapsed" role="button" data-bs-toggle="collapse" data-bs-target="#collapse-{{forloop.counter}}-{{kid.level}}" aria-expanded="false" aria-controls="collapse-{{forloop.counter}}-{{kid.level}}">
<span>{{ kid.get_menu_title }}</span>
</div>
<div id="collapse-{{forloop.counter}}-{{kid.level}}" class="collapse text-center" aria-labelledby="heading-{{forloop.counter}}-{{kid.level}}" data-parent="#navAccordion-{{forloop.counter}}">
<div id="collapse-{{forloop.counter}}-{{kid.level}}" class="collapse text-center" aria-labelledby="heading-{{forloop.counter}}-{{kid.level}}" data-bs-parent="#navAccordion-{{forloop.counter}}">
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a class="link" href="{{ kid.get_absolute_url }}">{{ kid.get_menu_title }}</a>
Expand Down

1 comment on commit 7d5ecf8

@skivinen
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#69

Please sign in to comment.