refs #1036: App Store app detail screenshot and video missing

This commit is contained in:
Cüneyt Şentürk
2019-12-26 12:24:38 +03:00
parent 64435b5e5a
commit 56cef21241
4 changed files with 140 additions and 90 deletions

View File

@ -0,0 +1,111 @@
<template>
<div v-if="video || screenshots">
<el-carousel :height="height"
:initial-index="initial_index"
:trigger="trigger" :autoplay="autoplay"
:indicator-position="indicator_position"
:type="type" :loop="loop" :direction="direction"
:interval="interval" :arrow="arrow">
<el-carousel-item v-if="video">
<iframe width="100%" height="400px"
:src="'https://www.youtube-nocookie.com/embed/' + video"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="image-description text-center">
{{ name }}
</div>
</el-carousel-item>
<el-carousel-item v-for="(screenshot, index) in screenshots" :key="index">
<img class="d-block w-100" :src="screenshot.path_string" :alt="screenshot.alt_attribute">
<div class="image-description text-center">
{{ screenshot.description }}
</div>
</el-carousel-item>
</el-carousel>
</div>
</template>
<script>
import {Image, Carousel, CarouselItem} from 'element-ui';
export default {
name: "akaunting-carousel",
components: {
[Image.name]: Image,
[Carousel.name]: Carousel,
[CarouselItem.name]: CarouselItem,
},
props: {
name: {
type: String,
default: null,
description: "App Name"
},
video: {
type: String,
default: null,
description: "App Video"
},
screenshots: {
type: Array,
default: false,
description: "App Screenshots"
},
height: {
type: String,
default: null,
description: "height of the carousel"
},
initial_index: {
type: Number,
default: 1,
description: "index of the initially active slide (starting from 0)"
},
trigger: {
type: String,
default: 'hover',
description: "how indicators are triggered (hover/click)"
},
autoplay: {
type: Boolean,
default: false,
description: "whether automatically loop the slides"
},
interval: {
type: Number,
default: 3000,
description: "interval of the auto loop, in milliseconds"
},
indicator_position: {
type: String,
default: 'none',
description: "position of the indicators (outside/none)"
},
arrow: {
type: String,
default: 'hover',
description: "when arrows are shown (always/hover/never)"
},
type: {
type: String,
default: '',
description: "type of the Carousel (card)"
},
loop: {
type: Boolean,
default: true,
description: "display the items in loop"
},
direction: {
type: String,
default: 'horizontal',
description: "display direction (horizontal/vertical)"
}
}
}
</script>

View File

