aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/comment/video-comment-add.component.html
blob: ec8da02e277839fa46988e5da5adc88517a5ec50 (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
<form novalidate [formGroup]="form" (ngSubmit)="formValidated()">
  <div class="avatar-and-textarea">
    <img [src]="getAvatarUrl()" alt="Avatar" />

    <div class="form-group">
      <my-help class="markdown-guide" helpType="custom" iconName="markdown" i18n-title title="Markdown compatible">
        <ng-template ptTemplate="customHtml">
          <div i18n>
            Markdown compatible that supports:

            <ul>
              <li>Emphasis: <strong>**bold**</strong>, <i>_italic_</i></li>
              <li>Links</li>
              <li>Break lines</li>
              <li>Lists</li>
            </ul>
          </div>
        </ng-template>
      </my-help>
      <textarea i18n-placeholder placeholder="Add comment..." myAutoResize
                [readonly]="(user === null) ? true : false"
                (click)="openVisitorModal($event)"
                formControlName="text" [ngClass]="{ 'input-error': formErrors['text'] }"
                (keyup.control.enter)="onValidKey()" (keyup.meta.enter)="onValidKey()" #textarea>

      </textarea>
      <div *ngIf="formErrors.text" class="form-error">
        {{ formErrors.text }}
      </div>
    </div>
  </div>

  <div class="comment-buttons">
    <button *ngIf="isAddButtonDisplayed()" class="cancel-button" (click)="cancelCommentReply()" type="button" i18n>
      Cancel
    </button>
    <button *ngIf="isAddButtonDisplayed()" [ngClass]="{ disabled: !form.valid || addingComment }">
      {{ addingCommentButtonValue }}
    </button>
  </div>
</form>

<ng-template #visitorModal let-modal>
  <div class="modal-header">
    <h4 class="modal-title" id="modal-basic-title" i18n>You are one step away from commenting</h4>
    <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hideVisitorModal()"></my-global-icon>
  </div>
  <div class="modal-body">
    <span i18n>
      You can comment using an account on any ActivityPub-compatible instance.
      On most platforms, you can find the video by typing its URL in the search bar and then comment it
      from within the software's interface.
    </span>
    <span i18n>
      If you have an account on Mastodon or Pleroma, you can open it directly in their interface:
    </span>
    <my-remote-subscribe [interact]="true" [uri]="getUri()"></my-remote-subscribe>
  </div>
  <div class="modal-footer inputs">
    <input
      type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel"
      (click)="hideVisitorModal()" (key.enter)="hideVisitorModal()"
    >

    <input
      type="submit" i18n-value value="Login to comment" class="action-button-submit"
      (click)="gotoLogin()"
    >
  </div>
</ng-template>