forked from jenkins-infra/cn.jenkins.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent-calendar.html.haml
77 lines (63 loc) · 2.43 KB
/
event-calendar.html.haml
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
---
layout: default
title: "活动日历"
# no such section (yet)
section: events
notitle: true
---
/ Some more spacing from the navbar
.pt-4
.container
.row
%h1
活动日历
.row
.col
#calendar-container
-# This div's innerHTML will be overwritten with the
-# calendar iframe set to the appropriate time zone.
%p
在下面的时区下查看日历:
%select#selected_timezone{:onChange => "set_calendar(this.value)"}
%option{:value => ''}= '(自动)'
%option{:value => 'GMT'}= '格林威治时间'
%option{:value => 'CET'}= '欧洲中部'
%option{:value => 'America/New_York'}= '美国东部'
%option{:value => 'America/Los_Angeles'}= '美国太平洋'
%option{:value => 'Asia/Tokyo'}= '东京'
%option{:value => 'Asia/Shanghai'}= '上海'
-# Text at one time kept on the wiki
-# https://wiki.jenkins.io/display/JENKINS/Jenkins+Event+Calendar
%h3
关于该日历
%p
该页面跟踪与 Jenkins 相关即将到来的活动。
%h3
修改
%p
需要修改的话,请
%a{:href => expand_link('mailing-lists/')}
给我们发邮件
,说明活动以便我们可以添加。
如果您希望添加很多活动,我们也很乐意给您直接编辑的权限。
-# JSTZ time zone detection library (https://bitbucket.org/pellepim/jstimezonedetect)
%script{:type => "text/javascript",
:src => "https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.6/jstz.min.js" }
%script{type: "text/javascript"}
:plain
var deviceTimeZone = jstz.determine().name();
var calendarSrc = 'https://calendar.google.com/calendar/b/1/embed'
+ '?showCalendars=0&height=600&wkst=1&bgcolor=%23FFFFFF'
+ '&src=4ss12f0mqr3tbp1t2fe369slf4%40group.calendar.google.com&color=%2329527A'
+ '&ctz='
var calendarSrcPrefix = '<iframe src="' + calendarSrc;
var calendarSrcSuffix = '" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>';
function set_calendar(timezone) {
timezone = timezone || deviceTimeZone;
var iframe_html = calendarSrcPrefix + encodeURIComponent(timezone) + calendarSrcSuffix;
document.getElementById('calendar-container').innerHTML = iframe_html;
};
$(document).ready( function() {
set_calendar();
} );