Skip to content

Commit

Permalink
upgrade to Bootstrap 5
Browse files Browse the repository at this point in the history
* replace all glyphicons with Bootstrap 5 icons
* replace all occurences of btn-default class
* replace all occurences of Bootstrap data- attributes by data-bs-
  attributes
* use Bootstrap 5's form classes
* etc.
  • Loading branch information
hgrf committed Jan 8, 2024
1 parent 439fb63 commit cf482b2
Show file tree
Hide file tree
Showing 44 changed files with 349 additions and 350 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ install-mathjax:

install-js-dependencies: install-mathjax api-client
mkdir -p app/static/css
mkdir -p app/static/fonts
mkdir -p app/static/css/fonts

# install typeahead.js
wget -O js/src/typeahead/typeahead.bundle.js \
Expand All @@ -77,7 +77,8 @@ install-js-dependencies: install-mathjax api-client
cd js && npm install && npx rollup -c

cp js/node_modules/bootstrap/dist/css/bootstrap.min.css app/static/css/bootstrap.min.css
cp js/node_modules/bootstrap/dist/fonts/* app/static/fonts/
cp js/node_modules/bootstrap-icons/font/bootstrap-icons.css app/static/css/bootstrap-icons.css
cp js/node_modules/bootstrap-icons/font/fonts/* app/static/css/fonts/

cp js/node_modules/tocbot/dist/tocbot.css app/static/css/tocbot.css

Expand Down
3 changes: 2 additions & 1 deletion app/static/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
mathjax/

css/bootstrap.min.css
css/bootstrap-icons.css
css/lightbox.css
css/tocbot.css
css/typeahead.css

fonts/
css/fonts/

images/close.png
images/loading.gif
Expand Down
53 changes: 9 additions & 44 deletions app/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,26 @@ body {
padding-top: 50px;
}

/*
* Top navigation
* Hide default border to remove 1px line.
*/
.navbar-fixed-top {
border: 0;
}

.navbar-brand > img {
float: left;
height: 1.4em;
margin-top: -0.2em;
height: 1.6em;
margin-top: -0.1em;
margin-right: 10px;
}

.nav-button {
display: none;
}

@media (max-width: 767px) {
.nav-button {
display: inline;
float: right;
color: #9d9d9d;
font-size: 18px;
line-height: 20px;
padding: 15px;
margin: 0px;
cursor: pointer;
}
.nav-button:hover {
color: #ffffff;
}
.nav-button.active {
color: #ffffff;
}
.nav-button-left {
float: left;
}
}

/*
* Sidebar
*/


/* Hide for mobile, show later */
.sidebar {
display: none;
}

