Skip to content

Commit

Permalink
Bug 35402: Update the OPAC and staff interface to Bootstrap 5
Browse files Browse the repository at this point in the history
This patch updates the OPAC and staff interface to use Bootstrap 5.
Bootstrap CSS assets are now pulled from node_modules and compiled into
staff-global.css and opac.css at build time. This update lays the
foundations of some other chnages, especially the addition of a dark
mode in the future.

Hundreds of templates have been updated, mostly with updates to the grid
markup. Most of the responsive behavior is still the same with the
exception of improved flexibility of headers and footers in both the
OPAC and staff interface.

The other most common change is to add a new "namespace" to data
attributes used by Bootstrap, e.g. "data-bs-target" or "data-bs-toggle".
Modal markup has also been updated everywhere. Other common changes:
dropdown button markup, alert markup (we now use Bootstrap's "alert
alert-warning" and "alert alert-info" instead of our old "dialog alert"
and "dialog info").

Bootstrap 5 now uses CSS variables which we can override in our own
'_variables.scss' (in both the OPAC and staff) to accomplish a lot of
the style overrides which we previously put in staff-global.scss.

Signed-off-by: Martin Renvoize <[email protected]>
Signed-off-by: Katrin Fischer <[email protected]>
  • Loading branch information
oleonard authored and kfischer committed Aug 23, 2024
1 parent f44d2cc commit 5fe1ad8
Show file tree
Hide file tree
Showing 636 changed files with 10,058 additions and 6,947 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ koha-tmpl/opac-tmpl/bootstrap/css/sco-rtl.css

koha-tmpl/intranet-tmpl/prog/css/maps/
koha-tmpl/intranet-tmpl/prog/css/calendar.css
koha-tmpl/intranet-tmpl/prog/css/calendar-rtl.css
koha-tmpl/intranet-tmpl/prog/css/holds.css
koha-tmpl/intranet-tmpl/prog/css/holds-rtl.css
koha-tmpl/intranet-tmpl/prog/css/installer.css
koha-tmpl/intranet-tmpl/prog/css/installer-rtl.css
koha-tmpl/intranet-tmpl/prog/css/mainpage.css
koha-tmpl/intranet-tmpl/prog/css/mainpage-rtl.css
koha-tmpl/intranet-tmpl/prog/css/staff-global.css

koha-tmpl/intranet-tmpl/prog/css/staff-global-rtl.css
koha-tmpl/intranet-tmpl/prog/js/vue/dist/

