-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathevents.html
99 lines (87 loc) · 3.58 KB
/
events.html
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
---
layout: default
title: 活动公告
permalink: /events/
jsEntry: event
---
<div class="container mtb">
<div class="row">
<!-- BLOG POSTS LIST -->
<div class="col-lg-10 offset-lg-1" id="events-list">
{% for event in site.categories['event'] %}
<!-- Blog Post -->
<div class="row event">
<div class="col-lg-9">
<div class="event-title">
<a href="{{ event.url | prepend: site.baseurl }}"><h3 class="ctitle">{{ event.title }}</h3></a>
</div>
<div class="event-meta mb-3">
<span class="me-3"><strong>{% fa_svg fas.fa-calendar %} 时间: </strong>{{event.date | date: "%F"}}{% if event.time %} {{event.time}} {% endif %}</span>
<span class="me-3"><strong>{% fa_svg fas.fa-location-dot %} 地点:</strong> {{event.place}}</span>
<span class="event-tags">
{% for tag in event.tags %}
<span class="badge text-bg-success">{{tag}}</span>
{% endfor %}
<span class="event-status" data-event-date="{{event.date | date: "%F"}}" data-hide-finished></span>
</span>
{% if event.video or event.slides or event.youtube or event.audio %}
<br>
<span><strong>{% fa_svg fas.fa-cloud-arrow-down %} 资源链接: </strong></span>
{% if event.audio %}
<a data-toggle="tooltip" title="录音下载" class="badge text-bg-info" href="{{event.audio}}" target="_blank">{% fa_svg fas.fa-headphones %}</a>
{% endif %}
{% if event.video %}
<a data-toggle="tooltip" title="录像下载" class="badge text-bg-info" href="{{event.video}}" target="_blank">{% fa_svg fas.fa-video %}</a>
{% endif %}
{% if event.youtube %}
<a data-toggle="tooltip" title="YouTube 在线播放" class="badge text-bg-info" href="{{event.youtube}}" target="_blank">{% fa_svg fab.fa-youtube %}</a>
{% endif %}
{% if event.slides %}
<a data-toggle="tooltip" title="讲稿下载" class="badge text-bg-info" href="{{event.slides}}" target="_blank">{% fa_svg fas.fa-file %}</a>
{% endif %}
{% endif %}
</div>
<div class="event-content">
{{ event.excerpt }}
</div>
<p><a href="{{ event.url | prepend: site.baseurl }}">[Read More]</a></p>
</div>
<div class="col-lg-3">
{% if event.poster %}
<img class="img-fluid event-poster" src="{%if event.poster contains 'http:' or event.poster contains 'https:'%}{{event.poster}}{%else%}{{"/assets/img/events/"|prepend: site.baseurl}}{{event.poster}}{%endif%}" />
{% endif %}
</div>
</div>
<hr />
{% endfor %}
</div><!--/col-lg-8 -->
</div><!--/row -->
</div><!--/container -->
<script type="text/javascript">
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
var today = function() {
var pad = function (number) {
var r = String(number);
if ( r.length === 1 ) {
r = '0' + r;
}
return r;
}
var _today = new Date();
return Date.parse(
_today.getFullYear().toString() + "-"
+ pad(_today.getMonth()+1) + "-"
+ pad(_today.getDate())
);
}();
$('#events-list .event').each(function() {
console.log($(this).attr("data-event-date"));
var event_date = Date.parse($(this).attr("data-event-date"));
if (today < event_date) {
var label = "<span class='label label-warning'>Upcoming</span>";
$(this).find(".event-tags").prepend(label);
}
});
});
</script>