Separate footer and fixed expiry date #46

Merged
ldr merged 12 commits from separate-footer into main 2026-03-17 19:48:48 +01:00
7 changed files with 48 additions and 25 deletions
Showing only changes of commit 357bf6aea2 - Show all commits

Reintroduce footer

- Rename the `footer_links` to `header_links` in the config files
- Change links to point to the student association for computer science instead of the common website of both student associations
Lukas Drescher 2026-03-13 23:17:46 +01:00

View file

@ -8,7 +8,7 @@ rust-version = "1.64"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
include = ["APACHE-2.0.LICENSE","MIT.LICENSE"] include = ["APACHE-2.0.LICENSE","MIT.LICENSE"]
repository = "https://www.fs-infmath.uni-kiel.de/git/FS-InfMath/Jobboerse" repository = "https://www.fs-infmath.uni-kiel.de/git/FS-InfMath/Jobboerse"
homepage = "https://www.fs-infmath.uni-kiel.de/wiki/Hauptseite" homepage = "https://www.fs-informatik.uni-kiel.de/"
readme = "README.md" readme = "README.md"
[workspace.dependencies] [workspace.dependencies]

View file

@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove the background gradient on the index page - Remove the background gradient on the index page
- Update the color scheme to more closely resemble the theme of the student association for computer science - Update the color scheme to more closely resemble the theme of the student association for computer science
- Change the logo to that of the student association for computer science - Change the logo to that of the student association for computer science
- Rename the `footer_links` to `header_links` in the config files
- Reintroduce a footer
- Change links to point to the student association for computer science instead of the common website of both student associations
## [0.4.1] (2024-01-02) ## [0.4.1] (2024-01-02)

View file

