Merged in feature/cms-improvements-ms-517-ms-518-ms-519 (pull request #108)
Feature/cms improvements ms 517 ms 518 ms 519 Approved-by: Daniel Egger
This commit is contained in:
commit
2fbd878387
|
|
@ -17,7 +17,7 @@ describe('Assignments', () => {
|
|||
assignment: {
|
||||
title: 'Ein Auftragstitel',
|
||||
solution: '<p>Eine Lösung</p>',
|
||||
assignment: 'Ein Auftrag',
|
||||
assignment: '<p>Ein <b>Auftrag</b></p>',
|
||||
submissions: [studentSubmission],
|
||||
},
|
||||
},
|
||||
|
|
@ -48,6 +48,7 @@ describe('Assignments', () => {
|
|||
|
||||
it('it does not display HTML tags', () => {
|
||||
cy.visit('/module/lohn-und-budget/submissions/QXNzaWdubWVudE5vZGU6MQ==');
|
||||
cy.getByDataCy('assignment-main-text').should('have.text', 'Ein Auftrag');
|
||||
cy.getByDataCy('assignment-solution').should('have.text', 'Eine Lösung');
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
<template>
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<div class="assignment-with-submissions">
|
||||
<p class="assignment-with-submissions__text">
|
||||
{{ assignment.assignment }}
|
||||
</p>
|
||||
<p
|
||||
class="assignment-with-submissions__text"
|
||||
data-cy="assignment-main-text"
|
||||
v-html="assignment.assignment"
|
||||
/>
|
||||
|
||||
<div>
|
||||
<a
|
||||
|
|
@ -145,6 +147,13 @@
|
|||
margin-top: $large-spacing;
|
||||
}
|
||||
|
||||
/deep/ ul {
|
||||
@include list-parent;
|
||||
}
|
||||
/deep/ li {
|
||||
@include list-child;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.submissions {
|
||||
|
|
|
|||
|
|
@ -327,11 +327,11 @@
|
|||
|
||||
/deep/ .text-block {
|
||||
ul {
|
||||
padding-left: 25px;
|
||||
@include list-parent;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: disc;
|
||||
@include list-child;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@
|
|||
:data-scrollto="value.id"
|
||||
class="assignment"
|
||||
>
|
||||
<p class="assignment__assignment-text">
|
||||
{{ assignment.assignment }}
|
||||
</p>
|
||||
<p
|
||||
class="assignment__main-text"
|
||||
data-cy="assignment-main-text"
|
||||
v-html="assignment.assignment"
|
||||
/>
|
||||
|
||||
<solution
|
||||
:value="solution"
|
||||
|
|
@ -273,6 +275,16 @@
|
|||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
&__main-text {
|
||||
/deep/ ul{
|
||||
@include list-parent
|
||||
}
|
||||
|
||||
/deep/ li {
|
||||
@include list-child;
|
||||
}
|
||||
}
|
||||
|
||||
&__toggle-input-container {
|
||||
display: flex;
|
||||
margin-bottom: 15px;
|
||||
|
|
|
|||
|
|
@ -113,11 +113,11 @@
|
|||
}
|
||||
|
||||
&__list {
|
||||
padding-left: $medium-spacing;
|
||||
@include list-parent;
|
||||
}
|
||||
|
||||
&__list-item {
|
||||
list-style: disc;
|
||||
@include list-child;
|
||||
}
|
||||
|
||||
&__text {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
}
|
||||
|
||||
& ul {
|
||||
padding-left: 25px;
|
||||
@include list-parent;
|
||||
}
|
||||
|
||||
& p + ul {
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
}
|
||||
|
||||
& li {
|
||||
list-style: disc;
|
||||
@include list-child;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -245,3 +245,12 @@
|
|||
width: $small-icon-dimension;
|
||||
height: $small-icon-dimension;
|
||||
}
|
||||
|
||||
|
||||
@mixin list-parent {
|
||||
padding-left: $medium-spacing;
|
||||
}
|
||||
|
||||
@mixin list-child {
|
||||
list-style: disc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ a {
|
|||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
b {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2rem;
|
||||
font-weight: 800;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 3.2.13 on 2022-06-15 15:40
|
||||
|
||||
from django.db import migrations
|
||||
import wagtail.core.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('assignments', '0013_auto_20210315_2143'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='assignment',
|
||||
name='assignment',
|
||||
field=wagtail.core.fields.RichTextField(),
|
||||
),
|
||||
]
|
||||
|
|
@ -13,7 +13,7 @@ from core.constants import DEFAULT_RICH_TEXT_FEATURES
|
|||
@register_snippet
|
||||
class Assignment(index.Indexed, TimeStampedModel):
|
||||
title = models.CharField(max_length=255)
|
||||
assignment = models.TextField()
|
||||
assignment = RichTextField(features=DEFAULT_RICH_TEXT_FEATURES)
|
||||
solution = RichTextField(null=True, blank=True, features=DEFAULT_RICH_TEXT_FEATURES)
|
||||
deleted = models.BooleanField(default=False)
|
||||
owner = models.ForeignKey(get_user_model(),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
# Generated by Django 3.2.13 on 2022-06-15 15:40
|
||||
|
||||
import assignments.models
|
||||
from django.db import migrations
|
||||
import surveys.models
|
||||
import wagtail.core.blocks
|
||||
import wagtail.core.fields
|
||||
import wagtail.images.blocks
|
||||
import wagtail.snippets.blocks
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('books', '0032_auto_20211213_1342'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='contentblock',
|
||||
name='contents',
|
||||
field=wagtail.core.fields.StreamField([('text_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold']))])), ('basic_knowledge', wagtail.core.blocks.StructBlock([('description', wagtail.core.blocks.RichTextBlock(required=False)), ('basic_knowledge', wagtail.core.blocks.PageChooserBlock(page_type=['basicknowledge.BasicKnowledge'], required=True))])), ('assignment', wagtail.core.blocks.StructBlock([('assignment_id', wagtail.snippets.blocks.SnippetChooserBlock(assignments.models.Assignment))])), ('survey', wagtail.core.blocks.StructBlock([('survey_id', wagtail.snippets.blocks.SnippetChooserBlock(surveys.models.Survey))])), ('image_block', wagtail.images.blocks.ImageChooserBlock()), ('image_url_block', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('link_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('solution', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold']))], icon='tick')), ('video_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('document_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('infogram_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock()), ('title', wagtail.core.blocks.TextBlock())])), ('genially_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('thinglink_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('subtitle', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock())])), ('instruction', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock()), ('text', wagtail.core.blocks.TextBlock(required=False))])), ('module_room_slug', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('content_list_item', wagtail.core.blocks.StreamBlock([('text_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold']))])), ('basic_knowledge', wagtail.core.blocks.StructBlock([('description', wagtail.core.blocks.RichTextBlock(required=False)), ('basic_knowledge', wagtail.core.blocks.PageChooserBlock(page_type=['basicknowledge.BasicKnowledge'], required=True))])), ('assignment', wagtail.core.blocks.StructBlock([('assignment_id', wagtail.snippets.blocks.SnippetChooserBlock(assignments.models.Assignment))])), ('survey', wagtail.core.blocks.StructBlock([('survey_id', wagtail.snippets.blocks.SnippetChooserBlock(surveys.models.Survey))])), ('image_block', wagtail.images.blocks.ImageChooserBlock()), ('image_url_block', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('link_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('solution', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold']))], icon='tick')), ('video_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('document_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('infogram_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock()), ('title', wagtail.core.blocks.TextBlock())])), ('genially_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('thinglink_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('subtitle', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock())])), ('instruction', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock()), ('text', wagtail.core.blocks.TextBlock(required=False))])), ('module_room_slug', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())]))]))], blank=True, null=True),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
DEFAULT_RICH_TEXT_FEATURES = ['ul', ]
|
||||
DEFAULT_RICH_TEXT_FEATURES = ['ul', 'bold']
|
||||
INSTRUMENTS_RICH_TEXT_FEATURES = ['bold', 'ul', 'brand', 'secondary']
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
# Generated by Django 3.2.13 on 2022-06-15 15:40
|
||||
|
||||
from django.db import migrations
|
||||
import wagtail.core.blocks
|
||||
import wagtail.core.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rooms', '0010_room_restricted'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='roomentry',
|
||||
name='contents',
|
||||
field=wagtail.core.fields.StreamField([('text_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold']))])), ('image_url_block', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('link_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('document_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('video_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())]))], blank=True, null=True),
|
||||
),
|
||||
]
|
||||
Loading…
Reference in New Issue