how-to.pl
Expand Down
2 changes: 1 addition & 1 deletion admin/library_groups.pl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
)->store();
};
if ($@) {
push @messages, { type => 'alert', code => 'error_on_insert' };
push @messages, { type => 'warning', code => 'error_on_insert' };
}
else {
$template->param( added => $group );
Expand Down
42 changes: 22 additions & 20 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,44 +39,46 @@ var sassOptions = {
// CSS processing for development
function css(css_base) {
css_base = css_base || CSS_BASE
var stream = src(css_base + "/src/**/*.scss")
.pipe(sourcemaps.init())
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(dest(css_base));
var stream = src(css_base + "/src/**/*.scss", { sourcemaps: true } );

if (args.view == "opac") {
stream = stream
.pipe(rtlcss())
.pipe(rename({
suffix: '-rtl'
})) // Append "-rtl" to the filename.
.pipe(dest(css_base));
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(dest(css_base))
.pipe(rtlcss())
.pipe(rename({
suffix: '-rtl'
})) // Append "-rtl" to the filename.
.pipe(dest(css_base, { sourcemaps: "./maps" } ));
} else {
stream = stream
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(dest(css_base))
.pipe(rtlcss())
.pipe(rename({
suffix: '-rtl'
})) // Append "-rtl" to the filename.
.pipe(dest(css_base, { sourcemaps: "/maps" } ));
}

stream = stream.pipe(sourcemaps.write('./maps'))
.pipe(dest(css_base));

return stream;

}

// CSS processing for production
function build(css_base) {
css_base = css_base || CSS_BASE;
sassOptions.outputStyle = "compressed";
var stream = src(css_base + "/src/**/*.scss")
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(dest(css_base));

if( args.view == "opac" ){
stream = stream.pipe(rtlcss())
.pipe(dest(css_base))
.pipe(rtlcss())
.pipe(rename({
suffix: '-rtl'
})) // Append "-rtl" to the filename.
.pipe(dest(css_base));
}

return stream;
}

Expand Down
7 changes: 0 additions & 7 deletions koha-tmpl/intranet-tmpl/lib/bootstrap/bootstrap-theme.min.css

This file was deleted.

7 changes: 7 additions & 0 deletions koha-tmpl/intranet-tmpl/lib/bootstrap/bootstrap.bundle.min.js

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions koha-tmpl/intranet-tmpl/lib/bootstrap/bootstrap.min.css

This file was deleted.

11 changes: 0 additions & 11 deletions koha-tmpl/intranet-tmpl/lib/bootstrap/bootstrap.min.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@

function fnCreateDropdown(aData) {
var index = i;
var r = '<div class="dropdown select_filter form-control"><a class="dropdown-toggle" data-toggle="dropdown" href="#">' + label + '<b class="caret"></b></a><ul class="dropdown-menu" role="menu"><li data-value=""><a>Show All</a></li>', j, iLen = aData.length;
var r = '<div class="dropdown select_filter form-control"><a class="dropdown-toggle" data-bs-toggle="dropdown" href="#">' + label + '<b class="caret"></b></a><ul class="dropdown-menu" role="menu"><li data-value=""><a>Show All</a></li>', j, iLen = aData.length;

for (j = 0; j < iLen; j++) {
r += '<li data-value="' + aData[j] + '"><a>' + aData[j] + '</a></li>';
Expand Down
1 change: 0 additions & 1 deletion koha-tmpl/intranet-tmpl/prog/css/addbiblio.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ a.expandfield {
}

.toptabs {
margin-left: -5px;
margin-top: 0;
}

Expand Down
1 change: 0 additions & 1 deletion koha-tmpl/intranet-tmpl/prog/css/itemsearchform.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ input[type="text"] {
border-radius: 4px;
color: #495057;
display: inline-block;
font-size: 1.5rem;
height: calc( 1.5em + .75rem + 2px );
line-height: 1.5;
padding: .375rem .75rem;
Expand Down
5 changes: 5 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/css/preferences.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,8 @@ span.overridden {
#admin_preferences .ms-drop label span {
margin-left: 5px;
}

.category-heading {
display: flex;
justify-content: space-between;
}
14 changes: 6 additions & 8 deletions koha-tmpl/intranet-tmpl/prog/css/src/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ fieldset {
&.rows {
clear: left;
float: left;
margin: .9em 0 0;
margin: 0;
padding: 1rem;
width: 100%;

& + fieldset.rows {
margin-top: .9em;
}

fieldset {
background-color: transparent;
margin: 1em;
Expand Down Expand Up @@ -71,7 +75,6 @@ fieldset {

div {
&.hint {
font-size: 1.25rem;
margin: .5rem 0;
margin-left: 11rem;
}
Expand Down Expand Up @@ -161,7 +164,7 @@ fieldset {
}

legend {
font-size: 1.55rem;
font-size: 1.2rem;
margin: 0 0 0 1em;
}

Expand Down Expand Up @@ -235,15 +238,10 @@ fieldset {
text-align: right;
width: 10rem;
}

&.hint {
font-size: 1.25rem;
}
}

table {
clear: both;
font-size: 1.25rem;
margin: 1em 0 1em 1em;

&.dataTable {
Expand Down
Loading

0 comments on commit 5fe1ad8

Please sign in to comment.