taipei-light2/modules/announcement/annc_index1.html.erb

42 lines
1.3 KiB
Plaintext

<div class="i-annc index-announcement-1">
<h3 class="i-annc__page-title">{{page-title}}</h3>
<ul class="i-annc__list" data-level="0" data-list="announcements">
<li class="i-annc__item row">
<span class="i-annc__category-wrap col-sm-2">
<span class="i-annc__category">{{category}}</span>
</span>
<h4 class="i-annc__entry-title col-sm-8">
<span class="i-annc__status-wrap" data-list="statuses" data-level="1">
<span class="i-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="i-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4>
<span class="i-annc__postdate-wrap col-sm-2" date-format="%Y-%m/%d">
<span class="i-annc__postdate">{{postdate}}</span>
</span>
</li>
</ul>
</div>
{{pagination_goes_here}}
<script>
function postdate() {
var len = $('.i-annc__postdate').length;
var date = $('.i-annc__postdate');
for (let i=0; i<len; i++) {
newDate = date[i].innerText.slice(5,10)
newYear = date[i].innerText.slice(0,5)
date[i].innerHTML= '';
date[i].append(newYear)
var date2 = document.createElement('span');
date2.className = 'new-date';
date2.textContent = newDate;
date[i].appendChild(date2);
}
}
postdate();
</script>