From 88e048c84cef9000e9c7600f1a141ca9df0c708f Mon Sep 17 00:00:00 2001 From: Rob Beeston Date: Sat, 7 Sep 2024 07:41:44 +0000 Subject: [PATCH] fixes for formatting issues (#1235) --- frontend/styles.css | 2 +- {frontend => static/css}/boostbookV2.css | 0 templates/base.html | 2 +- templates/includes/_header.html | 23 +++++++++++++++++---- templates/libraries/_library_list_item.html | 4 ++-- templates/libraries/category_list.html | 2 +- templates/libraries/detail.html | 4 ++-- templates/libraries/flat_list.html | 2 +- templates/libraries/list.html | 2 +- templates/versions/detail.html | 2 +- 10 files changed, 29 insertions(+), 14 deletions(-) rename {frontend => static/css}/boostbookV2.css (100%) diff --git a/frontend/styles.css b/frontend/styles.css index b0e56a86..cf832185 100644 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -81,7 +81,7 @@ /* just using .content as a class for these for now, but we can change later */ main.content { - @apply px-3 pt-3 mb-3 md:py-0 md:px-0; + @apply px-3 mb-3 md:px-0; } section.content { diff --git a/frontend/boostbookV2.css b/static/css/boostbookV2.css similarity index 100% rename from frontend/boostbookV2.css rename to static/css/boostbookV2.css diff --git a/templates/base.html b/templates/base.html index 669c210e..7db0890c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -56,7 +56,7 @@ {% block messages %}{% include "partials/messages.html" %}{% endblock messages %} -
+
{% block content_wrapper %} {% block subnav %}{% endblock %} {% block content %}{% endblock %} diff --git a/templates/includes/_header.html b/templates/includes/_header.html index 6ee50e40..8f03a74f 100644 --- a/templates/includes/_header.html +++ b/templates/includes/_header.html @@ -146,7 +146,7 @@ html.dark { margin-left: 1rem; font-weight: 500; color: var(--text-color); - font-weight: 18px; + font-size: 18px; } .header-menu-bar .menu-link-right { @@ -154,6 +154,7 @@ html.dark { margin-right: 1rem; font-weight: 600; color: var(--text-color); + font-size: 18px; } .icon-link { @@ -210,7 +211,7 @@ html.dark { #pageselector { text-transform: capitalize; margin-left: 1rem; - font-weight: 600; + font-weight: 500; display:flex; position: absolute; top: 0.25rem; @@ -278,8 +279,8 @@ html.dark { } body .body { - margin: 0px 1.25rem; - padding: 1rem 0rem 0; + margin: 0px 1rem; + padding: 1.5rem 0rem 0; max-width: 80rem; } @@ -504,4 +505,18 @@ html.dark { setTheme(localStorage.getItem("colorMode")); } + function removejscssfile(filename, filetype){ + var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist from + var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for + var allsuspects=document.getElementsByTagName(targetelement) + for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove + if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1) + allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild() + } + } + document.onreadystatechange = () => { + if (document.readyState === 'complete') { + removejscssfile("boostbook.css", "css") + } + } diff --git a/templates/libraries/_library_list_item.html b/templates/libraries/_library_list_item.html index 77574b11..d48de74d 100644 --- a/templates/libraries/_library_list_item.html +++ b/templates/libraries/_library_list_item.html @@ -32,9 +32,9 @@ onclick="window.location='{% if version %}{% url 'library-detail-by-version' slu
{#
{% if library.first_boost_version %}{{ library.first_boost_version.release_date|years_since }} yrs{% endif %}
#} -
+
{% for c in library.categories.all %} - {{ c.name }}{% if not forloop.last %}, {% endif %}{% endfor %} + {{ c.name }}{% if not forloop.last %}, {% endif %}{% endfor %}
diff --git a/templates/libraries/category_list.html b/templates/libraries/category_list.html index b632234b..8df604f9 100644 --- a/templates/libraries/category_list.html +++ b/templates/libraries/category_list.html @@ -8,7 +8,7 @@ {% block content %}
-
+
{% comment %}
diff --git a/templates/libraries/detail.html b/templates/libraries/detail.html index 8a700bcd..eea5aacc 100644 --- a/templates/libraries/detail.html +++ b/templates/libraries/detail.html @@ -8,7 +8,7 @@ {% block content %}
-
diff --git a/templates/libraries/flat_list.html b/templates/libraries/flat_list.html index 04da706e..31cff77d 100644 --- a/templates/libraries/flat_list.html +++ b/templates/libraries/flat_list.html @@ -8,7 +8,7 @@ {% block content %}
-
+
{% comment %}
diff --git a/templates/libraries/list.html b/templates/libraries/list.html index 1cd08a8c..be4dc6df 100644 --- a/templates/libraries/list.html +++ b/templates/libraries/list.html @@ -8,7 +8,7 @@ {% block content %}
{% if library_list %} -
+
{% comment %}
diff --git a/templates/versions/detail.html b/templates/versions/detail.html index ecfe3d0c..64669cee 100644 --- a/templates/versions/detail.html +++ b/templates/versions/detail.html @@ -7,7 +7,7 @@ {% block content %}
{% if version %} -