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: []
}
}
......
......@@ -146,7 +146,6 @@
</template>
<!-- Column: Actions
Finally some buttons to reorder or delete playlist entries
-->
......@@ -188,8 +187,10 @@
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
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>
......@@ -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;
}
......
......@@ -66,7 +66,8 @@
<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>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)
......@@ -83,17 +84,19 @@
</template>
<script>
export default {}
export default {}
</script>
<style scoped>
p {
p {
text-align: left;
}
.badge {
}
.badge {
margin-left: 0.25rem;
}
a {
}
a {
color: #c09;
}
}
</style>
......@@ -97,18 +97,18 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { FullCalendar } from 'vue-full-calendar'
import 'fullcalendar/dist/fullcalendar.css'
import showSelector from '@/components/ShowSelector.vue'
import modalEmissionManagerCreate from '@/components/emissions/ModalCreate.vue'
import modalEmissionManagerResolve from '@/components/emissions/ModalResolve.vue'
import modalEmissionManagerEdit from '@/components/emissions/ModalEdit.vue'
import AuthWall from '@/components/AuthWall.vue'
import rrules from '@/mixins/rrules'
export default {
import {mapGetters} from 'vuex'
import {FullCalendar} from 'vue-full-calendar'
import 'fullcalendar/dist/fullcalendar.css'
import showSelector from '@/components/ShowSelector.vue'
import modalEmissionManagerCreate from '@/components/emissions/ModalCreate.vue'
import modalEmissionManagerResolve from '@/components/emissions/ModalResolve.vue'
import modalEmissionManagerEdit from '@/components/emissions/ModalEdit.vue'
import AuthWall from '@/components/AuthWall.vue'
import rrules from '@/mixins/rrules'
export default {
components: {
FullCalendar,
AuthWall,
......@@ -118,9 +118,9 @@ export default {
'app-modalEmissionManagerEdit': modalEmissionManagerEdit,
},
mixins: [ rrules ],
mixins: [rrules],
data () {
data() {
return {
calendarSlots: [],
......@@ -156,7 +156,7 @@ export default {
},
// here we add a simple tooltip to every event, so that the full title
// of a show can be viewed
eventRender: function(event, element) {
eventRender: function (event, element) {
element.attr('title', event.title);
},
},
......@@ -164,7 +164,7 @@ export default {
},
computed: {
loaded () {
loaded() {
return {
shows: this.$store.state.shows.loaded['shows'],
timeslots: this.$store.state.shows.loaded['timeslots'],
......@@ -181,9 +181,7 @@ export default {
})
},
created () {
created() {
this.$store.dispatch('shows/fetchShows', {
callback: () => {
this.showHasSwitched()
......@@ -193,20 +191,20 @@ export default {
},
methods: {
switchShow () {
switchShow() {
this.loadCalendarSlots()
},
// This is the callback function that is activated by the show-selector
// component, whenever the user switches to a different show
showHasSwitched () {
showHasSwitched() {
this.$log.debug('show has switched to', this.selectedShow.name)
let start = this.$refs.calendar.fireMethod('getView').start.format()
let end = this.$refs.calendar.fireMethod('getView').end.format()
this.loadTimeslots(start, end)
},
getShowTitleById (id) {
getShowTitleById(id) {
let i = this.shows.findIndex(show => show.id === id)
if (i >= 0) {
return this.shows[i].name
......@@ -215,7 +213,7 @@ export default {
}
},
getShowIndexById (id) {
getShowIndexById(id) {
let i = this.shows.findIndex(show => show.id === id)
if (i >= 0) {
return i
......@@ -227,7 +225,7 @@ export default {
// this handler will be called whenever the user clicks on one of the
// displayed timeslots
eventSelected (event) {
eventSelected(event) {
// in conflict resolution mode only the newly generated events are
// clickable. if there is no conflict for an event, only a modal
// with a short notice should be opend, otherwise the resolution modal
......@@ -255,7 +253,7 @@ export default {
// currently this will not be called, as our events are not editable
// if editable is set to true in the calendar config, this handler will
// be called if a timeslot was dragged somewhere else
eventDrop (event) {
eventDrop(event) {
this.$log.debug('eventDrop', event)
this.notYetImplemented()
},
......@@ -263,13 +261,13 @@ export default {
// currently this will not be called, as our events are not editable
// if editable is set to true in the calendar config, this handler will
// be called if a timeslot was resized
eventResize (event) {
eventResize(event) {
this.$log.debug('eventResize', event)
this.notYetImplemented()
},
// this handler is called when the user creates a new timeslot
eventCreated (event) {
eventCreated(event) {
if (!this.conflictMode) {
this.$refs.appModalEmissionManagerCreate.open(event.start, event.end)
}
......@@ -277,7 +275,7 @@ export default {
// this is called when the user changes the calendar view, so we just
// refetch the timeslots with the updated visible date range
renderView (view) {
renderView(view) {
if (this.loaded.shows) {
let start = null
let end = null
......@@ -296,8 +294,7 @@ export default {
}
}
},
resolve (data) {
resolve(data) {
this.resolveData = data
this.conflictMode = true
this.conflictCount = 0
......@@ -345,7 +342,7 @@ export default {
}
},
resolveEvent (toResolve, mode) {
resolveEvent(toResolve, mode) {
let calendarSlot = this.calendarSlots.find(s => s.id === toResolve.id)
let originalSlot = this.resolveData.projected.find(s => s.hash === toResolve.hash)
// we only need the conflicting slot specifically for theirs-both mode, where there should be only one collision
......@@ -465,20 +462,32 @@ export default {
}
},
resolveCancel () {
resolveCancel() {
this.conflictMode = false
this.renderView(null)
},
// submit a conflict-resolved schedule to steering
resolveSubmit () {
resolveSubmit() {
// TODO: check why steering retourns undefined and null values here
if (this.resolveData.schedule.add_business_days_only === undefined) { this.resolveData.schedule.add_business_days_only = false }
if (this.resolveData.schedule.add_days_no === null) { this.resolveData.schedule.add_days_no = 0 }
if (this.resolveData.schedule.is_repetition === undefined) { this.resolveData.schedule.is_repetition = false }
if (this.resolveData.schedule.fallback_id === null) { this.resolveData.schedule.fallback_id = 0 }
if (this.resolveData.schedule.automation_id === null) { this.resolveData.schedule.automation_id = 0 }
if (this.resolveData.schedule.byweekday === undefined) { this.resolveData.schedule.byweekday = 0 }
if (this.resolveData.schedule.add_business_days_only === undefined) {
this.resolveData.schedule.add_business_days_only = false
}
if (this.resolveData.schedule.add_days_no === null) {
this.resolveData.schedule.add_days_no = 0
}
if (this.resolveData.schedule.is_repetition === undefined) {
this.resolveData.schedule.is_repetition = false
}
if (this.resolveData.schedule.fallback_id === null) {
this.resolveData.schedule.fallback_id = 0
}
if (this.resolveData.schedule.automation_id === null) {
this.resolveData.schedule.automation_id = 0
}
if (this.resolveData.schedule.byweekday === undefined) {
this.resolveData.schedule.byweekday = 0
}
// create the resolved schedule object including solutions
let resolvedSchedule = {
......@@ -505,7 +514,7 @@ export default {
})
},
loadCalendarSlots () {
loadCalendarSlots() {
this.calendarSlots = []
for (let i in this.timeslots) {
let highlighting = 'otherShow'
......@@ -522,7 +531,7 @@ export default {
}
},
loadTimeslots (start, end) {
loadTimeslots(start, end) {
this.$store.dispatch('shows/fetchTimeslots', {
start: start,
end: end,
......@@ -536,33 +545,39 @@ export default {
alert('By the mighty witchcraftry of the mother of time!\n\nThis feature is not implemented yet.')
},
},
}
}
</script>
<style>
.otherShow {
.otherShow {
background-color: #eee;
}
a.currentShow {
}
a.currentShow {
background-color: #17a2b8;
}
.conflict {
}
.conflict {
background-color: #b00;
}
.noconflict {
}
.noconflict {
background-color: #17a2b8;
}
.timeslot-discarded {
}
.timeslot-discarded {
background-color: #b00;
opacity: 0.5;
text-decoration: line-through !important;
}
.timeslot-accepted {
}
.timeslot-accepted {
background-color: #17a2b8;
}
.timeslot-partly {
}
.timeslot-partly {
background-color: #17a2b8;
opacity: 0.5;
font-weight: bold;
}
}
</style>
......@@ -7,30 +7,30 @@
/>
<hr>
<jumbotron />
<jumbotron/>
<!-- All the UI for uploading and editing files is only shown if the user
choose to edit files in the jumbotron above -->
<div v-if="mode === 'files'">
<files />
<files/>
</div>
<!-- All the UI for creating and editing playlists is only shown if the user
choose to edit playlists in the jumbotron above -->
<div v-if="mode === 'playlists'">
<playlists />
<playlists/>
</div>
</b-container>
</template>
<script>
import { mapGetters } from 'vuex'
import showSelector from '../components/ShowSelector.vue'
import jumbotron from '../components/filemanager/Jumbotron.vue'
import files from '../components/filemanager/Files.vue'
import playlists from '../components/filemanager/Playlists.vue'
import {mapGetters} from 'vuex'
import showSelector from '../components/ShowSelector.vue'
import jumbotron from '../components/filemanager/Jumbotron.vue'
import files from '../components/filemanager/Files.vue'
import playlists from '../components/filemanager/Playlists.vue'
export default {
export default {
components: {
'show-selector': showSelector,
'jumbotron': jumbotron,
......@@ -40,7 +40,7 @@ export default {
// the data this component will be handling: mostly flags and local versions
// of the data fetched from the AuRa tank API
data () {
data() {
return {
// for formatting the buttons - this way we could customize it later
button: {
......@@ -62,7 +62,7 @@ export default {
// from the AuRa tank module. This works quite similar to the ShowManager.
// We also want to load the files and playlists as soon as the shows are
// loaded.
created () {
created() {
this.$store.dispatch('shows/fetchShows', {
callback: () => {
this.showHasSwitched()
......@@ -77,7 +77,7 @@ export default {
// This switches the UI elements to reflect another show and fetches all
// relevent data from the tank API.
showHasSwitched () {
showHasSwitched() {
this.$store.dispatch('files/fetchFiles', {
slug: this.selectedShow.slug
})
......@@ -87,30 +87,35 @@ export default {
},
}
}
}
</script>
<style>
div.filelistbox {
div.filelistbox {
border: 1px solid #e9ecef;
border-radius: 0.3rem;
padding: 1rem 2rem;
}
.stateNew {
}
.stateNew {
color: red;
font-weight: bold;
}
.stateRunning {
}
.stateRunning {
color: darkgreen;
}
.stateUndefined {
}
.stateUndefined {
color: orange;
font-weight: bold;
}
.upDownArrows {
}
.upDownArrows {
font-size: 1.15rem;
}
.modalPlaylistRows {
}
.modalPlaylistRows {
padding: 0.2rem 0;
}
}
</style>
......@@ -16,7 +16,7 @@
</template>
<script>
export default {}
export default {}
</script>
<style>
......
......@@ -17,7 +17,7 @@
import AuthWall from '@/components/AuthWall'
export default {
components: { AuthWall }
components: {AuthWall}
}
</script>
......
......@@ -9,7 +9,7 @@
<!-- The jumbotron is used to display the name and description of the
currently selected show -->
<show-jumbotron />
<show-jumbotron/>
<!-- If the shows are not fully loaded yet, we just put the loading sign -->
<div v-if="!loaded.shows">
......@@ -25,18 +25,18 @@
<!-- When all show data is loaded, here we display all the rest -->
<div v-else>
<show-schedules />
<show-schedules/>
<!-- include the modals to edit show and timeslot entries from the modal compontents -->
<show-timeslots ref="timeslotsComponent" />
<show-timeslots ref="timeslotsComponent"/>
<hr>
<h2>General settings for the radio show:</h2>
<show-metaSimpleTypes />
<show-metaArrays />
<show-metaOwners />
<show-metaImages />
<show-metaSimpleTypes/>
<show-metaArrays/>
<show-metaOwners/>
<show-metaImages/>
<hr>
</div>
......@@ -44,17 +44,17 @@
</template>
<script>
import showJumbotron from '../components/shows/Jumbotron.vue'
import showTimeslots from '../components/shows/Timeslots.vue'
import showSchedules from '../components/shows/Schedules.vue'
import showMetaSimpleTypes from '../components/shows/MetaSimpleTypes.vue'
import showMetaArrays from '../components/shows/MetaArrays.vue'
import showMetaOwners from '../components/shows/MetaOwners.vue'
import showMetaImages from '../components/shows/MetaImages.vue'
import showSelector from '../components/ShowSelector.vue'
import { mapGetters } from 'vuex'
export default {
import showJumbotron from '../components/shows/Jumbotron.vue'
import showTimeslots from '../components/shows/Timeslots.vue'
import showSchedules from '../components/shows/Schedules.vue'
import showMetaSimpleTypes from '../components/shows/MetaSimpleTypes.vue'
import showMetaArrays from '../components/shows/MetaArrays.vue'
import showMetaOwners from '../components/shows/MetaOwners.vue'
import showMetaImages from '../components/shows/MetaImages.vue'
import showSelector from '../components/ShowSelector.vue'
import {mapGetters} from 'vuex'
export default {
// all modals to edit a show and its timeslots/notes, are importet as separate
// components, to make it a tiny lickle bit less messy here
components: {
......@@ -68,18 +68,21 @@ export default {
'show-selector': showSelector,
},
data () {
return {
}
data() {
return {}
},
// Some of the info we need in the template are not easily and directly
// retrievable, so we are computing them on the fly, when they are needed
computed: {
user () { return this.$store.state.auth.user },
isSuperuser () { return this.$store.state.auth.user.steeringUser.is_superuser },
user() {
return this.$store.state.auth.user
},
isSuperuser() {
return this.$store.state.auth.user.steeringUser.is_superuser
},
loaded () {
loaded() {
return {
shows: this.$store.state.shows.loaded.shows,
}
......@@ -93,9 +96,10 @@ export default {
// Right after this component is set up, we want to fetch all available shows
// and the arrays for the show meta info from the AuRa steering module.
created () {
if (this.$store.state.auth.user.steeringUser) { this.loadShowInfos() }
else {
created() {
if (this.$store.state.auth.user.steeringUser) {
this.loadShowInfos()
} else {
this.$store.watch(
(state) => state.auth.user.steeringUser,
() => {
......@@ -106,11 +110,11 @@ export default {
},
methods: {
showHasSwitched () {
showHasSwitched() {
this.$refs.timeslotsComponent.showHasSwitched()
}