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
# 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
**/*.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?,
})
}
pub fn connection(&self) -> &DatabaseConnection {
&self.conn
}
}

View file

@ -9,6 +9,9 @@ mod error;
pub use db::Database;
pub use db::entity;
use log::info;
use migration::Migrator;
use migration::MigratorTrait;
#[derive(Clone)]
struct AppConfig {
@ -24,6 +27,10 @@ async fn main() -> std::io::Result<()> {
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 app_config = AppConfig { ldap_auth: false };

View file

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

View file

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