{{ motion.title }}
@@ -50,7 +50,7 @@
State
-
+
@@ -60,8 +60,22 @@
+
+
+ Speakers
+
+
+
+
+
-
+
diff --git a/client/src/app/site/motions/components/motion-list/motion-list.component.scss b/client/src/app/site/motions/components/motion-list/motion-list.component.scss
index ebdc94b63..a62c88def 100644
--- a/client/src/app/site/motions/components/motion-list/motion-list.component.scss
+++ b/client/src/app/site/motions/components/motion-list/motion-list.component.scss
@@ -41,4 +41,10 @@
font-size: 150%;
}
}
+
+ /** Speakers indicator */
+ .mat-column-speakers {
+ flex: 0 0 100px;
+ justify-content: flex-end !important;
+ }
}
diff --git a/client/src/app/site/motions/components/motion-list/motion-list.component.ts b/client/src/app/site/motions/components/motion-list/motion-list.component.ts
index c5e5212cc..1e260b8bc 100644
--- a/client/src/app/site/motions/components/motion-list/motion-list.component.ts
+++ b/client/src/app/site/motions/components/motion-list/motion-list.component.ts
@@ -22,14 +22,14 @@ export class MotionListComponent extends ListViewBaseComponent imple
/**
* Use for minimal width
*/
- public columnsToDisplayMinWidth = ['identifier', 'title', 'state'];
+ public columnsToDisplayMinWidth = ['identifier', 'title', 'state', 'speakers'];
/**
* Use for maximal width
*
* TODO: Needs vp.desktop check
*/
- public columnsToDisplayFullWidth = ['identifier', 'title', 'meta', 'state'];
+ public columnsToDisplayFullWidth = ['identifier', 'title', 'state', 'speakers'];
/**
* Constructor implements title and translation Module.
@@ -110,6 +110,14 @@ export class MotionListComponent extends ListViewBaseComponent imple
}
}
+ /**
+ * Handler for the speakers button
+ * @param motion indicates the row that was clicked on
+ */
+ public onSpeakerIcon(motion: ViewMotion): void {
+ this.router.navigate([`/agenda/${motion.agenda_item_id}/speakers`]);
+ }
+
/**
* Handler for the plus button
*/
diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts
index 552c29395..05f07f036 100644
--- a/client/src/app/site/motions/models/view-motion.ts
+++ b/client/src/app/site/motions/models/view-motion.ts
@@ -7,6 +7,7 @@ import { BaseModel } from '../../../shared/models/base/base-model';
import { BaseViewModel } from '../../base/base-view-model';
import { ViewMotionCommentSection } from './view-motion-comment-section';
import { MotionComment } from '../../../shared/models/motions/motion-comment';
+import { Item } from 'app/shared/models/agenda/item';
export enum LineNumberingMode {
None,
@@ -35,6 +36,7 @@ export class ViewMotion extends BaseViewModel {
private _supporters: User[];
private _workflow: Workflow;
private _state: WorkflowState;
+ private _item: Item;
/**
* Indicates the LineNumberingMode Mode.
@@ -164,13 +166,22 @@ export class ViewMotion extends BaseViewModel {
this._motion.submitters_id = users.map(user => user.id);
}
+ public get item(): Item {
+ return this._item;
+ }
+
+ public get agendaSpeakerAmount(): number {
+ return this.item ? this.item.speakerAmount : null
+ }
+
public constructor(
motion?: Motion,
category?: Category,
submitters?: User[],
supporters?: User[],
workflow?: Workflow,
- state?: WorkflowState
+ state?: WorkflowState,
+ item?: Item,
) {
super();
@@ -180,6 +191,7 @@ export class ViewMotion extends BaseViewModel {
this._supporters = supporters;
this._workflow = workflow;
this._state = state;
+ this._item = item;
// TODO: Should be set using a a config variable
this.lnMode = LineNumberingMode.Outside;
@@ -216,13 +228,16 @@ export class ViewMotion extends BaseViewModel {
this.updateWorkflow(update as Workflow);
} else if (update instanceof Category) {
this.updateCategory(update as Category);
+ } else if (update instanceof Item) {
+ this.updateItem(update as Item);
}
// TODO: There is no way (yet) to add Submitters to a motion
// Thus, this feature could not be tested
}
/**
- * Updates the Category
+ * Update routine for the category
+ * @param update potentially the changed category. Needs manual verification
*/
public updateCategory(update: Category): void {
if (this.motion && update.id === this.motion.category_id) {
@@ -231,7 +246,8 @@ export class ViewMotion extends BaseViewModel {
}
/**
- * updates the Workflow
+ * Update routine for the workflow
+ * @param update potentially the changed workflow (state). Needs manual verification
*/
public updateWorkflow(update: Workflow): void {
if (this.motion && update.id === this.motion.workflow_id) {
@@ -239,6 +255,16 @@ export class ViewMotion extends BaseViewModel {
}
}
+ /**
+ * Update routine for the agenda Item
+ * @param update potentially the changed agenda Item. Needs manual verification
+ */
+ public updateItem(update: Item): void {
+ if (this.motion && update.id === this.motion.agenda_item_id) {
+ this._item = update as Item;
+ }
+ }
+
public hasSupporters(): boolean {
return !!(this.supporters && this.supporters.length > 0);
}
diff --git a/client/src/app/site/motions/services/motion-repository.service.ts b/client/src/app/site/motions/services/motion-repository.service.ts
index 3ba541fad..afc2fb7b6 100644
--- a/client/src/app/site/motions/services/motion-repository.service.ts
+++ b/client/src/app/site/motions/services/motion-repository.service.ts
@@ -19,6 +19,7 @@ import { CollectionStringModelMapperService } from '../../../core/services/colle
import { HttpService } from 'app/core/services/http.service';
import { ConfigService } from 'app/core/services/config.service';
import { Observable } from 'rxjs';
+import { Item } from 'app/shared/models/agenda/item';
/**
* Repository Services for motions (and potentially categories)
@@ -53,7 +54,7 @@ export class MotionRepositoryService extends BaseRepository
private readonly lineNumbering: LinenumberingService,
private readonly diff: DiffService
) {
- super(DS, mapperService, Motion, [Category, User, Workflow]);
+ super(DS, mapperService, Motion, [Category, User, Workflow, Item]);
}
/**
@@ -69,11 +70,12 @@ export class MotionRepositoryService extends BaseRepository
const submitters = this.DS.getMany(User, motion.submitterIds);
const supporters = this.DS.getMany(User, motion.supporters_id);
const workflow = this.DS.get(Workflow, motion.workflow_id);
+ const item = this.DS.get(Item, motion.agenda_item_id);
let state: WorkflowState = null;
if (workflow) {
state = workflow.getStateById(motion.state_id);
}
- return new ViewMotion(motion, category, submitters, supporters, workflow, state);
+ return new ViewMotion(motion, category, submitters, supporters, workflow, state, item);
}
/**