Format code according to new library rules

This commit is contained in:
Daniel Egger 2023-03-31 10:07:27 +02:00
parent 5661221ce6
commit edcfab1dd3
20 changed files with 64 additions and 78 deletions

View File

@ -29,7 +29,7 @@ async function changeLocale(language: AvailableLanguages) {
</MenuButton> </MenuButton>
<div class="relative"> <div class="relative">
<MenuItems <MenuItems
class="lg:right- absolute -top-24 -right-2/3 w-40 bg-white px-4 py-4 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" class="lg:right- absolute -right-2/3 -top-24 w-40 bg-white px-4 py-4 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
> >
<MenuItem v-for="locale in SUPPORT_LOCALES" :key="locale" class="py-1"> <MenuItem v-for="locale in SUPPORT_LOCALES" :key="locale" class="py-1">
<button <button

View File

@ -134,10 +134,10 @@ const profileDropdownData: DropdownListItem[] = [
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="flex items-center"> <div class="flex items-center">
<router-link to="/" class="flex"> <router-link to="/" class="flex">
<it-icon-vbv class="mr-3 -mt-6 -ml-3 h-8 w-16" /> <it-icon-vbv class="-ml-3 -mt-6 mr-3 h-8 w-16" />
</router-link> </router-link>
<router-link to="/" class="flex"> <router-link to="/" class="flex">
<div class="ml-1 border-l border-white pr-10 pl-3 text-2xl text-white"> <div class="ml-1 border-l border-white pl-3 pr-10 text-2xl text-white">
{{ $t("general.title") }} {{ $t("general.title") }}
</div> </div>
</router-link> </router-link>
@ -185,7 +185,7 @@ const profileDropdownData: DropdownListItem[] = [
<div <div
v-if="appStore.userLoaded && appStore.routingFinished && userStore.loggedIn" v-if="appStore.userLoaded && appStore.routingFinished && userStore.loggedIn"
:class="state.showMenu ? 'flex' : 'hidden'" :class="state.showMenu ? 'flex' : 'hidden'"
class="mt-8 flex-auto lg:mt-0 lg:flex lg:flex-row lg:items-center lg:space-y-0 lg:space-x-10" class="mt-8 flex-auto lg:mt-0 lg:flex lg:flex-row lg:items-center lg:space-x-10 lg:space-y-0"
> >
<!-- <router-link--> <!-- <router-link-->
<!-- v-if="inCourse() && courseSessionsStore.courseSessionForRoute"--> <!-- v-if="inCourse() && courseSessionsStore.courseSessionForRoute"-->

View File

@ -26,7 +26,7 @@ const props = withDefaults(defineProps<Props>(), {
></it-icon-smiley-thinking> ></it-icon-smiley-thinking>
<it-icon-smiley-neutral v-else></it-icon-smiley-neutral> <it-icon-smiley-neutral v-else></it-icon-smiley-neutral>
</div> </div>
<div class="mb-4 pr-5 lg:mr-10 lg:mb-0"> <div class="mb-4 pr-5 lg:mb-0 lg:mr-10">
<h4 class="text-bold mb-2"> <h4 class="text-bold mb-2">
{{ criteria.competence_id }} {{ criteria.title }} {{ criteria.competence_id }} {{ criteria.title }}
</h4> </h4>

View File

@ -26,7 +26,7 @@ defineEmits(["next", "exit"]);
<div> <div>
<div class="h-full"></div> <div class="h-full"></div>
<!-- just here to not make the footer jump during the transition --> <!-- just here to not make the footer jump during the transition -->
<div class="absolute top-0 bottom-0 w-full bg-white"> <div class="absolute bottom-0 top-0 w-full bg-white">
<div class="h-content overflow-y-scroll"> <div class="h-content overflow-y-scroll">
<header <header
class="relative flex h-12 w-full items-center justify-between bg-white px-4 py-4 lg:h-16 lg:px-8" class="relative flex h-12 w-full items-center justify-between bg-white px-4 py-4 lg:h-16 lg:px-8"

View File

@ -18,7 +18,7 @@ defineEmits(["back", "continue"]);
<template> <template>
<div> <div>
<nav class="mt-16 mb-4 flex"> <nav class="mb-4 mt-16 flex">
<button <button
v-if="showBackButton" v-if="showBackButton"
class="btn-secondary mr-2 flex items-center" class="btn-secondary mr-2 flex items-center"

View File

@ -29,7 +29,7 @@ const props = withDefaults(defineProps<Props>(), {
<div <div
v-if="icon" v-if="icon"
:class="[`bg-${icon}`]" :class="[`bg-${icon}`]"
class="-ml-8 h-32 bg-contain bg-left bg-no-repeat lg:ml-0 lg:-mr-8 lg:block lg:w-2/6 lg:bg-right" class="-ml-8 h-32 bg-contain bg-left bg-no-repeat lg:-mr-8 lg:ml-0 lg:block lg:w-2/6 lg:bg-right"
></div> ></div>
</div> </div>
</template> </template>

View File

@ -43,7 +43,7 @@ function onNotificationClick(notification: Notification) {
<template> <template>
<div <div
v-if="0 === state.notifications.length" v-if="0 === state.notifications.length"
class="mt-14 mb-14 text-center text-black" class="mb-14 mt-14 text-center text-black"
data-cy="no-notifications" data-cy="no-notifications"
> >
{{ $t("notifications.no_notifications") }} {{ $t("notifications.no_notifications") }}

View File

@ -20,7 +20,7 @@ function setIsOpen(value: boolean) {
<Dialog :open="modelValue" class="relative z-50" @close="setIsOpen"> <Dialog :open="modelValue" class="relative z-50" @close="setIsOpen">
<div class="fixed inset-0 bg-black/30" aria-hidden="true"></div> <div class="fixed inset-0 bg-black/30" aria-hidden="true"></div>
<div class="fixed inset-0 flex items-center justify-center p-4"> <div class="fixed inset-0 flex items-center justify-center p-4">
<DialogPanel class="w-full max-w-2xl bg-white px-8 pt-8 pb-4"> <DialogPanel class="w-full max-w-2xl bg-white px-8 pb-4 pt-8">
<DialogTitle class="relative mb-8 flex flex-row"> <DialogTitle class="relative mb-8 flex flex-row">
<slot name="title"></slot> <slot name="title"></slot>
<button <button

View File

@ -47,7 +47,7 @@ const endBadgeClasses = computed(() => {
<div v-for="step in props.steps" :key="step" class="flex flex-row"> <div v-for="step in props.steps" :key="step" class="flex flex-row">
<hr class="w-16 self-center border border-[1px] border-gray-400" /> <hr class="w-16 self-center border border-[1px] border-gray-400" />
<div <div
class="inline-flex h-7 w-7 items-center justify-center rounded-full py-1 px-3" class="inline-flex h-7 w-7 items-center justify-center rounded-full px-3 py-1"
:class="getPillClasses(step)" :class="getPillClasses(step)"
> >
{{ step }} {{ step }}

View File

@ -7,7 +7,7 @@
{{ label }} {{ label }}
</RadioGroupLabel> </RadioGroupLabel>
<div <div
class="align-items-center flex flex-col justify-between justify-items-center space-y-6 md:flex-row md:space-y-0 md:space-x-6" class="align-items-center flex flex-col justify-between justify-items-center space-y-6 md:flex-row md:space-x-6 md:space-y-0"
> >
<RadioGroupOption <RadioGroupOption
v-for="item in items" v-for="item in items"

View File

@ -29,7 +29,7 @@ onMounted(async () => {
{{ $t("dashboard.welcome", { name: userStore.first_name }) }} {{ $t("dashboard.welcome", { name: userStore.first_name }) }}
</h1> </h1>
<div v-if="courseSessionsStore.courseSessions.length > 0" class="mb-14"> <div v-if="courseSessionsStore.courseSessions.length > 0" class="mb-14">
<h2 class="mt-12 mb-3">Kurse</h2> <h2 class="mb-3 mt-12">Kurse</h2>
<div class="grid auto-rows-fr grid-cols-1 gap-4 md:grid-cols-2"> <div class="grid auto-rows-fr grid-cols-1 gap-4 md:grid-cols-2">
<div <div

View File

@ -39,7 +39,7 @@ const userStore = useUserStore();
v-model="state.username" v-model="state.username"
type="text" type="text"
name="username" name="username"
class="mt-1 block w-96 max-w-full border py-2 px-3" class="mt-1 block w-96 max-w-full border px-3 py-2"
/> />
</div> </div>
<div class="mb-4"> <div class="mb-4">
@ -49,7 +49,7 @@ const userStore = useUserStore();
v-model="state.password" v-model="state.password"
type="password" type="password"
name="password" name="password"
class="mt-1 block w-96 max-w-full border py-2 px-3" class="mt-1 block w-96 max-w-full border px-3 py-2"
/> />
</div> </div>

View File

@ -50,7 +50,7 @@ onMounted(async () => {
<template> <template>
<div class="bg-gray-200"> <div class="bg-gray-200">
<div class="container-large"> <div class="container-large">
<header class="mt-12 mb-8"> <header class="mb-8 mt-12">
<h1>{{ $t("general.settings") }}</h1> <h1>{{ $t("general.settings") }}</h1>
</header> </header>
<main> <main>

View File

@ -134,7 +134,7 @@ function log(data: any) {
Use them like &lt;it-icon-message/&gt; Use them like &lt;it-icon-message/&gt;
</p> </p>
<div class="mt-8 mb-8 flex flex-col flex-wrap gap-4 lg:flex-row"> <div class="mb-8 mt-8 flex flex-col flex-wrap gap-4 lg:flex-row">
<div class="inline-flex flex-col"> <div class="inline-flex flex-col">
message message
<it-icon-message class="it-icon" /> <it-icon-message class="it-icon" />
@ -191,7 +191,7 @@ function log(data: any) {
</div> </div>
</div> </div>
<div class="mt-8 mb-8 flex flex-col flex-wrap gap-4 lg:flex-row"> <div class="mb-8 mt-8 flex flex-col flex-wrap gap-4 lg:flex-row">
<div class="inline-flex flex-col"> <div class="inline-flex flex-col">
ls-apply ls-apply
<it-icon-ls-apply /> <it-icon-ls-apply />
@ -228,7 +228,7 @@ function log(data: any) {
</div> </div>
</div> </div>
<div class="mt-8 mb-8 flex flex-col flex-wrap gap-4 lg:flex-row"> <div class="mb-8 mt-8 flex flex-col flex-wrap gap-4 lg:flex-row">
<div class="inline-flex flex-col"> <div class="inline-flex flex-col">
lc-assignment lc-assignment
<it-icon-lc-assignment /> <it-icon-lc-assignment />
@ -275,7 +275,7 @@ function log(data: any) {
</div> </div>
</div> </div>
<div class="mt-8 mb-8 flex flex-col flex-wrap gap-4 lg:flex-row"> <div class="mb-8 mt-8 flex flex-col flex-wrap gap-4 lg:flex-row">
<div class="inline-flex flex-col"> <div class="inline-flex flex-col">
smiley-happy smiley-happy
<it-icon-smiley-happy /> <it-icon-smiley-happy />
@ -292,7 +292,7 @@ function log(data: any) {
</div> </div>
</div> </div>
<div class="mt-8 mb-8 flex flex-col flex-wrap gap-4 lg:flex-row"> <div class="mb-8 mt-8 flex flex-col flex-wrap gap-4 lg:flex-row">
<div class="inline-flex flex-col text-orange-500"> <div class="inline-flex flex-col text-orange-500">
message big message big
<it-icon-message class="h-16 w-16 text-orange-500" /> <it-icon-message class="h-16 w-16 text-orange-500" />
@ -361,7 +361,7 @@ function log(data: any) {
<h2 class="heading-1">Components</h2> <h2 class="heading-1">Components</h2>
</div> </div>
<h2 class="mt-8 mb-8">Buttons</h2> <h2 class="mb-8 mt-8">Buttons</h2>
<div class="mb-16 flex flex-col flex-wrap content-center gap-4 lg:flex-row"> <div class="mb-16 flex flex-col flex-wrap content-center gap-4 lg:flex-row">
<button class="btn-primary">Primary</button> <button class="btn-primary">Primary</button>
@ -394,7 +394,7 @@ function log(data: any) {
<button type="button" class="btn-primary inline-flex items-center px-3 py-2"> <button type="button" class="btn-primary inline-flex items-center px-3 py-2">
Button text Button text
<it-icon-message class="ml-3 -mr-1 h-5 w-5"></it-icon-message> <it-icon-message class="-mr-1 ml-3 h-5 w-5"></it-icon-message>
</button> </button>
<button type="button" class="btn-text inline-flex items-center px-3 py-2"> <button type="button" class="btn-text inline-flex items-center px-3 py-2">
@ -403,7 +403,7 @@ function log(data: any) {
</button> </button>
</div> </div>
<h2 class="mt-8 mb-8">Dropdown (Work-in-progress)</h2> <h2 class="mb-8 mt-8">Dropdown (Work-in-progress)</h2>
<ItDropdownSelect <ItDropdownSelect
v-model="state.dropdownSelected" v-model="state.dropdownSelected"
@ -412,7 +412,7 @@ function log(data: any) {
></ItDropdownSelect> ></ItDropdownSelect>
{{ state.dropdownSelected }} {{ state.dropdownSelected }}
<h2 class="mt-8 mb-8">Checkbox</h2> <h2 class="mb-8 mt-8">Checkbox</h2>
<ItCheckbox <ItCheckbox
:checkbox_item="{ :checkbox_item="{
@ -441,7 +441,7 @@ function log(data: any) {
Disabled Disabled
</ItCheckbox> </ItCheckbox>
<h2 class="mt-8 mb-8">Checkbox Group</h2> <h2 class="mb-8 mt-8">Checkbox Group</h2>
<ItCheckboxGroup <ItCheckboxGroup
label="Label" label="Label"
@ -466,7 +466,7 @@ function log(data: any) {
]" ]"
/> />
<h2 class="mt-8 mb-8">Dropdown</h2> <h2 class="mb-8 mt-8">Dropdown</h2>
<div class="h-60"> <div class="h-60">
<ItDropdown <ItDropdown
@ -500,7 +500,7 @@ function log(data: any) {
<HorizontalBarChart title="Frage X" text="Fragentext" :items="barChartItems" /> <HorizontalBarChart title="Frage X" text="Fragentext" :items="barChartItems" />
</div> </div>
<h2 class="mt-8 mb-8">LearningPathCircle</h2> <h2 class="mb-8 mt-8">LearningPathCircle</h2>
<LearningPathCircle <LearningPathCircle
class="h-48 w-48" class="h-48 w-48"
@ -520,11 +520,11 @@ function log(data: any) {
]" ]"
></LearningPathCircle> ></LearningPathCircle>
<h2 class="mt-8 mb-8">ItToggleSwitch</h2> <h2 class="mb-8 mt-8">ItToggleSwitch</h2>
<ItToggleSwitch></ItToggleSwitch> <ItToggleSwitch></ItToggleSwitch>
<h2 class="mt-8 mb-8">ItNavigationProgress</h2> <h2 class="mb-8 mt-8">ItNavigationProgress</h2>
<ItNavigationProgress <ItNavigationProgress
:steps="4" :steps="4"

View File

@ -61,7 +61,7 @@ function setActiveClasses(isActive: boolean) {
</div> </div>
</header> </header>
<main> <main>
<div v-if="learningPath" class="mb-8 w-full bg-white pt-8 pb-4"> <div v-if="learningPath" class="mb-8 w-full bg-white pb-4 pt-8">
<LearningPathDiagram <LearningPathDiagram
class="mx-auto max-h-[90px] w-full max-w-[1920px] px-4 lg:max-h-[380px]" class="mx-auto max-h-[90px] w-full max-w-[1920px] px-4 lg:max-h-[380px]"
diagram-type="horizontal" diagram-type="horizontal"

View File

@ -93,7 +93,7 @@ function updateActiveState(status: CourseCompletionStatus) {
'bg-gray-200': activeMenuItem.id === item.id, 'bg-gray-200': activeMenuItem.id === item.id,
'mr-6': item.id !== 'unknown', 'mr-6': item.id !== 'unknown',
}" }"
class="mr-6 inline-block py-4 px-2" class="mr-6 inline-block px-2 py-4"
@click="updateActiveState(item.id)" @click="updateActiveState(item.id)"
> >
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">

View File

@ -55,7 +55,7 @@ findCriteria();
</script> </script>
<template> <template>
<div v-if="competencePage" class="absolute top-0 bottom-0 w-full bg-white"> <div v-if="competencePage" class="absolute bottom-0 top-0 w-full bg-white">
<LearningContentContainer <LearningContentContainer
:title="''" :title="''"
:next-button-text="$t('general.save')" :next-button-text="$t('general.save')"

View File

@ -280,7 +280,7 @@ async function uploadDocument(data: DocumentUploadData) {
v-for="expert in courseSessionsStore.circleExperts" v-for="expert in courseSessionsStore.circleExperts"
:key="expert.user_id" :key="expert.user_id"
> >
<div class="mt-2 mb-2 flex flex-row items-center"> <div class="mb-2 mt-2 flex flex-row items-center">
<img <img
class="mr-2 h-[45px] rounded-full" class="mr-2 h-[45px] rounded-full"
:src="expert.avatar_url" :src="expert.avatar_url"

View File

@ -96,28 +96,28 @@ svg {
} }
.btn-primary { .btn-primary {
@apply inline-block border-2 border-blue-900 bg-blue-900 py-2 @apply inline-block border-2 border-blue-900 bg-blue-900 px-4
px-4 align-middle font-semibold text-white py-2 align-middle font-semibold text-white
hover:border-blue-700 hover:bg-blue-700 hover:border-blue-700 hover:bg-blue-700
disabled:cursor-not-allowed disabled:opacity-50; disabled:cursor-not-allowed disabled:opacity-50;
} }
.btn-secondary { .btn-secondary {
@apply inline-block border-2 border-blue-900 bg-white py-2 @apply inline-block border-2 border-blue-900 bg-white px-4
px-4 align-middle font-semibold text-blue-900 py-2 align-middle font-semibold text-blue-900
hover:bg-gray-200 hover:bg-gray-200
disabled:cursor-not-allowed disabled:opacity-50; disabled:cursor-not-allowed disabled:opacity-50;
} }
.btn-blue { .btn-blue {
@apply inline-block border-2 border-sky-500 bg-sky-500 py-2 @apply inline-block border-2 border-sky-500 bg-sky-500 px-4
px-4 align-middle font-semibold text-blue-900 py-2 align-middle font-semibold text-blue-900
hover:border-sky-400 hover:bg-sky-400 hover:border-sky-400 hover:bg-sky-400
disabled:cursor-not-allowed disabled:opacity-50; disabled:cursor-not-allowed disabled:opacity-50;
} }
.btn-text { .btn-text {
@apply inline-block py-2 px-4 align-middle font-normal @apply inline-block px-4 py-2 align-middle font-normal
text-blue-900 text-blue-900
hover:text-gray-700 hover:text-gray-700
disabled:cursor-not-allowed disabled:opacity-50; disabled:cursor-not-allowed disabled:opacity-50;

View File

@ -39,12 +39,17 @@ ADMIN_EMAILS = ["info@iterativ.ch", "admin"]
@click.command() @click.command()
@click.option('--course', '-c', multiple=True, default=[ @click.option(
COURSE_TEST_ID, "--course",
COURSE_UK, "-c",
COURSE_VERSICHERUNGSVERMITTLERIN_ID, multiple=True,
COURSE_UK_FR, default=[
]) COURSE_TEST_ID,
COURSE_UK,
COURSE_VERSICHERUNGSVERMITTLERIN_ID,
COURSE_UK_FR,
],
)
def command(course): def command(course):
print("Creating default courses", course) print("Creating default courses", course)
@ -112,8 +117,7 @@ def create_versicherungsvermittlerin_course():
experts = [expert1, expert2, expert3] experts = [expert1, expert2, expert3]
circles = Circle.objects.filter( circles = Circle.objects.filter(slug__startswith="versicherungsvermittler-in-lp")
slug__startswith="versicherungsvermittler-in-lp")
for i, circle in enumerate(circles): for i, circle in enumerate(circles):
expert = experts[i % len(experts)] expert = experts[i % len(experts)]
expert.expert.add(circle) expert.expert.add(circle)
@ -143,35 +147,23 @@ def create_course_uk_de():
# figma demo users and data # figma demo users and data
csu = CourseSessionUser.objects.create( csu = CourseSessionUser.objects.create(
course_session=cs, course_session=cs,
user=User.objects.get( user=User.objects.get(username="patrizia.huggel@eiger-versicherungen.ch"),
username="patrizia.huggel@eiger-versicherungen.ch"
),
role=CourseSessionUser.Role.EXPERT, role=CourseSessionUser.Role.EXPERT,
) )
csu.expert.add(Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-kickoff"))
csu.expert.add( csu.expert.add(
Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-kickoff") Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-haushalt-teil-1")
)
csu.expert.add(
Circle.objects.get(
slug="überbetriebliche-kurse-lp-circle-haushalt-teil-1"
)
)
csu.expert.add(
Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-fahrzeug")
) )
csu.expert.add(Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-fahrzeug"))
csu = CourseSessionUser.objects.create( csu = CourseSessionUser.objects.create(
course_session=cs, course_session=cs,
user=User.objects.get(username="andreas.feuz@eiger-versicherungen.ch"), user=User.objects.get(username="andreas.feuz@eiger-versicherungen.ch"),
role=CourseSessionUser.Role.EXPERT, role=CourseSessionUser.Role.EXPERT,
) )
csu.expert.add( csu.expert.add(
Circle.objects.get( Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-haushalt-teil-2")
slug="überbetriebliche-kurse-lp-circle-haushalt-teil-2"
)
)
csu.expert.add(
Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-basis")
) )
csu.expert.add(Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-basis"))
_csu = CourseSessionUser.objects.create( _csu = CourseSessionUser.objects.create(
course_session=cs, course_session=cs,
user=User.objects.get(username="michael.meier@example.com"), user=User.objects.get(username="michael.meier@example.com"),
@ -197,9 +189,7 @@ def create_course_uk_de():
_csu = CourseSessionUser.objects.create( _csu = CourseSessionUser.objects.create(
course_session=cs, course_session=cs,
user=User.objects.get( user=User.objects.get(username="patrick.muster@eiger-versicherungen.ch"),
username="patrick.muster@eiger-versicherungen.ch"
),
) )
create_feedback( create_feedback(
@ -208,9 +198,7 @@ def create_course_uk_de():
3, 3,
) )
create_feedback( create_feedback(
Circle.objects.get( Circle.objects.get(slug="überbetriebliche-kurse-lp-circle-haushalt-teil-2"),
slug="überbetriebliche-kurse-lp-circle-haushalt-teil-2"
),
cs, cs,
14, 14,
) )
@ -259,7 +247,7 @@ def create_course_uk_fr():
cs = CourseSession.objects.create( cs = CourseSession.objects.create(
course_id=COURSE_UK_FR, course_id=COURSE_UK_FR,
title="Cours hors établissement année 1 - Région Fribourg" title="Cours hors établissement année 1 - Région Fribourg",
) )
csu = CourseSessionUser.objects.create( csu = CourseSessionUser.objects.create(
@ -268,9 +256,7 @@ def create_course_uk_fr():
role=CourseSessionUser.Role.EXPERT, role=CourseSessionUser.Role.EXPERT,
) )
csu.expert.add( csu.expert.add(
Circle.objects.get( Circle.objects.get(slug="course-hors-établissement-lp-circle-coup-denvoi")
slug="course-hors-établissement-lp-circle-coup-denvoi"
)
) )
_csu = CourseSessionUser.objects.create( _csu = CourseSessionUser.objects.create(
course_session=cs, course_session=cs,
@ -283,7 +269,7 @@ def create_course_uk_fr():
) )
for fr_circle in Circle.objects.filter( for fr_circle in Circle.objects.filter(
slug__startswith="course-hors-établissement-lp" slug__startswith="course-hors-établissement-lp"
): ):
csu.expert.add(fr_circle) csu.expert.add(fr_circle)