Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Bootstrap 5 #473

Merged
merged 44 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
41d94b4
Upgrade vendored bootstrap to v5.3.2
lukasjuhrich Oct 7, 2023
d9b52e8
Fix visibility classes
lukasjuhrich Oct 7, 2023
1782943
Reset link underlining
lukasjuhrich Oct 7, 2023
1d303a5
Add missing `nav-link` classes and fix `data-` attributes
lukasjuhrich Oct 7, 2023
168cbf4
Add Bootstrap Icons 1.11.1
FestplattenSchnitzel Oct 7, 2023
aebfdec
Replace glyphicon with Bootstrap icon classes
FestplattenSchnitzel Oct 7, 2023
da9e60b
Remove unused CSS and fonts
FestplattenSchnitzel Oct 7, 2023
70b2960
Fix navbar for bs5
lukasjuhrich Oct 7, 2023
dfd96dc
Remove unused `trafficgauge` css rule
lukasjuhrich Oct 7, 2023
95364f0
Re-Add removed `_("Login")` label text
lukasjuhrich Oct 7, 2023
9fe1685
Replace `col-xs-` by `col-`
lukasjuhrich Oct 7, 2023
5b119f3
Replace `btn-default` classes by something else
lukasjuhrich Oct 7, 2023
7a5712c
Replace panels with cards
lukasjuhrich Oct 7, 2023
61c1927
slightly improve transactions table readability
lukasjuhrich Oct 8, 2023
f3ffbee
Improve password blur
lukasjuhrich Oct 8, 2023
6995dab
fix some further nav issues
lukasjuhrich Oct 8, 2023
954fe47
Make buttons move to right again with flex layout
lukasjuhrich Oct 8, 2023
97b62f4
Replace bootstrap-toc with Tocbot
FestplattenSchnitzel Oct 8, 2023
6d0cfd6
Remove replaced bootstrap-toc
FestplattenSchnitzel Oct 8, 2023
048d102
Fix label classes in pages
lukasjuhrich Oct 8, 2023
c2f651f
Fix and improve news design
lukasjuhrich Oct 8, 2023
0766206
Remove unused CSS rules
lukasjuhrich Oct 8, 2023
4440eb1
Replace `.newsblock` class by builtin bootstrap helper class
lukasjuhrich Oct 8, 2023
fe08dc5
Fix news pager
lukasjuhrich Oct 8, 2023
143574b
Give more space to sidebar
lukasjuhrich Oct 8, 2023
097db7a
[js] extract icon generation in status widget
lukasjuhrich Oct 8, 2023
553eddb
[js] simplify content generation in status widget
lukasjuhrich Oct 8, 2023
969d705
[js] extract status determination
lukasjuhrich Oct 9, 2023
740bf69
[js] Configure `StatusPage` with full endpoint URL instead of concate…
lukasjuhrich Oct 9, 2023
9502c6d
[js] fix icon classes in statuspage JS
lukasjuhrich Oct 9, 2023
1338d3f
Fix some html classes in statuspage widget definitions
lukasjuhrich Oct 9, 2023
1118033
[js] improve type hinting of status messages dict
lukasjuhrich Oct 9, 2023
45db44b
[js] fix statuspage widget tooltip generation
lukasjuhrich Oct 9, 2023
332e6b2
Add glowing placeholder to statuspage widget
lukasjuhrich Oct 9, 2023
26023be
Add frozen statuspage JSON response for testing
lukasjuhrich Oct 9, 2023
02639d0
Put `<script>` tags into the `head`, using `defer`
lukasjuhrich Oct 9, 2023
1a79ac9
Replace language dropdown by radio button in mobile breakpoints
lukasjuhrich Oct 9, 2023
7b86336
Extract locale image end text to jinja macro
lukasjuhrich Oct 9, 2023
e6079dd
Highlight current language in dropdown
lukasjuhrich Oct 9, 2023
e4c3604
Add replacements for pages' icons
lukasjuhrich Oct 9, 2023
6fc8fb5
Extract article and page rendering to jinja macros
lukasjuhrich Oct 9, 2023
897e39f
Restructure page vs. article templates
lukasjuhrich Oct 9, 2023
68fac88
Fix toc breakpoint
lukasjuhrich Oct 9, 2023
cfdafbb
Change colour of TOC position hint in usersuite
FestplattenSchnitzel Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions sipa/blueprints/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ def show():
reverse=True,
)
if len(news) == 0:
return render_template("index.html", articles=None,
previous_range=0, next_range=0)
return render_template(
"news.html", articles=None, previous_range=0, next_range=0
)

