Room per User and KalenderTag
This commit is contained in:
10
src/main/resources/db/migration/V0003__room.sql
Normal file
10
src/main/resources/db/migration/V0003__room.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
create table room (
|
||||
id bigint not null primary key,
|
||||
name varchar not null unique
|
||||
);
|
||||
|
||||
alter table users add column room_id bigint references room;
|
||||
alter table kalendertag add column room_id bigint references room;
|
||||
|
||||
alter table kalendertag drop constraint kalendertag_day_key;
|
||||
|
||||
25
src/main/resources/templates/room-modal.html
Normal file
25
src/main/resources/templates/room-modal.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<div class="modal fade" id="roomModal" tabindex="-1" aria-labelledby="roomModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="roomModalLabel">Raum anlegen</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<form action="/room/new" method="POST" name="roomForm" enctype="multipart/form-data">
|
||||
<div class="modal-body row mb-3">
|
||||
<div class="align-items-center col-md-10 mx-auto col-lg-11">
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" name="name" class="form-control" id="name" placeholder="Raumname" required>
|
||||
<label for="name">Name</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,6 +2,24 @@
|
||||
{#room_active}active{/}
|
||||
{#contents}
|
||||
|
||||
<div class="mt-2">
|
||||
{#if rooms.size == 0}
|
||||
Kein Raum vorhanden
|
||||
{#else}
|
||||
<h2>Raum wählen</h2>
|
||||
{/if}
|
||||
|
||||
<div class="btn-group" role="group">
|
||||
{#for room in rooms}
|
||||
<form action="/room/user" method="POST" name="chooseRoomForm" enctype="application/x-www-form-urlencoded">
|
||||
<input type="radio" class="btn-check" name="room" value="{room.name}" id="radio{room.name}" autocomplete="off"
|
||||
onchange="this.form.submit()" {#if room.name == current_room}checked{/if} >
|
||||
<label class="btn btn-outline-primary" for="radio{room.name}">{room.name}</label>
|
||||
</form>
|
||||
{/for}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<img src="/room/plan" alt="kein Raumplan vorhanden">
|
||||
</div>
|
||||
@@ -17,6 +35,11 @@
|
||||
<input class="btn btn-primary" type="submit" value="Upload" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<a class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#roomModal" role="button">neuer Raum</a>
|
||||
</div>
|
||||
{#include room-modal.html}{/include}
|
||||
{/if}
|
||||
|
||||
{/contents}
|
||||
|
||||
Reference in New Issue
Block a user