Skip to content

Commit

Permalink
Merge pull request #298 from vplan-fr/main
Browse files Browse the repository at this point in the history
added horizontal fill weekplan setting
  • Loading branch information
OfficialFreak authored Mar 24, 2024
2 parents c38560c + f13f383 commit 179ce06
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions client/src/components/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<span class="responsive-text"><input type="color" bind:value={temp_settings.cancelled_color}>Ausfallfarbe</span>
<span class="responsive-text"><input type="checkbox" bind:checked={temp_settings.external_times}>Externe Unterrichtszeiten</span>
<span class="responsive-text"><input type="checkbox" bind:checked={temp_settings.filled_in_buttons}>Ausgefüllte Buttons (Bei Änderungen / Ausfall)</span>
<span class="responsive-text"><input type="checkbox" bind:checked={temp_settings.filled_in_weekplan}>Unterrichtsstunden füllen die komplette Breite beim Wochenplan</span>
<span class="responsive-text"><input type="checkbox" bind:checked={temp_settings.rainbow}>Regenbogen 🌈</span>
<h2 class="category-heading">Nerd Section</h2>
<span class="responsive-text"><input type="checkbox" bind:checked={temp_settings.show_revision_selector}>Planversion auswählbar machen</span>
Expand Down
12 changes: 10 additions & 2 deletions client/src/components/Weekplan/Day.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@
{#each {length: block_count} as _, i}
<div class="block">
{#if lessons[i][0].length > 0}
<div class="blocks-container">
<div class="blocks-container" class:filled_in_weekplan={$settings.filled_in_weekplan}>
{#each lessons[i][0] as lesson}
<Lesson lesson={lesson} bind:plan_type bind:plan_value />
{/each}
</div>
{/if}
{#if lessons[i][1].length > 0 || lessons[i][2].length > 0}
<div class="lessons-container">
<div class="lessons-container" class:filled_in_weekplan={$settings.filled_in_weekplan}>
<div class="lesson top">
{#each lessons[i][1] as lesson}
<Lesson lesson={lesson} bind:plan_type bind:plan_value />
Expand Down Expand Up @@ -424,13 +424,21 @@
gap: .4rem;
padding: .2rem;
box-sizing: border-box;
&.filled_in_weekplan {
flex: 1
}
}
.lessons-container {
height: calc(2 * var(--lesson-height));
display: flex;
flex-direction: column;
&.filled_in_weekplan {
flex: 1
}
.lesson {
height: var(--lesson-height);
gap: .4rem;
Expand Down
6 changes: 5 additions & 1 deletion client/src/components/Weekplan/Lesson.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$: forms_changed = lesson.forms_changed && lesson.takes_place && !lesson.is_unplanned;
</script>
<div class="card" class:cancelled={!lesson.takes_place} class:changed={lesson.is_unplanned}>
<div class="card" class:filled_in_weekplan={$settings.filled_in_weekplan} class:cancelled={!lesson.takes_place} class:changed={lesson.is_unplanned}>
{#if (lesson.info.length > 0) || (plan_type === "forms" && (forms.length > 1)) || (plan_type === "teachers" && (teachers.length > 1)) || (plan_type === "rooms" && (rooms.length > 1))}
<button class="info-btn" on:click={() => {
$active_modal = "lesson-inspect";
Expand Down Expand Up @@ -353,6 +353,10 @@
box-sizing: border-box;
font-size: var(--card-font-size);
&.filled_in_weekplan {
flex: 1;
}
&::before {
content: "";
pointer-events: none;
Expand Down
6 changes: 5 additions & 1 deletion user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def validate_color(elem):
"type": "bool",
},
"filled_in_buttons": {
"default": False,
"default": True,
"type": "bool",
},
"swipe_day_change": {
Expand All @@ -75,6 +75,10 @@ def validate_color(elem):
"weekplan_default": {
"default": False,
"type": "bool",
},
"filled_in_weekplan": {
"default": False,
"type": "bool"
}
}
TYPE_FUNCTIONS = {
Expand Down

0 comments on commit 179ce06

Please sign in to comment.