-
Notifications
You must be signed in to change notification settings - Fork 6
/
events.html
101 lines (88 loc) · 3.31 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
100
101
---
layout: default
title: 活动与授课
permalink: /events/
---
<div class="container mtb">
<div class="row">
<div class="col-lg-10 col-lg-offset-1" id="events-list">
{% for event in site.categories['event'] %}
<div class="row event" data-event-date="{{event.date | date: " %F"}}">
<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">
<span><strong>时间: </strong>{{event.date | date: "%F"}}{% if event.time %} {{event.time}} {% endif %}</span>
<span><strong>地点:</strong> {{event.place}}</span>
<span class="event-tags">
{% for type in event.types %}
<span class="label label-success">{{type}}</span>
{% endfor %}
</span>
{% if event.podcast or event.slides or event.bilibili %}
<br>
<span><strong>资源: </strong></span>
{% if event.audio %}
<a data-toggle="tooltip" title="播客" class="label label-info" href="{{event.podcast}}" target="_blank"><i
class="fa fa-podcast fa-fw"></i></a>
{% endif %}
{% if event.bilibili %}
<a data-toggle="tooltip" title="Bilibili" class="label label-info" href="{{event.bilibili}}"
target="_blank"><i class="fa fa-video-camera fa-fw"></i></a>
{% endif %}
{% if event.slides %}
<a data-toggle="tooltip" title="讲稿" class="label label-info" href="{{event.slides}}" target="_blank"><i
class="fa fa-file-alt fa-fw"></i></a>
{% endif %}
{% endif %}
</div>
<div class="event-content">
{{ event.excerpt }}
</div>
<p><a href="{{ event.url | prepend: site.baseurl }}">[详情]</a></p>
</div>
<div class="col-lg-3">
{% if event.poster %}
<img class="img-responsive event-poster"
src="{%if event.poster contains 'http:' or event.poster contains 'https:'%}{{event.poster}}{%else%}{{"
/assets/img/events/"|prepend: site.url}}{{event.poster}}{%endif%}" />
{% endif %}
</div>
</div>
<div class="hline"></div>
<div class="spacing"></div>
{% 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'>即将举办</span>";
$(this).find(".event-tags").prepend(label);
}
});
});
</script>