aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/menu/menu.component.html
blob: bba5fdadfa9eb21a6bd34384c280ac85e76bfb8c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                          
                                                   

                                                      
             
                                                                                                                         
 


                                                                                                                                                                
 

                                                                      
 
                                                                                                                           








                                                                                                                                                        

                                                                                                               







                                                                                                                                             
                                                                                      


                                                                                                                                               
                                                                                                             






                                                                                                          
                                                                                     








                                                                                                                                                                                       

                                                                                                      




                                                                                                           

                                                                                       


                                                                                                           

                                                                                        

                  
                
              

                                    
                                                                                                                                 



                                                                                
                                                                                                                               








                                                                                                               

            
                                                           


                                                                                                                        
 

                                                         
 
                                                                                                   
                                                                                


                                                  
                                                                              
                                                                                   

                                                     
 
                                                                        
                                                                                       


                                                         
                                                                             
                                                                                 




                                                   

                                                               
 
                                                                   
                                                                               
                                                    

            
                                                                   
                                                                                  

                                                    
 
                                                                     
                                                                              


                                                      
                                                                         
                                                                                        

                                                          
 
                                                                
                                                                              
                                                        

            
          
 
                        
                                
                                                             
                                                                             

                                                    

                                                         
                                                                              


                                                 
 

                                
                                  
                                            
                                                                                                                                    







                                                                                                                                                                       
                                                                                           
                
              
 

                                                                                              
                                                                                                                                  
 
                                                                                                                            




                                                                                                                           


          
 
                                                                 
                                                           
