Commit 95139ad3 authored by Christian Hansen's avatar Christian Hansen Committed by Anton Koch
Browse files

Resolve "mb-table: detach "add"-button from table"

parent 316c112d
<template lang="pug">
div
// table title, add button -------------------------------------------------------------------------------------------
table-top-module(
:title="title"
:no-add="noAdd"
:current-page="currentPage"
)
// search bar, table settings ----------------------------------------------------------------------------------------
table-below-top-module(
:visible-columns="visibleColumns"
......@@ -105,7 +98,6 @@ div
import TablePaginationModule from 'components/MbComponents/MbTable/Modules/TablePaginationModule'
import TableHeaderModule from 'components/MbComponents/MbTable/Modules/TableHeaderModule'
import TableBodyCellActionsModule from 'components/MbComponents/MbTable/Modules/TableBodyCellActionsModule'
import TableTopModule from 'components/MbComponents/MbTable/Modules/TableTopModule'
import TableBelowTopModule from 'components/MbComponents/MbTable/Modules/TableBelowTopModule'
import TableCardModule from 'components/MbComponents/MbTable/Modules/TableCardModule'
......@@ -115,7 +107,6 @@ div
GroupsOverlayContent,
TableCardModule,
TableBelowTopModule,
TableTopModule,
TableBodyCellActionsModule,
TableHeaderModule,
TablePaginationModule,
......
<template lang="pug">
.table-top-module
// table title -----------------------------------------------------------------------------------------------------
q-item.q-pa-none
// title
q-item-section
mb-headline(:title="title")
// "add" button
q-item-section(avatar)
mb-icon-btn.q-mb-md(
v-if="!noAdd"
@click.native="onAddButton()"
icon-name="add"
:outline="true"
)
// "add" dialog ----------------------------------------------------------------------------------------------------
mb-dialog(
v-model="model.dialog"
label="Add"
)
template(v-if="currentPage === 'projects'")
dialog-create-project(type="Timeline")
template(v-else-if="currentPage === 'groups'")
dialog-create-group(type="Group")
template(v-else)
| default
</template>
<script>
import DialogCreateProject from 'components/MbComponents/MbDialog/DialogContents/Navigation/DialogCreateProject'
import DialogCreateGroup from 'components/MbComponents/MbDialog/DialogContents/Groups/DialogCreateGroup'
export default {
name: 'TableTopModule',
components: { DialogCreateGroup, DialogCreateProject },
props: ['title', 'noAdd', 'currentPage'],
data () {
return {
model: { dialog: false }
}
},
methods: {
onAddButton () {
this.model.dialog = true
}
}
}
</script>
<style scoped lang="stylus">
</style>
......@@ -24,23 +24,33 @@ div
.mb-content-outer
.mb-content-inner.q-py-lg
.asset-options.full-width.flex.justify-end.q-mb-md
// Upload Media
mb-icon-btn.q-mr-sm(icon-name="upload" @click.native="uploadMedia = true" :outline="true")
mb-tooltip {{$t('general.upload_media')}}
mb-dialog-overlay(v-model="uploadMedia")
template(slot="overlay-header") {{$t('general.upload_media')}}
template(slot="overlay-body")
dialog-overlay-upload-media(@closeOverlay="closeUploadOverlay")
// Hide / Show Collections
mb-btn(
:icon-name="collections ? 'visibility_off' : 'visibility'"
:label="$t('general.collections')"
@click.native="collections = !collections"
)
q-item.q-pa-none
q-item-section
mb-headline(:title="$t('general.assets')")
q-item-section(avatar)
div
// upload button
mb-icon-btn.q-mr-sm(icon-name="upload" @click.native="uploadMedia = true" :outline="true")
mb-tooltip {{$t('general.upload_media')}}
// Hide / Show Collections
mb-btn(
:icon-name="collections ? 'visibility_off' : 'visibility'"
:label="$t('general.collections')"
@click.native="collections = !collections"
)
mb-dialog-overlay(v-model="uploadMedia")
template(slot="overlay-header") {{$t('general.upload_media')}}
template(slot="overlay-body")
dialog-overlay-upload-media(@closeOverlay="closeUploadOverlay")
// Table ---------------------------------------------------------------------------------------------------------
mb-table(page="assets")
</template>
<script>
......
......@@ -2,6 +2,27 @@
q-page.groups.q-py-lg
q-item.q-pa-none
q-item-section
mb-headline(:title="$t('general.groups')")
q-item-section(avatar)
// add button
mb-icon-btn.q-mb-md(
@click.native="model.dialog = true"
icon-name="add"
:outline="true"
)
// add dialog
mb-dialog(
v-model="model.dialog"
label="Add"
)
groups-overlay-content
mb-table(
title="groups.list.title"
:data="data"
......@@ -17,11 +38,17 @@
<script>
import tableRequest from '../../lib/table-request'
import { DateTime } from 'luxon'
import GroupsOverlayContent
from 'components/MbComponents/MbDialogOverlay/OverlayContents/Groups/GroupsOverlayContent'
export default {
name: 'groups',
components: { GroupsOverlayContent },
data () {
return {
model: {
dialog: false
},
data: [],
resource: 'maps',
resourceAlias: 'timelines',
......
<template lang="pug">
q-page.projects.q-py-lg
// swiper
// recent activities -----------------------------------------------------------------------------------------------
.q-my-xl
mb-headline(title="last edited abc")
mb-swiper(:slides-per-view="3")
......@@ -11,8 +11,31 @@
card-style="media"
)
// table
// timelines -------------------------------------------------------------------------------------------------------
.q-my-xl
q-item.q-pa-none
q-item-section
mb-headline(:title="$t('general.timelines')")
q-item-section(avatar)
// add button
mb-icon-btn.q-mb-md(
@click.native="model.dialog = true"
icon-name="add"
:outline="true"
)
// add dialog
mb-dialog(
v-model="model.dialog"
label="Add"
)
dialog-create-project(type="Timeline")
// table
mb-table(
title="timelines.list.title"
:data="data"
......@@ -22,15 +45,22 @@
:resource-alias="resourceAlias"
@request="onRequest"
)
</template>
<script>
import tableRequest from '../lib/table-request'
import { DateTime } from 'luxon'
import DialogCreateProject from 'components/MbComponents/MbDialog/DialogContents/Navigation/DialogCreateProject'
export default {
name: 'projects',
components: { DialogCreateProject },
data () {
return {
model: {
dialog: false
},
data: [],
resource: 'maps',
resourceAlias: 'timelines',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment