From e630b44c2a801692cd55570dab2c35fb09a3359c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:25:02 +0200 Subject: [PATCH] Migracja Bootstrapa do wersji 5 (#1366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Podsumowanie większości modyfikacji, w zasadniczej części odpowiadających analogicznym zmianom w Bootstrapie: * _Namespacing_ atrybutów (zamiana `data-{toggle,trigger,content,dismiss,target}` na odpowiednio `data-bs-{toggle,trigger,content,dismiss,target}`) oraz zmiennych SCSS (`--red` → `--bs-red` itd.) * Zmiana nomenklatury klas `{float,text}-left` → `{float,text}-start`, `{float,text}-right` → `{float,text}-end`, `ml-X` → `ms-X`, `mr-X` → `me-X` itd. * Zastąpienie dedykowanych klas stylujących `badge-X` (wycofanych) przez bardziej ogólne `bg-X` i ew. `text-Y`, podobnie w nagłówkach niektórych tabel efekt wycofanej `thead-dark` daje teraz `table-dark`. * Zamiana rozmiarów `display-{1,3}` (mocno przedefiniowanych) na odpowiednio `display-{5,6}` (nowo wprowadzone). * Przebudowanie kilku typowych elementów (wycofany `jumbotron` buduje się w BS5 z bardziej ogólnych klas, `accordion` składa się z elementów `accordion-item` a nie `card`, przycisk do zamykania modali w całości zdefiniowany jest stylami i nie potrzeba podawać jego zawartości). * Usunięcie wycofywanych klas `form-row` (zamiana na `row`), `input-group-{append,prepend}` itd. * Okazjonalne poprawki marginesów, które przestały dobrze wyglądać. * Wykorzystanie `bootstrap-print-css` (nowa zależność) dla zachowania styli do druku wycofanych w BS5. * Przekonfigurowanie `fullcalendar`. * Poprawki w kilku kawałkach JS, które przestały działać – w wyborze sali do rezerwacji, wyświetlaniu pytania o zgodę na przetwarzanie danych, i dymkach dla grup z autozapisem. Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: KaMaCH12 <51365804+KaMaCH12@users.noreply.github.com> Co-authored-by: Bartosz Cieślik Co-authored-by: Bogusz Kaszowski Co-authored-by: Cezary Świtała Co-authored-by: Karolina Lubczańska Co-authored-by: Hello, Yes, This Is Dog --- zapisy/apps/common/assets/main/expose_libs.ts | 12 +- zapisy/apps/common/assets/main/index.scss | 103 ++++++++- .../assets/markdown/render-markdown.scss | 4 +- zapisy/apps/effects/templates/effects.html | 2 +- .../courses/templates/courses/base.html | 4 +- .../courses/course_parts/course_head.html | 8 +- .../courses/course_parts/groups_section.html | 16 +- .../courses/templates/courses/group.html | 2 +- .../templates/courses/students_list.html | 2 +- .../assets/components/CourseFilter.vue | 6 +- .../assets/components/TermControls.vue | 2 +- .../components/filters/LabelsFilter.vue | 2 +- .../components/filters/SelectFilter.vue | 2 +- .../assets/components/filters/TextFilter.vue | 16 +- .../templates/timetable/timetable.html | 6 +- .../grade/poll/templates/poll/results.html | 18 +- .../grade/poll/templates/poll/submission.html | 2 +- .../ticket_create/assets/TicketsGenerator.vue | 2 +- .../assets/components/Widget.vue | 20 +- .../templates/assignments/view.html | 6 +- .../templates/assignments/wizard.html | 24 +-- zapisy/apps/offer/preferences/forms.py | 4 + .../templates/preferences/main.html | 2 +- .../assets/components/CourseFilter.vue | 6 +- .../proposal/assets/components/CourseList.vue | 14 +- zapisy/apps/offer/proposal/forms.py | 12 +- .../proposal/fields/collapsable-fieldset.html | 2 +- .../templates/proposal/my-proposals.html | 48 +++-- .../templates/proposal/proposal_info.html | 8 +- .../vote/assets/components/CourseFilter.vue | 6 +- .../apps/offer/vote/assets/point-counter.ts | 2 +- zapisy/apps/offer/vote/forms.py | 11 +- .../apps/offer/vote/templates/vote/form.html | 4 +- .../vote/templates/vote/form_correction.html | 6 +- .../apps/offer/vote/templates/vote/index.html | 74 ++++--- .../offer/vote/templates/vote/my_vote.html | 2 +- .../assets/components/ClassroomPicker.vue | 7 +- zapisy/apps/schedule/assets/fullcalendar.js | 6 +- zapisy/apps/schedule/assets/fullcalendar.scss | 2 +- .../apps/schedule/assets/report-editor.scss | 12 +- zapisy/apps/schedule/assets/report.css | 2 +- zapisy/apps/schedule/assets/reservation.js | 5 + zapisy/apps/schedule/filters.py | 18 +- zapisy/apps/schedule/forms.py | 12 +- .../templates/schedule/classrooms.html | 6 +- .../templates/schedule/conflicts.html | 14 +- .../schedule/templates/schedule/event.html | 44 ++-- .../schedule/templates/schedule/events.html | 6 +- .../includes/_report_form_render.html | 26 +-- .../schedule/includes/reservation_view.html | 2 +- .../templates/schedule/reports/forms.html | 8 +- .../schedule/reports/report_doors.html | 18 +- .../schedule/reports/report_table.html | 8 +- .../templates/schedule/reservation.html | 27 ++- .../schedule/templates/schedule/session.html | 2 +- .../assets/components/StatisticsFilter.vue | 2 +- .../assets/components/StatisticsList.vue | 10 +- .../components/filters/SelectFilter.vue | 2 +- .../assets/components/filters/TextFilter.vue | 16 +- zapisy/apps/theses/forms.py | 4 +- .../apps/theses/templates/theses/thesis.html | 12 +- .../theses/templates/theses/thesis_form.html | 8 +- zapisy/apps/users/assets/consent-dialog.ts | 12 +- .../users/templates/registration/login.html | 6 +- zapisy/apps/users/templates/users/form.html | 2 +- .../users/templates/users/my_profile.html | 2 +- zapisy/package.json | 8 +- zapisy/templates/base.html | 204 +++++++++--------- zapisy/templates/common/index.html | 14 +- zapisy/templates/consent-dialog.html | 4 +- zapisy/templates/news/list_all.html | 12 +- zapisy/yarn.lock | 59 +++-- zapisy/zapisy/settings.py | 2 +- 73 files changed, 604 insertions(+), 460 deletions(-) diff --git a/zapisy/apps/common/assets/main/expose_libs.ts b/zapisy/apps/common/assets/main/expose_libs.ts index 03f719281f..bf7055caae 100644 --- a/zapisy/apps/common/assets/main/expose_libs.ts +++ b/zapisy/apps/common/assets/main/expose_libs.ts @@ -1,13 +1,15 @@ import $ from "jquery"; import Popper from "popper.js"; +import * as bootstrap from "bootstrap"; (window as any).$ = $; (window as any).jQuery = $; (window as any).Popper = Popper; -import "bootstrap"; - -$(function () { - // Enable Bootstrap popovers on entire site. - $('[data-toggle="popover"]').popover(); +window.addEventListener("load", () => { + Array.from(document.querySelectorAll('[data-bs-toggle="popover"]')).map( + function (popoverTriggerEl) { + return new bootstrap.Popover(popoverTriggerEl); + } + ); }); diff --git a/zapisy/apps/common/assets/main/index.scss b/zapisy/apps/common/assets/main/index.scss index 47af96932b..a9a6df688e 100644 --- a/zapisy/apps/common/assets/main/index.scss +++ b/zapisy/apps/common/assets/main/index.scss @@ -1,5 +1,6 @@ @import "variables"; @import "~bootstrap/scss/bootstrap"; +@import "~bootstrap-print-css/css/bootstrap-print"; @page { size: auto; @@ -17,7 +18,6 @@ footer { margin-top: auto; padding-top: 5rem; .container-fluid { - background-color: var(--light); padding: 1rem 0; p { margin: 0.5rem 0; @@ -25,16 +25,95 @@ footer { } } +.form-group { + margin-bottom: 1rem !important; +} + +.form-group > label { + margin-bottom: 0.5rem; +} + +.custom-select { + @extend .form-select !optional; +} + +.nav-link:hover { + text-decoration: none; +} + +.btn:hover, +.btn:focus, +.page-link:hover, +.page-link:focus { + text-decoration: none; +} + +.btn-link { + color: #007bff; + text-decoration: none; +} + +.btn-link:hover, +.btn-link:focus { + color: #0056b3; + text-decoration: underline; +} + +.btn-outline-info:hover, +.btn-outline-info:active { + color: white !important; +} + a { cursor: pointer; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +a.badge { + text-decoration: none; +} + +a.badge:hover { + color: #fff; +} + +a.bg-secondary:hover, +a.bg-secondary:focus { + background-color: #545b62 !important; +} + +a.bg-info:hover, +a.bg-info:focus { + background-color: #117a8b !important; +} + +a.bg-success:hover, +a.bg-success:focus { + background-color: #00401e !important; +} + +a.bg-info:focus { + box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); +} + +a.bg-success:focus { + box-shadow: 0 0 0 0.2rem rgba(0, 115, 54, 0.5); +} + +a.bg-secondary:focus { + outline: 0; + box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); } @media print { // Some browsers do not handle printing layouts with flexbox. This should be // fixed in Bootstrap. // https://github.com/twbs/bootstrap/issues/26781 - .row, - .form-row { + .row { display: block; } } @@ -93,6 +172,9 @@ div.top .topbar .inline-inputs label { #sidebar { @media (max-width: 992px) { #sidebar-inner { + /* :after will position itself against nearest positioned parent, so we + * need to ensure that it will be this sidebar */ + position: relative; overflow-y: hidden; &.folded { @@ -102,9 +184,7 @@ div.top .topbar .inline-inputs label { &:after { position: absolute; display: block; - // Height of the card footer. - bottom: 1.5em; - left: 0; + bottom: 0; height: 50%; width: 100%; content: ""; @@ -139,6 +219,7 @@ div.loginbox { #system_menu { width: 100%; + padding: unset; ul#main-menu-list { flex-wrap: nowrap; overflow-x: auto; @@ -170,17 +251,17 @@ colgroup col.table-info-type { // Required field marker in forms. .asteriskField { padding-left: 0.25em; - color: var(--red); + color: var(--bs-red); } // News items on the main page and the news page. .od-news-item { margin: 2rem 0; padding: 4rem; - background: var(--light); + background: var(--bs-light); .od-news-date { - color: var(--dark); + color: var(--bs-dark); font-style: italic; display: block; @media (min-width: 992px) { @@ -204,3 +285,7 @@ colgroup col.table-info-type { transition: transform 250ms; } } + +.background-gray { + background-color: $gray-200; +} diff --git a/zapisy/apps/common/assets/markdown/render-markdown.scss b/zapisy/apps/common/assets/markdown/render-markdown.scss index 3d0010e4c6..a9cfe3328c 100644 --- a/zapisy/apps/common/assets/markdown/render-markdown.scss +++ b/zapisy/apps/common/assets/markdown/render-markdown.scss @@ -2,8 +2,8 @@ // because H1 used in the markdown description should not be larger than h2 // before it. -// We are importing Boostrap variables to relate our font sizes to those from -// Boostrap. +// We are importing Bootstrap variables to relate our font sizes to those from +// Bootstrap. @import "~bootstrap/scss/functions"; @import "~bootstrap/scss/variables"; diff --git a/zapisy/apps/effects/templates/effects.html b/zapisy/apps/effects/templates/effects.html index 81ee69ee26..54aea3e3ba 100644 --- a/zapisy/apps/effects/templates/effects.html +++ b/zapisy/apps/effects/templates/effects.html @@ -2,7 +2,7 @@ Zrealizowane grupy efektów kształcenia {% for effect in effects %} - {{ effect }} + {{ effect }} {% endfor %} diff --git a/zapisy/apps/enrollment/courses/templates/courses/base.html b/zapisy/apps/enrollment/courses/templates/courses/base.html index 079bbc38ad..6e75dcc4ca 100644 --- a/zapisy/apps/enrollment/courses/templates/courses/base.html +++ b/zapisy/apps/enrollment/courses/templates/courses/base.html @@ -3,13 +3,13 @@ {% block sidebar %}