253 lines
9.9 KiB
Plaintext
253 lines
9.9 KiB
Plaintext
<article class="s-annc show-announcement">
|
|
<h1 class="s-annc__show-title">{{title}}</h1>
|
|
|
|
<ul class="s-annc__meta-wrap list-unstyled no-print">
|
|
<li class="s-annc__date-wrap s-annc__meta--item">
|
|
<i class="fa fa-calendar-o"></i>
|
|
<span class="s-annc__date" date-format="%Y-%m-%d">{{updated_at}}</span>
|
|
</li>
|
|
<li class="s-annc__author-wrap s-annc__meta--item">
|
|
<i class="fa fa-male"></i>
|
|
<span class="s-annc__author">{{update_user}}</span>
|
|
</li>
|
|
<li class="s-annc__tag-wrap s-annc__meta--item ">
|
|
<i class="fa fa-tags"></i>
|
|
<span data-list="tags" data-level="0">
|
|
<a href="{{url}}"><span class="s-annc__tag label label-default">{{tag}}</span></a>
|
|
</span>
|
|
</li>
|
|
</ul>
|
|
|
|
<section class="s-annc__post-wrap">
|
|
<div class="s-annc__sub-img pull-right {{hide_class}}">
|
|
<img src="{{img_src}}" alt="{{img_description}}"></img>
|
|
<span class="s-annc__img_description">{{img_description}}</span>
|
|
</div>
|
|
<div class="s-annc__subtitle">{{subtitle_ann}}</div>
|
|
<div class="s-annc__post-body">{{body}}</div>
|
|
</section>
|
|
|
|
<ul class="s-annc__related-wrap list-unstyled no-print">
|
|
<li class="s-annc__related-file">
|
|
<i class="fa fa-fw fa-paperclip"></i>
|
|
<div class="s-annc__related-file-list" data-list="bulletin_files" data-level="0">
|
|
<a class="s-annc__flie-title btn btn-default btn-sm" href="{{file_url}}">{{file_title}}</a>
|
|
</div>
|
|
</li>
|
|
|
|
<li class="s-annc__related-link">
|
|
<i class="fa fa-fw fa-link"></i>
|
|
<div class="s-annc__related-link-list" data-list="bulletin_links" data-level="0">
|
|
<a class="s-annc__link-title btn btn-default btn-sm" href="{{link_url}}" target="_blank">{{link_title}}</a>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
|
|
</article>
|
|
<div class="carousel_images" style="{{carousel_display_style}}">
|
|
<div class="w-ba-banner ba-banner-widget-1">
|
|
<div class="w-ba-banner__wrap cycle-slideshow"
|
|
data-list="bulletin_carousel_images"
|
|
data-level="0"
|
|
data-cycle-slides=".bulletin_carousel_slide"
|
|
data-cycle-log="false"
|
|
data-cycle-auto-height="0"
|
|
data-cycle-speed="300"
|
|
data-cycle-timeout="5000"
|
|
data-cycle-fx="fade"
|
|
data-pager-active-class="active-slide"
|
|
data-cycle-swipe=true
|
|
data-cycle-swipe-fx="scrollHorz"
|
|
>
|
|
<div class="w-ba-banner__slide bulletin_carousel_slide"
|
|
data-cycle-title="{{description_text}}"
|
|
>
|
|
<img class="w-ba-banner__image banner-responsive" src="{{src}}" alt="{{description_text}}">
|
|
<div class="ad-overlay w-ad-banner__overlay bulletin_carousel__overlay">
|
|
<p><strong class="carousel__description">{{description}}</strong></p>
|
|
</div>
|
|
<div class="transitionfade"></div>
|
|
</div>
|
|
</div>
|
|
<ul class="controlplay"><a class="resume-slide" title = "{{resume_btn_title}}"><i></i></a><a class="pause-slide" title = "{{pause_btn_title}}"><i></i></a></ul>
|
|
<ul class="button-mid">
|
|
<i class="fa fa-angle-left prev-button" aria-hidden="true" title = "{{prev_btn_title}}"></i>
|
|
<i class="fa fa-angle-right next-button" aria-hidden="true" title = "{{next_btn_title}}"></i>
|
|
</ul>
|
|
</div>
|
|
<div style="position: relative;">
|
|
<h4><span class="active_slide">1</span>/{{carousel_count}}</h4>
|
|
<ul class="carousel_images_slide w-annc__list row list-unstyled" data-level="0" data-list="bulletin_carousel_images">
|
|
<li class="carousel_img_item col-sm-3">
|
|
<div class="carousel_img-wrap">
|
|
<img class="carousel_img" src="{{src}}" alt="{{description_text}}">
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<ul class="button-mid">
|
|
<i class="fa fa-angle-left prev-button prev_img" aria-hidden="true" title = "{{prev_btn_title}}"></i>
|
|
<i class="fa fa-angle-right next-button next_img" aria-hidden="true" title = "{{next_btn_title}}"></i>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
{{link_to_edit}}
|
|
<style type="text/css">
|
|
.carousel_img_item{
|
|
display: none;
|
|
float: left;
|
|
}
|
|
.carousel_images_slide{
|
|
padding: 3em;
|
|
}
|
|
.carousel_img_item img{
|
|
cursor: pointer;
|
|
}
|
|
@media (max-width: 479px){
|
|
.carousel_img_item:nth-child(-n+1){
|
|
display: block;
|
|
float: left;
|
|
}
|
|
.carousel_img_item{
|
|
width: 100%;
|
|
}
|
|
}
|
|
@media (min-width: 480px){
|
|
.carousel_img_item:nth-child(-n+2){
|
|
display: block;
|
|
float: left;
|
|
}
|
|
.carousel_img_item{
|
|
width: 50%;
|
|
}
|
|
}
|
|
@media (min-width: 768px){
|
|
.carousel_img_item:nth-child(-n+3){
|
|
display: block;
|
|
width: 33%;
|
|
float: left;
|
|
}
|
|
.carousel_img_item{
|
|
width: 33%;
|
|
}
|
|
}
|
|
@media (min-width: 1280px){
|
|
.carousel_img_item:nth-child(-n+4){
|
|
display: block;
|
|
float: left;
|
|
}
|
|
}
|
|
</style>
|
|
<script>
|
|
(function($) {
|
|
|
|
function hideEmptyEl(el, elParent) {
|
|
if( el.length === 0) {
|
|
elParent.addClass('hide');
|
|
}
|
|
}
|
|
|
|
// Hiding parent element when children elements are not present
|
|
// Tags
|
|
hideEmptyEl($('.s-annc__tag'), $('.s-annc__tag-wrap'));
|
|
|
|
// Attachments
|
|
hideEmptyEl($('.s-annc__flie-title'), $('.s-annc__related-file'));
|
|
|
|
// Links
|
|
hideEmptyEl($('.s-annc__link-title'), $('.s-annc__related-link'));
|
|
|
|
$("img[src='']").remove();
|
|
$('.pause-slide').click(function(){
|
|
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause');
|
|
});
|
|
$('.resume-slide').click(function(){
|
|
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('resume');
|
|
});
|
|
$('.next-button').off('click').on('click',function(){
|
|
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("next");
|
|
})
|
|
$('.prev-button').off('click').on('click',function(){
|
|
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev");
|
|
})
|
|
window.active_slide = 0;
|
|
$('.prev_img').off('click').on('click',function(){
|
|
var carousel_images_slide = $('.carousel_images_slide');
|
|
var carousel_images_slide_first_child = carousel_images_slide.find(">li").eq(active_slide);
|
|
if(carousel_images_slide_first_child.length > 0){
|
|
var content_size = Math.floor((carousel_images_slide.width() - Number.parseInt(carousel_images_slide.css('font-size')) * 3) / carousel_images_slide_first_child.width());
|
|
content_size = Math.max(content_size,1);
|
|
if(carousel_images_slide.find(">li").length > content_size && active_slide > 0){
|
|
active_slide -= content_size;
|
|
carousel_images_slide.find(">li").css("display","none");
|
|
for(var i = active_slide; i < active_slide + content_size;i++){
|
|
carousel_images_slide.find(">li").eq(i).css("display","block");
|
|
}
|
|
}
|
|
}
|
|
})
|
|
$('.next_img').off('click').on('click',function(){
|
|
var carousel_images_slide = $('.carousel_images_slide');
|
|
var carousel_images_slide_first_child = carousel_images_slide.find(">li").eq(active_slide);
|
|
if(carousel_images_slide_first_child.length > 0){
|
|
var content_size = Math.floor((carousel_images_slide.width() - Number.parseInt(carousel_images_slide.css('font-size')) * 3) / carousel_images_slide_first_child.width());
|
|
content_size = Math.max(content_size,1);
|
|
var li_length = carousel_images_slide.find(">li").length;
|
|
if(li_length > content_size && (active_slide < li_length - 1)){
|
|
active_slide += content_size;
|
|
active_slide = Math.min(active_slide,li_length - 1);
|
|
carousel_images_slide.find(">li").css("display","none");
|
|
for(var i = active_slide; i < active_slide + content_size;i++){
|
|
carousel_images_slide.find(">li").eq(i).css("display","block");
|
|
}
|
|
}
|
|
}
|
|
|
|
})
|
|
$(".carousel_img_item img").off("click").on("click",function(){
|
|
$(".carousel_images .cycle-slideshow").cycle($(this).index(".carousel_img_item img"));
|
|
})
|
|
$(document).ready(function(){
|
|
$(".carousel_images .cycle-slideshow").cycle('pause');
|
|
var carousel_image_block_width = $('.carousel_images').width();
|
|
var heights = $(".bulletin_carousel_slide").map(function(i,v){
|
|
return $(v).height() * carousel_image_block_width / $(v).width();
|
|
})
|
|
var max_height = Math.max.apply(null,heights);
|
|
$(".bulletin_carousel_slide").each(function(i,v){
|
|
$(v).height(max_height);
|
|
})
|
|
$(".carousel_images .cycle-slideshow").cycle('resume');
|
|
$('.cycle-slideshow').on('cycle-after',function(){
|
|
$(".active_slide").text($('.bulletin_carousel_slide.cycle-slide-active').index());
|
|
})
|
|
})
|
|
$(window).resize(function(){
|
|
var carousel_images_slide = $('.carousel_images_slide');
|
|
var carousel_images_slide_first_child = carousel_images_slide.find(">li").eq(active_slide);
|
|
if(carousel_images_slide_first_child.length > 0){
|
|
var content_size = Math.floor((carousel_images_slide.width() - Number.parseInt(carousel_images_slide.css('font-size')) * 3) / carousel_images_slide_first_child.width());
|
|
content_size = Math.max(content_size,1);
|
|
carousel_images_slide.find(">li").css("display","none");
|
|
var active_count = carousel_images_slide.find(">li").length - active_slide;
|
|
if(active_count < content_size){
|
|
active_slide -= (content_size - active_count);
|
|
}
|
|
active_slide = Math.max(active_slide,0);
|
|
console.log(content_size)
|
|
for(var i = active_slide; i < active_slide + content_size;i++){
|
|
carousel_images_slide.find(">li").eq(i).css("display","block");
|
|
}
|
|
}
|
|
var carousel_image_block_width = $('.carousel_images').width();
|
|
$(".bulletin_carousel_slide").css("height",'');
|
|
var heights = $(".bulletin_carousel_slide").map(function(i,v){
|
|
return $(v).height() * carousel_image_block_width / $(v).width();
|
|
})
|
|
var max_height = Math.max.apply(null,heights);
|
|
$(".bulletin_carousel_slide").each(function(i,v){
|
|
$(v).height(max_height);
|
|
})
|
|
})
|
|
}(jQuery));
|
|
</script> |