Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #137 from fivejars/1.4
Browse files Browse the repository at this point in the history
1.4
  • Loading branch information
anpolimus authored May 11, 2021
2 parents a49c910 + d0a1938 commit 9511a50
Show file tree
Hide file tree
Showing 131 changed files with 5,131 additions and 253 deletions.
2 changes: 1 addition & 1 deletion js/gated-content/dist/gated-content.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions js/gated-content/dist/gated-content.umd.min.js

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added js/gated-content/src/assets/img/background-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added js/gated-content/src/assets/img/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions js/gated-content/src/assets/svg/cameraswitch_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/cancel_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions js/gated-content/src/assets/svg/fullscreen_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/mic_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/mic_off_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/settings_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/toggle_off_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/toggle_on_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions js/gated-content/src/assets/svg/videocam_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/videocam_off_black_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions js/gated-content/src/assets/svg/view-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/gated-content/src/assets/svg/view-inset.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions js/gated-content/src/assets/svg/view-vertical.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions js/gated-content/src/components/AccordionTab.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<template>
<div class="accordion-tab">
<div class="accordion-tab__header"
@click="toggle"
>
<div>{{ title }}</div>
<div>{{ open ? '-' : '+' }}</div>
</div>
<div class="accordion-tab__content"
v-if="content && open"
v-html="content"
></div>
<div
v-else-if="open"
class="accordion-tab__content"
>
<slot></slot>
</div>
</div>
</template>

<script>
export default {
name: 'AccordionTab',
props: {
title: {
type: String,
default: 'Tab Title',
},
content: {
type: String,
default: undefined,
},
},
data() {
return {
open: false,
};
},
methods: {
toggle() {
this.open = !this.open;
},
},
};
</script>
32 changes: 3 additions & 29 deletions js/gated-content/src/components/event/EventTeaser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@
<script>
import AddToFavorite from '@/components/AddToFavorite.vue';
import SvgIcon from '@/components/SvgIcon.vue';
import dayjs from 'dayjs';
import { EventMixin } from '@/mixins/EventMixin';
export default {
name: 'EventTeaser',
mixins: [EventMixin],
components: {
SvgIcon,
AddToFavorite,
Expand All @@ -66,28 +67,7 @@ export default {
},
computed: {
date() {
return dayjs(this.video.attributes.date.value).format('YYYY-MM-DD');
},
time() {
return dayjs(this.video.attributes.date.value).format('h:mm a');
},
duration() {
const min = Math.floor(dayjs.duration(
dayjs(this.video.attributes.date.end_value) - dayjs(this.video.attributes.date.value),
).asMinutes());
return `${min} ${this.$options.filters.simplePluralize('minute', min)}`;
},
startsIn() {
const eventStartDate = dayjs(this.video.attributes.date.value);
const startsDuration = dayjs.duration(eventStartDate - dayjs());
if (startsDuration.asHours() >= 48) {
return `${Math.floor(startsDuration.asDays())} days`;
}
const { prependZero } = this.$options.filters;
return `${prependZero(Math.floor(startsDuration.asHours()))}:${prependZero(startsDuration.minutes())}:${prependZero(startsDuration.seconds())}`;
return this.$dayjs.date(this.video.attributes.date.value).format('YYYY-MM-DD');
},
image() {
if (this.video.attributes['field_ls_image.field_media_image']) {
Expand All @@ -105,12 +85,6 @@ export default {
return this.video.attributes.field_ls_level ? this.video.attributes.field_ls_level.name
: this.video.attributes.level.name;
},
isOnAir() {
const dateStart = new Date(this.video.attributes.date.value);
const dateEnd = new Date(this.video.attributes.date.end_value);
const now = new Date();
return dateStart < now && now < dateEnd;
},
route() {
switch (this.video.type) {
case 'eventinstance--live_stream':
Expand Down
52 changes: 25 additions & 27 deletions js/gated-content/src/components/event/ScheduleEventCard.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<template>
<div class="schedule-event-card" :class="{'past': !isUpcoming}">
<div class="info">
<div class="time">{{ event.attributes.date | start_and_duration }}</div>
<div class="time">{{ event.date | start_and_duration }}</div>
<div class="title">
<router-link
:to="{ name: route, params: { id: event.id } }"
v-if="isUpcoming"
>
{{ event.attributes.title }}
</router-link>
<template v-if="route && isUpcoming">
<router-link :to="{ name: route, params: { id: event.uuid } }">
{{ event.title }}
</router-link>
</template>
<template v-else>
{{ event.attributes.title }}
{{ event.title }}
</template>
</div>
<div class="instructor" v-if="instructor">{{ instructor }}</div>
<div class="instructor" v-if="event.host_name">{{ event.host_name }}</div>
<div v-if="isPrivate"><div class="timer private">Private</div></div>
</div>
<AddToFavorite
v-if="isUpcoming"
:id="event.attributes.drupal_internal__id"
:type="'eventinstance'"
:bundle="type"
:id="event.id"
:type="event.type"
:bundle="event.bundle"
></AddToFavorite>
</div>
</template>
Expand All @@ -40,24 +40,22 @@ export default {
},
computed: {
route() {
switch (this.event.type) {
case 'eventinstance--live_stream':
return 'LiveStream';
case 'eventinstance--virtual_meeting':
return 'VirtualMeeting';
default:
return 'LiveStream';
}
const routes = {
eventinstance: {
live_stream: 'LiveStream',
virtual_meeting: 'VirtualMeeting',
},
personal_training: {
personal_training: 'PersonalTraining',
},
};
return routes[this.event.type][this.event.bundle];
},
isUpcoming() {
return (new Date(this.event.attributes.date.end_value)).getTime() > (new Date()).getTime();
},
instructor() {
return this.event.attributes.field_ls_host_name ? this.event.attributes.field_ls_host_name
: this.event.attributes.host_name;
return (new Date(this.event.date.end_value)).getTime() > (new Date()).getTime();
},
type() {
return this.event.type.replace('eventinstance--', '');
isPrivate() {
return this.event.type === 'personal_training';
},
},
};
Expand Down
49 changes: 49 additions & 0 deletions js/gated-content/src/components/personal-training/Meeting.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<JoinMeeting
v-if="!isJoinedVideoSession"
></JoinMeeting>
<div
class="personal-training-full-screen"
v-else
>
<Chat></Chat>
<LeaveMeeting></LeaveMeeting>
<ViewOptions></ViewOptions>
<div
class="personal-training-meeting"
>
<MeetingPlayer></MeetingPlayer>
<ControlPanel></ControlPanel>
</div>
</div>
</template>

<script>
import { mapGetters } from 'vuex';
import ControlPanel from '@/components/personal-training/meeting/ControlPanel.vue';
import MeetingPlayer from '@/components/personal-training/meeting/MeetingPlayer.vue';
import JoinMeeting from '@/components/personal-training/meeting/JoinMeeting.vue';
import Chat from '@/components/personal-training/modal/Chat.vue';
import LeaveMeeting from '@/components/personal-training/modal/LeaveMeeting.vue';
import ViewOptions from '@/components/personal-training/modal/ViewOptions.vue';
export default {
components: {
Chat, JoinMeeting, MeetingPlayer, ControlPanel, ViewOptions, LeaveMeeting,
},
computed: {
...mapGetters([
'isJoinedVideoSession',
]),
},
watch: {
isJoinedVideoSession(newVal) {
if (newVal === true) {
document.querySelector('html').style.overflow = 'hidden';
} else {
document.querySelector('html').style.overflow = 'scroll';
}
},
},
};
</script>
Loading

0 comments on commit 9511a50

Please sign in to comment.