@ -61,6 +61,7 @@ struct BaseData<'a> {
title: Cow<'a, str>, title: Cow<'a, str>,
short_lang: Cow<'a, str>, short_lang: Cow<'a, str>,
links: Vec<Link<'a>>, links: Vec<Link<'a>>,
footer_links: Vec<Link<'a>>,
styles: Vec<Url>, styles: Vec<Url>,
routes: StaticRoutes, routes: StaticRoutes,
banner: Option<String>, banner: Option<String>,
@ -129,26 +130,32 @@ fn base<'a>(
let static_routes = StaticRoutes::new(req)?; let static_routes = StaticRoutes::new(req)?;
let mut default_links = vec![( let mut default_links = vec![
"Impressum", ("Homepage", crate::PROJECT_HOMEPAGE.map(Into::into)),
Some("https://www.fs-infmath.uni-kiel.de/wiki/Fachschaften_Informatik_%26_Mathematik:Impressum".into()), ("FAQ", Some(static_routes.faq.to_string().into())),
),
(
"Homepage",
crate::PROJECT_HOMEPAGE.map(Into::into)
),
(
"Source Repository",
crate::PROJECT_REPO.map(Into::into),
),
("FAQ", Some(static_routes.faq.to_string().into()))
]; ];
let footer_links = vec![
(
"Impressum",
Some("https://www.fs-informatik.uni-kiel.de/impressum/"),
),
("Source Repository", crate::PROJECT_REPO.map(Into::into)),
]
.iter()
.filter_map(|(title, url)| {
url.map(|url| Link {
title,
url: url.into(),
})
})
.collect::<Vec<_>>();
#[allow(clippy::needless_collect)] #[allow(clippy::needless_collect)]
// the collect is necessary to end the borrow of borrows default_links by the map closure // the collect is necessary to end the borrow of borrows default_links by the map closure
let links = config let links = config
.config .config
.footer_links .header_links
.iter() .iter()
.map(|elem| { .map(|elem| {
default_links.retain(|&(title, _)| title != elem.title); default_links.retain(|&(title, _)| title != elem.title);
@ -171,6 +178,7 @@ fn base<'a>(
short_lang: "de".into(), short_lang: "de".into(),
styles: vec![index_css], styles: vec![index_css],
links, links,
footer_links,
routes: static_routes, routes: static_routes,
banner: config.config.banner.clone(), banner: config.config.banner.clone(),
operation_mode: config.args.mode.clone(), operation_mode: config.args.mode.clone(),

View file

@ -33,7 +33,7 @@ pub(crate) struct ProgramConfig {
#[serde(skip_serializing_if = "Option::is_none", default)] #[serde(skip_serializing_if = "Option::is_none", default)]
pub(crate) banner: Option<String>, pub(crate) banner: Option<String>,
#[serde(default)] #[serde(default)]
pub(crate) footer_links: Vec<Link>, pub(crate) header_links: Vec<Link>,
pub(crate) login_provider: LoginProviderConfig, pub(crate) login_provider: LoginProviderConfig,
#[serde(skip_serializing_if = "Option::is_none", default)] #[serde(skip_serializing_if = "Option::is_none", default)]
pub(crate) email: Option<EmailConfig>, pub(crate) email: Option<EmailConfig>,

View file

@ -14,5 +14,6 @@
{{> @partial-block }} {{> @partial-block }}
</main> </main>
</div> </div>
{{> footer}}
</body> </body>
</html> </html>

View file

@ -0,0 +1,20 @@
<footer class="footer">
<nav class="menu">
{{#each base.footer_links as |link|}}
<a class="footer-item" href="{{link.url}}">
<h3 class="inline">{{link.title}}</h3>
</a>
{{/each}}
<a class="footer-item" href="{{base.routes.licenses}}">
<h3 class="inline">Drittanbieter-Lizenzen</h3>
</a>
{{#if user}}
<label class="footer-item" for="submit-sync" tabindex="0">
<h3 class="inline" title="Reload Joboffer Metadata from Disk">Re-Sync</h3>
<form class="hidden" method="post" action="{{base.routes.sync}}">
<input type="submit" id="submit-sync" class="hidden">
</form>
</label>
{{/if}}
</nav>
</footer>

View file

@ -4,9 +4,6 @@
<h3 class="inline">{{link.title}}</h3> <h3 class="inline">{{link.title}}</h3>
</a> </a>
{{/each}} {{/each}}
<a class="menu-item" href="{{base.routes.licenses}}">
<h3 class="inline">Drittanbieter-Lizenzen</h3>
</a>
<a class="menu-item" href="{{base.routes.joboffer_create}}"> <a class="menu-item" href="{{base.routes.joboffer_create}}">
<h3 class="inline">Stellenanzeige einreichen</h3> <h3 class="inline">Stellenanzeige einreichen</h3>
</a> </a>
@ -15,19 +12,13 @@
title="Alle abgelaufenen Stellenanzeigen löschen"> title="Alle abgelaufenen Stellenanzeigen löschen">
<h3 class="inline">Abgelaufene löschen</h3> <h3 class="inline">Abgelaufene löschen</h3>
</a> </a>
<label class="menu-item" for="submit-sync" tabindex="0">
<h3 class="inline" title="Reload Joboffer Metadata from Disk">Re-Sync</h3>
<form class="hidden" method="post" action="{{base.routes.sync}}">
<input type="submit" id="submit-sync" class="hidden">
</form>
</label>
<label class="menu-item" for="submit-logout" tabindex="0"> <label class="menu-item" for="submit-logout" tabindex="0">
<h3 class="inline">Abmelden</h3> <h3 class="inline">Abmelden</h3>
<form class="hidden" method="post" action="{{base.routes.logout}}"> <form class="hidden" method="post" action="{{base.routes.logout}}">
<input type="submit" id="submit-logout" class="hidden"> <input type="submit" id="submit-logout" class="hidden">
</form> </form>
</label {{else}} <a class="menu-item" href="{{base.routes.login}}"> </label {{else}} <a class="menu-item" href="{{base.routes.login}}">
<h3 class="inline">Fachschaftler-Login</h3> <h3 class="inline">Fachschafts-Login</h3>
</a> </a>
{{/if}} {{/if}}
</nav> </nav>