@media (max-width: 767px) {
@media (max-width: 991px) {
.sidebar.overlay {
position: fixed;
top: 50px;
top: 56px;
bottom: 0;
left: 0;
z-index: 1000; /* top */
Expand All @@ -80,10 +45,10 @@ body {
}
}

@media (min-width: 768px) {
@media (min-width: 992px) {
.sidebar {
position: fixed;
top: 50px;
top: 56px;
bottom: 0;
left: 0;
z-index: 1000;
Expand All @@ -97,14 +62,14 @@ body {
}

/* Content overlay for small screen sidebar */
@media (max-width: 767px) {
@media (max-width: 991px) {
.content-overlay {
/* full screen */
width: 100vw;
/* transparent black */
background: rgba(0, 0, 0, 0.8);
position: fixed;
top: 50px;
top: 56px;
bottom: 0;
left: 0;
display: none;
Expand Down Expand Up @@ -138,7 +103,7 @@ body {
.main {
padding: 20px;
}
@media (min-width: 768px) {
@media (min-width: 992px) {
.main {
padding-right: 40px;
padding-left: 40px;
Expand Down
2 changes: 1 addition & 1 deletion app/static/css/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ div.news > div.news-title {
cursor: pointer;
}

div.news > div.news-title > i.glyphicon {
div.news > div.news-title > i {
color: #FF0000;
}

Expand Down
8 changes: 6 additions & 2 deletions app/static/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
.login-container {
margin: auto;
position: absolute;
top: 50px;
top: 56px;
left: 0;
bottom: 0;
right: 0;
Expand All @@ -38,7 +38,11 @@
max-width: 700px;
}

@media (min-width: 768px) {
.login-container div {
margin: 10px;
}

@media (min-width: 992px) {
.login-container {
min-width: 700px;
}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/auth/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
<form method="POST" action="#" id="loginform">
{{ form.hidden_tag() }}
<div class="form-group input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<span class="input-group-text"><i class="bi-person-fill"></i></span>
{{ form.username(class_='form-control', placeholder='username') }}
</div>
<div class="form-group input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<span class="input-group-text"><i class="bi-lock-fill"></i></span>
{{ form.password(class_='form-control', placeholder='password') }}
</div>
<div class="form-group input-group">
Expand Down
62 changes: 30 additions & 32 deletions app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,42 @@
{% endblock %}

{% block navbar_top %}
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search..." aria-label="Search" id="navbar-search">
</form>
<ul class="navbar-nav navbar-right">
{% if current_user.is_admin %}
<li><a href="/settings/smbresources"><i class="hidden-xs glyphicon glyphicon-wrench" title="Settings"></i><span class="visible-xs-block">Settings</span></a></li>
<li class="nav-item ms-2"><a class="nav-link" href="/settings/smbresources"><i class="bi-gear-fill" title="Settings"></i><span class="d-md-none ms-2">Settings</span></a></li>
{% endif %}
<li><a href="/print"><i class="hidden-xs glyphicon glyphicon-print" title="Print"></i><span class="visible-xs-block">Print</span></a></li>
<li><a href="/profile/overview"><i class="hidden-xs glyphicon glyphicon-user" title="Profile"></i><span class="hidden-xs">&nbsp;&nbsp;{{ current_user.username }}</span><span class="visible-xs-block">Profile</span></a></li>
<li><a href="{{ url_for('auth.logout') }}"><i class="hidden-xs glyphicon glyphicon-log-out" title="Sign out"></i><span class="visible-xs-block">Sign out</span></a></li>
<li><a href="/help"><i class="hidden-xs glyphicon glyphicon-question-sign" title="Help"></i><span class="visible-xs-block">Help</span></a></li>
<li class="nav-item ms-2"><a class="nav-link" href="/print"><i class="bi-printer-fill" title="Print"></i><span class="d-md-none ms-2">Print</span></a></li>
<li class="nav-item ms-2"><a class="nav-link" href="/profile/overview"><i class="bi-person-fill" title="Profile"></i><span class="d-none d-md-inline ms-2">{{ current_user.username }}</span><span class="d-md-none ms-2">Profile</span></a></li>
<li class="nav-item ms-2"><a class="nav-link" href="{{ url_for('auth.logout') }}"><i class="bi-box-arrow-right" title="Sign out"></i><span class="d-md-none ms-2">Sign out</span></a></li>
<li class="nav-item ms-2"><a class="nav-link" href="/help"><i class="bi-question-circle-fill" title="Help"></i><span class="d-md-none ms-2">Help</span></a></li>
</ul>
<form class="nav navbar-form navbar-right">
<input type="text" id="navbar-search" class="form-control" placeholder="Search...">
</form>
</div>
{% endblock %}

{% block content %}
<div class="container-fluid">
<div class="row">
<div id="sidebar" class="col-sm-3 col-md-2 sidebar">
{% block sidebarnav %}{% endblock %}
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<div class="container" id="flashmessages">
{% for message in get_flashed_messages() %}
{{ begin_flashmsg|safe }}
{{ message }}
{{ end_flashmsg|safe }}
{% endfor %}
</div>
{% block page_content %}{% endblock %}
{% block dialogs %}
{% include "dialogs/confirmdelete.html" %}
{% include "dialogs/error.html" %}
{% endblock %}
</div>
<div class="container-fluid">
<div class="row">
<div id="sidebar" class="col-lg-2 sidebar">
{% block sidebarnav %}{% endblock %}
</div>
<div class="col-lg-10 offset-lg-2 main">
<div class="container" id="flashmessages">
{% for message in get_flashed_messages() %}
{{ begin_flashmsg|safe }}
{{ message }}
{{ end_flashmsg|safe }}
{% endfor %}
</div>
{% block page_content %}
{% endblock %}
{% block dialogs %}
{% include "dialogs/confirmdelete.html" %}
{% include "dialogs/error.html" %}
{% endblock %}
</div>

<div class="content-overlay"></div>
</div>
</div>
<div class="content-overlay"></div>
{% endblock %}
6 changes: 3 additions & 3 deletions app/templates/browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<div id="browser-frame">
<div id="header">
<div id="pathbuttons" class="btn-group" role="group">
<button type="button" class="btn btn-default folder" data-url="">
<i class="glyphicon glyphicon-home"></i>
<button type="button" class="btn btn-secondary folder" data-url="">
<i class="bi-house"></i>
</button>
{% if smb_path is not undefined and smb_path != '' %}
{% set curr_path = '' %}
{% for element in smb_path.split('/') %}
{% set curr_path = curr_path+('/' if curr_path != '' else '')+element %}
<button type="button" class="btn btn-default folder" data-url="{{ curr_path }}">
<button type="button" class="btn btn-secondary folder" data-url="{{ curr_path }}">
{{ element }}
</button>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/dialogs/confirmdelete.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p class="debug-id"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<a class="btn btn-danger btn-ok">Delete</a>
</div>
{% endcall %}
2 changes: 1 addition & 1 deletion app/templates/dialogs/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{% call dialog.render_modal_dialog('dlg-error', 'Error') %}
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">OK</button>
</div>
{% endcall %}
6 changes: 3 additions & 3 deletions app/templates/dialogs/userbrowser.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<div class="modal-body">
<div>Select a user you want to share this sample with:<br>&nbsp;</div>
<div class="form-group input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<span class="input-group-text"><i class="bi-person-fill"></i></span>
<input type="text" id="username" class="form-control" placeholder="username">
</div>
<div id="recent-collaborators"></div>
</div>
<div class="modal-footer">
<button id="userbrowserok" type="button" class="btn btn-primary" data-dismiss="modal">
<button id="userbrowserok" type="button" class="btn btn-primary" data-bs-dismiss="modal">
OK
</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
</div>
{% endcall %}
Loading

0 comments on commit cf482b2

Please sign in to comment.