aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.html
blob: 537d7ffa2b36a47139c74358102f7a54df484385 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                              

                                                                           
 





                                                                                                                           
                                                


                                                          
































                                                                                                                                                                                                                                   





                                                                      






                                                                                                                 
                                                                                                                                






                                                                        
                                                           



                                                       
<div *ngIf="!hasImportedVideo" class="upload-video-container">
  <div class="first-step-block">
    <my-global-icon class="upload-icon" iconName="upload"></my-global-icon>

    <div class="button-file">
      <span i18n>Select the torrent to import</span>
      <input #torrentfileInput type="file" name="torrentfile" id="torrentfile" accept=".torrent" (change)="fileChange()" />
    </div>
    <span class="button-file-extension">(.torrent)</span>

    <div class="torrent-or-magnet" i18n>Or</div>

    <div class="form-group form-group-magnet-uri">
      <label i18n for="magnetUri">Paste magnet URI</label>
      <my-help
        helpType="custom" i18n-customHtml
        customHtml="You can import any torrent file that points to a mp4 file. You should make sure you have diffusion rights over the content it points to, otherwise it could cause legal trouble to yourself and your instance."
      ></my-help>

      <input type="text" id="magnetUri" [(ngModel)]="magnetUri" />
    </div>

    <div class="form-group">
      <label i18n for="first-step-channel">Channel</label>
      <div class="peertube-select-container">
        <select id="first-step-channel" [(ngModel)]="firstStepChannelId">
          <option *ngFor="let channel of userVideoChannels" [value]="channel.id">{{ channel.label }}</option>
        </select>
      </div>
    </div>

    <div class="form-group">
      <label i18n for="first-step-privacy">Privacy</label>
      <div class="peertube-select-container">
        <select id="first-step-privacy" [(ngModel)]="firstStepPrivacyId">
          <option *ngFor="let privacy of videoPrivacies" [value]="privacy.id">{{ privacy.label }}</option>
        </select>
      </div>
    </div>

    <input
      type="button" i18n-value value="Import"
      [disabled]="!isMagnetUrlValid() || isImportingVideo" (click)="importVideo()"
    />
  </div>
</div>

<div *ngIf="error" class="alert alert-danger">
  <div i18n>Sorry, but something went wrong</div>
  {{ error }}
</div>

<div *ngIf="hasImportedVideo && !error" class="alert alert-info" i18n>
  Congratulations, the video will be imported with BitTorrent! You can already add information about this video.
</div>

<!-- Hidden because we want to load the component -->
<form [hidden]="!hasImportedVideo" novalidate [formGroup]="form">
  <my-video-edit
    [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [schedulePublicationPossible]="false"
    [validationMessages]="validationMessages" [videoPrivacies]="explainedVideoPrivacies" [userVideoChannels]="userVideoChannels"
  ></my-video-edit>

  <div class="submit-container">
    <div class="submit-button"
       (click)="updateSecondStep()"
       [ngClass]="{ disabled: !form.valid || isUpdatingVideo === true }"
    >
      <my-global-icon iconName="validate"></my-global-icon>
      <input type="button" i18n-value value="Update" />
    </div>
  </div>
</form>