Separate footer and fixed expiry date #46
7 changed files with 48 additions and 25 deletions
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
commit
357bf6aea2
|
|
@ -8,7 +8,7 @@ rust-version = "1.64"
|
|||
license = "MIT OR Apache-2.0"
|
||||
include = ["APACHE-2.0.LICENSE","MIT.LICENSE"]
|
||||
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"
|
||||
|
||||
[workspace.dependencies]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
- 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
|
||||
- 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)
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ struct BaseData<'a> {
|
|||
title: Cow<'a, str>,
|
||||
short_lang: Cow<'a, str>,
|
||||
links: Vec<Link<'a>>,
|
||||
footer_links: Vec<Link<'a>>,
|
||||
styles: Vec<Url>,
|
||||
routes: StaticRoutes,
|
||||
banner: Option<String>,
|
||||
|
|
@ -129,26 +130,32 @@ fn base<'a>(
|
|||
|
||||
let static_routes = StaticRoutes::new(req)?;
|
||||
|
||||
let mut default_links = vec![(
|
||||
"Impressum",
|
||||
Some("https://www.fs-infmath.uni-kiel.de/wiki/Fachschaften_Informatik_%26_Mathematik:Impressum".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 mut default_links = vec![
|
||||
("Homepage", crate::PROJECT_HOMEPAGE.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)]
|
||||
// the collect is necessary to end the borrow of borrows default_links by the map closure
|
||||
let links = config
|
||||
.config
|
||||
.footer_links
|
||||
.header_links
|
||||
.iter()
|
||||
.map(|elem| {
|
||||
default_links.retain(|&(title, _)| title != elem.title);
|
||||
|
|
@ -171,6 +178,7 @@ fn base<'a>(
|
|||
short_lang: "de".into(),
|
||||
styles: vec![index_css],
|
||||
links,
|
||||
footer_links,
|
||||
routes: static_routes,
|
||||
banner: config.config.banner.clone(),
|
||||
operation_mode: config.args.mode.clone(),
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pub(crate) struct ProgramConfig {
|
|||
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||
pub(crate) banner: Option<String>,
|
||||
#[serde(default)]
|
||||
pub(crate) footer_links: Vec<Link>,
|
||||
pub(crate) header_links: Vec<Link>,
|
||||
pub(crate) login_provider: LoginProviderConfig,
|
||||
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||
pub(crate) email: Option<EmailConfig>,
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@
|
|||
{{> @partial-block }}
|
||||
</main>
|
||||
</div>
|
||||
{{> footer}}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
20
packages/jobboerse/templates/footer.hb
Normal file
20
packages/jobboerse/templates/footer.hb
Normal 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>
|
||||
|
|
@ -4,9 +4,6 @@
|
|||
<h3 class="inline">{{link.title}}</h3>
|
||||
</a>
|
||||
{{/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}}">
|
||||
<h3 class="inline">Stellenanzeige einreichen</h3>
|
||||
</a>
|
||||
|
|
@ -15,19 +12,13 @@
|
|||
title="Alle abgelaufenen Stellenanzeigen löschen">
|
||||
<h3 class="inline">Abgelaufene löschen</h3>
|
||||
</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">
|
||||
<h3 class="inline">Abmelden</h3>
|
||||
<form class="hidden" method="post" action="{{base.routes.logout}}">
|
||||
<input type="submit" id="submit-logout" class="hidden">
|
||||
</form>
|
||||
</label {{else}} <a class="menu-item" href="{{base.routes.login}}">
|
||||
<h3 class="inline">Fachschaftler-Login</h3>
|
||||
<h3 class="inline">Fachschafts-Login</h3>
|
||||
</a>
|
||||
{{/if}}
|
||||
</nav>
|
||||
Loading…
Add table
Add a link
Reference in a new issue