Fix support icon
[oweals/peertube.git] / client / src / app / videos / +video-watch / video-watch.component.html
1 <div class="root" [ngClass]="{ 'theater-enabled': theaterEnabled }">
2   <!-- We need the video container for videojs so we just hide it -->
3   <div id="video-wrapper">
4     <div *ngIf="remoteServerDown" class="remote-server-down">
5       Sorry, but this video is not available because the remote instance is not responding.
6       <br />
7       Please try again later.
8     </div>
9
10     <div id="videojs-wrapper"></div>
11
12     <my-video-watch-playlist
13       #videoWatchPlaylist
14       [video]="video" [playlist]="playlist" class="playlist"
15     ></my-video-watch-playlist>
16   </div>
17
18   <div class="row">
19     <div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToImport()">
20       The video is being imported, it will be available when the import is finished.
21     </div>
22
23     <div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToTranscode()">
24       The video is being transcoded, it may not work properly.
25     </div>
26
27     <div i18n class="col-md-12 alert alert-info" *ngIf="hasVideoScheduledPublication()">
28       This video will be published on {{ video.scheduledUpdate.updateAt | date: 'full' }}.
29     </div>
30
31     <div class="col-md-12 alert alert-danger" *ngIf="video?.blacklisted">
32       <div class="blacklisted-label" i18n>This video is blacklisted.</div>
33       {{ video.blacklistedReason }}
34     </div>
35   </div>
36
37   <!-- Video information -->
38   <div *ngIf="video" class="margin-content video-bottom">
39     <div class="video-info">
40       <div class="video-info-first-row">
41         <div>
42           <div class="d-block d-md-none"> <!-- only shown on medium devices, has its counterpart for larger viewports below -->
43             <h1 class="video-info-name">{{ video.name }}</h1>
44
45             <div i18n class="video-info-date-views">
46               Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle> <span class="views"> - {{ video.views | myNumberFormatter }} views</span>
47             </div>
48           </div>
49
50           <div class="d-flex justify-content-between flex-direction-column">
51             <div class="d-none d-md-block">
52               <h1 class="video-info-name">{{ video.name }}</h1>
53             </div>
54
55             <div class="video-info-first-row-bottom">
56               <div i18n class="d-none d-md-block video-info-date-views">
57                 Published <my-date-toggle [date]="video.publishedAt"></my-date-toggle> <span class="views"> - {{ video.views | myNumberFormatter }} views</span>
58               </div>
59
60               <div class="video-actions-rates">
61                 <div class="video-actions fullWidth justify-content-end">
62                   <div
63                     [ngbPopover]="getRatePopoverText()" [ngClass]="{ 'activated': userRating === 'like' }" (click)="setLike()"
64                     class="action-button action-button-like" role="button" [attr.aria-pressed]="userRating === 'like'"
65                     [ngbTooltip]="tooltipLike"
66                     placement="bottom auto"
67                   >
68                     <my-global-icon iconName="like"></my-global-icon>
69                     <span *ngIf="video.likes" class="count">{{ video.likes }}</span>
70                   </div>
71
72                   <div
73                     [ngbPopover]="getRatePopoverText()" [ngClass]="{ 'activated': userRating === 'dislike' }" (click)="setDislike()"
74                     class="action-button action-button-dislike" role="button" [attr.aria-pressed]="userRating === 'dislike'"
75                     [ngbTooltip]="tooltipDislike"
76                     placement="bottom auto"
77                   >
78                     <my-global-icon iconName="dislike"></my-global-icon>
79                     <span *ngIf="video.dislikes" class="count">{{ video.dislikes }}</span>
80                   </div>
81
82                   <div *ngIf="video.support" (click)="showSupportModal()" class="action-button"
83                     [ngbTooltip]="tooltipSupport"
84                     placement="bottom auto"
85                   >
86                     <my-global-icon iconName="support"></my-global-icon>
87                     <span class="icon-text" i18n>Support</span>
88                   </div>
89
90                   <div (click)="showShareModal()" class="action-button" role="button">
91                     <my-global-icon iconName="share"></my-global-icon>
92                     <span class="icon-text" i18n>Share</span>
93                   </div>
94
95                   <div
96                     class="action-dropdown" ngbDropdown placement="top" role="button" autoClose="outside"
97                      *ngIf="isUserLoggedIn()" (openChange)="addContent.openChange($event)"
98                      [ngbTooltip]="tooltipSaveToPlaylist"
99                      placement="bottom auto"
100                   >
101                     <div class="action-button action-button-save" ngbDropdownToggle role="button">
102                       <my-global-icon iconName="playlist-add"></my-global-icon>
103                       <span class="icon-text" i18n>Save</span>
104                     </div>
105
106                     <div ngbDropdownMenu>
107                       <my-video-add-to-playlist #addContent [video]="video"></my-video-add-to-playlist>
108                     </div>
109                   </div>
110
111                   <my-video-actions-dropdown
112                     placement="top auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video"
113                     (videoRemoved)="onVideoRemoved()" (modalOpened)="onModalOpened()"
114                   ></my-video-actions-dropdown>
115                 </div>
116
117                 <div
118                   class="video-info-likes-dislikes-bar"
119                   *ngIf="video.likes !== 0 || video.dislikes !== 0"
120                   [ngbTooltip]="likesBarTooltipText"
121                   placement="bottom"
122                 >
123                   <div class="likes-bar" [ngStyle]="{ 'width.%': video.likesPercent }"></div>
124                 </div>
125               </div>
126
127               <div
128                 class="video-info-likes-dislikes-bar"
129                 *ngIf="video.likes !== 0 || video.dislikes !== 0"
130                 [ngbTooltip]="likesBarTooltipText"
131                 placement="bottom"
132               >
133                 <div class="likes-bar" [ngStyle]="{ 'width.%': video.likesPercent }"></div>
134               </div>
135             </div>
136           </div>
137
138
139           <div class="pt-3 border-top video-info-channel">
140             <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" i18n-title title="Go the channel page">
141               <img [src]="video.videoChannelAvatarUrl" alt="Video channel avatar" />
142               {{ video.channel.displayName }}
143             </a>
144
145             <my-subscribe-button #subscribeButton [videoChannel]="video.channel" size="small"></my-subscribe-button>
146           </div>
147
148           <div class="video-info-by">
149             <a [routerLink]="[ '/accounts', video.byAccount ]" i18n-title title="Go to the account page">
150               <img [src]="video.accountAvatarUrl" alt="Account avatar" />
151               <span i18n>By {{ video.byAccount }}</span>
152             </a>
153           </div>
154         </div>
155
156       </div>
157
158       <div class="video-info-description ml-4">
159         <div class="video-info-description-html" [innerHTML]="videoHTMLDescription"></div>
160
161         <div class="video-info-description-more" *ngIf="completeDescriptionShown === false && video.description?.length >= 250" (click)="showMoreDescription()">
162           <ng-container i18n>Show more</ng-container>
163           <span *ngIf="descriptionLoading === false" class="glyphicon glyphicon-menu-down"></span>
164           <my-small-loader class="description-loading" [loading]="descriptionLoading"></my-small-loader>
165         </div>
166
167         <div *ngIf="completeDescriptionShown === true" (click)="showLessDescription()" class="video-info-description-more">
168           <ng-container i18n>Show less</ng-container>
169           <span *ngIf="descriptionLoading === false" class="glyphicon glyphicon-menu-up"></span>
170         </div>
171       </div>
172
173       <div class="video-attributes mb-3 ml-4">
174         <div class="video-attribute">
175           <span i18n class="video-attribute-label">Privacy</span>
176           <span class="video-attribute-value">{{ video.privacy.label }}</span>
177         </div>
178
179         <div *ngIf="!!video.originallyPublishedAt" class="video-attribute">
180           <span i18n class="video-attribute-label">Originally published</span>
181           <span class="video-attribute-value">{{ video.originallyPublishedAt | date: 'dd MMMM yyyy' }}</span>
182         </div>
183
184         <div class="video-attribute">
185           <span i18n class="video-attribute-label">Category</span>
186           <span *ngIf="!video.category.id" class="video-attribute-value">{{ video.category.label }}</span>
187           <a
188             *ngIf="video.category.id" class="video-attribute-value"
189             [routerLink]="[ '/search' ]" [queryParams]="{ categoryOneOf: [ video.category.id ] }"
190           >{{ video.category.label }}</a>
191         </div>
192
193         <div class="video-attribute">
194           <span i18n class="video-attribute-label">Licence</span>
195           <span *ngIf="!video.licence.id" class="video-attribute-value">{{ video.licence.label }}</span>
196           <a
197             *ngIf="video.licence.id" class="video-attribute-value"
198             [routerLink]="[ '/search' ]" [queryParams]="{ licenceOneOf: [ video.licence.id ] }"
199           >{{ video.licence.label }}</a>
200         </div>
201
202         <div class="video-attribute">
203           <span i18n class="video-attribute-label">Language</span>
204           <span *ngIf="!video.language.id" class="video-attribute-value">{{ video.language.label }}</span>
205           <a
206             *ngIf="video.language.id" class="video-attribute-value"
207             [routerLink]="[ '/search' ]" [queryParams]="{ languageOneOf: [ video.language.id ] }"
208           >{{ video.language.label }}</a>
209         </div>
210
211         <div class="video-attribute video-attribute-tags">
212           <span i18n class="video-attribute-label">Tags</span>
213           <a
214             *ngFor="let tag of getVideoTags()"
215             class="video-attribute-value" [routerLink]="[ '/search' ]" [queryParams]="{ tagsOneOf: [ tag ] }"
216           >{{ tag }}</a>
217         </div>
218       </div>
219
220       <my-video-comments class="border-top" [video]="video" [user]="user"></my-video-comments>
221     </div>
222
223     <my-recommended-videos
224         [inputRecommendation]="{ uuid: video.uuid, tags: video.tags }"
225         [user]="user"
226         [playlist]="playlist"
227         (gotRecommendations)="onRecommendations($event)"
228     ></my-recommended-videos>
229   </div>
230
231   <div class="row privacy-concerns" *ngIf="hasAlreadyAcceptedPrivacyConcern === false">
232     <div class="privacy-concerns-text">
233       <strong i18n>Friendly Reminder: </strong>
234       <ng-container i18n>
235         the sharing system used for this video implies that some technical information about your system (such as a public IP address) can be sent to other peers.
236       </ng-container>
237       <a i18n i18n-title title="Get more information" target="_blank" rel="noopener noreferrer" href="/about/peertube">More information</a>
238     </div>
239
240     <div i18n class="privacy-concerns-okay" (click)="acceptedPrivacyConcern()">
241       OK
242     </div>
243   </div>
244 </div>
245
246 <ng-container *ngIf="video !== null">
247   <my-video-support #videoSupportModal [video]="video"></my-video-support>
248   <my-video-share #videoShareModal [video]="video" [videoCaptions]="videoCaptions" [playlist]="playlist"></my-video-share>
249 </ng-container>