Compare commits

..

1 commit

Author SHA1 Message Date
cd02c48a14 remove view for livecoding 2022-05-12 02:29:30 +02:00
5 changed files with 8 additions and 78 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -18,8 +18,6 @@ Das Projekt
.. rjs-div:: grid grid-cols-2 gap-8
.. rjs-box:: bg-gray-700 rounded-3xl
.. rjs-fragments:: fade-right
- 👨🏻‍💻 Entwickler: Martin Kavik
@ -32,8 +30,6 @@ Das Projekt
Architektur
===========
.. rjs-box:: bg-gray-700 rounded-3xl text-center
.. image:: img/diagram.svg
:width: 60%
@ -112,28 +108,6 @@ Setup
#. Anwendung mit ``trunk serve`` kompilieren und live im Browser anzeigen
#. Anwendung mit ``trunk build --release`` im Releasemodus kompilieren
.. rjs-effect::
.. rjs-div:: grid grid-cols-3 gap-8 mt-16
.. rjs-box:: bg-gray-700 rounded-3xl text-center
Rust-Code
.. image:: img/rust_code.png
.. rjs-box:: bg-gray-700 rounded-3xl text-center
WASM
.. image:: img/wasm_code.png
.. rjs-box:: bg-gray-700 rounded-3xl text-center
Webbrowser
.. image:: img/web_app.png
Ende
====
@ -144,19 +118,3 @@ Ende
.. image:: img/seed_logo.svg
:width: 30%
.. rjs-div:: grid grid-cols-2 gap-8
.. rjs-box:: bg-gray-700 rounded-3xl
Webseite von Seed
https://seed-rs.org
.. rjs-box:: bg-gray-700 rounded-3xl
Quellcode zu diese Präsentation
https://code.thetadev.de/HSA/seed-presentation

View file

@ -5,6 +5,7 @@ use openmensa_rs::{request::MealRequest, Meal};
use seed::{prelude::*, *};
const DATE_ISO_FMT: &str = "%Y-%m-%d";
const DATE_DE_FMT: &str = "%d.%m.%Y";
// ------ ------
// Init
@ -66,36 +67,7 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
// `view` describes what to display.
fn view(model: &Model) -> Node<Msg> {
div![
h1![format!("Speiseplan vom {}", model.date.format("%d.%m.%Y"))],
input![
attrs! {
At::Type => "date",
At::Value => model.date.format(DATE_ISO_FMT)
},
input_ev(Ev::Input, Msg::SetDate),
],
if &model.meals.len() > &0 {
view_meals(&model.meals)
} else {
p!["Kein Speiseplan verfügbar"]
},
]
}
fn view_meals(meals: &[Meal]) -> Node<Msg> {
ul![meals.iter().map(|meal| {
let price = meal.prices().students();
let price_str = match price {
Some(p) => format!("{:.2}", p),
None => String::from("unbekannt"),
};
li![
el_key(&meal.id()),
format!("{} ({})", meal.name(), price_str),
]
})]
div!["Hello World"]
}
// ------ ------