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

156 lines
7.0 KiB
HTML
Raw Normal View History

2018-09-30 18:43:20 +02:00
<!-- A summary of all changes -->
<section class="change-recommendation-overview">
2018-11-04 11:11:48 +01:00
<strong> {{ 'Summary of changes' | translate }}: </strong>
2018-09-30 18:43:20 +02:00
<!--
2018-11-04 11:11:48 +01:00
<button os-perms="motions.can_manage" class="btn btn-sm btn-default pull-right"
uib-tooltip="{{ 'Note: You have to reject all change recommendations if the plenum does not follow the recommendation. This does not affect amendments.' | translate }}"
ng-click="viewChangeRecommendations.rejectAllChangeRecommendations(motion)">
<i class="fa fa-thumbs-down"></i>
<translate>Reject all change recommendations</translate>
</button>
2018-09-30 18:43:20 +02:00
-->
<ul *ngIf="changes.length > 0">
<li *ngFor="let change of changes">
2018-11-04 11:11:48 +01:00
<a
href=""
(click)="scrollToChangeClicked(change, $event)"
[class.amendment]="isAmendment(change)"
[class.recommendation]="isChangeRecommendation(change)"
>
<span *ngIf="change.getLineFrom() >= change.getLineTo() - 1" class="line-number">
{{ 'Line' | translate }} {{ change.getLineFrom() }}
2018-09-30 18:43:20 +02:00
</span>
2018-11-04 11:11:48 +01:00
<span *ngIf="change.getLineFrom() < change.getLineTo() - 1" class="line-number">
{{ 'Line' | translate }} {{ change.getLineFrom() }} - {{ change.getLineTo() - 1 }}
</span>
<span *ngIf="isChangeRecommendation(change)"> ({{ 'Change recommendation' | translate }})</span>
<span *ngIf="isAmendment(change)"> ({{ 'Amendment' | translate }} {{ change.getIdentifier() }})</span>
<span class="operation" *ngIf="isChangeRecommendation(change)"
> {{ getRecommendationTypeName(change) }}
<!--
@TODO
<span ng-if="change.original.getType(motion.getVersion(version).text) == 3">
{ change.other_description }
</span>
-->
</span>
<span class="status">
<ng-container *ngIf="change.isRejected()" translate>Rejected</ng-container>
<ng-container *ngIf="change.isAccepted() && isAmendment(change)" translate>Accepted</ng-container>
</span>
</a>
2018-09-30 18:43:20 +02:00
</li>
</ul>
2018-11-04 11:11:48 +01:00
<div *ngIf="changes.length === 0" class="no-changes">{{ 'No change recommendations yet' | translate }}</div>
2018-09-30 18:43:20 +02:00
</section>
<!-- The actual diff view -->
<div class="motion-text-with-diffs">
<div *ngFor="let change of changes; let i = index">
<div class="motion-text"
[class.line-numbers-none]="isLineNumberingNone()"
[class.line-numbers-inline]="isLineNumberingInline()"
[class.line-numbers-outside]="isLineNumberingOutside()"
>
2018-09-30 18:43:20 +02:00
<os-motion-detail-original-change-recommendations
2018-11-04 11:11:48 +01:00
[html]="getTextBetweenChanges(changes[i - 1], change)"
[changeRecommendations]="[]"
(createChangeRecommendation)="onCreateChangeRecommendation($event)"
2018-09-30 18:43:20 +02:00
></os-motion-detail-original-change-recommendations>
</div>
2018-11-04 11:11:48 +01:00
<div
class="diff-box diff-box-{{ change.getChangeId() }} clearfix"
[class.collides]="hasCollissions(change, changes)"
>
<div class="collission-hint" *ngIf="hasCollissions(change, changes)">
2018-09-30 18:43:20 +02:00
<mat-icon matTooltip="{{ 'This change collides with another one.' | translate }}">warning</mat-icon>
</div>
<div class="action-row" *osPerms="'motions.can_manage'">
2018-11-04 11:11:48 +01:00
<button
mat-icon-button
*ngIf="isRecommendation(change)"
type="button"
[matMenuTriggerFor]="changeRecommendationMenu"
[matMenuTriggerData]="{ change: change }"
>
2018-09-30 18:43:20 +02:00
<mat-icon>more_vert</mat-icon>
</button>
<!--
<a ng-if="change.type == 'amendment'" ui-sref="motions.motion.detail({id: change.original.id})"
uib-tooltip="Open amendment"
class="btn btn-default btn-sm pull-right btn-amend-info">
<i class="fa fa-info"></i>
{{ change.original.identifier }}
</a>
2018-11-04 11:11:48 +01:00
-->
2018-09-30 18:43:20 +02:00
</div>
<div class="status-row" *ngIf="change.isRejected()">
2018-11-04 11:11:48 +01:00
<i class="grey">{{ 'Rejected' | translate }}</i>
2018-09-30 18:43:20 +02:00
</div>
2018-11-04 11:11:48 +01:00
<div
class="motion-text motion-text-diff"
[class.line-numbers-none]="isLineNumberingNone()"
[class.line-numbers-inline]="isLineNumberingInline()"
[class.line-numbers-outside]="isLineNumberingOutside()"
2018-11-04 11:11:48 +01:00
[attr.data-change-id]="change.getChangeId()"
[innerHTML]="getDiff(change)"
></div>
2018-09-30 18:43:20 +02:00
</div>
</div>
<div class="motion-text"
[class.line-numbers-none]="isLineNumberingNone()"
[class.line-numbers-inline]="isLineNumberingInline()"
[class.line-numbers-outside]="isLineNumberingOutside()"
>
2018-09-30 18:43:20 +02:00
<os-motion-detail-original-change-recommendations
2018-11-04 11:11:48 +01:00
[html]="getTextRemainderAfterLastChange()"
[changeRecommendations]="[]"
(createChangeRecommendation)="onCreateChangeRecommendation($event)"
2018-09-30 18:43:20 +02:00
></os-motion-detail-original-change-recommendations>
</div>
</div>
<mat-menu #changeRecommendationMenu="matMenu">
<ng-template matMenuContent let-change="change">
2018-11-04 11:11:48 +01:00
<button
type="button"
mat-menu-item
[disabled]="hasCollissions(change, changes)"
2018-11-04 11:11:48 +01:00
(click)="setAcceptanceValue(change, 'accepted')"
>
2018-09-30 18:43:20 +02:00
<mat-icon>thumb_up</mat-icon>
<span translate>Accept</span>
<mat-icon *ngIf="change.isAccepted()" class="active-indicator">done</mat-icon>
</button>
2018-11-04 11:11:48 +01:00
<button
type="button"
mat-menu-item
[disabled]="hasCollissions(change, changes)"
2018-11-04 11:11:48 +01:00
(click)="setAcceptanceValue(change, 'rejected')"
>
2018-09-30 18:43:20 +02:00
<mat-icon>thumb_down</mat-icon>
<span translate>Reject</span>
<mat-icon *ngIf="change.isRejected()" class="active-indicator">done</mat-icon>
</button>
<button type="button" mat-menu-item (click)="setInternal(change, !change.internal)">
2018-11-04 11:11:48 +01:00
<mat-icon>{{ change.internal ? 'check_box_outline_blank' : 'check_box' }}</mat-icon>
<span translate>Public</span>
</button>
2018-09-30 18:43:20 +02:00
<button type="button" mat-menu-item (click)="deleteChangeRecommendation(change, $event)">
<mat-icon>delete</mat-icon>
<span translate>Delete</span>
</button>
<button type="button" mat-menu-item (click)="editChangeRecommendation(change, $event)">
<mat-icon>edit</mat-icon>
<span translate>Edit</span>
</button>
</ng-template>
</mat-menu>