OpenSlides/client/src/app/site/motions/motion-detail/motion-detail.component.html

202 lines
8.8 KiB
HTML
Raw Normal View History

<mat-toolbar color='primary'>
2018-08-21 14:56:26 +02:00
<button (click)='editMotionButton()' [ngClass]="{'save-button': editMotion}" class='generic-mini-button on-transition-fade'
mat-mini-fab>
2018-08-16 17:03:39 +02:00
<fa-icon *ngIf="!editMotion" icon='pen'></fa-icon>
<fa-icon *ngIf="editMotion" icon='check'></fa-icon>
</button>
<div class='motion-title on-transition-fade'>
2018-08-21 14:56:26 +02:00
<span *ngIf="newMotion">New </span>
<span translate>Motion</span>
<span *ngIf="motion && !editMotion"> {{motion.identifier}}</span>
2018-08-21 14:56:26 +02:00
<span *ngIf="editMotion && !newMotion"> {{metaInfoForm.get('identifier').value}}</span>
<span>:</span>
<span *ngIf="motion && !editMotion"> {{motion.currentTitle}}</span>
<span *ngIf="editMotion"> {{contentForm.get('currentTitle').value}}</span>
<br>
<div *ngIf="motion" class='motion-submitter'>
<span translate>by</span> {{motion.submitterAsUser}}
</div>
</div>
2018-08-22 16:03:49 +02:00
<span class='spacer'></span>
<button class='on-transition-fade' mat-icon-button [matMenuTriggerFor]="motionExtraMenu">
<fa-icon icon='ellipsis-v'></fa-icon>
</button>
<mat-menu #motionExtraMenu="matMenu">
<!-- TODO the functions for the buttons -->
<button mat-menu-item translate>Export As...</button>
<button mat-menu-item translate>Project</button>
<mat-divider></mat-divider>
<button mat-menu-item class='deleteMotionButton' (click)='deleteMotionButton()' translate>DeleteMotion</button>
</mat-menu>
</mat-toolbar>
<mat-accordion multi='true' class='on-transition-fade'>
2018-08-16 17:03:39 +02:00
<!-- MetaInfo -->
<!-- <mat-expansion-panel #metaInfoPanel [expanded]='true' class='meta-info-panel'> -->
2018-08-21 14:56:26 +02:00
<mat-expansion-panel #metaInfoPanel [expanded]='this.editMotion && this.newMotion' class='meta-info-panel'>
<mat-expansion-panel-header>
<mat-panel-title>
<fa-icon icon='info-circle' [fixedWidth]="true"></fa-icon>
<span translate>Meta information</span>
</mat-panel-title>
</mat-expansion-panel-header>
2018-08-13 13:49:38 +02:00
2018-08-16 17:03:39 +02:00
<!-- Meta info -->
<form [formGroup]='metaInfoForm' class='expansion-panel-custom-body' (ngSubmit)='saveMotion()'>
<!-- Identifier -->
2018-08-21 14:56:26 +02:00
<div *ngIf="editMotion && !newMotion">
<!-- <div *ngIf="editMotion"> -->
2018-08-16 17:03:39 +02:00
<div *ngIf='!editMotion'>
<h3 translate>Identifier</h3>
{{motion.identifier}}
</div>
<mat-form-field *ngIf="editMotion">
<input matInput placeholder='Identifier' formControlName='identifier' [value]='motion.identifier'>
2018-08-16 17:03:39 +02:00
</mat-form-field>
</div>
<!-- Submitter -->
<div *ngIf="motion && motion.submitters || editMotion">
<h3 translate>Submitters</h3>
{{motion.submitterAsUser}}
</div>
2018-08-13 13:49:38 +02:00
2018-08-16 17:03:39 +02:00
<!-- Supporter -->
<div *ngIf='motion && motion.supporters_id && motion.supporters_id.length > 0 || editMotion'>
2018-08-16 17:03:39 +02:00
<h3 translate>Supporters</h3>
<!-- print all motion supporters -->
</div>
2018-08-13 13:49:38 +02:00
2018-08-16 17:03:39 +02:00
<!-- State -->
2018-08-23 10:35:05 +02:00
<div *ngIf='!newMotion && motion && motion.workflow && motion.state_id || editMotion'>
2018-08-16 17:03:39 +02:00
<div *ngIf='!editMotion'>
<h3 translate>State</h3>
2018-08-23 10:35:05 +02:00
{{motion.state}}
2018-08-16 17:03:39 +02:00
</div>
2018-08-23 10:35:05 +02:00
<mat-form-field *ngIf="editMotion && !newMotion">
<mat-select placeholder='State' formControlName='state_id'>
2018-08-23 10:35:05 +02:00
<mat-option [value]="motion.state.id">{{motion.state}}</mat-option>
<mat-divider></mat-divider>
<mat-option *ngFor="let state of motion.nextStates" [value]="state.id">{{state}}</mat-option>
2018-08-16 17:03:39 +02:00
<mat-divider></mat-divider>
<mat-option>
2018-08-23 10:35:05 +02:00
<fa-icon icon='exclamation-triangle'></fa-icon> <span translate>Reset State</span>
2018-08-16 17:03:39 +02:00
</mat-option>
</mat-select>
</mat-form-field>
</div>
2018-08-13 13:49:38 +02:00
2018-08-16 17:03:39 +02:00
<!-- Recommendation -->
<!-- The suggestion of the work group weather or not a motion should be accepted -->
<div *ngIf='motion && motion.recomBy && (motion.recommendation_id || editMotion)'>
<div *ngIf='!editMotion'>
<h3>{{motion.recomBy}}</h3>
{{motion.recommendation.name}}
</div>
2018-08-22 16:03:49 +02:00
<mat-form-field *ngIf="motion && editMotion">
<mat-select placeholder='Recommendation' formControlName='recommendation_id'>
2018-08-23 10:35:05 +02:00
<mat-option *ngFor="let state of motion.nextStates" [value]="state.id">{{state}}</mat-option>
<mat-divider></mat-divider>
<mat-option>
<fa-icon icon='exclamation-triangle'></fa-icon>
<span translate>Reset recommendation</span>
</mat-option>
</mat-select>
</mat-form-field>
</div>
2018-08-13 13:49:38 +02:00
2018-08-16 17:03:39 +02:00
<!-- Category -->
<div *ngIf="motion && motion.category_id || editMotion">
2018-08-16 17:03:39 +02:00
<div *ngIf='!editMotion'>
<h3 translate> Category</h3>
{{motion.category}}
</div>
2018-08-22 16:03:49 +02:00
<mat-form-field *ngIf="motion && editMotion">
<mat-select placeholder='Category' formControlName='category_id'>
2018-08-16 17:03:39 +02:00
<mat-option>None</mat-option>
<mat-divider></mat-divider>
<mat-option *ngFor="let cat of getMotionCategories()" [value]="cat.id">{{cat}}</mat-option>
2018-08-16 17:03:39 +02:00
</mat-select>
</mat-form-field>
</div>
2018-08-13 13:49:38 +02:00
2018-08-16 17:03:39 +02:00
<!-- Origin -->
<div *ngIf="motion && motion.origin || editMotion">
2018-08-16 17:03:39 +02:00
<div *ngIf='!editMotion'>
<h3 translate> Origin</h3>
{{motion.origin}}
</div>
<mat-form-field *ngIf="editMotion">
<input matInput placeholder='Origin' formControlName='origin' [value]='motion.origin'>
</mat-form-field>
</div>
2018-08-16 17:03:39 +02:00
<!-- Voting -->
<!-- <div *ngIf='motion.polls && motion.polls.length > 0 || editMotion'>
<h3 translate>Voting</h3>
2018-08-16 17:03:39 +02:00
</div> -->
</form>
</mat-expansion-panel>
2018-08-16 17:03:39 +02:00
<!-- Personal Note -->
2018-08-13 13:49:38 +02:00
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
<fa-icon icon='file-signature' [fixedWidth]="true"></fa-icon>
<span translate>Personal note</span>
</mat-panel-title>
</mat-expansion-panel-header>
TEST
</mat-expansion-panel>
2018-08-16 17:03:39 +02:00
<!-- Content -->
<mat-expansion-panel #contentPanel [expanded]='true' class='content-panel'>
<mat-expansion-panel-header>
<mat-panel-title>
<fa-icon icon='align-left' [fixedWidth]="true"></fa-icon>
<span translate>Content</span>
</mat-panel-title>
</mat-expansion-panel-header>
<form [formGroup]='contentForm' class='expansion-panel-custom-body' (ngSubmit)='saveMotion()'>
2018-08-16 17:03:39 +02:00
<!-- Title -->
<div *ngIf="motion && motion.currentTitle || editMotion">
2018-08-16 17:03:39 +02:00
<div *ngIf='!editMotion'>
<h2>{{motion.currentTitle}}</h2>
</div>
<mat-form-field *ngIf="editMotion" class='wide-text'>
<input matInput placeholder='Title' formControlName='currentTitle' [value]='motion.currentTitle'>
2018-08-16 17:03:39 +02:00
</mat-form-field>
</div>
<!-- Text -->
<!-- TODO: this is a config variable. Read it out -->
2018-08-16 17:03:39 +02:00
<h3 translate>The assembly may decide:</h3>
<div *ngIf='motion && !editMotion'>
2018-08-16 17:03:39 +02:00
<div [innerHtml]='motion.currentText'></div>
</div>
<mat-form-field *ngIf="motion && editMotion" class='wide-text'>
<textarea matInput placeholder='Motion Text' formControlName='currentText' [value]='motion.currentText'></textarea>
2018-08-16 17:03:39 +02:00
</mat-form-field>
<!-- Reason -->
<div *ngIf="motion && motion.currentReason || editMotion">
2018-08-16 17:03:39 +02:00
<div *ngIf='!editMotion'>
<h4 translate>Reason</h4>
<div [innerHtml]='motion.currentReason'></div>
</div>
<mat-form-field *ngIf="editMotion" class='wide-text'>
<textarea matInput placeholder="Reason" formControlName='currentReason' [value]='motion.currentReason'></textarea>
2018-08-16 17:03:39 +02:00
</mat-form-field>
</div>
2018-08-21 14:56:26 +02:00
</form>
</mat-expansion-panel>
2018-08-21 14:56:26 +02:00
</mat-accordion>