diff --git a/bvplan/src/cache.rs b/bvplan/src/cache.rs index 44eb80c..7459bca 100644 --- a/bvplan/src/cache.rs +++ b/bvplan/src/cache.rs @@ -24,7 +24,6 @@ lazy_static! { } pub mod keys { - pub const HTML: &str = "html"; pub const DISPLAY_HTML: &str = "disp_html"; } diff --git a/bvplan/src/worker/update_meta.rs b/bvplan/src/worker/update_meta.rs index 354a516..93c78f3 100644 --- a/bvplan/src/worker/update_meta.rs +++ b/bvplan/src/worker/update_meta.rs @@ -45,7 +45,7 @@ async fn fetch_schoolyears(client: &untis::Client, db_conn: &mut db::Connection) async fn fetch_current_tenant( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let tenant = client.current_tenant().await?; @@ -94,7 +94,7 @@ async fn fetch_current_tenant( async fn fetch_timegrid( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let days = client.timegrid().await?; @@ -138,7 +138,7 @@ async fn fetch_timegrid( async fn fetch_teachers( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let existing_teachers = db::schema::teachers::table @@ -172,7 +172,7 @@ async fn fetch_teachers( async fn fetch_classes( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let existing_classes = db::schema::classes::table @@ -202,7 +202,7 @@ async fn fetch_classes( async fn fetch_subjects( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let existing_classes = db::schema::subjects::table @@ -231,7 +231,7 @@ async fn fetch_subjects( async fn fetch_rooms( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let existing_classes = db::schema::rooms::table @@ -260,7 +260,7 @@ async fn fetch_rooms( async fn fetch_departments( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let existing_classes = db::schema::departments::table @@ -289,7 +289,7 @@ async fn fetch_departments( async fn fetch_holidays( client: &untis::Client, - db_conn: &mut PgConnection, + db_conn: &mut db::Connection, schoolyear_id: i32, ) -> Result<()> { let existing_classes = db::schema::holidays::table diff --git a/bvplan/templates/base.html b/bvplan/templates/base.html index 8462088..eb7210f 100644 --- a/bvplan/templates/base.html +++ b/bvplan/templates/base.html @@ -2,9 +2,11 @@ + + + - {% block title %}{% endblock %} | dergrimm.net diff --git a/bvplan/templates/bvplan.html b/bvplan/templates/bvplan.html index 9723748..d49b38f 100644 --- a/bvplan/templates/bvplan.html +++ b/bvplan/templates/bvplan.html @@ -10,128 +10,9 @@ {% block body %} -
-
-

BVplan

- dergrimm.net -
-
- {{ data.tenant }}, {{ data.schoolyear }} -
- Stand: {{ data.queried_at }} -
- Vertretungsplan (offline): {{ data.last_import_time }} -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% for subst in data.substitutions %} - - - - - - - - - - - {% endfor %} - -
- {{ data.date }}, Woche {{ data.week_type }} -
StundeKlasse(n)(Fach)FachVertreter(Raum)RaumText
{{ subst.period }}{{ subst.classes|join(", ") }} - {% match subst.prev_subject %} - {% when Some with (x) %} - {{ x }} - {% when None %} - --- - {% endmatch %} - - {% match subst.subject %} - {% when Some with (x) %} - {{ x }} - {% when None %} - --- - {% endmatch %} - - {% match subst.teachers %} - {% when Some with (x) %} - {{ x|join(", ") }} - {% when None %} - --- - {% endmatch %} - - {% if subst.prev_rooms.is_empty() %} - --- - {% else %} - {{ subst.prev_rooms|join(", ") }} - {% endif %} - - {% if subst.rooms.is_empty() %} - --- - {% else %} - {{ subst.rooms|join(", ") }} - {% endif %} - - {% match subst.text %} - {% when Some with (x) %} - {{ x }} - {% when None %} - {% endmatch %} -
-
- - + {% include "header.html" %} + {% include "main.html" %} + {% include "footer.html" %}