Skip to content

Commit

Permalink
Backport of 18818
Browse files Browse the repository at this point in the history
Signed-off-by: GretaD <gretadoci@gmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
  • Loading branch information
GretaD authored and npmbuildbot[bot] committed Mar 24, 2020
1 parent 5f83196 commit 281f52a
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 36 deletions.
12 changes: 6 additions & 6 deletions apps/settings/css/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1614,14 +1614,14 @@ doesnotexist:-o-prefocus, .strengthify-wrapper {
}

&.quota {
height: 44px;
display: flex;
align-items: center;
justify-content: center;
display: flex;;
justify-content: left;
white-space: nowrap;
position: relative;

progress {
width: 100%;
margin: 0 10px;
width: 150px;
margin-top: 35px;
height: 3px;
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/js/vue-0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-0.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions apps/settings/js/vue-4.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-4.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions apps/settings/js/vue-5.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-5.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/settings/js/vue-6.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-6.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/settings/js/vue-7.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-7.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions apps/settings/js/vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

32 changes: 23 additions & 9 deletions apps/settings/src/components/UserList/UserRowSimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@
<div v-if="subAdminsGroups.length > 0 && settings.isAdmin" class="subAdminsGroups">
{{ userSubAdminsGroupsLabels }}
</div>
<div v-tooltip.auto="usedSpace" class="quota">
<progress
class="quota-user-progress"
:class="{'warn': usedQuota > 80}"
:value="usedQuota"
max="100" />
<div class="userQuota">
<div class="quota">
{{ userQuota }} ({{ usedSpace }})
<progress
class="quota-user-progress"
:class="{'warn': usedQuota > 80}"
:value="usedQuota"
max="100" />
</div>
</div>
<div v-if="showConfig.showLanguages" class="languages">
{{ userLanguage.name }}
Expand All @@ -55,7 +58,7 @@
</div>

<div class="userActions">
<div v-if="canEditUser(user) && !loading.all" class="toggleUserActions">
<div v-if="canEdit && !loading.all" class="toggleUserActions">
<Actions>
<ActionButton icon="icon-rename" @click="toggleEdit">
{{ t('settings', 'Edit User') }}
Expand All @@ -79,6 +82,7 @@
<script>
import { PopoverMenu, Actions, ActionButton } from 'nextcloud-vue'
import ClickOutside from 'vue-click-outside'
import { getCurrentUser } from '@nextcloud/auth'
import UserRowMixin from '../../mixins/UserRowMixin'
export default {
Expand Down Expand Up @@ -143,9 +147,19 @@ export default {
}
return t('settings', '{size} used', { size: OC.Util.humanFileSize(0) })
},
canEditUser() {
return (user) => this.settings.isAdmin || user.id !== OC.getCurrentUser().uid
canEdit() {
return getCurrentUser().uid !== this.user.id && this.user.id !== 'admin'
},
userQuota() {
if (this.user.quota.quota === 'none') {
return t('settings', 'Unlimited')
}
if (this.user.quota.quota >= 0) {
return OC.Util.humanFileSize(this.user.quota.quota)
}
return OC.Util.humanFileSize(0)
},
},
methods: {
hideMenu() {
Expand Down

0 comments on commit 281f52a

Please sign in to comment.