aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu/menu.component.html
blob: 6c52580100f7e571a300c6b5eff61639d54e2e54 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<div class="menu-wrapper">
  <menu [ngClass]="{ 'is-logged-in': isLoggedIn }">
    <div class="top-menu">
      <div *ngIf="isLoggedIn" class="logged-in-block">
        <div>
          <div
            class="logged-in-more" ngbDropdown #dropdown="ngbDropdown" placement="bottom-left auto"
            [container]="dropdownContainer" (openChange)="onDropdownOpenChange($event)" autoClose="outside"
          >
            <div ngbDropdownToggle>
              <my-actor-avatar [actor]="user.account" actorType="account" size="34"></my-actor-avatar>

              <div class="logged-in-info">
                <div class="logged-in-display-name">{{ user.account?.displayName }}</div>

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

              <div class="dropdown-toggle-indicator">
                <span class="chevron-down"></span>
              </div>
            </div>

            <div ngbDropdownMenu>
              <a
                *ngIf="user.account" ngbDropdownItem ngbDropdownToggle class="dropdown-item" [routerLink]="[ '/a', user.account.nameWithHost ]"
                #profile (click)="onActiveLinkScrollToAnchor(profile)"
              >
                <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
                myPluginSelector pluginSelectorId="menu-user-dropdown-language-item"
                ngbDropdownItem ngbDropdownToggle class="dropdown-item" (click)="openLanguageChooser()"
              >
                <my-global-icon iconName="language" aria-hidden="true"></my-global-icon>
                <span i18n>Interface:</span>
                <span class="ms-auto 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="ms-auto muted">{{ videoLanguages.join(', ') }}</span>
              </a>

              <a ngbDropdownItem ngbDropdownToggle class="dropdown-item settings-sensitive" routerLink="/my-account/settings"
                fragment="video-sensitive-content-policy" #settingsSensitiveContentPolicy
                (click)="onActiveLinkScrollToAnchor(settingsSensitiveContentPolicy)"
              >
                <my-global-icon class="hover-display-toggle" [hidden]="user.nsfwPolicy === 'display'" iconName="eye-open" aria-hidden="true"></my-global-icon>
                <my-global-icon class="hover-display-toggle" [hidden]="user.nsfwPolicy !== 'display'" iconName="eye-close" aria-hidden="true"></my-global-icon>
                <span i18n>Sensitive:</span>
                <span class="ms-auto 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="ms-auto" [checked]="user.p2pEnabled"></my-input-switch>
              </a>

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

              <a *ngIf="!isInMobileView" 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>

          <my-notification (navigate)="onActiveLinkScrollToAnchor($event)"></my-notification>
        </div>

        <div class="logged-in-menu">
          <a class="menu-link" 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 class="menu-link" routerLink="/my-library" routerLinkActive="active" #libraryLink (click)="onActiveLinkScrollToAnchor(libraryLink)">
            <my-global-icon class="channel-icon" iconName="channel" aria-hidden="true"></my-global-icon>
            <ng-container i18n>My library</ng-container>
          </a>

          <a class="menu-link" *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">
        <my-login-link className="peertube-button-link orange-button w-100"></my-login-link>

        <a *ngIf="isRegistrationAllowed()" routerLink="/signup" class="peertube-button-link create-account-button">
          <my-signup-label [requiresApproval]="requiresApproval"></my-signup-label>
        </a>
      </div>

      <ng-container *ngFor="let menuSection of menuSections" >
        <div [ngClass]="[ menuSection.key, 'menu-block' ]">
          <div i18n class="block-title">{{ menuSection.title }}</div>

          <a class="menu-link" *ngFor="let link of menuSection.links" [routerLink]="link.path" routerLinkActive="active">
            <my-global-icon *ngIf="link.icon" [iconName]="link.icon" [ngClass]="link.iconClass" aria-hidden="true"></my-global-icon>
            <ng-container>{{ link.shortLabel }}</ng-container>
          </a>
        </div>
      </ng-container>
    </div>

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

        <a class="menu-link" 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="footer-bottom">

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

          <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 role="button" (click)="openHotkeysCheatSheet()" class="c-hand" i18n>Keyboard shortcuts</a>
          </div>
        </div>

        <div class="footer-copyleft" i18n-title title="powered by PeerTube - CopyLeft 2015-2023">
          <a href="https://joinpeertube.org" class="me-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-2023
          </a>
        </div>
      </div>
    </div>
  </menu>
</div>

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