Author SHA1 Message Date
TheDiluTek 2a15f77f4f so ein bisschen buttons und links und non admin user tests 2026-06-06 18:13:40 +02:00
4 changed files with 49 additions and 84 deletions
+14 -13
View File
@@ -169,6 +169,16 @@ pub fn submit_ticket_component() -> Html {
let valid_rooms: HashSet<i16> = VALID_ROOMS.iter().copied().collect(); let valid_rooms: HashSet<i16> = VALID_ROOMS.iter().copied().collect();
{
let message = "Bevor sie zum Support weitergeleitet werden prüfen sie ob: \r\n - Ob das Problem durch Neustarten gelößt wird \r\n - Ob sie die richtigen Anmeldedaten genutzt habem \r\n - Alle notwendigen Kabel eingesteckt sind".to_string();
use_effect(move || {
if let Some(win) = web_sys::window() {
let _ = win.alert_with_message(&message);
}
|| ()
});
}
let onsubmit = { let onsubmit = {
let category = category.clone(); let category = category.clone();
let betreff = betreff.clone(); let betreff = betreff.clone();
@@ -313,7 +323,7 @@ pub fn submit_ticket_component() -> Html {
{ {
if !room_valid { if !room_valid {
html! { html! {
<p style="color: red;">{ "Ungültiger oder nicht erlaubter Raum (z. B. 101, K12, D5)" }</p> <p class="warning" >{ "Ungültiger / nicht erlaubter Raum (z. B. 101, K12, D5)" }</p>
} }
} else { } else {
html! {} html! {}
@@ -665,16 +675,8 @@ pub fn all_tickets_component() -> Html {
} else { } else {
html! { html! {
<ul class= "postits"> <ul class= "postits">
{ for tickets.iter().filter(|t| t.status != "Archived" && (if user.is_admin { true } else if let Some(uid) = user.id { t.user_id == uid } else { false })).map(|t| { { for tickets.iter().filter(|t| t.status != "Archived" && (if user.is_admin { true } else if let Some(uid) = user.id { t.user_id == uid } else { false })).map(|t| html! {
let status_class = match t.status.as_str() { <div class="ticketbox">
"ToDo" => "To-Do",
"InProgress" => "InProgress",
"Completed" => "Completed",
"Archived" => "Archived",
_ => "To-Do"
};
html! {
<div class={classes!{status_class, "listbox"}}>
<li key={t.id.to_string()}> <li key={t.id.to_string()}>
<Link<crate::Route> to={crate::Route::TicketById{id: t.id}}><h3>{ format!("{} - #{}", t.betreff, t.id) }</h3></Link<crate::Route>> <Link<crate::Route> to={crate::Route::TicketById{id: t.id}}><h3>{ format!("{} - #{}", t.betreff, t.id) }</h3></Link<crate::Route>>
<p>{ &t.description }</p> <p>{ &t.description }</p>
@@ -688,8 +690,7 @@ pub fn all_tickets_component() -> Html {
</li> </li>
</div> </div>
}})} })}
<Link<crate::Route> to={crate::Route::Ticket}>{ "Zurück zur Startseite" }</Link<crate::Route>> <Link<crate::Route> to={crate::Route::Ticket}>{ "Zurück zur Startseite" }</Link<crate::Route>>
</ul> </ul>
} }
+4 -4
View File
@@ -222,7 +222,7 @@ pub fn register_component() -> Html {
}; };
html! { html! {
<form {onsubmit} class="rundbg"> <form {onsubmit}>
<label>{ "Vorname:" } <label>{ "Vorname:" }
<input type="text" value={(*first_name).clone()} oninput={fn_change}/> <input type="text" value={(*first_name).clone()} oninput={fn_change}/>
</label> </label>
@@ -330,7 +330,7 @@ pub fn login_component() -> Html {
html! { html! {
<div> <div>
<h1 class="headline">{ "Anmeldung" }</h1> <h1 class="headline">{ "Anmeldung" }</h1>
<form {onsubmit} class="rundbg login"> <form {onsubmit} class="rundbg">
<input <input
placeholder="username" placeholder="username"
value={(*username).clone()} value={(*username).clone()}
@@ -425,9 +425,9 @@ pub fn all_users_component() -> Html {
html! { <p>{ format!("Error: {}", e) }</p> } html! { <p>{ format!("Error: {}", e) }</p> }
} else { } else {
html! { html! {
<ul class="posti8s"> <ul>
{ for users.iter().map(|t| html! { { for users.iter().map(|t| html! {
<li key={t.id.to_string()} class="listbox"> <li key={t.id.to_string()}>
<Link<crate::Route> to={crate::Route::UserByID{id: t.id}}><h3>{ format!("{} {}- #{}", t.first_name, t.last_name, t.id) }</h3></Link<crate::Route>> <Link<crate::Route> to={crate::Route::UserByID{id: t.id}}><h3>{ format!("{} {}- #{}", t.first_name, t.last_name, t.id) }</h3></Link<crate::Route>>
</li> </li>
})} })}
+9 -22
View File
@@ -13,42 +13,29 @@
} }
.listbox { .ticketbox {
max-width: auto; max-width: auto;
margin:0 0; margin:0 0;
background-color: $rundbgbackgroundcolor; margin-top: 96px;
background-color: #90ff82;
padding-bottom: 96px; padding-bottom: 96px;
color: white;
padding-left: 32px; padding-left: 32px;
padding-right: 32px; padding-right: 32px;
padding-top: 96px; padding-top: 96px;
border-radius: 20px; border-radius: 20px;
border-color: #000000; border-color: #000000;
border-style: double; border-style: double;
box-shadow: 10px 10px 10px rgba(43, 43, 43, 0.8); box-shadow: 20px 20px 10px;
box-shadow: rgb(43, 43, 43);
font-size: 26px; font-size: 26px;
list-style-type: none;
&.To-Do {
background-color: #b1003b;
}
&.InProgress {
background-color: #fff385;
}
&.Completed {
background-color: #90ff82;
}
&.Archived {
background-color: #af69ee;
}
} }
.postits { .postits {
display: grid; display: grid;
grid-template-columns: auto auto auto; grid-template-columns: auto auto auto;
gap: 8px; gap: 8px;
}
.warning {
color: #570000;
} }
+22 -45
View File
@@ -16,52 +16,38 @@ body {
} }
.admin { display: flex; } .admin { display: flex; }
.content { flex: 1; padding: variables.$spacing-md; }
.layout { .layout {
display: flex; display: flex;
height: 100vh; min-height: 100vh;
overflow: hidden;
box-sizing: border-box;
} }
.sidebar { .sidebar {
width: 260px; width: 260px;
flex-shrink: 0; flex-shrink: 0;
height: 100%;
overflow-y: auto;
box-sizing: border-box;
} }
.content { .content {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
height: 100%;
overflow-y: auto;
padding: variables.$spacing-md;
box-sizing: border-box;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.sidebar { .sidebar { position: fixed; left: -100%; transition: left .2s; }
position: fixed;
top: 0;
bottom: 0;
left: -100%;
transition: left .2s;
z-index: 1000;
height: 100%;
box-sizing: border-box;
}
.sidebar.open { left: 0; } .sidebar.open { left: 0; }
.content { margin-left: 0; padding: variables.$spacing-md; box-sizing: border-box; } .content { margin-left: 0; }
} }
.rundbg { .rundbg {
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
max-width: 40%; max-width: 40%;
margin:0 auto; margin:0 auto;
margin-top: 96px;
background-color: variables.$rundbgbackgroundcolor; background-color: variables.$rundbgbackgroundcolor;
padding-bottom: 96px; padding-bottom: 96px;
padding-left: 32px; padding-left: 32px;
@@ -71,39 +57,30 @@ body {
gap: 8px; gap: 8px;
border-color: #000000; border-color: #000000;
border-style: double; border-style: double;
box-shadow: 20px 20px 10px rgb(43, 43, 43); box-shadow: 20px 20px 10px;
box-shadow: rgb(43, 43, 43);
font-size: 26px; font-size: 26px;
label {
display: block;
width: 100%;
box-sizing: border-box;
}
input, select, button { input, button, a {
width: 100%;
box-sizing: border-box;
padding: 16px; padding: 16px;
font-size: 1.8rem; font-size: 1.8rem;
background-color: #f0f0f0; background-color: #f0f0f0;
box-shadow: #6d6d6d; box-shadow: #6d6d6d;
box-shadow: 6px 6px 8px; box-shadow: 6px 6px 8px
}
input[type="checkbox"] {
width: auto;
} }
button { button {
margin: 16px 0; margin: 16px 0;
} }
&.login { a {
margin-top: 96px; color: #000000;
text-align: center;
border-style: dashed;
} }
} }
.setup-form input {
width: 100%;
box-sizing: border-box;
}