<div class="menu-wrapper">
  <menu [ngClass]="{ 'is-logged-in': isLoggedIn }">
    <div class="top-menu">
      <div *ngIf="isLoggedIn" class="logged-in-block">
        <div>
          <my-avatar-notification [user]="user" (navigate)="onActiveLinkScrollToAnchor($event)"></my-avatar-notification>

          <div class="logged-in-info">
            <a *ngIf="user.account" [routerLink]="[ '/accounts', user.account.nameWithHost ]" class="logged-in-display-name">{{ user.account?.displayName }}</a>
            <a *ngIf="!user.account" routerLink="/my-account/settings" class="logged-in-display-name">{{ user.account?.displayName }}</a>

            <div class="logged-in-username">@{{ user.username }}</div>
          </div>

          <div class="logged-in-more" ngbDropdown [placement]="loggedInMorePlacement" container="body" autoClose="outside">
            <my-global-icon iconName="more-vertical" ngbDropdownToggle role="button"></my-global-icon>

            <div ngbDropdownMenu>
              <a *ngIf="user.account" ngbDropdownItem ngbDropdownToggle class="dropdown-item" [routerLink]="[ '/accounts', user.account.nameWithHost ]">
                <my-global-icon iconName="go" aria-hidden="true"></my-global-icon> <ng-container i18n>Public profile</ng-container>
              </a>

              <div class="dropdown-divider"></div>

              <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/notifications"
                #notifications (click)="onActiveLinkScrollToAnchor(notifications)">
                <my-global-icon iconName="inbox-full" aria-hidden="true"></my-global-icon> <ng-container i18n>My notifications</ng-container>
              </a>

              <div class="dropdown-divider"></div>

              <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" (click)="openLanguageChooser()">
                <my-global-icon iconName="language" aria-hidden="true"></my-global-icon>
                <span i18n>Interface:</span>
                <span class="ml-auto text-muted">{{ currentInterfaceLanguage }}</span>
              </a>

              <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="video-languages-subtitles"
                #settingsLanguagesSubtitles (click)="onActiveLinkScrollToAnchor(settingsLanguagesSubtitles)">
                <my-global-icon iconName="video-lang" aria-hidden="true"></my-global-icon>
                <span i18n>Videos:</span>
                <span class="ml-auto text-muted">{{ videoLanguages.join(', ') }}</span>
              </a>

              <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings"
                fragment="video-sensitive-content-policy" #settingsSensitiveContentPolicy
                (click)="onActiveLinkScrollToAnchor(settingsSensitiveContentPolicy)">
                <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy === 'display' }" iconName="sensitive" aria-hidden="true"></my-global-icon>
                <my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy !== 'display' }" iconName="unsensitive" aria-hidden="true"></my-global-icon>
                <span i18n>Sensitive:</span>
                <span class="ml-auto text-muted">{{ nsfwPolicy }}</span>
              </a>

              <a ngbDropdownItem class="dropdown-item" (click)="toggleUseP2P()">
                <my-global-icon iconName="p2p" aria-hidden="true"></my-global-icon>
                <ng-container i18n>Help share videos</ng-container>

                <my-input-switch class="ml-auto" [checked]="user.webTorrentEnabled"></my-input-switch>
              </a>

              <div class="dropdown-divider"></div>

              <a ngbDropdownItem ngbDropdownToggle class="dropdown-item" (click)="openHotkeysCheatSheet()">
                <my-global-icon iconName="command" aria-hidden="true"></my-global-icon>
                <ng-container i18n>Keyboard shortcuts</ng-container>
              </a>

              <a ngbDropdownItem ngbDropdownToggle (click)="logout($event)" class="dropdown-item" href="#">
                <my-global-icon iconName="sign-out" aria-hidden="true"></my-global-icon>
                <ng-container i18n>Log out</ng-container>
              </a>
            </div>
          </div>
        </div>

        <div class="logged-in-menu">
          <a routerLink="/my-account" routerLinkActive="active" #settingsLink (click)="onActiveLinkScrollToAnchor(settingsLink)">
            <my-global-icon iconName="user" aria-hidden="true"></my-global-icon>
            <ng-container i18n>My account</ng-container>
          </a>

          <a routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onActiveLinkScrollToAnchor(libraryLink)">
            <my-global-icon iconName="channel" aria-hidden="true"></my-global-icon>
            <ng-container i18n>My library</ng-container>
          </a>

          <a *ngIf="userHasAdminAccess" [routerLink]="getFirstAdminRouteAvailable()" routerLinkActive="active">
            <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
            <ng-container i18n>Administration</ng-container>
          </a>
        </div>
      </div>

      <div *ngIf="!isLoggedIn" class="login-buttons-block">
        <a i18n routerLink="/login" class="login-button">Login</a>
        <a i18n *ngIf="isRegistrationAllowed()" routerLink="/signup" class="create-account-button">Create an account</a>
      </div>

      <div *ngIf="isLoggedIn" class="in-my-library">
        <div i18n class="block-title">IN MY LIBRARY</div>

        <a *ngIf="user.canSeeVideosLink" routerLink="/my-library/videos" routerLinkActive="active">
          <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Videos</ng-container>
        </a>

        <a routerLink="/my-library/video-playlists" routerLinkActive="active">
          <my-global-icon iconName="playlists" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Playlists</ng-container>
        </a>

        <a routerLink="/videos/subscriptions" routerLinkActive="active">
          <my-global-icon iconName="subscriptions" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Subscriptions</ng-container>
        </a>

        <a routerLink="/my-library/history/videos" routerLinkActive="active">
          <my-global-icon iconName="history" aria-hidden="true"></my-global-icon>
          <ng-container i18n>History</ng-container>
        </a>

      </div>

      <div class="on-instance">
        <div i18n class="block-title">ON {{instanceName}}</div>

        <a routerLink="/videos/overview" routerLinkActive="active">
          <my-global-icon iconName="globe" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Discover</ng-container>
        </a>

        <a routerLink="/videos/trending" routerLinkActive="active">
          <my-global-icon iconName="trending" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Trending</ng-container>
        </a>

        <a routerLink="/videos/most-liked" routerLinkActive="active">
          <my-global-icon iconName="like" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Most liked</ng-container>
        </a>

        <a routerLink="/videos/recently-added" routerLinkActive="active">
          <my-global-icon iconName="recently-added" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Recently added</ng-container>
        </a>

        <a routerLink="/videos/local" routerLinkActive="active">
          <my-global-icon iconName="home" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Local videos</ng-container>
        </a>
      </div>
    </div>

    <div class="footer">
      <div class="footer-block">
        <a *ngIf="!isLoggedIn" (click)="openQuickSettings()">
          <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
          <ng-container i18n>Settings</ng-container>
        </a>

        <a routerLink="/about" routerLinkActive="active">
          <my-global-icon iconName="help" aria-hidden="true"></my-global-icon>
          <ng-container i18n>About</ng-container>
        </a>
      </div>

      <div class="bottom-links">

        <div class="footer-links">
          <div *ngIf="isLoggedIn === false">
            <span role="button" (click)="openLanguageChooser()" class="c-hand" i18n>Interface: {{ currentInterfaceLanguage }}</span>
          </div>

          <div>
            <a i18n routerLink="/about/instance">Contact</a>
            <a i18n href="https://joinpeertube.org/help" i18n-title title="Get help using PeerTube" target="_blank" rel="noopener noreferrer">Help</a>
            <a i18n href="https://joinpeertube.org/faq" i18n-title title="Frequently asked questions about PeerTube" target="_blank" rel="noopener noreferrer">FAQ</a>
            <a i18n routerLink="/about/instance" fragment="statistics">Stats</a>
            <a i18n href="https://docs.joinpeertube.org/api-rest-reference.html" i18n-title title="API documentation" target="_blank" rel="noopener noreferrer">API</a>
            <a (click)="openHotkeysCheatSheet()" class="c-hand" i18n>Keyboard shortcuts</a>
          </div>
        </div>

        <div class="footer-copyleft">
          <small class="d-inline" i18n-title title="powered by PeerTube - CopyLeft 2015-2020">
            <a href="https://joinpeertube.org" class="mr-1" target="_blank" rel="noopener noreferrer" i18n>powered by PeerTube</a>

            <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE" target="_blank" rel="noopener noreferrer">
              <span aria-label="copyleft" class="d-inline-block" style="transform: rotateY(180deg)">&copy;</span> 2015-2020
            </a>
          </small>
        </div>
      </div>
    </div>
  </menu>
</div>

<my-language-chooser #languageChooserModal></my-language-chooser>
<my-quick-settings #quickSettingsModal></my-quick-settings>