Parent: [3abb2e] (diff)

Child: [c1be33] (diff)

Download this file

project_list.py    39 lines (34 with data), 1.0 kB

 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
import ew
class ProjectSummary(ew.Widget):
template='jinja:project_summary.html'
params=['value']
value=None
def resources(self):
yield ew.resource.JSLink('js/jquery.tools.min.js')
yield ew.JSScript('''
$(document).ready(function() {
var badges = $('small.badge');
var i = badges.length;
while(i){
i--;
var tipHolder = document.createElement('div');
tipHolder.id = "tip"+i;
tipHolder.className = "tip";
document.body.appendChild(tipHolder)
$(badges[i]).parent('a[title]').tooltip({
tip: '#tip'+i,
opacity: '.9',
offset: [-10,0]
});
}
});
''')
class ProjectList(ew.Widget):
template='jinja:project_list_widget.html'
params=['projects', 'project_summary', 'display_mode']
projects=[]
project_summary=ProjectSummary()
display_mode='list'
def resources(self):
for r in self.project_summary.resources():
yield r