-
Notifications
You must be signed in to change notification settings - Fork 3
/
kit-list.html
executable file
·113 lines (106 loc) · 3.06 KB
/
kit-list.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
102
103
104
105
106
107
108
109
110
111
112
113
<link rel="import" href="/components/polymer/polymer.html">
<link rel="import" href="/components/paper-input/paper-input.html">
<link rel="import" href="/post-service/post-service.html">
<link rel="import" href="kit-card.html">
<polymer-element name="kit-list" attributes="show">
<template>
<style>
:host {
display: block;
width: 100%;
}
kit-card {
margin-bottom: 30px;
}
core-icon-button {
position: absolute;
top: 3px;
right: 3px;
}
core-icon-button {
fill: #636363;
}
:host([favorite]) core-icon-button {
fill: #da4336;
}
.info-btn {
background: #fff000;
margin: 0 10px;
font-size: 12px;
min-width: 60px;
}
.share-btn {
background: #f39c12;
margin: 0;
font-size: 12px;
min-width: 60px;
}
@media (max-width: 600px) {
.info-btn {
background: #fff000;
margin: 0 10px;
font-size: 10px;
}
.share-btn {
font-size: 10px;
}
}
.flag-avatar {
width:70px;
height:70px;
min-height: 70px;
min-width: 70px;
}
.notes {
width: 100%;
color: #666;
}
a {
color: #333;
}
p {
color: #333;
}
</style>
<post-service id="service" posts="{{posts}}"></post-service>
<div layout vertical center hidden?="{{show == 'none'}}">
<h1>Info Kits</h1>
<h3>《雨傘運動懶人包》</h3>
<p> We've prepared localized info kits for you to read and share about <code>#umbrellaRevolution</code>.
<br>Welcome to download PDF to print as posters. </p>
<template repeat="{{post in posts}}" attributes="lang">
<kit-card>
<img src="{{post.avatar}}" class="flag-avatar">
<h2>{{post.lang_name}}</h2>
<a href="{{post.pdf_url}}" target="_blank">
<core-icon-button
id="favicon"
icon="file-download"
title="Download"
on-tap="{{PDFtapped}}"
hidden?="{{post.status != 'ready'}}"
> PDF
</core-icon-button>
</a>
<paper-button raised class="info-btn" hidden?="{{post.status != 'ready'}}" attributes="lang" lang="{{post.lang}}" on-tap="{{viewTapped}}">View</paper-button>
<p class="notes">{{post.notes}}</p>
<paper-button raised hidden?="{{post.status != 'ready'}}" class="share-btn" attributes="lang" lang="{{post.lang}}" on-tap="{{shareTapped}}">Share</paper-button>
</kit-card>
</template>
</div>
</template>
<script>
Polymer('kit-list', {
viewTapped: function(event, detail, sender) {
var kit = sender.templateInstance.model.post;
this.fire('view-tap', {lang: kit.lang});
},
PDFTapped: function(event, detail, sender) {
},
shareTapped : function(event, detail, sender) {
var kit = sender.templateInstance.model.post;
this.fire('share-tap', {lang: kit.lang});
}
});
</script>
</polymer-element>