1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
| @extends('_layoutClient')
@section('title') Espace Client @endsection
@section('hero')
<section class="hero hero--profil mb-6">
<div class="hero-body has-text-centered">
<p class="title is-capitalized has-text-white is-center is-family-secondary">
{{ $gallery->name }}
</p>
{{--<p class="subtitle"> Primary subtitle </p>--}}
</div>
</section>
@endsection
@section('content')
<nav class="level level--galleryclient is-mobile">
<div class="level-item has-text-centered is-size-7-touch">
<div>
<a href="{{ URL::previous() }}">
<p class="heading">Retour</p>
<i class="fas fa-arrow-left fa-2x"></i>
</a>
</div>
</div>
<div id="top" class="level-item has-text-centered">
<div>
<p class="heading">Sélectionnées</p>
<p class="title is-size-1-desktop is-size-2-touch">{{ \App\Http\Controllers\MediaController::nombrePhotosSelec($gallery->id) }}/{{ count($gallery->media) }}</p>
</div>
</div>
<div class="level-item has-text-centered is-hidden-touch">
<div>
<!-- Si la sélection de galerie est déjà finie -->
@if($gallery->selection_lock == 1)
<a href="{{ $gallery->link_zip }}" class="button is-dark">
<span class="icon">
<i class="fas fa-download"></i>
</span>
<span>Télécharger la galerie</span>
</a>
<!-- Si l'utilisateur n'a pas encore fini de sélectionner le nombre minimum de photos -->
@elseif(\App\Http\Controllers\MediaController::nombrePhotosSelec($gallery->id) < count($gallery->media))
<button class="button is-dark" title="Veuillez terminer votre sélection" disabled>
<span class="icon">
<i class="fas fa-check"></i>
</span>
<span>Valider la sélection</span>
</button>
@else
<!-- Si l'utilisateur a sélectionné le nombre minimum de photos et que la galerie est prête pour validation -->
<button class="button is-dark">
<span class="icon">
<i class="fas fa-check"></i>
</span>
<span>Valider la sélection</span>
</button>
@endif
</div>
</div>
</nav>
<section class="section section__galleryclient">
<div class="columns galleryclient">
<div class="column is-3 is-2-widescreen is-offset-1">
<div class="galleryclient__miniature card is-shadowless is-transparent">
<div class="card-image is-hidden-touch mb-5">
@if(count($gallery->media) >0)
@foreach($gallery->media as $media)
<img class="image is-128x128" src="{{ asset('storage/'.$media->link) }}" alt="{{$media->title}}">
@break
@endforeach
@else
<img class="image is-128x128" src="https://bulma.io/images/placeholders/128x128.png" alt="Pas de miniature">
@endif
</div>
<div class="card-content pl-1 pt-0">
<p class="is-size-6">{{ $gallery->name }}</p>
<p class="is-size-6 mt-1"><span class="has-text-weight-bold has-text-orange">Photos incluses: </span> {{$gallery->number_photos}}</p>
<p class="is-size-6 mt-1"><span class="has-text-weight-bold has-text-orange">Pack actuel: </span>
@if($gallery->number_photos <= 20)
Starter
@elseif($gallery->number_photos >= 20 && $gallery->number_photos <= 40)
Zen
@else
Max
@endif
</p>
</div>
</div>
</div>
<div class="column">
<div class="galleryclient__liste">
@if(count($gallery->media) > 0)
@foreach($gallery->media as $media)
{{--href 2000x1333 data-lcl-thumb 400 267 backgound image 150x100--}}
<a class="galleryclient__el" href="{{ asset('storage/'.$media->link) }}" title="{{ $loop->index+1 ."/". count($gallery->media)}}" data-lcl-txt="{{ $gallery->desc }}" data-lcl-author="www.pexels.com{{--{{ $gallery->user->first_name." ".$gallery->user->last_name }}--}}" data-lcl-thumb="{{ asset('storage/'.$media->link) }}">
@if($media->selected==1)
<img data-id="{{$media->id}}" class="galleryclient__el-img galleryclient__el-img--selected" src="{{ asset('storage/'.$media->link) }}" alt="{{$media->title}}">
@else
<img data-id="{{$media->id}}" class="galleryclient__el-img" src="{{ asset('storage/'.$media->link) }}" alt="{{$media->title}}">
@endif
</a>
{{--<a id="lcl_on_open" href="#" class="galleryclient__el-button button button--blue">
<span class="icon">
<i class="fas fa-undo-alt"></i>
</span>
<span>Sélectionner</span>
</a>--}}
@endforeach
@else
<div class="is-block">
<h1 class="title is-4">Aucune photo n'a été encore ajouté dans cet album</h1>
<a href="{{ URL::previous() }}" class="button button--blue">
<span class="icon">
<i class="fas fa-undo-alt"></i>
</span>
<span>Retour</span>
</a>
</div>
@endif
</div>
</div>
<a href="#top">
<i class="icon icon__top fas fa-chevron-up"></i>
</a>
</div>
</section>
@endsection
@section('script')
<!-- LIGHTBOX INITIALIZATION -->
<script>
"use strict";
$(document).ready(function(e) {
// live handler
lc_lightbox('.galleryclient__el', {
wrap_class: 'lcl_fade_oc',
gallery : true,
thumb_attr: 'data-lcl-thumb',
skin: 'minimal',
radius: 0,
padding : 0,
border_w: 0,
//custom
cmd_position:'outer',
fullscreen:true,
fs_img_behavior:'fit',
fs_only:false,
socials:true,
//txt_toggle_cmd:true,
download:true,
touchswipe:true,
mousewheel:true,
rclick_prevent:true,
html_is_ready :function(opts,vars){
//console.log("html ready : l'index de l'image courante est :",vars.elem_index);
//console.log("html is ready :",", opts :",opts,", vars :",vars);
let button = $("<button class='galleryclient__el-button button button--blue'>Sélectionner</button>");
//button.attr('id', vars.elem_index);
$('#lcl_contents_wrap').append(button);
}
}).on('lcl_on_open lcl_on_elem_switch',function(e,opts,index){
console.log("e.type :",e.type,", index :",index);
$('#lcl_contents_wrap')
.on('click','#btn',function(){
console.log(
'data-id de l\'image courante est :'+$("#lcl_contents_wrap").find("img.image").eq(index).attr("data-id")
+', l\'index de l\'image courante est :',index
);
});
});
});
</script> |
Partager