default_step = 10
# calculating mod len() allows things like `end=-1` for the last
Expand Down Expand Up @@ -56,8 +57,12 @@ def show():
if end < len(news) - 1:
next_range = {'start': end + 1, 'end': min(end + delta, len(news) - 1)}

return render_template("index.html", articles=news[start:end+1],
previous_range=prev_range, next_range=next_range)
return render_template(
"news.html",
articles=news[start : end + 1],
previous_range=prev_range,
next_range=next_range,
)


@bp_news.route("/<filename>")
Expand All @@ -66,6 +71,6 @@ def show_news(filename):

for article in news:
if article.file_basename == filename:
return render_template("template.html", article=article)
return render_template("news.html", articles=[article])

abort(404)
2 changes: 1 addition & 1 deletion sipa/blueprints/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def show(category_id, article_id):
if article.link:
return redirect(article.link)

return render_template("template.html", article=article)
return render_template("page.html", article=article)
6 changes: 6 additions & 0 deletions sipa/flatpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ def hidden(self) -> bool:
"""
return self.localized_page.meta.get('hidden', False)

@property
def icon(self) -> str:
return self.localized_page.meta.get("icon") or self.localized_page.meta.get(
"glyphicon"
)

def __getattr__(self, attr: str) -> str:
"""Return the meta attribute of the localized page

Expand Down
31 changes: 31 additions & 0 deletions sipa/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,37 @@ def init_app(app, **kwargs):
app.context_processor(inject_meetingcal)

app.add_template_filter(render_links)

def glyphicon_to_bi(glyphicon: str) -> str:
MAP = {
"glyphicon-briefcase": "bi-briefcase-fill",
"glyphicon-bullhorn": "bi-megaphone-fill",
"glyphicon-chevron-down": "bi-chevron-down",
"glyphicon-cloud": "bi-cloud-fill",
"glyphicon-comment": "bi-chat-left-fill",
"glyphicon-dashboard": "bi-speedometer",
"glyphicon-download-alt": "bi-download",
"glyphicon-envelope": "bi-envelope-fill",
"glyphicon-euro": "bi-currency-euro",
"glyphicon-file": "bi-file-earmark-fill",
"glyphicon-globe": "bi-globe-europe-africa",
"glyphicon-headphones": "bi-headphones",
"glyphicon-list-alt": "bi-card-list",
"glyphicon-lock": "bi-lock-fill",
"glyphicon-log-in": "bi-box-arrow-in-right",
"glyphicon-question-sign": "bi-question-circle-fill",
"glyphicon-retweet": "bi-arrow-repeat",
"glyphicon-signal": "bi-router-fill", # used for router page
"glyphicon-star": "bi-star-fill",
"glyphicon-tasks": "bi-box-arrow-up-right",
"glyphicon-tint": "bi-droplet-fill",
"glyphicon-transfer": "bi-arrow-left-right",
"glyphicon-user": "bi-person-fill",
"glyphicon-wrench": "bi-wrench-adjustable",
}
return MAP.get(glyphicon, glyphicon.replace("glyphicon-", "bi-"))

app.add_template_filter(glyphicon_to_bi)
logger.debug("Jinja globals have been set",
extra={'data': {'jinja_globals': app.jinja_env.globals}})

