rename types of Contentblocks, change box appearance

This commit is contained in:
Christian Cueni 2018-10-15 13:59:48 +02:00
parent 78f142e2da
commit a1a75e9b3f
7 changed files with 70 additions and 37 deletions

View File

@ -136,6 +136,7 @@
<style scoped lang="scss">
@import "@/styles/_variables.scss";
@import "@/styles/_mixins.scss";
.content-block {
margin-bottom: 2.5em;
@ -166,14 +167,16 @@
top: 40px;
}
&--yellow {
background-color: rgba($color-accent-1, 0.15);
border: 1px solid $color-accent-1;
padding: 15px;
/deep/ .button {
border-color: $color-accent-1;
&--base_communication {
@include content-box($color-accent-1);
}
&--task {
@include content-box($color-brand);
}
&--base_society {
@include content-box($color-accent-2);
}
/deep/ p {

View File

@ -17,7 +17,7 @@
margin-bottom: 30px;
align-items: start;
background-color: $color-brand-light;
padding: 20px;
padding: 20px, 0;
border-radius: $default-border-radius;
}
</style>

View File

@ -32,3 +32,15 @@
}
}
@mixin content-box($main-color) {
background-color: rgba($main-color, 0.15);
padding: 15px;
align-items: start;
border-radius: $default-border-radius;
/deep/ .button {
border-color: $main-color;
background-color: $color-white;
}
}

View File

@ -93,7 +93,7 @@ class ContentBlockFactory(BasePageFactory):
class Meta:
model = ContentBlock
type = factory.LazyAttribute(lambda x: random.choice(['plain', 'yellow', 'green', 'blue']))
type = factory.LazyAttribute(lambda x: random.choice(['normal', 'base_communication', 'task', 'base_society']))
contents = wagtail_factories.StreamFieldFactory({
'text_block': TextBlockFactory,

View File

@ -0,0 +1,18 @@
# Generated by Django 2.0.6 on 2018-10-15 09:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0002_auto_20181010_0825'),
]
operations = [
migrations.AlterField(
model_name='contentblock',
name='type',
field=models.CharField(choices=[('normal', 'Normal'), ('base_communication', 'Basiswissen Sprache & Kommunikation'), ('task', 'Aufgabe'), ('base_society', 'Basiswissen Gesellschaft')], default='normal', max_length=100),
),
]

View File

@ -19,16 +19,16 @@ class ContentBlock(StrictHierarchyPage):
verbose_name = 'Inhaltsblock'
verbose_name_plural = 'Inhaltsblöcke'
PLAIN = 'plain'
YELLOW = 'yellow'
GREEN = 'green'
BLUE = 'blue'
NORMAL = 'normal'
BASE_COMMUNICATION = 'base_communication'
TASK = 'task'
BASE_SOCIETY = 'base_society'
TYPE_CHOICES = (
(PLAIN, 'Normal'),
(YELLOW, 'Gelb'),
(GREEN, 'Grün'),
(BLUE, 'Blau'),
(NORMAL, 'Normal'),
(BASE_COMMUNICATION, 'Basiswissen Sprache & Kommunikation'),
(TASK, 'Aufgabe'),
(BASE_SOCIETY, 'Basiswissen Gesellschaft'),
)
hidden_for = models.ManyToManyField(SchoolClass, related_name='hidden_content_blocks')
@ -50,7 +50,7 @@ class ContentBlock(StrictHierarchyPage):
type = models.CharField(
max_length=100,
choices=TYPE_CHOICES,
default=PLAIN
default=NORMAL
)
content_panels = [

View File

@ -83,7 +83,7 @@ data = [
'title': '1.1 Lehrbeginn',
'content_blocks': [
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 1',
'contents': [
{
@ -102,7 +102,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 2',
'contents': [
{
@ -139,7 +139,7 @@ data = [
]
},
{
'type': 'yellow',
'type': 'base_communication',
'title': 'Das Interview',
'contents': [
{
@ -151,7 +151,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 3',
'contents': [
{
@ -175,7 +175,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 4',
'contents': [
{
@ -199,7 +199,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'normal',
'title': 'Tipp',
'contents': [
{
@ -216,7 +216,7 @@ data = [
'title': '1.2 Die drei Lernorte',
'content_blocks': [
{
'type': 'blue',
'type': 'base_society',
'title': 'Das Berufsbildungssystem',
'contents': [
{
@ -246,7 +246,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 5',
'contents': [
{
@ -271,7 +271,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 6',
'contents': [
{
@ -283,7 +283,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 7',
'contents': [
{
@ -325,7 +325,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 8',
'contents': [
{
@ -381,7 +381,7 @@ data = [
'title': '2.1 Eine Welt ohne Geld?',
'content_blocks': [
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 1',
'contents': [
{
@ -433,7 +433,7 @@ data = [
'title': '2.2 Geld regiert die Welt',
'content_blocks': [
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 2',
'contents': [
{
@ -493,7 +493,7 @@ data = [
'title': '2.3 Funktionen der Geschäftsbanken',
'content_blocks': [
{
'type': 'yellow',
'type': 'base_communication',
'title': 'Basiswissen: Notizen',
'contents': [
{
@ -505,7 +505,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 3',
'contents': [
{
@ -535,7 +535,7 @@ data = [
'title': '2.4 Geld aufbewahren',
'content_blocks': [
{
'type': 'yellow',
'type': 'base_communication',
'title': 'Basiswissen: Geldanlage',
'contents': [
{
@ -547,7 +547,7 @@ data = [
]
},
{
'type': 'yellow',
'type': 'base_communication',
'title': 'Basiswissen: Anlageformen',
'contents': [
{
@ -559,7 +559,7 @@ data = [
]
},
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 4',
'contents': [
{
@ -608,7 +608,7 @@ data = [
'title': '2.5 Geldinstitute im Vergleich',
'content_blocks': [
{
'type': 'plain',
'type': 'task',
'title': 'Auftrag 5',
'contents': [
{