Merge pull request #5564 from tsiegleauq/amendment-projection-default
Add amendment projection defaults
This commit is contained in:
commit
2687d1abba
@ -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
|
||||
};
|
||||
}
|
||||
|
@ -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),
|
||||
]
|
Loading…
Reference in New Issue
Block a user