Expand Down
5 changes: 5 additions & 0 deletions sipa/static/bootstrap-icons.min.css

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions sipa/static/css/bootstrap-toc.min.css

This file was deleted.

11 changes: 6 additions & 5 deletions sipa/static/css/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sipa/static/css/bootstrap.min.css.map

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions sipa/static/css/fa-all.min.css

This file was deleted.

65 changes: 9 additions & 56 deletions sipa/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
display: none;
}

.newsblock {
margin-bottom: 40px;
}

hr {
margin-bottom: 5px;
margin-top: 5px;
}

body {
padding-top: 50px;
/* LINKS:
* Don't underline them if they're not part of a special component
* (i.e., don't have a `class=` attribute
*/
a:not([class]):not(:hover) {
text-decoration: none;
}

.affix {
top: 60px;
width: 100%;
max-width: inherit;
a:not([class]):hover {
text-decoration: underline;
}

@media (min-width: 768px) {
Expand Down Expand Up @@ -61,36 +60,6 @@ body {
opacity: 1;
}

@media (max-height: 480px) {
#navbar {
max-height: 200px;
}
}

@media (max-height: 300px) {
#navbar {
max-height: 150px;
}
}

@media (max-width: 767px) {
#navbar {
background: linear-gradient(0deg, rgba(0, 0, 0, 0.1), white 40%);
}

#navbar > ul:last-child {
border-bottom: 4px double rgba(0, 0, 0, 0.1);
}
}

#trafficgauge {
height: 200px;
/* Hack to remove upper spacing of the trafficgauge
* See https://github.com/toorshia/justgage/issues/172
*/
margin-top: -50px;
}

.module {
padding: 15px;
margin-bottom: 10px;
Expand Down Expand Up @@ -118,18 +87,6 @@ body {
margin-right: -15px;
}

a#traffic_gauge_link {
text-decoration: none;
transition: text-shadow 1s ease, color 1s ease;
-moz-transition: text-shadow 1s ease, color 1s ease;
-webkit-transition: text-shadow 1s ease, color 1s ease;
-o-transition: text-shadow 1s ease, color 1s ease;
}

#traffic_gauge_error {
margin-top: 1em;
}

div#row-contact div.module > div > div.row + div.row{
margin-top: 1em;
}
Expand All @@ -139,10 +96,6 @@ td {
padding-bottom: 20px;
}

#trafstat {
width: 100%;
}

img[alt=software_logo] {
width: 100px;
}
Expand All @@ -161,7 +114,7 @@ img[alt=software_logo] {


.text-password {
filter: blur(2px);
filter: blur(5px);
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
}

Expand Down
1 change: 1 addition & 0 deletions sipa/static/css/tocbot.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions sipa/static/css/usersuite_index.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#usersuite-sidebar-nav .nav>li>a {
font-size: 20px;
.toc .node-name--H2 {
font-size: 1.5rem;
}
#usersuite-sidebar-nav .nav .nav>li>a {
font-size: 19px;
.toc .node-name--H3 {
font-size: 1.25rem;
}

.is-active-link::before {
background-color: var(--bs-primary);
}

h2,h3 {
padding-top: 70px;
margin-top: -50px;
Expand Down
Binary file removed sipa/static/fonts/Oxygen-Bold.otf
Binary file not shown.
Binary file removed sipa/static/fonts/Oxygen-BoldItalic.otf
Binary file not shown.
Binary file removed sipa/static/fonts/Oxygen-Italic.otf
Binary file not shown.
Binary file removed sipa/static/fonts/Oxygen.otf
Binary file not shown.
Binary file added sipa/static/fonts/bootstrap-icons.woff
Binary file not shown.
Binary file added sipa/static/fonts/bootstrap-icons.woff2
Binary file not shown.
Binary file removed sipa/static/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
Loading
Loading