fgu_e1/modules/announcement/_annc_widget4.html.erb

94 lines
3.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="w-annc widget-announcement-4">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}"><%= (I18n.locale.to_s =="zh_tw") ? "更多最新消息" : "More NEWS" %></a>
</div>
<ul class="w-annc__list row" data-level="0" data-list="announcements">
<li class="w-annc__item col-sm-4">
<div class="w-annc__item_inner">
<a href="{{link_to_show}}">
<div class="w-annc__img-wrap bullseye" style="position:relative">
<img class="w-annc__img" src="{{img_src}}" alt="" >
<div class="transitionfade"></div>
</div>
<div class="w-annc__content-wrap">
<div class="w-annc__meta">
<span class="w-annc__postdate-wrap" date-format="%Y-%m-%d">
<i class="fa-regular fa-calendar"></i>
<span class="w-annc__postdate">{{postdate}}</span>
</span>
<span class="w-annc__category-wrap">
<i class="fa-solid fa-list"></i>
<span class="w-annc__category">{{category}}</span>
</span>
</div>
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label {{status-class}}">{{status}}</span>
</span>
<h4 class="w-annc__entry-title">
<span class="w-annc__title" >{{title}}</span>
</h4>
<p class="w-annc__subtitle">{{subtitle}}</p>
</div>
</a>
</div>
</li>
</ul>
</div>
<style type="text/css">
[data-subpart-id="{{subpart-id}}"] .bullseye{
overflow: hidden;
}
/* 防止外部排版套件影響此 widget 的 li */
[data-subpart-id="{{subpart-id}}"] ul.w-annc__list > li {
position: static !important;
left: auto !important;
top: auto !important;
opacity: 1 !important;
transform: none !important;
transition-property: none !important;
}
[data-subpart-id="{{subpart-id}}"] ul.w-annc__list {
position: static !important;
height: auto !important;
}
</style>
<script>
function clearNavTabsFilterStyle_{{subpart-id}}(){
$('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list > li').each(function(){
var $li = $(this);
$li[0].style.removeProperty('width');
$li[0].style.removeProperty('position');
$li[0].style.removeProperty('left');
$li[0].style.removeProperty('top');
$li[0].style.removeProperty('float');
$li[0].style.removeProperty('opacity');
$li[0].style.removeProperty('transform');
$li[0].style.removeProperty('transition-property');
$li[0].style.removeProperty('transition-duration');
});
$('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').each(function(){
this.style.removeProperty('position');
this.style.removeProperty('height');
});
}
// 若父層有 .nav_tabs_filter,跳過 reorganize(由頁籤自行控制顯示/隱藏)
var hasNavTabsFilter_{{subpart-id}} = (
$('[data-subpart-id=\"{{subpart-id}}\"]').parents('.nav_tabs_filter').length > 0 ||
$('[data-subpart-id=\"{{subpart-id}}\"]').closest('.tab-content, .tab_content, [data-pp]').length > 0 &&
$('.nav_tabs_filter').length > 0
);
$(window).resize(function(){
if(hasNavTabsFilter_{{subpart-id}}){
clearNavTabsFilterStyle_{{subpart-id}}();
}
})
setTimeout(function() {
$('.widget-announcement-4 .w-annc__item').removeAttr('tabindex');
}, 500);
</script>