Merge pull request #5564 from tsiegleauq/amendment-projection-default

Add amendment projection defaults
This commit is contained in:
Emanuel Schütze 2020-09-17 17:26:29 +02:00 committed by GitHub
commit 2687d1abba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 1 deletions

View File

@ -334,6 +334,13 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers<Mot
}
];
let projectionDefaultName: string;
if (this.isParagraphBasedAmendment()) {
projectionDefaultName = 'amendments';
} else {
projectionDefaultName = 'motions';
}
return {
getBasicProjectorElement: options => ({
name: Motion.COLLECTIONSTRING,
@ -341,7 +348,7 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers<Mot
getIdentifiers: () => ['name', 'id']
}),
slideOptions: slideOptions,
projectionDefaultName: 'motions',
projectionDefaultName: projectionDefaultName,
getDialogTitle: this.getAgendaSlideTitle
};
}

View File

@ -0,0 +1,32 @@
from django.db import migrations
def add_amendment_projection_defaults(apps, schema_editor):
"""
Adds projectiondefaults for messages and countdowns.
"""
Projector = apps.get_model("core", "Projector")
ProjectionDefault = apps.get_model("core", "ProjectionDefault")
default_projector = Projector.objects.order_by("pk").first()
projectiondefaults = []
projectiondefaults.append(
ProjectionDefault(
name="amendments", display_name="Amendments", projector=default_projector
)
)
# Create all new projectiondefaults
ProjectionDefault.objects.bulk_create(projectiondefaults)
class Migration(migrations.Migration):
dependencies = [
("core", "0033_live_stream_permission"),
]
operations = [
migrations.RunPython(add_amendment_projection_defaults),
]