Skip to content

Commit

Permalink
Upgrade bootstrap to v5
Browse files Browse the repository at this point in the history
Use npm to install bootstrap and remove copy of bootstrap from repository.

Adjust stylings for bootstrap 5.

Format some js files.
  • Loading branch information
dchiller committed Jan 9, 2025
1 parent 5b16099 commit 1c7ce30
Show file tree
Hide file tree
Showing 264 changed files with 1,469 additions and 51,489 deletions.
81 changes: 33 additions & 48 deletions app/public/cantusdata/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<title>
{% block document_title %}Cantus Ultimus{% endblock %}
</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Language" content="en_US" />
{# Replace .no-js with .js before loading the CSS #}
<script>
Expand All @@ -14,64 +14,49 @@
html.className = html.className.replace(/\bno-js\b/g, 'js');
})(document.documentElement);
</script>
<link rel="stylesheet" type="text/css" href="/static/css/cantus-min.css">
<link rel="stylesheet" type="text/css" href="/static/css/cantus-min.css" />
{% block head %}{% endblock %}
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/ico" href="/static/img/favicon.ico">
<link rel="icon" type="image/ico" href="/static/img/favicon.ico" />
</head>
<body>
<div id="menu-sidenav"></div>
<div id="header-container">
<div id="page-header">
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand">
<a class="primary-brand-component" href="/">Cantus Ultimus (v{{ APP_VERSION }})</a><!-- no space
--><span id="page-title">
<nav class="navbar navbar-default navbar-expand-lg bg-dark"
data-bs-theme="dark"
role="navigation">
<div class="container-fluid justify-content-start align-items-stretch">
<button class="navbar-toggler py-3"
type="button"
aria-controls="top-menu"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-brand py-3">
<a class="primary-brand-component" href="/">Cantus Ultimus (v{{ APP_VERSION }})</a><!-- no space--><span id="page-title">
{% block breadcrumb %}{% endblock %}
</span>
</div>
</div>
<div class="collapse navbar-collapse" id="top-menu">
<ul class="nav navbar-nav navbar-right">
<li>
<a style="font-weight:bold; font-size:larger" href="/manuscripts/">Manuscripts</a>
</li>
<div class="collapse navbar-collapse navbar-nav justify-content-end align-items-stretch"
id="top-menu">
<a class="nav-link py-3" href="/manuscripts/">Manuscripts</a>
{% if IS_DEVELOPMENT %}
<li>
<a href="/manifests/">IIIF Manifests</a>
</li>
<a class="nav-link py-3" href="/manifests/">IIIF Manifests</a>
{% endif %}
<li>
<a href="/about/">About</a>
</li>
<li>
<a href="/activities/">Activities</a>
</li>
<li>
<a href="/team/">Team</a>
</li>
<li>
<a href="/search/" class="search-modal-link">Search</a>
</li>
<li>
<a href="/admin/">Admin Page</a>
</li>
</ul>
<a class="nav-link py-3" href="/about/">About</a>
<a class="nav-link py-3" href="/activities/">Activities</a>
<a class="nav-link py-3" href="/team/">Team</a>
<a class="nav-link py-3" data-bs-toggle="modal" href="#searchModal">Search</a>
<a class="nav-link py-3" href="/admin/">Admin Page</a>
</div>
</div>
</div>
</nav>
<div id="search-modal"></div>
<div id="about-volpiano-modal"></div>
</nav>
<div id="search-modal"></div>
<div id="about-volpiano-modal"></div>
</div>
</div>
</div>
{% block body %}{% endblock %}
</body>
{% block body %}{% endblock %}
</body>
</html>
25 changes: 13 additions & 12 deletions app/public/cantusdata/templates/require.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{% extends "base.html" %}
{% block head %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-2371659-10', 'auto');
ga('send', 'pageview');
</script>
<script defer src="/static/js/app/cantus-min.js"></script>
{% endblock %}
{% block body %}
<noscript class="no-js-message">
<div class="container">
Expand All @@ -13,21 +25,10 @@
<div class="col-lg-12">
<img class="center-block logos"
alt="Combined logos: Social Sciences and Humanities Research Council of Canada; Schulich School of Music, McGill University; Distributed Digital Music Archives and Libraries Lab; Centre for Interdisciplinary Research in Music Media and Technology; Fonds de recherche du Québec – Société et culture"
src="/static/img/all_logos_sm.png">
src="/static/img/all_logos_sm.png" />
</div>
</div>
</div>
</noscript>
<div id="content-root"></div>
<script src="/static/js/app/cantus-min.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-2371659-10', 'auto');
ga('send', 'pageview');

</script>
{% endblock %}
17 changes: 6 additions & 11 deletions app/public/cantusdata/templates/staticpages/general.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
{% extends "base.html" %}

{% block document_title %}
Cantus Ultimus {% if title %}— {{ title }}{% endif %}
Cantus Ultimus
{% if title %}— {{ title }}{% endif %}
{% endblock %}

{% spaceless %}
{% block breadcrumb %}
{% if title %}
<a class="secondary-brand-component">{{ title }}</a>
{% endif %}
{% if title %}<a class="secondary-brand-component">{{ title }}</a>{% endif %}
{% endblock %}
{% endspaceless %}

{% block body %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-lg-10">
<h1 class="h2">{{ title }}</h1>
<div>{{ content|safe }}</div>
</div>
</div>
</div>

<script src="/static/js/app/cantus-static-min.js"></script>
{% endblock %}
142 changes: 68 additions & 74 deletions app/public/cantusdata/templates/staticpages/homepage.html
Original file line number Diff line number Diff line change
@@ -1,94 +1,88 @@
{% extends "base.html" %}

{% block body %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-lg-10">
<h1 class="h2">{{ title }}</h1>
<div>{{ content|safe }}</div>
</div>
</div>
</div>

<script src="/static/js/app/cantus-static-min.js"></script>
<style>
div.logo_map {
position: relative;
}

<style>
div.logo_map {
position: relative;
}

div.logo_map > img {
display: block;
max-width: 100%;
margin: 0 auto;
}

div.logo_map > a {
display: block;
position: absolute;
}
div.logo_map>img {
display: block;
max-width: 100%;
margin: 0 auto;
}

div.logo_map > a:hover {
background-color: rgba(255, 0, 0, .0);
}
div.logo_map>a {
display: block;
position: absolute;
}

div.logo_map > a.simssa {
top: 8%;
left: 20%;
width: 60%;
height: 27%;
}
div.logo_map>a:hover {
background-color: rgba(255, 0, 0, .0);
}

div.logo_map > a.sshrc {
top: 33%;
left: 20%;
width: 60%;
height: 20%;
}
div.logo_map>a.simssa {
top: 8%;
left: 20%;
width: 60%;
height: 27%;
}

div.logo_map > a.mcgill {
top: 53%;
left: 20%;
width: 34%;
height: 20%;
}
div.logo_map>a.sshrc {
top: 33%;
left: 20%;
width: 60%;
height: 20%;
}

div.logo_map > a.ddmal {
top: 53%;
left: 54%;
width: 26%;
height: 20%;
}
div.logo_map>a.mcgill {
top: 53%;
left: 20%;
width: 34%;
height: 20%;
}

div.logo_map > a.cirmmt {
top: 73%;
left: 20%;
width: 34%;
height: 23%;
}
div.logo_map > a.frqsc {
top: 73%;
left: 54%;
width: 26%;
height: 23%;
}
</style>
div.logo_map>a.ddmal {
top: 53%;
left: 54%;
width: 26%;
height: 20%;
}

div.logo_map>a.cirmmt {
top: 73%;
left: 20%;
width: 34%;
height: 23%;
}

<div class="logo_map">
<img src="/static/img/all_logos_scaled.png"/ border="0" style="max-width:60%">
<a href="https://simssa.ca" target="_blank" class="simssa"></a>
<a href="http://www.sshrc-crsh.gc.ca" target="_blank" class="sshrc"></a>
<a href="https://www.mcgill.ca/music" target="_blank" class="mcgill"></a>
<a href="http://ddmal.music.mcgill.ca/" target="_blank" class="ddmal"></a>
<a href="http://www.cirmmt.org" target="_blank" class="cirmmt"></a>
<a href="http://www.frqsc.gouv.qc.ca" target="_blank" class="frqsc"></a>
</div>

<!--
div.logo_map>a.frqsc {
top: 73%;
left: 54%;
width: 26%;
height: 23%;
}
</style>
<div class="logo_map">
<img src="/static/img/all_logos_scaled.png"/ border="0" style="max-width:60%" />
<a href="https://simssa.ca" target="_blank" class="simssa"></a>
<a href="http://www.sshrc-crsh.gc.ca" target="_blank" class="sshrc"></a>
<a href="https://www.mcgill.ca/music" target="_blank" class="mcgill"></a>
<a href="http://ddmal.music.mcgill.ca/" target="_blank" class="ddmal"></a>
<a href="http://www.cirmmt.org" target="_blank" class="cirmmt"></a>
<a href="http://www.frqsc.gouv.qc.ca" target="_blank" class="frqsc"></a>
</div>
<!--
<div class="row text-center">
<img src="/static/img/all_logos.png" border="0" style="max-width:60%">
<img src="/static/img/all_logos.png" border="0" style="max-width:60%" />
</div>
-->

{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN unzip volpiano51_web.zip
RUN rm volpiano51_web.zip
RUN mv volpiano51_web/volpiano.woff ../static/fonts/volpiano.woff
COPY ./public/node/ /code/
RUN gulp build --release
RUN gulp build

FROM nginx:1.25
COPY ./nginx.conf /etc/nginx/nginx.conf
Expand Down
7 changes: 3 additions & 4 deletions nginx/public/node/frontend/gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ gulp.task('build:js', gulp.series('clean:js', 'bundle:js'), function (cb) {

gulp.task('bundle:css', function () {
var sources = [
'./public/css/bootstrap-theme.min.css',
'./public/css/diva.min.css',
'./public/css/styles.scss'
'./public/css/styles.scss',
'./public/css/diva.min.css'
];

var isScssFile = /\.scss$/;
Expand All @@ -115,7 +114,7 @@ gulp.task('bundle:css', function () {

var compileScss = lazypipe()
.pipe(function () {
return sass({ outputStyle: 'compressed' }).on('error', sass.logError);
return sass({ loadPaths: ["node_modules"] }).on('error', sass.logError);
})
.pipe(autoprefixer);

Expand Down
3 changes: 3 additions & 0 deletions nginx/public/node/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"title": "Cantus Ultimus frontend",
"private": true,
"description": "Frontend for the Cantus Ultimus project",
"dependencies": {
"bootstrap": "^5.3.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"babel-loader": "^9.0.0",
Expand Down
Loading

0 comments on commit 1c7ce30

Please sign in to comment.