@ -12,6 +12,8 @@ import Global from '../../mixins/global';
import {Progress} from 'element-ui'; import {Progress} from 'element-ui';
import AkauntingCarousel from './../../components/AkauntingCarousel';
Vue.use(Progress); Vue.use(Progress);
const app = new Vue({ const app = new Vue({
@ -23,6 +25,7 @@ const app = new Vue({
components: { components: {
[Progress.name]: Progress, [Progress.name]: Progress,
AkauntingCarousel
}, },
mounted() { mounted() {

View File

@ -3,7 +3,7 @@
@section('title', trans_choice('general.modules', 2)) @section('title', trans_choice('general.modules', 2))
@section('new_button') @section('new_button')
<span class="new-button"> <span class="new-button">
<a href="{{ route('apps.api-key.create') }}" class="btn btn-white btn-sm header-button-top"> <a href="{{ route('apps.api-key.create') }}" class="btn btn-white btn-sm header-button-top">
<span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_key') }} <span class="fa fa-key"></span> &nbsp;{{ trans('modules.api_key') }}
</a> </a>
@ -36,64 +36,25 @@
{!! $module->description !!} {!! $module->description !!}
@if($module->screenshots || $module->video) @if($module->screenshots || $module->video)
<div id="carousel-screenshot-generic" class="carousel slide" data-ride="carousel"> <akaunting-carousel :name="'{{ $module->name }}'" :height="'430px'"
<div class="carousel-inner"> @if($module->video)
@if($module->video) @php
@php if (strpos($module->video->link, '=') !== false) {
if (strpos($module->video->link, '=') !== false) { $code = explode('=', $module->video->link);
$code = explode('=', $module->video->link); $code[1]= str_replace('&list', '', $code[1]);
$code[1]= str_replace('&list', '', $code[1]); }
@endphp
if (empty($status)) { :video="'{{ $code[1] }}'"
$status = 5; @endif
} else { :screenshots="{{ json_encode($module->screenshots) }}">
$status = 1; </akaunting-carousel>
}
@endphp
<div class="item @if($status == 5) {{ 'active' }} @endif">
<iframe width="100%" height="410px" src="https://www.youtube-nocookie.com/embed/{{ $code[1] }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="image-description text-center">
{{ $module->name }}
</div>
</div>
@php } @endphp
@endif
@foreach($module->screenshots as $screenshot)
@php if (empty($status)) { $status = 5; } else { $status = 1; } @endphp
<div class="item @if($status == 5) {{ 'active' }} @endif">
<a href="{{ $screenshot->path_string }}" data-toggle="lightbox" data-gallery="{{ $module->slug}}">
<img class="img-fluid d-block w-100" src="{{ $screenshot->path_string }}" alt="{{ $screenshot->alt_attribute }}">
</a>
<div class="image-description text-center">
{{ $screenshot->description }}
</div>
</div>
@endforeach
<div class="carousel-navigation-message">
@if (($module->video && (count($module->screenshots) > 1)) || (!$module->video && (count($module->screenshots) > 1)))
<a href="#carousel-screenshot-generic" class="left carousel-control" role="button" data-slide="prev">
<i class="fa fa-chevron-left"></i>
<span class="sr-only">{{ trans('pagination.previous') }}</span>
</a>
<a href="#carousel-screenshot-generic" class="right carousel-control" role="button" data-slide="next">
<i class="fa fa-chevron-right"></i>
<span class="sr-only">{{ trans('pagination.next') }}</span>
</a>
@endif()
</div>
</div>
</div>
@endif @endif
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<h3>{{ trans_choice('general.actions', 1) }}</h3> <h3>{{ trans_choice('general.actions', 1) }}</h3>
<div class="card"> <div class="card">

View File

@ -82,43 +82,18 @@
{!! $module->description !!} {!! $module->description !!}
@if($module->screenshots || $module->video) @if($module->screenshots || $module->video)
<div class="carousel-inner"> <akaunting-carousel :name="'{{ $module->name }}'" :height="'430px'"
<div class="carousel-item" data-ride="carousel"> @if($module->video)
@if($module->video) @php
@php if (strpos($module->video->link, '=') !== false) {
if (strpos($module->video->link, '=') !== false) { $code = explode('=', $module->video->link);
$code = explode('=', $module->video->link); $code[1]= str_replace('&list', '', $code[1]);
$code[1]= str_replace('&list', '', $code[1]); }
@endphp
if (empty($status)) { :video="'{{ $code[1] }}'"
$status = 5; @endif
} else { :screenshots="{{ json_encode($module->screenshots) }}">
$status = 1; </akaunting-carousel>
}
@endphp
<div class="carousel-item @if($status == 5) {{ 'active' }} @endif">
<iframe width="100%" height="410px" src="https://www.youtube-nocookie.com/embed/{{ $code[1] }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="image-description text-center">
{{ $module->name }}
</div>
</div>
@php } @endphp
@endif
@foreach($module->screenshots as $screenshot)
@php if (empty($status)) { $status = 5; } else { $status = 1; } @endphp
<div class="carousel-item @if($status == 5) {{ 'active' }} @endif">
<a href="{{ $screenshot->path_string }}" data-toggle="lightbox" data-gallery="{{ $module->slug}}">
<img class="d-block w-100" src="{{ $screenshot->path_string }}" alt="{{ $screenshot->alt_attribute }}">
</a>
<div class="image-description text-center">
{{ $screenshot->description }}
</div>
</div>
@endforeach
</div>
</div>
@endif @endif
</div> </div>