Skip to content

Commit

Permalink
Provide link for missing focus modules
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystucki committed Feb 2, 2024
1 parent 5b11026 commit 0403e21
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
26 changes: 15 additions & 11 deletions src/components/Focus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<button
class="button is-fullwidth button-focus"
:aria-expanded="isOpen"
:class="{ 'is-success': !filteredModuleNames.length }"
:class="{ 'is-success': !filteredModules.length }"
type="button"
@click="toggleFocus()"
>
<div class="focus-main">
<span>{{ name }}</span>
<span
v-if="filteredModuleNames.length"
v-if="filteredModules.length"
class="tag is-info is-light"
>
{{ filteredModuleNames.length }} Module werden noch benötigt
{{ filteredModules.length }} Module werden noch benötigt
</span>
<span
v-if="!filteredModuleNames.length"
v-if="!filteredModules.length"
class="tag is-success is-light"
>
Vertiefung geplant
Expand All @@ -33,18 +33,22 @@
class="column is-full column-focus"
>
<div class="box box-focus">
<p v-if="!filteredModuleNames.length">
<p v-if="!filteredModules.length">
Alle benötigten Module sind bestanden/geplant.
</p>
<p v-if="filteredModuleNames.length">
<p v-if="filteredModules.length">
Für die Vertiefung müssen folgende Module noch geplant werden:
</p>
<ul class="focus-missing-modules-list">
<li
v-for="filteredModuleName in filteredModuleNames"
:key="filteredModuleName"
v-for="module in filteredModules"
:key="module.id"
>
{{ filteredModuleName }}
<a
target="_blank"
:href="'https://studien.rj.ost.ch/' + module.url.replace('.json', '.html')"
>{{ module.name }}
</a>
</li>
</ul>
</div>
Expand All @@ -69,9 +73,9 @@ export default defineComponent({
type: Array<Module>,
default: () => [],
},
filteredModuleNames: {
filteredModules: {
required: true,
type: Array<string>,
type: Array<Module>,
default: () => [],
},
},
Expand Down
7 changes: 3 additions & 4 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<FocusComponent
:name="focus.name"
:all-modules="focus.modules"
:filtered-module-names="focus.filteredModuleNames"
:filtered-modules="focus.filteredModules"
/>
</div>
</div>
Expand Down Expand Up @@ -203,9 +203,8 @@ export default defineComponent({
const plannedModuleIds = this.plannedModules.map((module) => module.id);
return this.focuses.map((focus) => ({
...focus,
filteredModuleNames: focus.modules
.filter((module) => !plannedModuleIds.includes(module.id))
.map((module) => module.name),
filteredModules: focus.modules
.filter((module) => !plannedModuleIds.includes(module.id)),
}));
},
totalPlannedEcts() {
Expand Down
10 changes: 8 additions & 2 deletions styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@
color: white;
}

.module a:hover {
text-decoration: underline;
.focus-missing-modules-list a {
color: inherit;
}

.module, .focus-missing-modules-list {
a:hover {
text-decoration: underline;
}
}

@include desktop {
Expand Down

0 comments on commit 0403e21

Please sign in to comment.