<link rel="Shortcut Icon" href="//www.tld-linux.org/favicon.ico"/>
<title>TLD builder queue</title>
<link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="style.css">
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
- <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.3/jquery.timeago.min.js"></script>
- <script type="text/javascript" src="script.js"></script>
</head>
<body>
-<div id="header">
- <div id="requesters-filter">Filter by requesters:<br></div>
-</div>
<div id="content">
"""
)
f.write(
"<div id=\"%(no)d\" class=\"request %(flags)s\">\n"
"<a href=\"#%(no)d\">%(no)d</a>. "
- "<time class=\"timeago\" title=\"%(datetime)s\" datetime=\"%(datetime)s\">%(time)s</time> "
+ "<time title=\"%(datetime)s\" datetime=\"%(datetime)s\">%(time)s</time> "
"from <b class=requester>%(requester)s</b> "
"<small>%(id)s, prio=%(priority)d, jobs=%(max_jobs)d, %(flags)s</small>\n"
% {
r.close()
os.umask(old_umask)
-def write_js():
- js_src = os.path.join(os.path.dirname(__file__), 'script.js')
- js_file = path.www_dir + '/script.js'
- # skip if file exists and code is not newer
- if os.path.exists(js_file) and os.stat(js_src).st_mtime < os.stat(js_file).st_mtime:
- return
-
- old_umask = os.umask(0o0022)
- r = open(js_src, 'r')
- f = open(js_file, 'w')
- f.write(r.read())
- f.close()
- r.close()
- os.umask(old_umask)
-
def main(srv_ssl=False):
write_css();
- write_js();
socket.setdefaulttimeout(30)
try:
init_conf()
+++ /dev/null
-jQuery(function($) {
- update_tz();
- filter_requesters();
-
- // setup relative time display
- function update_tz() {
- $('time.timeago').timeago();
- }
-
- // draw filter for requesters
- function filter_requesters() {
- var requesters = ['everyone'];
- $('div b.requester').each(function(i, d) {
- var requester = $(d).text();
- if (!~requesters.indexOf(requester)) {
- requesters.push(requester);
- }
- });
-
- var $filter = $('#requesters-filter');
- if ($filter.length == 0) {
- $filter = $('<div id=requesters-filter>Filter by requesters:<br></div>');
- $('body').prepend($filter);
- }
- requesters.forEach(function(r) {
- var $button = $('<button class=request-filter>'+ r + '</button>');
- $button.on('click', function() {
- $('div#requesters-filter button').removeAttr('disabled');
- $('div.request').filter(function(i, d) {
- var c = $(d).find('b.requester').text();
- if (c == r || r == 'everyone') {
- $(d).show();
- $button.attr('disabled', 'disabled');
- } else {
- $(d).hide();
- }
- })
- })
- $filter.append($button);
- });
- }
-});