Style home page a bit

This commit is contained in:
Daniel Egger 2022-06-03 10:12:52 +02:00
parent 65ecf77a59
commit fd008be527
8 changed files with 49 additions and 48 deletions

View File

@ -1,9 +1,17 @@
<script setup lang="ts">
</script>
import MainNavigationBar from '@/components/MainNavigationBar.vue';</script>
<template>
<main>
<p class="title">Hello from Home View</p>
<MainNavigationBar/>
<main class="px-8 py-8">
<h1>myVBV Start Page</h1>
<div class="mt-8 flex flex-row justify-start gap-4">
<router-link class="link text-xl" to="/styleguide">Styelguide</router-link>
<a class="link text-xl" href="/login/">Login</a>
<router-link class="link text-xl" to="/circle/analyse">Circle "Analyse" (Login benötigt)</router-link>
</div>
</main>
</template>

View File

@ -1,24 +1,20 @@
<script lang="ts">
import {defineComponent} from 'vue'
<script setup lang="ts">
export default defineComponent({
data() {
return {
colors: ['blue', 'sky', 'orange', 'green', 'red', 'gray',],
colorValues: [100, 300, 500, 700, 900],
}
},
methods: {
colorBgClass(color: string, value: integer) {
import MainNavigationBar from '@/components/MainNavigationBar.vue';
const colors = ['blue', 'sky', 'orange', 'green', 'red', 'gray',];
const colorValues = [100, 300, 500, 700, 900,];
function colorBgClass(color: string, value: number) {
return `bg-${color}-${value}`;
}
},
});
}
</script>
<template>
<main class="container mx-auto mt-4">
<MainNavigationBar/>
<main class="px-8 py-4">
<h1>Style Guide</h1>
<div class="border-b text-gray-700 pb-2 mt-8">
@ -47,12 +43,12 @@ export default defineComponent({
<div class="mt-8 text-xl font-bold">Text Large Bold</div>
<div class="mt-8 text-xl">Text Large</div>
<div class="mt-8 underline underline-offset-2">Link Large</div>
<div class="mt-8 link text-xl">Link Large</div>
<div class="mt-8 font-bold">Text Bold</div>
<div class="mt-8">Text</div>
<div class="mt-8 underline underline-offset-2">Link</div>
<div class="mt-8 link">Link</div>
<div class="mt-8 text-sm">Text Small</div>
<div class="mt-8 text-sm underline underline-offset-2">Link Small</div>
<div class="mt-8 link text-sm">Link Small</div>
<div class="border-b text-gray-700 pb-2 mt-12">
<h2 class="heading-1">Components</h2>

View File

@ -124,12 +124,12 @@ AUTHENTICATION_BACKENDS = [
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-user-model
AUTH_USER_MODEL = "core.User"
# https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
# LOGIN_REDIRECT_URL = "users:redirect"
# https://docs.djangoproject.com/en/dev/ref/settings/#login-url
# FIXME make configurable!?
# LOGIN_URL = "/sso/login/"
LOGIN_URL = "/login/"
LOGIN_REDIRECT_URL = "/"
ALLOW_LOCAL_LOGIN = env.bool("IT_ALLOW_LOCAL_LOGIN", default=False)

View File

@ -1,17 +0,0 @@
<div class="container mx-auto bg-blue-900">
<div class="flex flex-col md:flex-row items-center p-4 text-white space-x-8">
<div class="text-2xl mx-4">
<a href="/">
VBV Ausbildungsportal
</a>
</div>
<div>
<a href="/todo/">
SimpleTodo App
</a>
</div>
<div>Infos zu Berufen</div>
<div>Branchennews</div>
</div>
</div>

View File

@ -118,7 +118,10 @@ class LearningSequence(Page):
@classmethod
def get_serializer_class(cls):
return get_it_serializer_class(cls, field_names=['id', 'title', 'slug', 'type'])
return get_it_serializer_class(cls, field_names=['id', 'title', 'slug', 'type', 'translation_key'])
def get_admin_display_title(self):
return f'Lernsequenz: {self.draft_title}'
def full_clean(self, *args, **kwargs):
super(LearningSequence, self).full_clean(*args, **kwargs)
@ -130,7 +133,8 @@ class LearningUnit(Page):
"""
# TODO: Review model architecture, is the stream field the right thing here?
parent_page_types = ['learnpath.LearningSequence']
parent_page_types = ['learnpath.Circle']
subpage_types = []
content_blocks = [
('web_based_training', WebBasedTrainingBlock()),
@ -152,7 +156,8 @@ class LearningUnit(Page):
APIField('contents'),
]
subpage_types = []
def get_admin_display_title(self):
return f'FOOBAR {self.draft_title}'
class Meta:
verbose_name = "Learning Unit"
@ -163,7 +168,7 @@ class LearningUnit(Page):
@classmethod
def get_serializer_class(cls):
return get_it_serializer_class(cls, field_names=['id', 'title', 'contents', 'slug', 'type'])
return get_it_serializer_class(cls, field_names=['id', 'title', 'contents', 'slug', 'type', 'translation_key'])
def __str__(self):
return f"{self.title}"

View File

@ -1,13 +1,17 @@
import wagtail_factories
from django.conf import settings
from wagtail.core.models import Site
from wagtail.core.models import Site, Page
from vbv_lernwelt.core.admin import User
from vbv_lernwelt.learnpath.models import LearningPath, Topic, Circle, LearningSequence, LearningUnit
from vbv_lernwelt.learnpath.tests.learning_path_factories import LearningPathFactory, TopicFactory, CircleFactory, \
LearningSequenceFactory, LearningUnitFactory, VideoBlockFactory, WebBasedTrainingBlockFactory
def create_default_learning_path():
def create_default_learning_path(user=None):
if user is None:
user = User.objects.get(username='admin')
site = Site.objects.filter(is_default_site=True).first()
if not site:
@ -128,6 +132,9 @@ von Neukunden zu benützen
tp = TopicFactory.create(title="Prüfung", is_visible=False, learning_path=lp)
circle_7 = CircleFactory.create(title="Prüfungsvorbereitung", parent=lp, topic=tp)
# all pages belong to 'admin' by default
Page.objects.update(owner=user)
def delete_default_learning_path():
LearningUnit.objects.all().delete()

View File

@ -30,8 +30,6 @@
<body>
{% include "core/partials/header.html" %}
<div class="container">
{% if messages %}

View File

@ -31,6 +31,10 @@ html {
.heading-3 {
@apply text-3xl xl:text-4xl font-bold
}
.link {
@apply underline underline-offset-2
}
}
@layer components {