Use title for amendments if an id does not exist

Also some slight head-bar cleanups
This commit is contained in:
Sean 2020-06-17 11:08:22 +02:00
parent b43151fd59
commit 00e644292d
3 changed files with 25 additions and 24 deletions

View File

@ -264,7 +264,7 @@ export class AmendmentCreateWizardComponent extends BaseViewComponent implements
}); });
const newMotionValues = { const newMotionValues = {
...this.contentForm.value, ...this.contentForm.value,
title: this.translate.instant('Amendment to') + ' ' + this.motion.identifier, title: this.translate.instant('Amendment to') + ' ' + this.motion.getIdentifierOrTitle(),
text: text, // Workaround as 'text' is required from the backend text: text, // Workaround as 'text' is required from the backend
parent_id: this.motion.id, parent_id: this.motion.id,
category_id: this.motion.category_id, category_id: this.motion.category_id,

View File

@ -22,17 +22,19 @@
</div> </div>
<!-- Back and forth buttons --> <!-- Back and forth buttons -->
<div *ngIf="!editMotion && !vp.isMobile" class="extra-controls-slot"> <div *ngIf="!editMotion && !vp.isMobile" class="extra-controls-slot prev-next-motion-controls">
<div *ngIf="previousMotion"> <div *ngIf="previousMotion">
<button mat-button (click)="navigateToMotion(previousMotion)"> <button mat-button (click)="navigateToMotion(previousMotion)">
<mat-icon>chevron_left</mat-icon> <os-icon-container icon="chevron_left">
<span>{{ previousMotion.identifier }}</span> {{ previousMotion.identifier }}
</os-icon-container>
</button> </button>
</div> </div>
<div *ngIf="nextMotion"> <div *ngIf="nextMotion">
<button mat-button (click)="navigateToMotion(nextMotion)"> <button mat-button (click)="navigateToMotion(nextMotion)">
<span>{{ nextMotion.identifier }}</span> <os-icon-container icon="chevron_right" [swap]="true">
<mat-icon>chevron_right</mat-icon> {{ nextMotion.identifier }}
</os-icon-container>
</button> </button>
</div> </div>
</div> </div>
@ -464,7 +466,7 @@
<span *ngIf="amendments.length > 1">{{ 'Amendments' | translate }}</span> <span *ngIf="amendments.length > 1">{{ 'Amendments' | translate }}</span>
</a> </a>
<br> <br />
<mat-checkbox [(ngModel)]="showAllAmendments" *ngIf="isRecoMode(ChangeRecoMode.Diff)"> <mat-checkbox [(ngModel)]="showAllAmendments" *ngIf="isRecoMode(ChangeRecoMode.Diff)">
{{ 'Show all changes' | translate }} {{ 'Show all changes' | translate }}
</mat-checkbox> </mat-checkbox>
@ -534,8 +536,7 @@
mat-button mat-button
[matMenuTriggerFor]="changeRecoMenu" [matMenuTriggerFor]="changeRecoMenu"
*ngIf=" *ngIf="
motion && motion && ((allChangingObjects && allChangingObjects.length) || motion.modified_final_version)
((allChangingObjects && allChangingObjects.length) || motion.modified_final_version)
" "
> >
<mat-icon>rate_review</mat-icon> <mat-icon>rate_review</mat-icon>
@ -888,19 +889,28 @@
[class.line-numbers-outside]="isLineNumberingOutside()" [class.line-numbers-outside]="isLineNumberingOutside()"
[class.amendment-context]="showAmendmentContext" [class.amendment-context]="showAmendmentContext"
> >
<h3 class="amendment-line-header" *ngIf="!showAmendmentContext">{{ getAmendmentParagraphLinesTitle(paragraph) }}</h3> <h3 class="amendment-line-header" *ngIf="!showAmendmentContext">
{{ getAmendmentParagraphLinesTitle(paragraph) }}
</h3>
<os-motion-detail-original-change-recommendations <os-motion-detail-original-change-recommendations
*ngIf="isLineNumberingOutside() && (isRecoMode(ChangeRecoMode.Original) || isRecoMode(ChangeRecoMode.Changed))" *ngIf="
isLineNumberingOutside() &&
(isRecoMode(ChangeRecoMode.Original) || isRecoMode(ChangeRecoMode.Changed))
"
[html]="getAmendmentDiffTextWithContext(paragraph)" [html]="getAmendmentDiffTextWithContext(paragraph)"
[changeRecommendations]="changeRecommendations" [changeRecommendations]="changeRecommendations"
(createChangeRecommendation)="createChangeRecommendation($event)" (createChangeRecommendation)="createChangeRecommendation($event)"
(gotoChangeRecommendation)="gotoChangeRecommendation($event)" (gotoChangeRecommendation)="gotoChangeRecommendation($event)"
></os-motion-detail-original-change-recommendations> ></os-motion-detail-original-change-recommendations>
<div <div
*ngIf="!isLineNumberingOutside() || !(isRecoMode(ChangeRecoMode.Original) || isRecoMode(ChangeRecoMode.Changed))" *ngIf="
!isLineNumberingOutside() ||
!(isRecoMode(ChangeRecoMode.Original) || isRecoMode(ChangeRecoMode.Changed))
"
[outerHTML]="getAmendmentDiffTextWithContext(paragraph) | trust: 'html'" [outerHTML]="getAmendmentDiffTextWithContext(paragraph) | trust: 'html'"
></div><!-- the <div> element is only a placeholder -> outerHTML to replace it --> ></div>
<!-- the <div> element is only a placeholder -> outerHTML to replace it -->
</div> </div>
</ng-container> </ng-container>

View File

@ -8,19 +8,10 @@ span {
margin-bottom: 1em; margin-bottom: 1em;
} }
.extra-controls-slot { .prev-next-motion-controls {
div { div {
padding: 0px;
button {
.mat-button-wrapper {
display: inherit; display: inherit;
} }
font-size: 100%;
}
span {
font-size: 80%;
}
}
} }
.motion-content { .motion-content {