Commit 41554002 authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Normalize code style

parent f3117536
......@@ -51,7 +51,10 @@
"no-console": "off",
"curly": "error",
"block-spacing": "error",
"keyword-spacing": "error"
"keyword-spacing": "error",
"vue/html-indent": ["warning", 4, {
"baseIndent": 1
}]
},
"parserOptions": {
"parser": "babel-eslint"
......
......@@ -88,8 +88,7 @@
},
],
footer: [
]
footer: []
}
}
......
<style></style>
<template>
<div
v-if="!selectedShow"
class="tw-text-center tw-my-8"
>
Lädt...
</div>
<b-container
v-else
class="tw-mb-8"
>
<h1>
<template v-if="id">
Playliste {{ playlistEditor.id }} für Sendung '{{ selectedShow.name }}' bearbeiten
</template>
<template v-else>
Neue Playliste für Sendung '{{ selectedShow.name }}' hinzufügen
</template>
</h1>
<b-row class="tw-my-8 tw-items-center">
<b-col cols="2">
Beschreibung:
</b-col>
<b-col>
<b-form-input
v-model="playlistEditor.description"
type="text"
placeholder="Beschreibung eingeben..."
/>
</b-col>
</b-row>
<!-- If no entries are here (i.e. we add a new playlist), only show
a hint that there's nothing here yet. -->
<div
v-if="playlistEditor.entries.length === 0"
align="center"
v-if="!selectedShow"
class="tw-text-center tw-my-8"
>
Noch keine Einträge vorhanden. Füge doch welche hinzu!
Lädt...
</div>
<!-- As soon as we have at least one entry in our temporary playlist
we can display a table with all the info and action buttons -->
<div v-else>
<b-table
ref="playlistEditTable"
striped
:items="playlistEditor.entries"
:fields="playlistEditTableFields"
>
<!-- Column: Index
Here we just use the array index, because the playlist entries
are ordered as an array, without the need for an extra id field
-->
<template v-slot:cell(id)="data">
{{ data.index + 1 }}.
</template>
<!-- Column: Type
Based on the entry content (either file or uri), we display
a small badge indicating which type of source this is
-->
<template v-slot:cell(type)="data">
<b-badge
v-if="data.item.file"
variant="success"
>
Datei
</b-badge>
<b-badge
v-else-if="data.item.uri.startsWith('line://')"
variant="info"
>
Line-in
</b-badge>
<b-badge
v-else-if="data.item.uri.startsWith('http://') || data.item.uri.startsWith('https://')"
variant="light"
>
Stream
</b-badge>
<b-badge
<b-container
v-else
variant="dark"
>
Andere
</b-badge>
</template>
<!-- Column: Source
Here we display where this playlist entry is coming from
-->
<template v-slot:cell(source)="data">
class="tw-mb-8"
>
<h1>
<template v-if="id">
Playliste {{ playlistEditor.id }} für Sendung '{{ selectedShow.name }}' bearbeiten
</template>
<template v-else>
Neue Playliste für Sendung '{{ selectedShow.name }}' hinzufügen
</template>
</h1>
<b-row class="tw-my-8 tw-items-center">
<b-col cols="2">
Beschreibung:
</b-col>
<b-col>
<b-form-input
v-model="playlistEditor.description"
type="text"
placeholder="Beschreibung eingeben..."
/>
</b-col>
</b-row>
<!-- If no entries are here (i.e. we add a new playlist), only show
a hint that there's nothing here yet. -->
<div
v-if="playlistEditor.entries.length === 0"
align="center"
>
Noch keine Einträge vorhanden. Füge doch welche hinzu!
</div>
<!-- As soon as we have at least one entry in our temporary playlist
we can display a table with all the info and action buttons -->
<div v-else>
<b-table
ref="playlistEditTable"
striped
:items="playlistEditor.entries"
:fields="playlistEditTableFields"
>
<!-- Column: Index
Here we just use the array index, because the playlist entries
are ordered as an array, without the need for an extra id field
-->
<template v-slot:cell(id)="data">
{{ data.index + 1 }}.
</template>
<!-- Column: Type
Based on the entry content (either file or uri), we display
a small badge indicating which type of source this is
-->
<template v-slot:cell(type)="data">
<b-badge
v-if="data.item.file"
variant="success"
>
Datei
</b-badge>
<b-badge
v-else-if="data.item.uri.startsWith('line://')"
variant="info"
>
Line-in
</b-badge>
<b-badge
v-else-if="data.item.uri.startsWith('http://') || data.item.uri.startsWith('https://')"
variant="light"
>
Stream
</b-badge>
<b-badge
v-else
variant="dark"
>
Andere
</b-badge>
</template>
<!-- Column: Source
Here we display where this playlist entry is coming from
-->
<template v-slot:cell(source)="data">
<span v-if="data.item.file">
<span class="tw-font-bold">{{ getFileTitleForPlaylist(data.item.file.show, data.item.file.id) }}</span><br>
<span class="tw-text-gray-700">(file://{{ data.item.file.show }}/{{ data.item.file.id }})</span>
</span>
<span v-else>
<span v-else>
{{ data.item.uri }}
</span>
</template>
</template>
<!-- Column: Duration
Here we give the user the ability to edit the duration of an entry.
-->
<template v-slot:cell(duration)="data">
<!-- Column: Duration
Here we give the user the ability to edit the duration of an entry.
-->
<template v-slot:cell(duration)="data">
<span v-if="playlistEditor.durationField === data.index">
<input
ref="durationField"
v-model="playlistEditor.newDuration"
type="text"
class="tw-w-24"
placeholder="hh:mm:ss"
pattern="\d{2}:\d{2}(:\d{2})?"
@blur="checkAndUpdateDuration"
ref="durationField"
v-model="playlistEditor.newDuration"
type="text"
class="tw-w-24"
placeholder="hh:mm:ss"
pattern="\d{2}:\d{2}(:\d{2})?"
@blur="checkAndUpdateDuration"
>
</span>
<span v-else-if="data.item.file">
<span v-else-if="data.item.file">
{{ prettyNanoseconds(getFileById(data.item.file.id).duration) }}
</span>
<span
v-else-if="data.item.duration"
v-b-tooltip="'Klicken um zu bearbeiten'"
class="tw-underline hover:tw-no-underline tw-cursor-pointer"
@click="toggleDurationField(data.index)"
>
<span
v-else-if="data.item.duration"
v-b-tooltip="'Klicken um zu bearbeiten'"
class="tw-underline hover:tw-no-underline tw-cursor-pointer"
@click="toggleDurationField(data.index)"
>
{{ prettyNanoseconds(data.item.duration) }}
</span>
<span v-else>
<span v-else>
<span
v-b-tooltip="'Klicken um zu bearbeiten'"
class="tw-text-gray-700 tw-underline hover:tw-no-underline tw-cursor-pointer"
@click="toggleDurationField(data.index)"
v-b-tooltip="'Klicken um zu bearbeiten'"
class="tw-text-gray-700 tw-underline hover:tw-no-underline tw-cursor-pointer"
@click="toggleDurationField(data.index)"
>
(Unbekannt)
</span>
</span>
</template>
<!-- Column: Actions
Finally some buttons to reorder or delete playlist entries
-->
<template v-slot:cell(actions)="data">
<b-button-group size="sm">
<b-button
:disabled="data.index === 0"
@click="movePlaylistItemUp(data.index)"
</template>
<!-- Column: Actions
Finally some buttons to reorder or delete playlist entries
-->
<template v-slot:cell(actions)="data">
<b-button-group size="sm">
<b-button
:disabled="data.index === 0"
@click="movePlaylistItemUp(data.index)"
>
<b class="upDownArrows">&uarr;</b>
</b-button>
<b-button
:disabled="data.index === playlistEditor.entries.length - 1"
@click="movePlaylistItemDown(data.index)"
>
<b class="upDownArrows">&darr;</b>
</b-button>
<b-button
variant="danger"
@click="deletePlaylistItem(data.index)"
>
Delete
</b-button>
</b-button-group>
</template>
</b-table>
<hr>
<p class="d-flex justify-content-between border-t">
<span class="font-weight-bold">Playlisteinträge</span>
<span>Dauer: {{ playlistDuration }}</span>
</p>
<hr>
<div
v-if="playlistExceedsAllowedUnknowns"
class="tw-text-red-600 tw-my-4"
>
<b class="upDownArrows">&uarr;</b>
</b-button>
<b-button
:disabled="data.index === playlistEditor.entries.length - 1"
@click="movePlaylistItemDown(data.index)"
Es gibt 2 oder mehr Einträge die eine unbekannte Dauer haben. Bitte korrigiere das, indem du auf die
Dauer
in der Tabelle klickst und manuell eine einträgst. Es darf maximal ein Eintrag mit unbekannter Dauer
vorhanden
sein.
</div>
</div>
<!-- Below the table with the playlists entry we display buttons to
add new entries to the table - these can either be files from our
uploaded/imported files, or one of the preconfigured inputs, or a
stream.
TODO: should we disable choosing files that are still being imported?
TODO: make the inputs configurable
-->
<b-modal
id="modal-edit-playlist-add-stream"
title="Add stream to the playlist"
@ok="addPlaylistItemStream('save')"
>
<b-input
v-model="playlistEditor.newStreamURL"
type="url"
>
<b class="upDownArrows">&darr;</b>
</b-button>
...
</b-input>
</b-modal>
<div class="tw-flex tw-justify-between">
<b-button-group>
<b-dropdown text="Datei">
<b-dropdown-item
v-for="(file, index) in files"
:key="index"
@click="addPlaylistItemFile(file.show, file.id)"
>
{{ file.id }}: {{ file.metadata.title ? file.metadata.title : "" }} ({{
prettyNanoseconds(file.duration) }}, {{ prettyFileSize(file.size) }}, {{ file.source.uri }})
</b-dropdown-item>
</b-dropdown>
<b-dropdown text="Line-in">
<b-dropdown-item @click="addPlaylistItemLine('0')">
Studio 1
</b-dropdown-item>
<b-dropdown-item @click="addPlaylistItemLine('1')">
Preprod
</b-dropdown-item>
<b-dropdown-item @click="addPlaylistItemLine('2')">
Line 2
</b-dropdown-item>
</b-dropdown>
<b-button
@click="addPlaylistItemStream('openModal')"
>
Stream
</b-button>
</b-button-group>
<b-button
variant="danger"
@click="deletePlaylistItem(data.index)"
variant="success"
:disabled="playlistExceedsAllowedUnknowns"
@click="storePlaylist"
>
Delete
Speichern
</b-button>
</b-button-group>
</template>
</b-table>
<hr>
<p class="d-flex justify-content-between border-t">
<span class="font-weight-bold">Playlisteinträge</span>
<span>Dauer: {{ playlistDuration }}</span>
</p>
<hr>
<div
v-if="playlistExceedsAllowedUnknowns"
class="tw-text-red-600 tw-my-4"
>
Es gibt 2 oder mehr Einträge die eine unbekannte Dauer haben. Bitte korrigiere das, indem du auf die Dauer
in der Tabelle klickst und manuell eine einträgst. Es darf maximal ein Eintrag mit unbekannter Dauer vorhanden
sein.
</div>
</div>
<!-- Below the table with the playlists entry we display buttons to
add new entries to the table - these can either be files from our
uploaded/imported files, or one of the preconfigured inputs, or a
stream.
TODO: should we disable choosing files that are still being imported?
TODO: make the inputs configurable
-->
<b-modal
id="modal-edit-playlist-add-stream"
title="Add stream to the playlist"
@ok="addPlaylistItemStream('save')"
>
<b-input
v-model="playlistEditor.newStreamURL"
type="url"
>
...
</b-input>
</b-modal>
<div class="tw-flex tw-justify-between">
<b-button-group>
<b-dropdown text="Datei">
<b-dropdown-item
v-for="(file, index) in files"
:key="index"
@click="addPlaylistItemFile(file.show, file.id)"
>
{{ file.id }}: {{ file.metadata.title ? file.metadata.title : "" }} ({{
prettyNanoseconds(file.duration) }}, {{ prettyFileSize(file.size) }}, {{ file.source.uri }})
</b-dropdown-item>
</b-dropdown>
<b-dropdown text="Line-in">
<b-dropdown-item @click="addPlaylistItemLine('0')">
Studio 1
</b-dropdown-item>
<b-dropdown-item @click="addPlaylistItemLine('1')">
Preprod
</b-dropdown-item>
<b-dropdown-item @click="addPlaylistItemLine('2')">
Line 2
</b-dropdown-item>
</b-dropdown>
<b-button
@click="addPlaylistItemStream('openModal')"
>
Stream
</b-button>
</b-button-group>
<b-button
variant="success"
:disabled="playlistExceedsAllowedUnknowns"
@click="storePlaylist"
>
Speichern
</b-button>
</div>
</b-container>
</div>
</b-container>
</template>
<script>
......@@ -267,7 +268,7 @@
mixins: [prettyDate],
props: {
id: {
type: [ Number, Boolean ],
type: [Number, Boolean],
default: false,
},
},
......@@ -457,7 +458,7 @@
// add a line input to the playlist that is being edited
addPlaylistItemLine(line) {
this.playlistEditor.entries.push({uri: 'line://' + line })
this.playlistEditor.entries.push({uri: 'line://' + line})
},
// controls sub-modal to add a new URI to the playlist editor
......@@ -491,7 +492,7 @@
let playlist = this.getPlaylistById(this.id);
if (!playlist) {
this.$router.push({ name: 'addPlaylist' })
this.$router.push({name: 'addPlaylist'})
return;
}
......
<template>
<b-container>
<h1>Credits</h1>
<p>
AURA is developed under the GNU Affero General Public License v3. Current and former developers are:<br>
</p>
<ul>
<li>
Andrea Ida Malkah Klaura
<a href="https://gitlab.servus.at/jackie">@jackie</a>
<b-badge variant="primary">
dashboard
</b-badge>
<b-badge>oidc</b-badge>
</li>
<li>
Christian Pointner
<a href="https://gitlab.servus.at/equinox">@equinox</a>
<b-badge variant="danger">
tank
</b-badge>
<b-badge>oidc</b-badge>
</li>
<li>
David Trattnig
<a href="https://gitlab.servus.at/david">@david</a>
<b-badge variant="success">
engine
</b-badge>
</li>
<li>
Ernesto Rico Schmidt
<a href="https://gitlab.servus.at/nnrcschmdt">@nnrcschmdt</a>
<b-badge variant="warning">
steering
</b-badge>
</li>
<li>
Gottfried Gaisbauer
<a href="https://gitlab.servus.at/gg">@gg</a>
<b-badge variant="success">
engine
</b-badge>
</li>
<li>
Ingo Leindecker
<a href="https://gitlab.servus.at/ingo">@ingo</a>
<b-badge variant="warning">
steering
</b-badge>
<b-badge>oidc</b-badge>
</li>
<li>
Martin Lasinger
<b-badge>gfx</b-badge>
</li>
<li>
Richard Blechinger
<a href="https://gitlab.servus.at/pretzelhands">@pretzelhands</a>
<b-badge variant="primary">
dashboard
</b-badge>
</li>
</ul>
<p>
<b>Graphics &amp; Icons</b><br>
</p>
<ul>
<li>animated loading icon: <a href="https://loading.io/spinner">spinner by loading.io</a> (CC-BY License).</li>
<li>
all other Icons:
<a href="http://tango.freedesktop.org/">Tango Project</a> (Public Domain)
and <a href="https://bootstrap-vue.org/docs/icons">BootstrapVue</a> (MIT).
</li>
</ul>
<p>
For more infos visit the <a href="https://gitlab.servus.at/aura/dashboard">dashboard repository</a>.
To get the big picture of the whole AURA architecture, visit the
<a href="https://gitlab.servus.at/aura/meta">AURA meta repo</a>.
All AURA repos can be found at <a href="https://gitlab.servus.at/aura">https://gitlab.servus.at/aura</a>.
</p>
</b-container>
<b-container>
<h1>Credits</h1>
<p>
AURA is developed under the GNU Affero General Public License v3. Current and former developers are:<br>
</p>
<ul>
<li>
Andrea Ida Malkah Klaura
<a href=