Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pmattmann committed Sep 28, 2024
1 parent 8f0e4fc commit 3138910
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 64 deletions.
83 changes: 40 additions & 43 deletions frontend/src/components/checklist/ChecklistItemTree.vue
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
<template>
<table style="width: 100%;">
<tr>
<td style="width: 30px;">
({{ checklistItem.position + 1 }})
</td>
<td style="text-wrap: wrap;">
{{ checklistItem.text }}
</td>
<td style="width: 400px">
<div
v-for="activity in this.getActivities(checklistItem)"
:key="activity._meta.self"
style="display: inline"
>
<div
v-for="scheduleEntry in activity.scheduleEntries().items"
:key="scheduleEntry._meta.self"
style="display: inline"
>
({{ scheduleEntry.number }})
</div>
{{ activity.title }}
</div>

</td>
</tr>
<tr
v-for="subItem in this.sortBy(checklistItem.children().items, c => c.position)"
:key="subItem._meta.self"
<table style="width: 100%">
<tr>
<td style="width: 30px">({{ checklistItem.position + 1 }})</td>
<td style="text-wrap: wrap">
{{ checklistItem.text }}
</td>
<td style="width: 400px">
<div
v-for="activity in getActivities(checklistItem)"
:key="activity._meta.self"
style="display: inline"
>
<td style="width: 30px;"></td>
<td colspan="2">
<ChecklistItemTree :checklistItem="subItem" />
</td>
</tr>
</table>

<div
v-for="scheduleEntry in activity.scheduleEntries().items"
:key="scheduleEntry._meta.self"
style="display: inline"
>
({{ scheduleEntry.number }})
</div>
{{ activity.title }}
</div>
</td>
</tr>
<tr
v-for="subItem in sortBy(checklistItem.children().items, (c) => c.position)"
:key="subItem._meta.self"
>
<td style="width: 30px"></td>
<td colspan="2">
<ChecklistItemTree :checklist-item="subItem" />
</td>
</tr>
</table>
</template>

<script>
Expand All @@ -50,14 +46,15 @@ export default {
methods: {
getActivities(checklistItem) {
const camp = checklistItem.checklist().camp()
const activities = camp.activities().items
const checklistNodes = checklistItem.checklistNodes().items
const camp = checklistItem.checklist().camp()
const activities = camp.activities().items
const checklistNodes = checklistItem.checklistNodes().items
return activities.filter(a => checklistNodes.some(cn => cn.root().id == a.rootContentNode().id))
return activities.filter((a) =>
checklistNodes.some((cn) => cn.root().id == a.rootContentNode().id)
)
},
sortBy
}
sortBy,
},
}
</script>
42 changes: 21 additions & 21 deletions frontend/src/views/camp/Checklist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
:no-border="$vuetify.breakpoint.mdAndUp"
>
<v-card-text>
<v-list class="mx-n2 py-0">
<v-list-item
v-for="checklist in checklists"
:key="checklist._meta.self"
class="px-2 rounded"
>
<v-list-item-content>
<v-list-item-title>
<h3>{{ checklist.name }}</h3>
<ChecklistItemTree
v-for="rootChecklistItem in getRootChecklistItems(checklist)"
:key="rootChecklistItem._meta.self"
:checklistItem="rootChecklistItem"
/>
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
<v-list class="mx-n2 py-0">
<v-list-item
v-for="checklist in checklists"
:key="checklist._meta.self"
class="px-2 rounded"
>
<v-list-item-content>
<v-list-item-title>
<h3>{{ checklist.name }}</h3>
<ChecklistItemTree
v-for="rootChecklistItem in getRootChecklistItems(checklist)"
:key="rootChecklistItem._meta.self"
:checklist-item="rootChecklistItem"
/>
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-card-text>
</content-card>
</template>
Expand All @@ -44,15 +44,15 @@ export default {
computed: {
checklists() {
return this.camp.checklists().items
}
},
},
methods: {
getRootChecklistItems(checklist) {
return sortBy(
checklist.checklistItems().items.filter((c) => c.parent == null),
(c) => c.position
)
}
}
},
},
}
</script>

0 comments on commit 3138910

Please sign in to comment.