diff options
author | Kim <1877318+kimsible@users.noreply.github.com> | 2020-07-28 15:18:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 15:18:38 +0200 |
commit | dfe3f7b72ef46401206f6f461077a7984a0c72f0 (patch) | |
tree | 775a747f2dd4bc098afc2ec254792e2e8e8cbbb4 /client/src/app/+admin | |
parent | 0579dee3b29e301838387f53b91b58bff2ffb19a (diff) | |
download | PeerTube-dfe3f7b72ef46401206f6f461077a7984a0c72f0.tar.gz PeerTube-dfe3f7b72ef46401206f6f461077a7984a0c72f0.tar.zst PeerTube-dfe3f7b72ef46401206f6f461077a7984a0c72f0.zip |
Add alert and hide upload view when no upload is possible (#2966)
* Add alert and hide upload view when no upload is possible
* Add about instance link to alert
* Hide videos and imports links when no upload is possible
* Correct curly spacing lint
* Put logic canUpload to User model + add isHidden param to to-menu-dropdown
* Use canSeeVideoLinks from user model
* Rename and change logic canUpload to isUploadDisabled
* Use isDisplayed() method intead of isHidden value
* Refactor client and check videos count using quota
Co-authored-by: kimsible <kimsible@users.noreply.github.com>
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r-- | client/src/app/+admin/admin.component.ts | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index 319d50cda..7fc83351b 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts | |||
@@ -74,12 +74,24 @@ export class AdminComponent implements OnInit { | |||
74 | }) | 74 | }) |
75 | } | 75 | } |
76 | 76 | ||
77 | if (this.hasUsersRight()) this.menuEntries.push({ label: this.i18n('Users'), routerLink: '/admin/users' }) | 77 | if (this.hasUsersRight()) { |
78 | this.menuEntries.push({ label: this.i18n('Users'), routerLink: '/admin/users' }) | ||
79 | } | ||
80 | |||
78 | if (this.hasServerFollowRight()) this.menuEntries.push(federationItems) | 81 | if (this.hasServerFollowRight()) this.menuEntries.push(federationItems) |
79 | if (this.hasAbusesRight() || this.hasVideoBlocklistRight()) this.menuEntries.push(moderationItems) | 82 | if (this.hasAbusesRight() || this.hasVideoBlocklistRight()) this.menuEntries.push(moderationItems) |
80 | if (this.hasConfigRight()) this.menuEntries.push({ label: this.i18n('Configuration'), routerLink: '/admin/config' }) | 83 | |
81 | if (this.hasPluginsRight()) this.menuEntries.push({ label: this.i18n('Plugins/Themes'), routerLink: '/admin/plugins' }) | 84 | if (this.hasConfigRight()) { |
82 | if (this.hasJobsRight() || this.hasLogsRight() || this.hasDebugRight()) this.menuEntries.push({ label: this.i18n('System'), routerLink: '/admin/system' }) | 85 | this.menuEntries.push({ label: this.i18n('Configuration'), routerLink: '/admin/config' }) |
86 | } | ||
87 | |||
88 | if (this.hasPluginsRight()) { | ||
89 | this.menuEntries.push({ label: this.i18n('Plugins/Themes'), routerLink: '/admin/plugins' }) | ||
90 | } | ||
91 | |||
92 | if (this.hasJobsRight() || this.hasLogsRight() || this.hasDebugRight()) { | ||
93 | this.menuEntries.push({ label: this.i18n('System'), routerLink: '/admin/system' }) | ||
94 | } | ||
83 | } | 95 | } |
84 | 96 | ||
85 | hasUsersRight () { | 97 | hasUsersRight () { |