aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-add.component.html
blob: a70788ed82264e0a9e54a29460742217dd5a5673 (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<div class="row">
  <div class="content-padding">

    <h3>Upload a video</h3>

    <div *ngIf="error !== undefined" class="alert alert-danger">{{ error }}</div>

    <form novalidate [formGroup]="form">
      <div class="form-group">
        <label for="name">Name</label>
        <input
          type="text" class="form-control" id="name"
          formControlName="name"
        >
        <div *ngIf="formErrors.name" class="alert alert-danger">
          {{ formErrors.name }}
        </div>
      </div>

      <div class="form-group">
        <input
          type="checkbox" id="nsfw"
          formControlName="nsfw"
        >
        <label for="nsfw">This video contains mature or explicit content</label>
      </div>

      <div class="form-group">
        <label for="category">Channel</label>
        <select class="form-control" id="channelId" formControlName="channelId">
          <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
        </select>

        <div *ngIf="formErrors.channelId" class="alert alert-danger">
          {{ formErrors.channelId }}
        </div>
      </div>

      <div class="form-group">
        <label for="category">Category</label>
        <select class="form-control" id="category" formControlName="category">
          <option></option>
          <option *ngFor="let category of videoCategories" [value]="category.id">{{ category.label }}</option>
        </select>

        <div *ngIf="formErrors.category" class="alert alert-danger">
          {{ formErrors.category }}
        </div>
      </div>

      <div class="form-group">
        <label for="licence">Licence</label>
        <select class="form-control" id="licence" formControlName="licence">
          <option></option>
          <option *ngFor="let licence of videoLicences" [value]="licence.id">{{ licence.label }}</option>
        </select>

        <div *ngIf="formErrors.licence" class="alert alert-danger">
          {{ formErrors.licence }}
        </div>
      </div>

      <div class="form-group">
        <label for="language">Language</label>
        <select class="form-control" id="language" formControlName="language">
          <option></option>
          <option *ngFor="let language of videoLanguages" [value]="language.id">{{ language.label }}</option>
        </select>

        <div *ngIf="formErrors.language" class="alert alert-danger">
          {{ formErrors.language }}
        </div>
      </div>

      <div class="form-group">
        <label class="label-tags">Tags</label> <span class="little-information">(press enter to add the tag)</span>
        <tag-input
          [ngModel]="tags" [validators]="tagValidators" [errorMessages]="tagValidatorsMessages"
          formControlName="tags" maxItems="5" modelAsStrings="true"
        ></tag-input>
      </div>

      <div class="form-group">
        <label for="videofile">File</label>
        <div class="btn btn-default btn-file">
          <span>Select the video...</span>
          <input #videofileInput type="file" name="videofile" id="videofile" (change)="fileChange($event)" />
          <input type="hidden" name="videofileHidden" formControlName="videofile"/>
        </div>
      </div>

      <div class="file-to-upload">
        <div class="file" *ngIf="filename">
          <span class="filename">{{ filename }}</span>
          <span class="glyphicon glyphicon-remove" (click)="removeFile()"></span>
        </div>
      </div>

      <div *ngIf="formErrors.videofile" class="alert alert-danger">
        {{ formErrors.videofile }}
      </div>

      <div class="form-group">
        <label for="description">Description</label>
        <my-video-description formControlName="description"></my-video-description>

        <div *ngIf="formErrors.description" class="alert alert-danger">
          {{ formErrors.description }}
        </div>
      </div>

      <div class="progress">
        <progressbar [value]="progressPercent" max="100">
          <ng-template [ngIf]="progressPercent === 100">
            <span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
            Server is processing the video
          </ng-template>
        </progressbar>
      </div>

      <div class="form-group">
        <input
          type="button" value="Upload" class="btn btn-default form-control"
          (click)="upload()"
        >
      </div>
    </form>
  </div>
</div>