Commit 471de46b authored by Christian Hansen's avatar Christian Hansen Committed by Anton Koch

piecemaker cells are more distinguish from media cells NEW (#384)

parent 6325df9a
......@@ -3,11 +3,12 @@
.cell-item-inner(:class="{'display-preview': preview, 'display-full': display}")
template(v-if="cell")
component.animated-opacity(
:is="cell.configuration._value.component",
:is="setComponent",
:cell="cell",
:class="cellClasses",
:display="display",
:preview="preview",
:prefix="setPrefix",
:visible="inViewPort")
template(v-else-if="temp")
......@@ -35,6 +36,15 @@
}
},
computed: {
setPrefix () {
let comp = this.cell.configuration._value.component
if (comp === 'CellPiecemaker') return 'PM'
},
setComponent () {
let comp = this.cell.configuration._value.component
if (comp === 'CellPiecemaker') return 'CellMedia'
else return comp
},
cellClasses () {
let classes = ['cell-content']
if (this.cell) {
......
......@@ -142,6 +142,38 @@
path: 'content',
features: []
},
'CellPiecemaker': {
inputType: 'url',
type: 'Piecemaker Media',
label: 'Piecemaker Media Cell',
help: 'todo',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'content',
features: [
{
inputType: 'number',
type: 'Annotation-List',
label: 'Start',
help: 'Filter from video start point (seconds)',
error: false,
errorMessage: 'Needs to be a valid number',
value: 0,
path: 'start'
},
{
inputType: 'number',
type: 'Annotation-List',
label: 'Duration',
help: 'Filter duration (seconds)',
error: false,
errorMessage: 'Needs to be a valid number',
value: 0,
path: 'duration'
}
]
},
'CellMedia': {
inputType: 'url',
type: 'Media',
......@@ -220,8 +252,8 @@
},
'CellAnnotationList': {
inputType: 'text',
type: 'Annotation-List',
label: 'Annotation List Cell',
type: 'Piecemaker Annotation-List',
label: 'Piecemaker Annotation List Cell',
help: 'Insert a Video UUID',
error: false,
errorMessage: '',
......
<template lang="pug">
.cell-info(:class="setClass()")
strong.prefix.text-grey-6.q-py-none.q-mr-sm(v-if="prefix") {{ prefix }}
strong.text-grey-3 {{ shortenType(type) }}
p.faded
span.q-pr-md(v-if="cell.styleClass") Class: .{{ cell.styleClass }}
......@@ -11,7 +12,8 @@
export default {
props: {
cell: Object,
type: String
type: String,
prefix: String
},
methods: {
setClass () {
......@@ -19,8 +21,14 @@
this.cell.source._value.content.length > 0 ? 'text-dark' : 'text-red'
},
shortenType (type) {
return type.substr(0, type.length - 5)
if (type.substr(type.length - 4, type.length) === 'Cell') return type.substr(0, type.length - 5)
else return type
}
}
}
</script>
<style scoped lang="stylus">
.prefix
// border-radius .1rem
// border-right 1px solid rgba(255,255,255,0.325)
</style>
......@@ -63,7 +63,7 @@
//-------------------------------------------------------------------------------------------------------- edit mode
template(v-else)
.q-pa-sm
cell-info(:cell="cell", type="Annotation List")
cell-info(:cell="cell", type="Annotation List", prefix="PM")
</template>
......
......@@ -15,7 +15,7 @@
:no-volume-panel="true")
template(v-else)
cell-info(:cell="cell", type="Media Cell")
cell-info(:cell="cell", type="Media Cell", :prefix="prefix")
</template>
......@@ -29,7 +29,7 @@
CellInfo,
MediaPlayer
},
props: ['cell', 'display', 'preview', 'visible'],
props: ['cell', 'display', 'preview', 'visible', 'prefix'],
data () {
return {
video: undefined,
......
......@@ -23,7 +23,7 @@
q-item-tile
//----- media
q-btn.bg-primary.text-white.media-button(@click="cacheNewCell(entry.annotation, 'CellMedia')", flat)
q-btn.bg-primary.text-white.media-button(@click="cacheNewCell(entry.annotation, 'CellPiecemaker')", flat)
q-icon(name="local movies", size="22px")
//----- annotations
......@@ -63,7 +63,7 @@
}
},
methods: {
cacheNewCell (item, component = 'CellMedia') {
cacheNewCell (item, component = 'CellPiecemaker') {
const resourceCell = {
configuration: {
value: {
......@@ -74,7 +74,8 @@
value: {
id: item.id,
sourceUuid: item.id ? parseURI(item.id).uuid : undefined,
content: component === 'CellMedia' ? item.body.source.id : item.id
content: item.id
// content: component === 'CellPiecemaker' ? item.body.source.id : item.id
}
}
}
......@@ -105,6 +106,7 @@
entries.push(entry)
}
this.currentMedia = entries
console.log('#####', this.currentMedia)
this.loadingMedia = false
}
}
......
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