Compare commits

...

4 commits

Author SHA1 Message Date
9a693821ce push cargo-lock
Some checks failed
ci/woodpecker/pr/cargo_check Pipeline was successful
ci/woodpecker/pr/cargo_clippy Pipeline was successful
ci/woodpecker/pr/cargo_test Pipeline was successful
ci/woodpecker/pr/check_fmt Pipeline failed
2025-04-09 09:59:45 +02:00
f81590ff24 feat: automatically run migration on startup 2025-04-09 09:59:45 +02:00
9bad76dcd6 Merge pull request 'chaged the header and styling' (#60) from frontend/changing-more-things-on-header into main
Reviewed-on: #60
Reviewed-by: DulliGulli <jan.hoegerle@gmail.com>
2025-04-09 09:45:15 +02:00
6b4dd96d83 chaged the header and styling
Some checks failed
ci/woodpecker/pr/cargo_check Pipeline was successful
ci/woodpecker/pr/cargo_clippy Pipeline was successful
ci/woodpecker/pr/cargo_test Pipeline was successful
ci/woodpecker/pr/check_fmt Pipeline failed
2025-04-09 09:38:53 +02:00
7 changed files with 4414 additions and 98 deletions

2
.gitignore vendored
View file

@ -6,7 +6,7 @@ target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock # Cargo.lock
# These are backup files generated by rustfmt # These are backup files generated by rustfmt
**/*.rs.bk **/*.rs.bk

4314
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -16,4 +16,8 @@ impl Database {
conn: sea_orm::Database::connect(options).await?, conn: sea_orm::Database::connect(options).await?,
}) })
} }
pub fn connection(&self) -> &DatabaseConnection {
&self.conn
}
} }

View file

@ -9,6 +9,9 @@ mod error;
pub use db::Database; pub use db::Database;
pub use db::entity; pub use db::entity;
use log::info;
use migration::Migrator;
use migration::MigratorTrait;
#[derive(Clone)] #[derive(Clone)]
struct AppConfig { struct AppConfig {
@ -24,6 +27,10 @@ async fn main() -> std::io::Result<()> {
let database = Database::new(database_url.into()).await.unwrap(); let database = Database::new(database_url.into()).await.unwrap();
info!("Running migrations");
Migrator::up(database.connection(), None).await.unwrap();
info!("Migrations completed");
let redis_conn = connect_to_redis_database().await; let redis_conn = connect_to_redis_database().await;
let app_config = AppConfig { ldap_auth: false }; let app_config = AppConfig { ldap_auth: false };

View file

@ -1,26 +1,23 @@
<script setup lang="ts"> <script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'; import { RouterLink, RouterView } from 'vue-router';
import HeaderNav from './components/HeaderNav.vue'; import HeaderNav from './components/HeaderNav.vue';
import { BoltIcon } from 'lucide-vue-next';
const isTeacher = false const isTeacher = true;
const isLoggedIn = true const isLoggedIn = true;
</script> </script>
<template> <template>
<div class="sticky top-0"> <header class="sticky top-0 z-50 bg-black w-full">
<header> <HeaderNav :isLoggedIn="isLoggedIn" :isTeacher="isTeacher">
<HeaderNav :isLoggedIn="isLoggedIn" :isTeacher="isTeacher"> <template #left-icon>
<template #left-icon> <BoltIcon class="icon" />
<BoltIcon class="icon" /> <!--Hier dann ein richtiges Logo rein--> </template>
</template> </HeaderNav>
</HeaderNav> </header>
</header> <div id="app" class="flex flex-col min-h-screen overflow-x-hidden">
<main class="flex-grow p-4">
<RouterView />
</main>
</div> </div>
<RouterView /> </template>
</template>
<style scoped>
</style>

View file

@ -20,16 +20,3 @@ a,
background-color: hsla(160, 100%, 37%, 0.2); background-color: hsla(160, 100%, 37%, 0.2);
} }
} }
@media (min-width: 1024px) {
body {
display: flex;
place-items: start;
}
#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}

View file

@ -1,71 +1,78 @@
<template> <template>
<nav class="header-container"> <nav class="header-container">
<div class="left-icon"> <div class="left-icon">
<!-- Platzhalter für ein Icon --> <slot name="left-icon"></slot>
<slot name="left-icon"></slot> </div>
</div> <div class="nav-items">
<div class="nav-items"> <button
v-if="!isLoggedIn"
class="nav-button"
>
<component :is="LogInIcon" class="icon" />
Login
</button>
<template v-if="isLoggedIn">
<button class="nav-button">
<component :is="LogOutIcon" class="icon" />
Logout
</button>
<button <button
v-if="!isLoggedIn" v-if="isTeacher"
class="nav-button" class="nav-button"
> >
<component :is="LogInIcon" class="icon" /> <component :is="BoltIcon" class="icon" />
Login Lehrerverwaltung
</button> </button>
</template>
<template v-else> </div>
<button class="nav-button"> </nav>
<component :is="LogOutIcon" class="icon" /> </template>
Logout
</button> <script setup lang="ts">
import { LogInIcon, LogOutIcon, BoltIcon } from 'lucide-vue-next';
<button
v-if="isTeacher" defineProps<{
class="nav-button" isLoggedIn: boolean;
> isTeacher: boolean;
<component :is="BoltIcon" class="icon" /> }>();
Lehrerverwaltung </script>
</button>
</template> <style scoped>
</div> .header-container {
</nav> display: flex;
</template> justify-content: space-between;
align-items: center;
<script setup lang="ts"> padding: 1rem;
import { LogInIcon, LogOutIcon, BoltIcon } from 'lucide-vue-next'; width: 100%;
box-sizing: border-box;
defineProps<{ }
isLoggedIn: boolean;
isTeacher: boolean; .left-icon {
}>(); display: flex;
</script> align-items: center;
}
<style scoped>
.header-container { .nav-items {
display: flex; display: flex;
justify-content: space-between; gap: 1rem;
align-items: center; align-items: center;
padding: 1rem; margin-left: auto;
} }
.nav-items { .nav-button {
display: flex; display: flex;
gap: 1rem; align-items: center;
} gap: 0.5rem;
background: none;
.nav-button { border: none;
display: flex; cursor: pointer;
align-items: center; font-weight: bold;
gap: 0.5rem; color: white;
background: none; }
border: none;
cursor: pointer; .icon {
font-weight: bold; width: 1rem;
} height: 1rem;
}
.icon { </style>
width: 1rem;
height: 1rem;
}
</style>