aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-moderation/report-modals/video-report.component.html
blob: 51ca0b9d6f78ad3833640c90e87b786745e40840 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<ng-template #modal>
  <div class="modal-header">
    <h4 i18n class="modal-title">Report video "{{ video.name }}"</h4>
    <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon>
  </div>

  <div class="modal-body">
    <form novalidate [formGroup]="form" (ngSubmit)="report()">

    <div class="row">
      <div class="col-12 col-md-5">
        <label i18n for="reportPredefinedReasons">What is the issue?</label>

        <div class="ms-2 mt-2 d-flex flex-column">
          <ng-container formGroupName="predefinedReasons">

            <div class="form-group" *ngFor="let reason of predefinedReasons">
              <my-peertube-checkbox [inputName]="reason.id" [formControlName]="reason.id" [labelText]="reason.label">
                <ng-template *ngIf="reason.help" ptTemplate="help">
                  <div [innerHTML]="reason.help"></div>
                </ng-template>

                <ng-container *ngIf="reason.description" ngProjectAs="description">
                  <div [innerHTML]="reason.description"></div>
                </ng-container>
              </my-peertube-checkbox>
            </div>

          </ng-container>
        </div>
      </div>

      <div class="col-12 col-md-7">
        <my-embed [video]="video"></my-embed>

        <div class="mb-1 mt-3 start-at" formGroupName="timestamp">
          <my-peertube-checkbox
            formControlName="hasStart"
            i18n-labelText labelText="Start at"
          ></my-peertube-checkbox>

          <my-timestamp-input
            [timestamp]="timestamp.startAt"
            [maxTimestamp]="video.duration"
            formControlName="startAt"
            inputName="startAt"
          >
          </my-timestamp-input>
        </div>

        <div class="mb-3 stop-at"  formGroupName="timestamp" *ngIf="timestamp.hasStart">
          <my-peertube-checkbox
            formControlName="hasEnd"
            i18n-labelText labelText="Stop at"
          ></my-peertube-checkbox>

          <my-timestamp-input
            [timestamp]="timestamp.endAt"
            [maxTimestamp]="video.duration"
            formControlName="endAt"
            inputName="endAt"
          >
          </my-timestamp-input>
        </div>

        <div i18n class="information">
          Your report will be sent to moderators of {{ currentHost }}<ng-container *ngIf="isRemote()"> and will be forwarded to the video origin ({{ originHost }}) too</ng-container>.
        </div>

        <div class="form-group">
          <textarea
            i18n-placeholder placeholder="Please describe the issue..." formControlName="reason" ngbAutofocus
            [ngClass]="{ 'input-error': formErrors['reason'] }" class="form-control"
          ></textarea>
          <div *ngIf="formErrors.reason" class="form-error">
            {{ formErrors.reason }}
          </div>
        </div>
      </div>
    </div>

    <div class="form-group inputs">
      <input
        type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
        (click)="hide()" (key.enter)="hide()"
      >

      <input type="submit" i18n-value value="Submit" class="peertube-button orange-button" [disabled]="!form.valid">
    </div>

    </form>
  </div>
</ng-template>