Remove subtitle from room entry

This commit is contained in:
Ramon Wenger 2018-11-01 16:18:35 +01:00
parent a51a882c1d
commit 90f980fe09
11 changed files with 19 additions and 18 deletions

View File

@ -14,9 +14,7 @@
@input="setContentBlockType"
class="contents-form__task"
></checkbox>
<modal-input v-if="blockType === 'RoomEntry'"
placeholder="Untertitel für Raumeintrag erfassen"
v-model="localContentBlock.subtitle"></modal-input>
</template>
<add-content-element class="contents-form__add"
@ -113,7 +111,6 @@
title: this.contentBlock.title,
contents: [...this.contentBlock.contents],
id: this.contentBlock.id || undefined,
subtitle: this.contentBlock.subtitle,
isAssignment: this.contentBlock.type && this.contentBlock.type === 'TASK'
})
}

View File

@ -23,7 +23,6 @@
return {
entry: {
title: '',
subtitle: '',
contents: []
}
}

View File

@ -2,7 +2,6 @@ fragment RoomEntryParts on RoomEntryNode {
id
slug
title
subtitle
contents
author {
id

View File

@ -13,7 +13,6 @@ mutation AddRoomEntry($input: AddRoomEntryInput!){
#{"input": {
# "roomEntry": {
# "title": "Hi",
# "subtitle": "Marc",
# "contents": [{
# "type": "text_block",
# "value": {"text": "Something more\r\n what what"}

View File

@ -5,7 +5,6 @@
<user-widget v-bind="roomEntry.author"></user-widget>
</div>
<h1 class="article__title">{{roomEntry.title}}</h1>
<h2 class="article__subtitle">{{roomEntry.subtitle}}</h2>
</div>
<div class="article__content">

View File

@ -19,7 +19,6 @@ data = [
'entries': [
{
'title': 'Ein neues Festival auf dem Gurten und ich bin dabei!',
'subtitle': 'Endlich war es soweit. Zum ersten Mal fand am 2. und 3. Juli 1977 das 1. Internationale …',
'contents': [
{
'type': 'image_url_block',
@ -45,7 +44,6 @@ data = [
},
{
'title': 'Mein Tagesblog',
'subtitle': 'https://blogger.com/cruel-festivals-around-the-world/',
'contents': [
{
'type': 'image_url_block',
@ -71,7 +69,6 @@ data = [
},
{
'title': 'Woodstock',
'subtitle': 'In Woodstock hat sich dem Mythos nach vor genau vierzig Jahren das Lebensgefühl …',
'contents': [
{
'type': 'image_url_block',
@ -91,7 +88,6 @@ data = [
},
{
'title': 'Das Festival',
'subtitle': 'www.meinblog.ch',
'contents': [
{
'type': 'image_url_block',
@ -124,7 +120,6 @@ data = [
'entries': [
{
'title': 'Ich heisse Jan und habe am 01. August 2017 meine Ausbildung begonnen. Pünktlich zum …',
'subtitle': '',
'contents': [
{
'type': 'image_url_block',
@ -150,7 +145,6 @@ data = [
},
{
'title': 'Mein Lehrbeginn',
'subtitle': 'Was war ich angespannt… und nervös. Das hat sich aber schnell gelegt.',
'contents': [
{
'type': 'image_url_block',

View File

@ -29,7 +29,6 @@ class RoomEntryFactory(factory.django.DjangoModelFactory):
model = RoomEntry
title = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(8, 12)))
subtitle = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(8, 12)))
description = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(20, 30)))
author = factory.Iterator(get_user_model().objects.all())
room = factory.SubFactory(RoomFactory)

View File

@ -22,7 +22,6 @@ class UpdateRoomArgument(RoomInput):
class RoomEntryArgument(InputObjectType):
title = graphene.String(required=True)
subtitle = graphene.String()
contents = graphene.List(ContentElementInput)

View File

@ -0,0 +1,17 @@
# Generated by Django 2.0.6 on 2018-11-01 15:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rooms', '0002_auto_20181015_1237'),
]
operations = [
migrations.RemoveField(
model_name='roomentry',
name='subtitle',
),
]

View File

@ -27,7 +27,6 @@ class RoomEntry(TitleSlugDescriptionModel):
room = models.ForeignKey(Room, blank=False, null=False, on_delete=models.CASCADE, related_name='room_entries')
author = models.ForeignKey(get_user_model(), null=True, on_delete=models.CASCADE)
subtitle = models.CharField(blank=True, null=False, max_length=255)
contents = StreamField([
('text_block', TextBlock()),

View File

@ -23,7 +23,7 @@ class RoomEntrySerializer(serializers.ModelSerializer):
class Meta:
model = RoomEntry
fields = ('room', 'author', 'subtitle', 'title', 'contents')
fields = ('room', 'author', 'title', 'contents')
read_only_fields = ('id', 'slug',)
def validate_contents(self, value):