diff --git a/src/components/page_list/page_list.js b/src/components/page_list/page_list.js index 7e96473c4..d20c3a90d 100644 --- a/src/components/page_list/page_list.js +++ b/src/components/page_list/page_list.js @@ -1,61 +1,61 @@ import SelectableList from 'src/components/selectable_list/selectable_list.vue' const PageList = { - components: { - SelectableList - }, - props: { - box_only: { - type: Boolean, - default: false - }, - page_size: { - type: Number, - default: 50 - }, - fetch_page: { - type: Function, - default: async () => [] - }, - single_page: { - type: Boolean, - default: false + components: { + SelectableList + }, + props: { + box_only: { + type: Boolean, + default: false + }, + page_size: { + type: Number, + default: 50 + }, + fetch_page: { + type: Function, + default: async () => [] + }, + single_page: { + type: Boolean, + default: false + } + }, + data () { + return { + page_index: 1, + items: [], + can_load_more: true, + is_loading: false + } + }, + methods: { + reset () { + this.can_load_more = true + this.page_index = 1 + this.items = [] + this.is_loading = false + this.load_more() // load one page + }, + load_more () { + if (!this.is_loading && this.can_load_more) { + this.is_loading = true + this.fetch_page(this.$store, { + page: this.page_index++, + page_size: this.page_size + }).then(items => { + this.items = [...this.items, ...items] + this.is_loading = false + }) } - }, - data () { - return { - page_index: 1, - items: [], - can_load_more: true, - gliter: 0, - } - }, - methods: { - reset () { - this.can_load_more = true - this.page_index = 1 - this.items = [] - this.load_more() // load one page - }, - load_more () { - this.gliter++ - const iter = this.gliter - this.fetch_page(this.$store, { - page: this.page_index++, - page_size: this.page_size - }).then((items) => { - // ignore if another request was already dispatched - if (iter == this.gliter) { - this.items = [...this.items, ...items] - } - }) - }, - selected () { - return this.$refs.list.selected - } - }, - mounted () { - this.reset() - } + }, + selected () { + return this.$refs.list.selected + } + }, + mounted () { + this.reset() + } } export default PageList diff --git a/src/components/page_list/page_list.vue b/src/components/page_list/page_list.vue index 8df121955..fc72a82fd 100644 --- a/src/components/page_list/page_list.vue +++ b/src/components/page_list/page_list.vue @@ -18,6 +18,20 @@ v-bind="slotProps" /> + +
-

prev first next

diff --git a/src/components/settings_modal/admin_tabs/admin_card.vue b/src/components/settings_modal/admin_tabs/admin_card.vue index f0246cdd0..2ae8bf695 100644 --- a/src/components/settings_modal/admin_tabs/admin_card.vue +++ b/src/components/settings_modal/admin_tabs/admin_card.vue @@ -17,67 +17,88 @@
-
-
- +
  • + +
  • +
  • - {{ $t('admin_dash.users.is_admin') }} -
    - + {{ $t('admin_dash.users.is_admin') }} + +
  • +
  • + + {{ $t('admin_dash.users.is_moderator') }} + +
  • +
  • - {{ $t('admin_dash.users.is_moderator') }} -
    -

    + +
  • +

  • -
  • -
    + + +

  • -
  • -
    - - {{ $t('admin_dash.users.is_active') }} -
    - + + +
  • + + {{ $t('admin_dash.users.is_active') }} + +
  • +
  • + +
  • +
    diff --git a/src/components/settings_modal/admin_tabs/admin_status_card.js b/src/components/settings_modal/admin_tabs/admin_status_card.js index 0ea042782..249caf7f0 100644 --- a/src/components/settings_modal/admin_tabs/admin_status_card.js +++ b/src/components/settings_modal/admin_tabs/admin_status_card.js @@ -1,6 +1,6 @@ import Checkbox from 'src/components/checkbox/checkbox.vue' import Select from 'src/components/select/select.vue' -import StatusBody from 'src/components/status_body/status_body.vue' +import Status from 'src/components/status/status.vue' import { parseStatus } from 'src/services/entity_normalizer/entity_normalizer.service.js' const AdminStatusCard = { @@ -30,7 +30,7 @@ const AdminStatusCard = { components: { Checkbox, Select, - StatusBody, + Status, }, mounted () { this.$store.dispatch('adminChangeStatusScope', { opts: { id: this.status_details.id }}).then(res => parseStatus(res)).then(s => this.status_cache = s) diff --git a/src/components/settings_modal/admin_tabs/admin_status_card.vue b/src/components/settings_modal/admin_tabs/admin_status_card.vue index f969b32db..0dbe5958d 100644 --- a/src/components/settings_modal/admin_tabs/admin_status_card.vue +++ b/src/components/settings_modal/admin_tabs/admin_status_card.vue @@ -1,55 +1,80 @@