Initial jinja2 porting work
This commit is contained in:
parent
dbb60e91f3
commit
dee1127ce8
59 changed files with 3129 additions and 2797 deletions
|
|
@ -62,6 +62,7 @@ except ImportError:
|
|||
import dnf
|
||||
|
||||
import Cheetah.Template
|
||||
import jinja2
|
||||
import librepo
|
||||
import requests
|
||||
import rpm
|
||||
|
|
@ -2104,6 +2105,7 @@ class WrapperRPMTask(BaseBuildTask):
|
|||
def handler(self, spec_url, build_target, build, task, opts=None):
|
||||
if not opts:
|
||||
opts = {}
|
||||
self.opts = opts
|
||||
|
||||
if not (build or task):
|
||||
raise koji.BuildError('build and/or task must be specified')
|
||||
|
|
@ -2286,13 +2288,8 @@ class WrapperRPMTask(BaseBuildTask):
|
|||
|
||||
# get the source before chown, git > 2.35.2 would refuse to that later
|
||||
source = scm.get_source()
|
||||
spec_template = None
|
||||
for path, dir, files in os.walk(specdir):
|
||||
files.sort()
|
||||
for filename in files:
|
||||
if filename.endswith('.spec.tmpl'):
|
||||
spec_template = os.path.join(path, filename)
|
||||
break
|
||||
|
||||
engine, spec_template = self.find_template(specdir)
|
||||
if not spec_template:
|
||||
raise koji.BuildError('no spec file template found at URL: %s' % spec_url)
|
||||
|
||||
|
|
@ -2313,13 +2310,12 @@ class WrapperRPMTask(BaseBuildTask):
|
|||
|
||||
# change directory to the specdir to the template can reference files there
|
||||
os.chdir(specdir)
|
||||
contents = Cheetah.Template.Template(file=spec_template,
|
||||
searchList=[values]).respond()
|
||||
contents = contents.encode('utf-8')
|
||||
|
||||
specfile = spec_template[:-5]
|
||||
with open(specfile, 'wb') as specfd:
|
||||
specfd.write(contents)
|
||||
if engine == 'cheetah':
|
||||
specfile = self.handle_cheetah(spec_template, values)
|
||||
elif engine == 'jinja':
|
||||
specfile = self.handle_jinja(spec_template, values)
|
||||
|
||||
uploadpath = self.getUploadDir()
|
||||
self.session.uploadWrapper(specfile, uploadpath)
|
||||
|
||||
|
|
@ -2475,6 +2471,51 @@ class WrapperRPMTask(BaseBuildTask):
|
|||
|
||||
return results
|
||||
|
||||
def find_template(self, specdir):
|
||||
# historically, spec templates were cheetah templates
|
||||
# now we support jinja as well
|
||||
spec_template = None
|
||||
engine = None
|
||||
for dirpath, dirnames, filenames in os.walk(specdir):
|
||||
for filename in sorted(filenames):
|
||||
if filename.endswith('.spec.tmpl'):
|
||||
spec_template = os.path.join(dirpath, filename)
|
||||
engine = 'cheetah'
|
||||
break
|
||||
if self.opts.get('jinja') and filename.endswith(('.spec.jinja', '.spec.j2')):
|
||||
spec_template = os.path.join(dirpath, filename)
|
||||
engine = 'jinja'
|
||||
break
|
||||
return engine, spec_template
|
||||
|
||||
def handle_cheetah(self, spec_template, values):
|
||||
"""Generate specfile from cheetah template"""
|
||||
contents = Cheetah.Template.Template(file=spec_template,
|
||||
searchList=[values]).respond()
|
||||
contents = contents.encode('utf-8')
|
||||
|
||||
# strip .tmpl
|
||||
specfile = spec_template[:-5]
|
||||
with open(specfile, 'wb') as specfd:
|
||||
specfd.write(contents)
|
||||
return specfile
|
||||
|
||||
def handle_jinja(self, spec_template, values):
|
||||
"""Generate specfile from jinja template"""
|
||||
env = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader('.'),
|
||||
autoescape=False # not html
|
||||
)
|
||||
path = os.path.relpath(spec_template)
|
||||
template = env.get_template(path)
|
||||
contents = template.render(**values)
|
||||
|
||||
# strip .j2 or .jinja ext
|
||||
specfile = os.path.splitext(spec_template)[0]
|
||||
with open(specfile, 'wt') as specfd:
|
||||
specfd.write(contents)
|
||||
return specfile
|
||||
|
||||
|
||||
class ChainMavenTask(MultiPlatformTask):
|
||||
|
||||
|
|
|
|||
190
devtools/convert-cheetah
Executable file
190
devtools/convert-cheetah
Executable file
|
|
@ -0,0 +1,190 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import os.path
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
from optparse import OptionParser
|
||||
|
||||
|
||||
"""
|
||||
Poorly convert some cheetah template code to jinja
|
||||
|
||||
This is NOT a full or accurate conversion, it is a set of simple
|
||||
tranformations that reduce some of the manual work.
|
||||
|
||||
Always review the changes.
|
||||
Always review the changes.
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
global subs
|
||||
global options
|
||||
parser = OptionParser(usage="%prog <filename>")
|
||||
parser.add_option('-w', '--write', action='store_true', help='write changes to file')
|
||||
options, args = parser.parse_args()
|
||||
options.args = args
|
||||
|
||||
if len(args) != 1:
|
||||
error('Please specify one template')
|
||||
fn = args[0]
|
||||
handle_file(fn)
|
||||
|
||||
|
||||
def handle_file(fn):
|
||||
outp = None
|
||||
if options.write:
|
||||
dirname = os.path.dirname(fn)
|
||||
basename = os.path.basename(fn)
|
||||
outfile = tempfile.NamedTemporaryFile(dir=dirname, mode='wt', prefix=f'_{basename}', delete=False)
|
||||
with outfile as outp:
|
||||
_handle_file(fn, outp)
|
||||
os.replace(outfile.name, fn)
|
||||
print(f'Wrote {fn}')
|
||||
else:
|
||||
_handle_file(fn, outp)
|
||||
|
||||
|
||||
def _handle_file(fn, outp):
|
||||
with open(fn, 'rt') as fp:
|
||||
for lineno, line in enumerate(fp):
|
||||
line = handle_line(lineno, line, outp)
|
||||
if line is not None and outp is not None:
|
||||
outp.write(line)
|
||||
|
||||
|
||||
def handle_line(lineno, line, outp):
|
||||
orig = line
|
||||
matches = 0
|
||||
skip = False
|
||||
rules = list(SUBS)
|
||||
while rules:
|
||||
prog, repl = rules.pop(0)
|
||||
last = line
|
||||
if repl == SKIP:
|
||||
m = prog.search(line)
|
||||
if m:
|
||||
print(f'{lineno}: Matched skip pattern {prog.pattern!r}')
|
||||
print(line, end='')
|
||||
skip = True
|
||||
line = orig
|
||||
break
|
||||
continue
|
||||
elif repl == DROP:
|
||||
m = prog.search(line)
|
||||
if m:
|
||||
print(f'{lineno}: Matched DROP pattern {prog.pattern!r}')
|
||||
print(line, end='')
|
||||
return None
|
||||
elif repl == BREAK:
|
||||
m = prog.search(line)
|
||||
if m:
|
||||
print(f'{lineno}: Matched BREAK pattern {prog.pattern!r}')
|
||||
print(line, end='')
|
||||
break
|
||||
elif isinstance(repl, Jump):
|
||||
# forget remaing rules and use target rules from here
|
||||
m = prog.search(line)
|
||||
if m:
|
||||
rules = list(repl.target)
|
||||
else:
|
||||
line, n = prog.subn(repl, line)
|
||||
if n:
|
||||
matches += n
|
||||
print(f'{lineno}: Matched {prog.pattern!r} (count: {n})')
|
||||
if matches:
|
||||
print(f'Made {matches} substitutions for line {lineno}')
|
||||
print(f'ORIG: {orig}', end='')
|
||||
print(f' NEW: {line}')
|
||||
return collapse(line)
|
||||
|
||||
|
||||
def rules(subs):
|
||||
# compile subs
|
||||
return [(re.compile(pat, flags), repl) for pat, repl, flags in subs]
|
||||
|
||||
|
||||
class Jump:
|
||||
# jump to new set of substitutions
|
||||
def __init__(self, target):
|
||||
self.target = target
|
||||
|
||||
|
||||
SKIP = ('skip subs for this line',)
|
||||
DROP = ('drop line',)
|
||||
BREAK = ('stop subs checks for this line',)
|
||||
STATE = rules([
|
||||
# subrules for some line statements
|
||||
[r'[$]', '', 0],
|
||||
[r'len\(([\w.$]+)\)', r'(\1 |length)', 0 ],
|
||||
])
|
||||
SUBS = rules([
|
||||
# [pattern, replacement, flags]
|
||||
[r'util.(toggleOrder|rowToggle|sortImage|passthrough_except|passthrough|authToken)\b', r'util.\g<1>2', 0],
|
||||
[r'(#include .*)header.chtml', r'\1header2.chtml', 0],
|
||||
[r'(#include .*)footer.chtml', r'\1footer2.chtml', 0],
|
||||
[r'^#import', DROP, 0],
|
||||
[r'^#from .* import', DROP, 0],
|
||||
[r'^\s*#(if|for|elif|set)', Jump(STATE), 0],
|
||||
[r'#end if', r'#endif', 0],
|
||||
[r'#end for', r'#endfor', 0],
|
||||
[r'[(][$]self, ', r'(', 0 ],
|
||||
[r'\([$]self\)', r'()', 0 ],
|
||||
[r'len\(([\w.$]+)\)', r'(\1 |length)', 0 ],
|
||||
[r'[$](([\w.]+)[(][^()]*[)])', r'{{ \1 }}', 0 ],
|
||||
[r'${\s*([^{}]+)\s*}', r'{{ \1 }}', 0 ],
|
||||
[r'#echo ([^#]+)#', r'{{ \1 }}', 0 ],
|
||||
[r'#if ([^#]+) then ([^#]+) else ([^#]+)\s*#', r'{{ \2 if \1 else \3 }}', 0 ],
|
||||
[r'''[$]([\w.]+)\['(\w+)'\]''', r'{{ \1.\2 }}', 0],
|
||||
[r'''[$]([\w.]+)\["(\w+)"\]''', r'{{ \1.\2 }}', 0],
|
||||
[r'[$]([\w.]+)[([]', SKIP, 0],
|
||||
[r'^(\s*)#attr ', r'\1#set ', 0],
|
||||
[r'^\s*#', BREAK, 0],
|
||||
[r'[$]([\w.]+)', r'{{ \1 }}', 0],
|
||||
])
|
||||
|
||||
|
||||
def error(msg):
|
||||
print(msg)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
BRACES = re.compile(r'({{ | }})')
|
||||
|
||||
def collapse(line):
|
||||
"""Collapse nested double braces"""
|
||||
tokens = BRACES.split(line)
|
||||
|
||||
depth = 0
|
||||
tokens2 = []
|
||||
for tok in tokens:
|
||||
if tok == '{{ ':
|
||||
# only keep braces at the outer layer
|
||||
if depth == 0:
|
||||
tokens2.append(tok)
|
||||
depth += 1
|
||||
elif tok == ' }}':
|
||||
depth -= 1
|
||||
if depth < 0:
|
||||
warning("Brace mismatch. Can't collapse")
|
||||
break
|
||||
elif depth == 0:
|
||||
# only keep braces at the outer layer
|
||||
tokens2.append(tok)
|
||||
else:
|
||||
# keep everything else
|
||||
tokens2.append(tok)
|
||||
|
||||
if depth < 0:
|
||||
warning('Unexpected }}')
|
||||
return line
|
||||
elif depth > 0:
|
||||
warning('Missing }}')
|
||||
return line
|
||||
else:
|
||||
return ''.join(tokens2)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
@ -2,9 +2,11 @@
|
|||
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import ast
|
||||
import mimetypes
|
||||
import os
|
||||
import os.path
|
||||
import optparse
|
||||
import pprint
|
||||
import sys
|
||||
from urllib.parse import quote
|
||||
|
|
@ -17,6 +19,7 @@ sys.path.insert(0, CWD)
|
|||
sys.path.insert(1, os.path.join(CWD, 'www/lib'))
|
||||
sys.path.insert(1, os.path.join(CWD, 'www/kojiweb'))
|
||||
import wsgi_publisher
|
||||
import index as kojiweb_handlers
|
||||
|
||||
|
||||
def get_url(environ):
|
||||
|
|
@ -122,11 +125,75 @@ def application(environ, start_response):
|
|||
return wsgi_publisher.application(environ, start_response)
|
||||
|
||||
|
||||
def nice_literal(value):
|
||||
try:
|
||||
return ast.literal_eval(value)
|
||||
except (ValueError, SyntaxError):
|
||||
return value
|
||||
|
||||
|
||||
def get_options():
|
||||
parser = optparse.OptionParser(usage='%prog [options]')
|
||||
# parser.add_option('--pdb', action='store_true',
|
||||
# help='drop into pdb on error')
|
||||
parser.add_option('--user', '-u', help='fake login as user')
|
||||
parser.add_option('-o', '--config-option', help='override config option',
|
||||
action='append', metavar='NAME=VALUE')
|
||||
opts, args = parser.parse_args()
|
||||
|
||||
if args:
|
||||
parser.error('This command takes no args, just options')
|
||||
|
||||
if opts.config_option:
|
||||
overrides = {}
|
||||
for s in opts.config_option:
|
||||
k, v = s.split('=', 1)
|
||||
v = nice_literal(v)
|
||||
overrides[k] = v
|
||||
opts.config_option = overrides
|
||||
|
||||
return opts
|
||||
|
||||
|
||||
def override_load_config(opts):
|
||||
original_load_config = wsgi_publisher.Dispatcher.load_config
|
||||
|
||||
def my_load_config(_self, environ):
|
||||
oldopts = original_load_config(_self, environ)
|
||||
oldopts.update(opts)
|
||||
_self.options = oldopts
|
||||
return oldopts
|
||||
|
||||
wsgi_publisher.Dispatcher.load_config = my_load_config
|
||||
|
||||
|
||||
def fake_login(user):
|
||||
original_assertLogin = kojiweb_handlers._assertLogin
|
||||
original_getServer = kojiweb_handlers._getServer
|
||||
|
||||
def my_assertLogin(environ):
|
||||
pass
|
||||
|
||||
def my_getServer(environ):
|
||||
session = original_getServer(environ)
|
||||
environ['koji.currentUser'] = session.getUser(user)
|
||||
return session
|
||||
|
||||
kojiweb_handlers._assertLogin = my_assertLogin
|
||||
kojiweb_handlers._getServer = my_getServer
|
||||
|
||||
|
||||
def main():
|
||||
options = get_options()
|
||||
if options.config_option:
|
||||
override_load_config(options.config_option)
|
||||
if options.user:
|
||||
fake_login(options.user)
|
||||
# koji.add_file_logger('koji', 'fakeweb.log')
|
||||
httpd = make_server('', 8000, application)
|
||||
print("Serving kojiweb on http://localhost:8000 ...")
|
||||
httpd.serve_forever()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
|||
158
tests/test_builder/test_wrapperRPM.py
Normal file
158
tests/test_builder/test_wrapperRPM.py
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
from __future__ import absolute_import
|
||||
try:
|
||||
from unittest import mock
|
||||
except ImportError:
|
||||
import mock
|
||||
import os
|
||||
import rpm
|
||||
import shutil
|
||||
import tempfile
|
||||
import threading
|
||||
import unittest
|
||||
import koji
|
||||
import koji.tasks
|
||||
from .loadkojid import kojid
|
||||
from six.moves import range
|
||||
from functools import partial
|
||||
|
||||
|
||||
mylock = threading.Lock()
|
||||
|
||||
|
||||
class TestWrapperRPM(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.tempdir = tempfile.mkdtemp()
|
||||
self.session = mock.MagicMock()
|
||||
self.options = mock.MagicMock()
|
||||
self.options.copy_old_repodata = False
|
||||
self.options.createrepo_update = True
|
||||
self.topdir = self.tempdir + '/topdir'
|
||||
self.options.topdir = self.topdir
|
||||
self.pathinfo = koji.PathInfo(self.topdir)
|
||||
mock.patch('koji.pathinfo', new=self.pathinfo).start()
|
||||
|
||||
# set up task handler
|
||||
task_id = 99
|
||||
method = 'wrapperRPM'
|
||||
self.spec_url = 'SPEC_URL'
|
||||
self.target = {'id': 123, 'name': 'TARGET', 'build_tag': 456}
|
||||
self.build = {'id': 12345, 'state': 1, 'name': '_name', 'version': '_version',
|
||||
'release': '_release'}
|
||||
self.task = None
|
||||
self.opts = {}
|
||||
params = [self.spec_url, self.target, self.build, self.task, self.opts]
|
||||
self.handler = kojid.WrapperRPMTask(task_id, method, params, self.session,
|
||||
self.options, self.tempdir + '/work')
|
||||
|
||||
self.handler.find_arch = mock.MagicMock()
|
||||
self.handler.chownTree = mock.MagicMock()
|
||||
self.handler.localPath = self.my_localPath
|
||||
|
||||
# mock some more things
|
||||
self.wait = mock.MagicMock()
|
||||
self.handler.wait = self.wait
|
||||
self.session.getExternalRepoList.return_value = []
|
||||
self.SCM = mock.patch.object(kojid, 'SCM').start()
|
||||
self.SCM.return_value.assert_allowed = mock.MagicMock()
|
||||
self.SCM.return_value.checkout.side_effect = self.my_checkout
|
||||
self.BuildRoot = mock.patch.object(kojid, 'BuildRoot').start()
|
||||
self.BuildRoot().resultdir.return_value = self.tempdir + '/result'
|
||||
mock.patch('pwd.getpwnam').start()
|
||||
mock.patch('grp.getgrnam').start()
|
||||
|
||||
# default to a maven build
|
||||
self.session.getMavenBuild.return_value = {'build_id': 12345, 'artifact_id': 'ARTIFACT'}
|
||||
self.session.getWinBuild.return_value = None
|
||||
self.session.getImageBuild.return_value = None
|
||||
|
||||
self.session.listArchives.return_value = [{'id': 999, 'filename': 'test.pom',
|
||||
'group_id': 'GROUP', 'artifact_id': 'ARTIFACT',
|
||||
'version': 'VERSION', 'name': 'NAME'}]
|
||||
# This handler relies on chdir
|
||||
mylock.acquire()
|
||||
self.savecwd = os.getcwd()
|
||||
|
||||
def tearDown(self):
|
||||
# clean up the chdir
|
||||
os.chdir(self.savecwd)
|
||||
mylock.release()
|
||||
mock.patch.stopall()
|
||||
shutil.rmtree(self.tempdir)
|
||||
|
||||
def my_checkout(self, *a, **kw):
|
||||
return self.my_checkout2(['foo.spec.tmpl'], *a, **kw)
|
||||
|
||||
def my_checkout2(self, relpaths, *a, **kw):
|
||||
scmdir = self.tempdir + '/checkout'
|
||||
koji.ensuredir(scmdir)
|
||||
for relpath in relpaths:
|
||||
fn = koji.util.joinpath(scmdir, relpath)
|
||||
with open(fn, 'wt') as fp:
|
||||
fp.write(f'Hello World\n{relpath}\n')
|
||||
return scmdir
|
||||
|
||||
def my_localPath(self, relpath):
|
||||
path = koji.util.joinpath(self.tempdir, relpath)
|
||||
koji.ensuredir(os.path.dirname(path))
|
||||
with open(path, 'wt') as fp:
|
||||
fp.write('Hola Mundo\n')
|
||||
return path
|
||||
|
||||
def write_srpm(self):
|
||||
fn = self.tempdir + '/result/foo.src.rpm'
|
||||
koji.ensuredir(os.path.dirname(fn))
|
||||
with open(fn, 'wt') as fp:
|
||||
fp.write('Bonjour le monde\n')
|
||||
|
||||
def my_build(self, *a, **kw):
|
||||
self.write_srpm()
|
||||
fn = self.tempdir + '/result/foo.noarch.rpm'
|
||||
koji.ensuredir(os.path.dirname(fn))
|
||||
with open(fn, 'wt') as fp:
|
||||
fp.write('Ahoj světe\n')
|
||||
|
||||
def test_basic(self):
|
||||
# self.session.getTag.return_value = {'id': 'TAGID', 'name': 'TAG'}
|
||||
self.write_srpm()
|
||||
# rewrite the srpm when build is called
|
||||
self.BuildRoot().build.side_effect = self.my_build
|
||||
|
||||
# this handler relies on os.chdir
|
||||
result = self.handler.run()
|
||||
|
||||
self.assertEqual(result['srpm'], 'foo.src.rpm')
|
||||
self.assertEqual(result['rpms'], ['foo.noarch.rpm'])
|
||||
|
||||
|
||||
def test_basic_jinja(self):
|
||||
# self.session.getTag.return_value = {'id': 'TAGID', 'name': 'TAG'}
|
||||
self.write_srpm()
|
||||
# rewrite the srpm when build is called
|
||||
self.BuildRoot().build.side_effect = self.my_build
|
||||
# use a jinja template
|
||||
self.SCM.return_value.checkout.side_effect = partial(self.my_checkout2, ['foo.spec.j2'])
|
||||
|
||||
# this handler relies on os.chdir
|
||||
self.opts['jinja'] = True
|
||||
result = self.handler.run()
|
||||
|
||||
self.assertEqual(result['srpm'], 'foo.src.rpm')
|
||||
self.assertEqual(result['rpms'], ['foo.noarch.rpm'])
|
||||
|
||||
def test_jinja_requires_opt(self):
|
||||
# self.session.getTag.return_value = {'id': 'TAGID', 'name': 'TAG'}
|
||||
self.write_srpm()
|
||||
# rewrite the srpm when build is called
|
||||
self.BuildRoot().build.side_effect = self.my_build
|
||||
# use a jinja template
|
||||
self.SCM.return_value.checkout.side_effect = partial(self.my_checkout2, ['foo.spec.j2'])
|
||||
|
||||
# this handler relies on os.chdir
|
||||
with self.assertRaises(koji.BuildError) as ex:
|
||||
result = self.handler.run()
|
||||
|
||||
self.assertIn('no spec file template found', str(ex.exception))
|
||||
|
||||
|
||||
# the end
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
from unittest import mock
|
||||
import unittest
|
||||
|
||||
import koji
|
||||
from .loadwebindex import webidx
|
||||
|
||||
|
||||
|
|
@ -26,7 +27,8 @@ class TestRepoInfo(unittest.TestCase):
|
|||
self.get_server.return_value = self.server
|
||||
|
||||
self.server.repoInfo.return_value = {'dist': True, 'id': int(self.repo_id),
|
||||
'tag_name': 'test-tag'}
|
||||
'tag_name': 'test-tag', 'state': koji.REPO_READY,
|
||||
'create_ts': 1735707600.0}
|
||||
self.server.listBuildroots.return_value = []
|
||||
|
||||
webidx.repoinfo(self.environ, self.repo_id)
|
||||
|
|
@ -38,7 +40,8 @@ class TestRepoInfo(unittest.TestCase):
|
|||
self.get_server.return_value = self.server
|
||||
|
||||
self.server.repoInfo.return_value = {'dist': False, 'id': int(self.repo_id),
|
||||
'tag_name': 'test-tag'}
|
||||
'tag_name': 'test-tag', 'state': koji.REPO_READY,
|
||||
'create_ts': 1735707600.0}
|
||||
self.server.listBuildroots.return_value = [{'id': 1, 'repo_id': int(self.repo_id)}]
|
||||
|
||||
webidx.repoinfo(self.environ, self.repo_id)
|
||||
|
|
|
|||
|
|
@ -1,28 +1,26 @@
|
|||
#include "includes/header.chtml"
|
||||
#import koji
|
||||
#from kojiweb import util
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#attr _PASSTHROUGH = ['userID']
|
||||
#set _PASSTHROUGH = ['userID']
|
||||
|
||||
<h4>Active sessions for $loggedInUser.name user</h4>
|
||||
<h4>Active sessions for {{ loggedInUser.name }} user</h4>
|
||||
<br>
|
||||
<table class="data-list">
|
||||
<tr class="list-header">
|
||||
<th><a href="activesession?order=$util.toggleOrder($self, 'id')$util.passthrough_except($self, 'order')">Session ID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="activesession?order=$util.toggleOrder($self, 'hostip')$util.passthrough_except($self, 'order')">Client IP</a> $util.sortImage($self, 'hostip')</th>
|
||||
<th><a href="activesession?order=$util.toggleOrder($self, 'authtype')$util.passthrough_except($self, 'order')">Auth type</a> $util.sortImage($self, 'authtype')</th>
|
||||
<th><a href="activesession?order=$util.toggleOrder($self, 'start_time')$util.passthrough_except($self, 'order')">Session start time</a> $util.sortImage($self, 'start_time')</th>
|
||||
<th><a href="activesession?order=$util.toggleOrder($self, 'start_time')$util.passthrough_except($self, 'order')">Length session</a> $util.sortImage($self, 'start_time')</th>
|
||||
<th><a href="activesession?order=$util.toggleOrder($self, 'id')$util.passthrough_except($self, 'order')">Logout?</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="activesession?order={{ util.toggleOrder('id') }}{{ util.passthrough_except('order') }}">Session ID</a> {{ util.sortImage('id') }}</th>
|
||||
<th><a href="activesession?order={{ util.toggleOrder('hostip') }}{{ util.passthrough_except('order') }}">Client IP</a> {{ util.sortImage('hostip') }}</th>
|
||||
<th><a href="activesession?order={{ util.toggleOrder('authtype') }}{{ util.passthrough_except('order') }}">Auth type</a> {{ util.sortImage('authtype') }}</th>
|
||||
<th><a href="activesession?order={{ util.toggleOrder('start_time') }}{{ util.passthrough_except('order') }}">Session start time</a> {{ util.sortImage('start_time') }}</th>
|
||||
<th><a href="activesession?order={{ util.toggleOrder('start_time') }}{{ util.passthrough_except('order') }}">Length session</a> {{ util.sortImage('start_time') }}</th>
|
||||
<th><a href="activesession?order={{ util.toggleOrder('id') }}{{ util.passthrough_except('order') }}">Logout?</a> {{ util.sortImage('id') }}</th>
|
||||
</tr>
|
||||
#for $act in $activesess
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$act.id</td>
|
||||
<td>$act.hostip</td>
|
||||
<td>$act.authtype</td>
|
||||
<td>$util.formatTimeLong($act.start_time)</td>
|
||||
<td>$act.lengthSession days</td>
|
||||
<td><a href="activesessiondelete?sessionID=$act.id$util.authToken($self)">Logout</a></td>
|
||||
#for act in activesess
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ act.id }}</td>
|
||||
<td>{{ act.hostip }}</td>
|
||||
<td>{{ act.authtype }}</td>
|
||||
<td>{{ util.formatTimeLong(act.start_time) }}</td>
|
||||
<td>{{ act.lengthSession }} days</td>
|
||||
<td><a href="activesessiondelete?sessionID={{ act.id }}{{ util.authToken() }}">Logout</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "includes/header.chtml"
|
||||
#import koji
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>API reference <small>(hub version: $koji_version, web version: $koji.__version__)</small></h4>
|
||||
<h4>API reference <small>(hub version: {{ koji_version }}, web version: {{ web_version }})</small></h4>
|
||||
|
||||
Various constants used in API calls can be found in first part of <a
|
||||
href="https://pagure.io/koji/blob/master/f/koji/__init__.py">koji module</a>.
|
||||
|
|
@ -15,7 +14,7 @@ Basic anonymous client in python would look like this:
|
|||
import koji
|
||||
|
||||
mytag = "mytag"
|
||||
session = koji.ClientSession("$koji_hub_url")
|
||||
session = koji.ClientSession("{{ koji_hub_url }}")
|
||||
try:
|
||||
repo_info = session.getRepo(mytag, koji.REPO_STATES["READY"], dist=True)
|
||||
if not repo_info:
|
||||
|
|
@ -26,13 +25,13 @@ except koji.GenericError:
|
|||
|
||||
<h4>List of API calls</h4>
|
||||
<ul>
|
||||
#for method in $methods
|
||||
#for method in methods
|
||||
<li>
|
||||
<pre><b>$method['name']$method['argdesc']</b>
|
||||
$method['doc']
|
||||
<pre><b>{{ method['name'] ~ method['argdesc'] }}</b>
|
||||
{{ method['doc'] }}
|
||||
</pre>
|
||||
</li>
|
||||
#end for
|
||||
#endfor
|
||||
</ul>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,163 +1,159 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
#from pprint import pformat
|
||||
#from urllib.parse import quote
|
||||
|
||||
#attr _PASSTHROUGH = ['archiveID', 'fileOrder', 'fileStart', 'buildrootOrder', 'buildrootStart']
|
||||
#set _PASSTHROUGH = ['archiveID', 'fileOrder', 'fileStart', 'buildrootOrder', 'buildrootStart']
|
||||
|
||||
#include "includes/header.chtml"
|
||||
<h4>Information for archive <a href="archiveinfo?archiveID=$archive.id">$archive.filename</a></h4>
|
||||
#include "includes/header2.chtml"
|
||||
<h4>Information for archive <a href="archiveinfo?archiveID={{ archive.id }}">{{ archive.filename }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th><td>$archive.id</td>
|
||||
<th>ID</th><td>{{ archive.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#if $wininfo
|
||||
<th>File Name</th><td>$koji.pathinfo.winfile($archive)</td>
|
||||
#if wininfo
|
||||
<th>File Name</th><td>{{ koji.pathinfo.winfile(archive) }}</td>
|
||||
#else
|
||||
<th>File Name</th><td>$archive.filename</td>
|
||||
#end if
|
||||
<th>File Name</th><td>{{ archive.filename }}</td>
|
||||
#endif
|
||||
</tr>
|
||||
#if $archive.metadata_only
|
||||
#if archive.metadata_only
|
||||
<tr>
|
||||
<th>Metadata only</th><td>True (file not imported)</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>File Type</th><td>$archive_type.description</td>
|
||||
<th>File Type</th><td>{{ archive_type.description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Build</th><td><a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a></td>
|
||||
<th>Build</th><td><a href="buildinfo?buildID={{ build.id }}">{{ koji.buildLabel(build) }}</a></td>
|
||||
</tr>
|
||||
#if $maveninfo
|
||||
#if maveninfo
|
||||
<tr>
|
||||
<th>Maven groupId</th><td>$archive.group_id</td>
|
||||
<th>Maven groupId</th><td>{{ archive.group_id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Maven artifactId</th><td>$archive.artifact_id</td>
|
||||
<th>Maven artifactId</th><td>{{ archive.artifact_id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Maven version</th><td>$archive.version</td>
|
||||
<th>Maven version</th><td>{{ archive.version }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Size</th><td><span title="$util.formatThousands($archive.size)">$util.formatNatural($archive.size)</span></td>
|
||||
<th>Size</th><td><span title="{{ util.formatThousands(archive.size) }}">{{ util.formatNatural(archive.size) }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Checksum</th><td>$archive.checksum</td>
|
||||
<th>Checksum</th><td>{{ archive.checksum }}</td>
|
||||
</tr>
|
||||
#if $wininfo
|
||||
#if wininfo
|
||||
<tr>
|
||||
<th>Platforms</th><td>$archive.platforms</td>
|
||||
<th>Platforms</th><td>{{ archive.platforms }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Flags</th><td>$archive.flags</td>
|
||||
<th>Flags</th><td>{{ archive.flags }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $builtInRoot
|
||||
#endif
|
||||
#if builtInRoot
|
||||
<tr>
|
||||
<th>Buildroot</th><td><a href="buildrootinfo?buildrootID=$builtInRoot.id">$util.brLabel($builtInRoot)</a></td>
|
||||
<th>Buildroot</th><td><a href="buildrootinfo?buildrootID={{ builtInRoot.id }}">{{ util.brLabel(builtInRoot) }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $archive.get('extra')
|
||||
#endif
|
||||
#if archive.get('extra')
|
||||
<tr>
|
||||
<th>Extra</th><td class="usertext">$pformat($archive.extra)</td>
|
||||
<th>Extra</th><td class="usertext">{{ archive.extra|pprint }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $files
|
||||
#endif
|
||||
#if files
|
||||
<tr>
|
||||
<th id="filelist">Files</th>
|
||||
<td class="container">
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($filePages) > 1
|
||||
#if (filePages |length) > 1
|
||||
<form class="pageJump">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'archiveinfo?fileStart=' + this.value * $fileRange + '$util.passthrough_except($self, 'fileStart')#filelist';">
|
||||
#for $pageNum in $filePages
|
||||
<option value="$pageNum"#if $pageNum == $fileCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'archiveinfo?fileStart=' + this.value * {{ fileRange }} + '{{ util.passthrough_except('fileStart') }}#filelist';">
|
||||
#for pageNum in filePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == fileCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $fileStart > 0
|
||||
<a href="archiveinfo?fileStart=#echo $fileStart - $fileRange#$util.passthrough_except($self, 'fileStart')#filelist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $fileStart + 1 # through #echo $fileStart + $fileCount # of $totalFiles</strong>
|
||||
#if $fileStart + $fileCount < $totalFiles
|
||||
<a href="archiveinfo?fileStart=#echo $fileStart + $fileRange#$util.passthrough_except($self, 'fileStart')#filelist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if fileStart > 0
|
||||
<a href="archiveinfo?fileStart={{ fileStart - fileRange }}{{ util.passthrough_except('fileStart') }}#filelist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ fileStart + 1 }} through {{ fileStart + fileCount }} of {{ totalFiles }}</strong>
|
||||
#if fileStart + fileCount < totalFiles
|
||||
<a href="archiveinfo?fileStart={{ fileStart + fileRange }}{{ util.passthrough_except('fileStart') }}#filelist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="archiveinfo?fileOrder=$util.toggleOrder($self, 'name', 'fileOrder')$util.passthrough_except($self, 'fileOrder', 'fileStart')#filelist">Name</a> $util.sortImage($self, 'name', 'fileOrder')</th>
|
||||
<th><a href="archiveinfo?fileOrder=$util.toggleOrder($self, 'size', 'fileOrder')$util.passthrough_except($self, 'fileOrder', 'fileStart')#filelist">Size</a> $util.sortImage($self, 'size', 'fileOrder')</th>
|
||||
<th><a href="archiveinfo?fileOrder={{ util.toggleOrder('name', 'fileOrder') }}{{ util.passthrough_except('fileOrder', 'fileStart') }}#filelist">Name</a> {{ util.sortImage('name', 'fileOrder') }}</th>
|
||||
<th><a href="archiveinfo?fileOrder={{ util.toggleOrder('size', 'fileOrder') }}{{ util.passthrough_except('fileOrder', 'fileStart') }}#filelist">Size</a> {{ util.sortImage('size', 'fileOrder') }}</th>
|
||||
</tr>
|
||||
#for $file in $files
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="fileinfo?archiveID=$archive.id&filename=$quote($file.name)">$file.name</a></td><td><span title="$util.formatThousands($file.size)">$util.formatNatural($file.size)</span></td>
|
||||
#for file in files
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="fileinfo?archiveID={{ archive.id }}&filename={{ file.name|urlencode }}">{{ file.name }}</a></td><td><span title="{{ util.formatThousands(file.size) }}">{{ util.formatNatural(file.size) }}</span></td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th id="buildrootlist">Component of</th>
|
||||
<td class="container">
|
||||
#if $len($buildroots) > 0
|
||||
#if (buildroots |length) > 0
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($buildrootPages) > 1
|
||||
#if (buildrootPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'archiveinfo?buildrootStart=' + this.value * $buildrootRange + '$util.passthrough_except($self, 'buildrootStart')#buildrootlist';">
|
||||
#for $pageNum in $buildrootPages
|
||||
<option value="$pageNum"#if $pageNum == $buildrootCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'archiveinfo?buildrootStart=' + this.value * {{ buildrootRange }} + '{{ util.passthrough_except('buildrootStart') }}#buildrootlist';">
|
||||
#for pageNum in buildrootPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildrootCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildrootStart > 0
|
||||
<a href="archiveinfo?buildrootStart=#echo $buildrootStart - $buildrootRange #$util.passthrough_except($self, 'buildrootStart')#buildrootlist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $buildrootStart + 1 # through #echo $buildrootStart + $buildrootCount # of $totalBuildroots</strong>
|
||||
#if $buildrootStart + $buildrootCount < $totalBuildroots
|
||||
<a href="archiveinfo?buildrootStart=#echo $buildrootStart + $buildrootRange#$util.passthrough_except($self, 'buildrootStart')#buildrootlist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildrootStart > 0
|
||||
<a href="archiveinfo?buildrootStart={{ buildrootStart - buildrootRange }}{{ util.passthrough_except('buildrootStart') }}#buildrootlist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ buildrootStart + 1 }} through {{ buildrootStart + buildrootCount }} of {{ totalBuildroots }}</strong>
|
||||
#if buildrootStart + buildrootCount < totalBuildroots
|
||||
<a href="archiveinfo?buildrootStart={{ buildrootStart + buildrootRange }}{{ util.passthrough_except('buildrootStart') }}#buildrootlist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="archiveinfo?buildrootOrder=$util.toggleOrder($self, 'id', 'buildrootOrder')$util.passthrough_except($self, 'buildrootOrder', 'buildrootStart')#buildrootlist">Buildroot</a> $util.sortImage($self, 'id', 'buildrootOrder')</th>
|
||||
<th><a href="archiveinfo?buildrootOrder=$util.toggleOrder($self, 'create_event_time', 'buildrootOrder')$util.passthrough_except($self, 'buildrootOrder', 'buildrootStart')#buildrootlist">Created</a> $util.sortImage($self, 'create_event_time', 'buildrootOrder')</th>
|
||||
<th><a href="archiveinfo?buildrootOrder=$util.toggleOrder($self, 'state', 'buildrootOrder')$util.passthrough_except($self, 'buildrootOrder', 'buildrootStart')#buildrootlist">State</a> $util.sortImage($self, 'state', 'buildrootOrder')</th>
|
||||
<th><a href="archiveinfo?buildrootOrder={{ util.toggleOrder('id', 'buildrootOrder') }}{{ util.passthrough_except('buildrootOrder', 'buildrootStart') }}#buildrootlist">Buildroot</a> {{ util.sortImage('id', 'buildrootOrder') }}</th>
|
||||
<th><a href="archiveinfo?buildrootOrder={{ util.toggleOrder('create_event_time', 'buildrootOrder') }}{{ util.passthrough_except('buildrootOrder', 'buildrootStart') }}#buildrootlist">Created</a> {{ util.sortImage('create_event_time', 'buildrootOrder') }}</th>
|
||||
<th><a href="archiveinfo?buildrootOrder={{ util.toggleOrder('state', 'buildrootOrder') }}{{ util.passthrough_except('buildrootOrder', 'buildrootStart') }}#buildrootlist">State</a> {{ util.sortImage('state', 'buildrootOrder') }}</th>
|
||||
</tr>
|
||||
#for $buildroot in $buildroots
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></td>
|
||||
<td>$util.formatTime($buildroot.create_event_time)</td>
|
||||
<td>$util.imageTag($util.brStateName($buildroot.state))</td>
|
||||
#for buildroot in buildroots
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></td>
|
||||
<td>{{ util.formatTime(buildroot.create_event_time) }}</td>
|
||||
<td>{{ util.imageTag(util.brStateName(buildroot.state)) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No buildroots
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#if $show_rpm_components
|
||||
#if show_rpm_components
|
||||
<tr>
|
||||
<th colspan="2"><a href="rpmlist?imageID=$archive.id&type=image" title="RPM components that are part of this archive">RPM components</a></th>
|
||||
<th colspan="2"><a href="rpmlist?imageID={{ archive.id }}&type=image" title="RPM components that are part of this archive">RPM components</a></th>
|
||||
</tr>
|
||||
#end if
|
||||
#if $show_archive_components
|
||||
#endif
|
||||
#if show_archive_components
|
||||
<tr>
|
||||
<th colspan="2"><a href="archivelist?imageID=$archive.id&type=image" title="Archive components that are part of this archive">Archive components</a></th>
|
||||
<th colspan="2"><a href="archivelist?imageID={{ archive.id }}&type=image" title="Archive components that are part of this archive">Archive components</a></th>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,94 +1,92 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#@util.safe_return
|
||||
#def getID()
|
||||
#if $type == 'image'
|
||||
imageID=$image.id #slurp
|
||||
#macro getID()
|
||||
#if type == 'image'
|
||||
imageID={{ image.id }}
|
||||
#else
|
||||
buildrootID=$buildroot.id #slurp
|
||||
#end if
|
||||
#end def
|
||||
buildrootID={{ buildroot.id }}
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#if $type == 'component'
|
||||
<h4>Component Archives of buildroot <a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></h4>
|
||||
#elif $type == 'image'
|
||||
<h4>Archives installed in <a href="archiveinfo?archiveID=$image.id">$image.filename</a></h4>
|
||||
#if type == 'component'
|
||||
<h4>Component Archives of buildroot <a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></h4>
|
||||
#elif type == 'image'
|
||||
<h4>Archives installed in <a href="archiveinfo?archiveID={{ image.id }}">{{ image.filename }}</a></h4>
|
||||
#else
|
||||
<h4>Archives built in buildroot <a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></h4>
|
||||
#end if
|
||||
<h4>Archives built in buildroot <a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></h4>
|
||||
#endif
|
||||
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="#if $type == 'component' then '3' else '2'#">
|
||||
#if $len($archivePages) > 1
|
||||
<td class="paginate" colspan="{{ '3' if type == 'component' else '2' }}">
|
||||
#if (archivePages |length) > 1
|
||||
<form class="pageJump">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'archivelist?$getID()&start=' + this.value * $archiveRange + '$util.passthrough($self, 'order', 'type')';">
|
||||
#for $pageNum in $archivePages
|
||||
<option value="$pageNum"#if $pageNum == $archiveCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'archivelist?{{ getID()|trim }}&start=' + this.value * {{ archiveRange }} + '{{ util.passthrough('order', 'type') }}';">
|
||||
#for pageNum in archivePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == archiveCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $archiveStart > 0
|
||||
<a href="archivelist?$getID()&start=#echo $archiveStart - $archiveRange #$util.passthrough($self, 'order', 'type')"><<<</a>
|
||||
#end if
|
||||
#if $totalArchives != 0
|
||||
<strong>Archives #echo $archiveStart + 1 # through #echo $archiveStart + $archiveCount # of $totalArchives</strong>
|
||||
#end if
|
||||
#if $archiveStart + $archiveCount < $totalArchives
|
||||
<a href="archivelist?$getID()&start=#echo $archiveStart + $archiveRange#$util.passthrough($self, 'order', 'type')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if archiveStart > 0
|
||||
<a href="archivelist?{{ getID()|trim }}&start={{ archiveStart - archiveRange }}{{ util.passthrough('order', 'type') }}"><<<</a>
|
||||
#endif
|
||||
#if totalArchives != 0
|
||||
<strong>Archives {{ archiveStart + 1 }} through {{ archiveStart + archiveCount }} of {{ totalArchives }}</strong>
|
||||
#endif
|
||||
#if archiveStart + archiveCount < totalArchives
|
||||
<a href="archivelist?{{ getID()|trim }}&start={{ archiveStart + archiveRange }}{{ util.passthrough('order', 'type') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="archivelist?$getID()&order=$util.toggleOrder($self, 'filename')$util.passthrough($self, 'type')">Filename</a> $util.sortImage($self, 'filename')</th>
|
||||
<th><a href="archivelist?$getID()&order=$util.toggleOrder($self, 'type_name')$util.passthrough($self, 'type')">Type</a> $util.sortImage($self, 'type_name')</th>
|
||||
#if $type == 'component'
|
||||
<th><a href="archivelist?$getID()&order=$util.toggleOrder($self, 'project')$util.passthrough($self, 'type')">Build Dependency?</a> $util.sortImage($self, 'project')</th>
|
||||
#end if
|
||||
<th><a href="archivelist?{{ getID()|trim }}&order={{ util.toggleOrder('filename') }}{{ util.passthrough('type') }}">Filename</a> {{ util.sortImage('filename') }}</th>
|
||||
<th><a href="archivelist?{{ getID()|trim }}&order={{ util.toggleOrder('type_name') }}{{ util.passthrough('type') }}">Type</a> {{ util.sortImage('type_name') }}</th>
|
||||
#if type == 'component'
|
||||
<th><a href="archivelist?{{ getID()|trim }}&order={{ util.toggleOrder('project') }}{{ util.passthrough('type') }}">Build Dependency?</a> {{ util.sortImage('project') }}</th>
|
||||
#endif
|
||||
</tr>
|
||||
#if $len($archives) > 0
|
||||
#for $archive in $archives
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="archiveinfo?archiveID=$archive.id">$archive.filename</a></td>
|
||||
<td>$archive.type_name</td>
|
||||
#if $type == 'component'
|
||||
#set $project = $archive.project and 'yes' or 'no'
|
||||
<td class="$project">$util.imageTag($project)</td>
|
||||
#end if
|
||||
#if (archives |length) > 0
|
||||
#for archive in archives
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="archiveinfo?archiveID={{ archive.id }}">{{ archive.filename }}</a></td>
|
||||
<td>{{ archive.type_name }}</td>
|
||||
#if type == 'component'
|
||||
#set project = archive.project and 'yes' or 'no'
|
||||
<td class="{{ project }}">{{ util.imageTag(project) }}</td>
|
||||
#endif
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="#if $type == 'component' then '3' else '2'#">No Archives</td>
|
||||
<td colspan="{{ '3' if type == 'component' else '2' }}">No Archives</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="#if $type == 'component' then '3' else '2'#">
|
||||
#if $len($archivePages) > 1
|
||||
<td class="paginate" colspan="{{ '3' if type == 'component' else '2' }}">
|
||||
#if (archivePages |length) > 1
|
||||
<form class="pageJump">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'archivelist?$getID()&start=' + this.value * $archiveRange + '$util.passthrough($self, 'order', 'type')';">
|
||||
#for $pageNum in $archivePages
|
||||
<option value="$pageNum"#if $pageNum == $archiveCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'archivelist?{{ getID()|trim }}&start=' + this.value * {{ archiveRange }} + '{{ util.passthrough('order', 'type') }}';">
|
||||
#for pageNum in archivePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == archiveCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $archiveStart > 0
|
||||
<a href="archivelist?$getID()&start=#echo $archiveStart - $archiveRange #$util.passthrough($self, 'order', 'type')"><<<</a>
|
||||
#end if
|
||||
#if $totalArchives != 0
|
||||
<strong>Archives #echo $archiveStart + 1 # through #echo $archiveStart + $archiveCount # of $totalArchives</strong>
|
||||
#end if
|
||||
#if $archiveStart + $archiveCount < $totalArchives
|
||||
<a href="archivelist?$getID()&start=#echo $archiveStart + $archiveRange#$util.passthrough($self, 'order', 'type')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if archiveStart > 0
|
||||
<a href="archivelist?{{ getID()|trim }}&start={{ archiveStart - archiveRange }}{{ util.passthrough('order', 'type') }}"><<<</a>
|
||||
#endif
|
||||
#if totalArchives != 0
|
||||
<strong>Archives {{ archiveStart + 1 }} through {{ archiveStart + archiveCount }} of {{ totalArchives }}</strong>
|
||||
#endif
|
||||
#if archiveStart + archiveCount < totalArchives
|
||||
<a href="archivelist?{{ getID()|trim }}&start={{ archiveStart + archiveRange }}{{ util.passthrough('order', 'type') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,269 +1,261 @@
|
|||
#import koji
|
||||
#import koji.util
|
||||
#from pprint import pformat
|
||||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#set $nvrpath = $pathinfo.build($build)
|
||||
#include "includes/header2.chtml"
|
||||
#set nvrpath = pathinfo.build(build)
|
||||
|
||||
<h4>Information for build <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a></h4>
|
||||
<h4>Information for build <a href="buildinfo?buildID={{ build.id }}">{{ koji.buildLabel(build) }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th><td>$build.id</td>
|
||||
<th>ID</th><td>{{ build.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Package Name</th><td><a href="packageinfo?packageID=$build.package_id">$build.package_name</a></td>
|
||||
<th>Package Name</th><td><a href="packageinfo?packageID={{ build.package_id }}">{{ build.package_name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Version</th><td>$build.version</td>
|
||||
<th>Version</th><td>{{ build.version }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Release</th><td>$build.release</td>
|
||||
<th>Release</th><td>{{ build.release }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Epoch</th><td>$build.epoch</td>
|
||||
<th>Epoch</th><td>{{ build.epoch }}</td>
|
||||
</tr>
|
||||
#if $build.draft
|
||||
<tr>
|
||||
#if build.draft
|
||||
<th>Draft</th><td>True</td>
|
||||
#else
|
||||
<th>Draft</th><td>False</td>
|
||||
#end if
|
||||
#if $build.get('source')
|
||||
<tr>
|
||||
<th>Source</th><td>$build['source']</td>
|
||||
#endif
|
||||
</tr>
|
||||
#end if
|
||||
#if 'maven' in $typeinfo
|
||||
#if build.get('source')
|
||||
<tr>
|
||||
<th>Maven groupId</th><td>$typeinfo.maven.group_id</td>
|
||||
<th>Source</th><td>{{ build.source }}</td>
|
||||
</tr>
|
||||
#endif
|
||||
#if 'maven' in typeinfo
|
||||
<tr>
|
||||
<th>Maven groupId</th><td>{{ typeinfo.maven.group_id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Maven artifactId</th><td>$typeinfo.maven.artifact_id</td>
|
||||
<th>Maven artifactId</th><td>{{ typeinfo.maven.artifact_id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Maven version</th><td>$typeinfo.maven.version</td>
|
||||
<th>Maven version</th><td>{{ typeinfo.maven.version }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if 'module' in $typeinfo
|
||||
#if $module_id
|
||||
#endif
|
||||
#if 'module' in typeinfo
|
||||
#if module_id
|
||||
<tr>
|
||||
<th>Module ID</th>
|
||||
#if $mbs_web_url
|
||||
<td><a href="$mbs_web_url/module/$module_id">$module_id</a></td>
|
||||
#if mbs_web_url
|
||||
<td><a href="{{ mbs_web_url }}/module/{{ module_id }}">{{ module_id }}</a></td>
|
||||
#else
|
||||
<td>$module_id</td>
|
||||
#end if
|
||||
<td>{{ module_id }}</td>
|
||||
#endif
|
||||
</tr>
|
||||
#end if
|
||||
#if $module_tag
|
||||
#endif
|
||||
#if module_tag
|
||||
<tr>
|
||||
<th>Module Tag</th><td><a href="taginfo?tagID=$module_tag.id">$module_tag.name</a></td>
|
||||
<th>Module Tag</th><td><a href="taginfo?tagID={{ module_tag.id }}">{{ module_tag.name }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#end if
|
||||
#if $summary
|
||||
#endif
|
||||
#endif
|
||||
#if summary
|
||||
<tr>
|
||||
<th>Summary</th><td class="rpmheader">$summary</td>
|
||||
<th>Summary</th><td class="rpmheader">{{ summary }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $description
|
||||
#endif
|
||||
#if description
|
||||
<tr>
|
||||
<th>Description</th><td class="rpmheader">$description</td>
|
||||
<th>Description</th><td class="rpmheader">{{ description }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $vcs
|
||||
#endif
|
||||
#if vcs
|
||||
<tr>
|
||||
<th><label title="Package source code VCS location">VCS</label></th><td>$util.formatLink($vcs)</td>
|
||||
<th><label title="Package source code VCS location">VCS</label></th><td>{{ util.formatLink(vcs) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $disturl
|
||||
#endif
|
||||
#if disturl
|
||||
<tr>
|
||||
<th>DistURL</th><td>$util.formatLink($disturl)</td>
|
||||
<th>DistURL</th><td>{{ util.formatLink(disturl) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Built by</th><td><a href="userinfo?userID=$build.owner_id">$build.owner_name</a></td>
|
||||
<th>Built by</th><td><a href="userinfo?userID={{ build.owner_id }}">{{ build.owner_name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
#set $stateName = $util.stateName($build.state)
|
||||
#set stateName = util.stateName(build.state)
|
||||
<th>State</th>
|
||||
<td class="$stateName">$stateName
|
||||
#if $build.state == $koji.BUILD_STATES.BUILDING
|
||||
#if $currentUser and ('admin' in $perms or $build.owner_id == $currentUser.id)
|
||||
<span class="adminLink">(<a href="cancelbuild?buildID=$build.id$util.authToken($self)">cancel</a>)</span>
|
||||
#end if
|
||||
#end if
|
||||
<td class="{{ stateName }}">{{ stateName }}
|
||||
#if build.state == koji.BUILD_STATES.BUILDING
|
||||
#if currentUser and ('admin' in perms or build.owner_id == currentUser.id)
|
||||
<span class="adminLink">(<a href="cancelbuild?buildID={{ build.id }}{{ util.authToken() }}">cancel</a>)</span>
|
||||
#endif
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Volume</th>
|
||||
<td>$build.volume_name</td>
|
||||
<td>{{ build.volume_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Started</th><td>$util.formatTimeLong($start_ts)</td>
|
||||
<th>Started</th><td>{{ util.formatTimeLong(start_ts) }}</td>
|
||||
</tr>
|
||||
#if $build.state == $koji.BUILD_STATES.BUILDING
|
||||
#if $estCompletion
|
||||
#if build.state == koji.BUILD_STATES.BUILDING
|
||||
#if estCompletion
|
||||
<tr>
|
||||
<th>Est. Completion</th><td>$util.formatTimeLong($estCompletion)</td>
|
||||
<th>Est. Completion</th><td>{{ util.formatTimeLong(estCompletion) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
#else
|
||||
<tr>
|
||||
<th>Completed</th><td>$util.formatTimeLong($build.completion_ts)</td>
|
||||
<th>Completed</th><td>{{ util.formatTimeLong(build.completion_ts) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $build.promotion_ts
|
||||
#endif
|
||||
#if build.promotion_ts
|
||||
<tr>
|
||||
<th>Promoted</th><td>$util.formatTimeLong($build.promotion_ts)</td>
|
||||
<th>Promoted</th><td>{{ util.formatTimeLong(build.promotion_ts) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Promoted by</th><td><a href="userinfo?userID=$build.promoter_id">$build.promoter_name</a></td>
|
||||
<th>Promoted by</th><td><a href="userinfo?userID={{ build.promoter_id }}">{{ build.promoter_name }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $build.cg_id
|
||||
#endif
|
||||
#if build.cg_id
|
||||
<tr>
|
||||
<th>Content generator</th><td>$build.cg_name</td>
|
||||
<th>Content generator</th><td>{{ build.cg_name }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $task
|
||||
#endif
|
||||
#if task
|
||||
<tr>
|
||||
<th>Task</th><td><a href="taskinfo?taskID=$task.id" class="task$util.taskState($task.state)">$koji.taskLabel($task)</a></td>
|
||||
<th>Task</th><td><a href="taskinfo?taskID={{ task.id }}" class="task{{ util.taskState(task.state) }}">{{ koji.taskLabel(task) }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $build.get('extra')
|
||||
#endif
|
||||
#if build.get('extra')
|
||||
<tr>
|
||||
<th>Extra</th><td class="usertext">$pformat($build.extra)</td>
|
||||
<th>Extra</th><td class="usertext">{{ build.extra|pprint }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Tags</th>
|
||||
<td class="container">
|
||||
#if $len($tags) > 0
|
||||
#if (tags |length) > 0
|
||||
<table class="nested">
|
||||
#for $tag in $tags
|
||||
#for tag in tags
|
||||
<tr>
|
||||
<td><a href="taginfo?tagID=$tag.id">$tag.name</a></td>
|
||||
<td><a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No tags
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>RPMs</th>
|
||||
<td class="container">
|
||||
#if $len($rpmsByArch) > 0
|
||||
#if (rpmsByArch |length) > 0
|
||||
<table class="nested">
|
||||
#if 'src' in $rpmsByArch
|
||||
#if 'src' in rpmsByArch
|
||||
<tr><th>src</th><th></th></tr>
|
||||
#for $rpm in $rpmsByArch['src']
|
||||
#set $rpmfile = '%(name)s-%(version)s-%(release)s.%(arch)s.rpm' % $rpm
|
||||
#set $rpmpath = $pathinfo.rpm($rpm)
|
||||
#for rpm in rpmsByArch['src']
|
||||
#set rpmfile = '%(name)s-%(version)s-%(release)s.%(arch)s.rpm' % rpm
|
||||
#set rpmpath = pathinfo.rpm(rpm)
|
||||
<tr>
|
||||
<td></td>
|
||||
#if $rpm.metadata_only
|
||||
<td>$rpmfile (<a href="rpminfo?rpmID=$rpm.id">info</a>) (metadata only)</td>
|
||||
#elif $build.state == $koji.BUILD_STATES.DELETED
|
||||
<td>$rpmfile (<a href="rpminfo?rpmID=$rpm.id">info</a>)
|
||||
#if rpm.metadata_only
|
||||
<td>{{ rpmfile }} (<a href="rpminfo?rpmID={{ rpm.id }}">info</a>) (metadata only)</td>
|
||||
#elif build.state == koji.BUILD_STATES.DELETED
|
||||
<td>{{ rpmfile }} (<a href="rpminfo?rpmID={{ rpm.id }}">info</a>)
|
||||
#else
|
||||
<td>$rpmfile (<a href="rpminfo?rpmID=$rpm.id">info</a>) (<a href="$nvrpath/$rpmpath">download</a>)</td>
|
||||
#end if
|
||||
<td>{{ rpmfile }} (<a href="rpminfo?rpmID={{ rpm.id }}">info</a>) (<a href="{{ nvrpath }}/{{ rpmpath }}">download</a>)</td>
|
||||
#endif
|
||||
</tr>
|
||||
#end for
|
||||
#end if
|
||||
#set $arches = $rpmsByArch.keys()
|
||||
#for $arch in sorted($arches)
|
||||
#if $arch == 'src'
|
||||
#silent continue
|
||||
#end if
|
||||
#endfor
|
||||
#endif
|
||||
#set arches = rpmsByArch.keys()
|
||||
#for arch in arches|sort if arch != 'src'
|
||||
<tr>
|
||||
<th>$arch</th>
|
||||
<th>{{ arch }}</th>
|
||||
</tr>
|
||||
#for $rpm in $rpmsByArch[$arch]
|
||||
#for rpm in rpmsByArch[arch]
|
||||
<tr>
|
||||
#set $rpmfile = '%(name)s-%(version)s-%(release)s.%(arch)s.rpm' % $rpm
|
||||
#set $rpmpath = $pathinfo.rpm($rpm)
|
||||
#set rpmfile = '%(name)s-%(version)s-%(release)s.%(arch)s.rpm' % rpm
|
||||
#set rpmpath = pathinfo.rpm(rpm)
|
||||
<td></td>
|
||||
<td>
|
||||
#if $build.state != $koji.BUILD_STATES.DELETED
|
||||
$rpmfile (<a href="rpminfo?rpmID=$rpm.id">info</a>) (<a href="$nvrpath/$rpmpath">download</a>)
|
||||
#if build.state != koji.BUILD_STATES.DELETED
|
||||
{{ rpmfile }} (<a href="rpminfo?rpmID={{ rpm.id }}">info</a>) (<a href="{{ nvrpath }}/{{ rpmpath }}">download</a>)
|
||||
#else
|
||||
$rpmfile (<a href="rpminfo?rpmID=$rpm.id">info</a>)
|
||||
#end if
|
||||
{{ rpmfile }} (<a href="rpminfo?rpmID={{ rpm.id }}">info</a>)
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#end for
|
||||
#end for
|
||||
#endfor
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No RPMs
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#for btype in $archiveIndex
|
||||
#set $archivesByExt = $archiveIndex[btype]
|
||||
#if not $archivesByExt
|
||||
#continue
|
||||
#end if
|
||||
#for btype in archiveIndex if archiveIndex[btype]
|
||||
#set archivesByExt = archiveIndex[btype]
|
||||
<tr>
|
||||
<th>$btype.capitalize() Archives</th>
|
||||
<th>{{ btype.capitalize() }} Archives</th>
|
||||
<td class="container">
|
||||
<table class="nested">
|
||||
#set $exts = $archivesByExt.keys()
|
||||
#for ext in $exts
|
||||
#set exts = archivesByExt.keys()
|
||||
#for ext in exts
|
||||
<tr>
|
||||
<th>$ext</th>
|
||||
<th>{{ ext }}</th>
|
||||
</tr>
|
||||
#for $archive in $archivesByExt[$ext]
|
||||
#for archive in archivesByExt[ext]
|
||||
<tr>
|
||||
<td/>
|
||||
<td>
|
||||
#if $archive.metadata_only or $build.state == $koji.BUILD_STATES.DELETED
|
||||
$archive.display (<a href="archiveinfo?archiveID=$archive.id">info</a>)
|
||||
#if archive.metadata_only or build.state == koji.BUILD_STATES.DELETED
|
||||
{{ archive.display }} (<a href="archiveinfo?archiveID={{ archive.id }}">info</a>)
|
||||
#else
|
||||
$archive.display (<a href="archiveinfo?archiveID=$archive.id">info</a>) (<a href="$archive.dl_url">download</a>)
|
||||
#end if
|
||||
{{ archive.display }} (<a href="archiveinfo?archiveID={{ archive.id }}">info</a>) (<a href="{{ archive.dl_url }}">download</a>)
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#end for
|
||||
#end for
|
||||
#endfor
|
||||
#endfor
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
#end for
|
||||
#if $logs_by_dir
|
||||
#endfor
|
||||
#if logs_by_dir
|
||||
<tr>
|
||||
<th>Logs</th>
|
||||
<td class="container">
|
||||
<table class="nested">
|
||||
#set $logdirs = $logs_by_dir.keys()
|
||||
#for logdir in $logdirs
|
||||
#set logdirs = logs_by_dir.keys()
|
||||
#for logdir in logdirs
|
||||
<tr>
|
||||
<th>$logdir</th>
|
||||
<th>{{ logdir }}</th>
|
||||
</tr>
|
||||
#for loginfo in $logs_by_dir[$logdir]
|
||||
#for loginfo in logs_by_dir[logdir]
|
||||
<tr>
|
||||
<td/>
|
||||
<td>
|
||||
<a href="$loginfo.dl_url">$loginfo.name</a>
|
||||
<a href="{{ loginfo.dl_url }}">{{ loginfo.name }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
#end for
|
||||
#end for
|
||||
#endfor
|
||||
#endfor
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $changelog
|
||||
#endif
|
||||
#if changelog
|
||||
<tr>
|
||||
<th>Changelog</th>
|
||||
<td class="changelog">$koji.util.formatChangelog($changelog)</td>
|
||||
<td class="changelog">{{ koji.util.formatChangelog(changelog) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,62 +1,59 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
#from pprint import pformat
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for buildroot <a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></h4>
|
||||
<h4>Information for buildroot <a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Host</th><td><a href="hostinfo?hostID=$buildroot.host_id">$buildroot.host_name</a></td>
|
||||
<th>Host</th><td><a href="hostinfo?hostID={{ buildroot.host_id }}">{{ buildroot.host_name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arch</th><td>$buildroot.arch</td>
|
||||
<th>Arch</th><td>{{ buildroot.arch }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$buildroot.id</td>
|
||||
<th>ID</th><td>{{ buildroot.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Task</th><td><a href="taskinfo?taskID=$task.id" class="task$util.taskState($task.state)">$koji.taskLabel($task)</a></td>
|
||||
<th>Task</th><td><a href="taskinfo?taskID={{ task.id }}" class="task{{ util.taskState(task.state) }}">{{ koji.taskLabel(task) }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>State</th><td>$util.imageTag($util.brStateName($buildroot.state))</td>
|
||||
<th>State</th><td>{{ util.imageTag(util.brStateName(buildroot.state)) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Created</th><td>$util.formatTimeLong($buildroot.create_event_time)</td>
|
||||
<th>Created</th><td>{{ util.formatTimeLong(buildroot.create_event_time) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Retired</th><td>$util.formatTimeLong($buildroot.retire_event_time)</td>
|
||||
<th>Retired</th><td>{{ util.formatTimeLong(buildroot.retire_event_time) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Repo ID</th><td><a href="repoinfo?repoID=$buildroot.repo_id">$buildroot.repo_id</a></td>
|
||||
<th>Repo ID</th><td><a href="repoinfo?repoID={{ buildroot.repo_id }}">{{ buildroot.repo_id }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Repo Tag</th><td><a href="taginfo?tagID=$buildroot.tag_id">$buildroot.tag_name</a></td>
|
||||
<th>Repo Tag</th><td><a href="taginfo?tagID={{ buildroot.tag_id }}">{{ buildroot.tag_name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Repo State</th><td>$util.imageTag($util.repoStateName($buildroot.repo_state))</td>
|
||||
<th>Repo State</th><td>{{ util.imageTag(util.repoStateName(buildroot.repo_state)) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Repo Created</th><td>$util.formatTimeLong($buildroot.repo_create_event_time)</td>
|
||||
<th>Repo Created</th><td>{{ util.formatTimeLong(buildroot.repo_create_event_time) }}</td>
|
||||
</tr>
|
||||
#if $buildroot.get('extra')
|
||||
#if buildroot.get('extra')
|
||||
<tr>
|
||||
<th>Extra</th><td class="usertext">$pformat($buildroot.extra)</td>
|
||||
<th>Extra</th><td class="usertext">{{ buildroot.extra| pprint }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID=$buildroot.id&type=component" title="RPMs that are installed into this buildroot when building packages">Component RPMs</a></th>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID={{ buildroot.id }}&type=component" title="RPMs that are installed into this buildroot when building packages">Component RPMs</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID=$buildroot.id&type=built" title="RPMs that have been built in this buildroot">Built RPMs</a></th>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID={{ buildroot.id }}&type=built" title="RPMs that have been built in this buildroot">Built RPMs</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="archivelist?buildrootID=$buildroot.id&type=component" title="Archives that are installed into this buildroot when building packages">Component Archives</a></th>
|
||||
<th colspan="2"><a href="archivelist?buildrootID={{ buildroot.id }}&type=component" title="Archives that are installed into this buildroot when building packages">Component Archives</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="archivelist?buildrootID=$buildroot.id&type=built" title="Archives that have been built in this buildroot">Built Archives</a></th>
|
||||
<th colspan="2"><a href="archivelist?buildrootID={{ buildroot.id }}&type=built" title="Archives that have been built in this buildroot">Built Archives</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,47 +1,44 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
#from pprint import pformat
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for external buildroot <a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></h4>
|
||||
<h4>Information for external buildroot <a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th><td>$buildroot.id</td>
|
||||
<th>ID</th><td>{{ buildroot.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Host OS</th><td>$buildroot.host_os</td>
|
||||
<th>Host OS</th><td>{{ buildroot.host_os }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Host Arch</th><td>$buildroot.host_arch</td>
|
||||
<th>Host Arch</th><td>{{ buildroot.host_arch }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Content Generator</th><td>$buildroot.cg_name ($buildroot.cg_version)</td>
|
||||
<th>Content Generator</th><td>{{ buildroot.cg_name }} ({{ buildroot.cg_version }})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Container Type</th><td>$buildroot.container_type</td>
|
||||
<th>Container Type</th><td>{{ buildroot.container_type }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Container Arch</th><td>$buildroot.container_arch</td>
|
||||
<th>Container Arch</th><td>{{ buildroot.container_arch }}</td>
|
||||
</tr>
|
||||
#if $buildroot.get('extra')
|
||||
#if buildroot.get('extra')
|
||||
<tr>
|
||||
<th>Extra</th><td class="usertext">$pformat($buildroot.extra)</td>
|
||||
<th>Extra</th><td class="usertext">{{ buildroot.extra |pprint }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID=$buildroot.id&type=component" title="RPMs that are installed into this buildroot when building packages">Component RPMs</a></th>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID={{ buildroot.id }}&type=component" title="RPMs that are installed into this buildroot when building packages">Component RPMs</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID=$buildroot.id&type=built" title="RPMs that have been built in this buildroot">Built RPMs</a></th>
|
||||
<th colspan="2"><a href="rpmlist?buildrootID={{ buildroot.id }}&type=built" title="RPMs that have been built in this buildroot">Built RPMs</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="archivelist?buildrootID=$buildroot.id&type=component" title="Archives that are installed into this buildroot when building packages">Component Archives</a></th>
|
||||
<th colspan="2"><a href="archivelist?buildrootID={{ buildroot.id }}&type=component" title="Archives that are installed into this buildroot when building packages">Component Archives</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="archivelist?buildrootID=$buildroot.id&type=built" title="Archives that have been built in this buildroot">Built Archives</a></th>
|
||||
<th colspan="2"><a href="archivelist?buildrootID={{ buildroot.id }}&type=built" title="Archives that have been built in this buildroot">Built Archives</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
|
||||
#attr _PASSTHROUGH = ['repoID', 'order', 'state']
|
||||
#set _PASSTHROUGH = ['repoID', 'order', 'state']
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Buildroots in repo <a href="repoinfo?repoID=$repoID">$repoID</a></h4>
|
||||
<h4>Buildroots in repo <a href="repoinfo?repoID={{ repoID }}">{{ repoID }}</a></h4>
|
||||
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
|
|
@ -14,84 +12,84 @@
|
|||
<tr><td>
|
||||
<strong>State</strong>:
|
||||
</td><td>
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'buildroots?state=' + this.value + '$util.passthrough_except($self, 'state')';">
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'buildroots?state=' + this.value + '{{ util.passthrough_except('state') }}';">
|
||||
<option value="all">all</option>
|
||||
#for $stateOpt in ['INIT', 'WAITING', 'BUILDING', 'EXPIRED']
|
||||
<option value="$koji.BR_STATES[$stateOpt]" #if $state == $koji.BR_STATES[$stateOpt] then 'selected' else ''#>$stateOpt.lower()</option>
|
||||
#end for
|
||||
#for stateOpt in ['INIT', 'WAITING', 'BUILDING', 'EXPIRED']
|
||||
<option value="{{ koji.BR_STATES[stateOpt] }}"{{ ' selected' if state == koji.BR_STATES[stateOpt] else '' }}>{{ stateOpt|lower }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="5">
|
||||
#if $len($buildrootPages) > 1
|
||||
#if (buildrootPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildrootRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $buildrootPages
|
||||
<option value="$pageNum"#if $pageNum == $buildrootCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * {{ buildrootRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in buildrootPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildrootCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildrootStart > 0
|
||||
<a href="builds?start=#echo $buildrootStart - $buildrootRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalBuildroots != 0
|
||||
<strong>Buildroots #echo $buildrootStart + 1 # through #echo $buildrootStart + $buildrootCount # of $totalBuildroots</strong>
|
||||
#end if
|
||||
#if $buildrootStart + $buildrootCount < $totalBuildroots
|
||||
<a href="builds?start=#echo $buildrootStart + $buildrootRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildrootStart > 0
|
||||
<a href="builds?start={{ buildrootStart - buildrootRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalBuildroots != 0
|
||||
<strong>Buildroots {{ buildrootStart + 1 }} through {{ buildrootStart + buildrootCount }} of {{ totalBuildroots }}</strong>
|
||||
#endif
|
||||
#if buildrootStart + buildrootCount < totalBuildroots
|
||||
<a href="builds?start={{ buildrootStart + buildrootRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="buildroots?order=$util.toggleOrder($self, 'id')$util.passthrough_except($self, 'order')">BuildrootID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="buildroots?order=$util.toggleOrder($self, 'repo_id')$util.passthrough_except($self, 'order')">Repo ID</a> $util.sortImage($self, 'repo_id')</th>
|
||||
<th><a href="buildroots?order=$util.toggleOrder($self, 'task_id')$util.passthrough_except($self, 'order')">Task ID</a> $util.sortImage($self, 'task_id')</th>
|
||||
<th><a href="buildroots?order=$util.toggleOrder($self, 'tag_name')$util.passthrough_except($self, 'order')">Tag name</a> $util.sortImage($self, 'tag_name')</th>
|
||||
<th><a href="buildroots?order=$util.toggleOrder($self, 'state')$util.passthrough_except($self, 'order')">State</a> $util.sortImage($self, 'state')</th>
|
||||
<th><a href="buildroots?order={{ util.toggleOrder('id') }}{{ util.passthrough_except('order') }}">BuildrootID</a> {{ util.sortImage('id') }}</th>
|
||||
<th><a href="buildroots?order={{ util.toggleOrder('repo_id') }}{{ util.passthrough_except('order') }}">Repo ID</a> {{ util.sortImage('repo_id') }}</th>
|
||||
<th><a href="buildroots?order={{ util.toggleOrder('task_id') }}{{ util.passthrough_except('order') }}">Task ID</a> {{ util.sortImage('task_id') }}</th>
|
||||
<th><a href="buildroots?order={{ util.toggleOrder('tag_name') }}{{ util.passthrough_except('order') }}">Tag name</a> {{ util.sortImage('tag_name') }}</th>
|
||||
<th><a href="buildroots?order={{ util.toggleOrder('state') }}{{ util.passthrough_except('order') }}">State</a> {{ util.sortImage('state') }}</th>
|
||||
</tr>
|
||||
#if $len($buildroots) > 0
|
||||
#for $buildroot in $buildroots
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="buildrootinfo?buildrootID=$buildroot.id">$buildroot.id</a></td>
|
||||
<td><a href="repoinfo?repoID=$buildroot.repo_id">$buildroot.repo_id</a></td>
|
||||
<td><a href="taskinfo?taskID=$buildroot.task_id">$buildroot.task_id</a></td>
|
||||
<td><a href="taginfo?tagID=$buildroot.tag_id">$buildroot.tag_name</a></td>
|
||||
#set $stateName = $util.brStateName($buildroot.state)
|
||||
<td class="$stateName">$util.brStateImage($buildroot.state)</td>
|
||||
#if (buildroots |length) > 0
|
||||
#for buildroot in buildroots
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ buildroot.id }}</a></td>
|
||||
<td><a href="repoinfo?repoID={{ buildroot.repo_id }}">{{ buildroot.repo_id }}</a></td>
|
||||
<td><a href="taskinfo?taskID={{ buildroot.task_id }}">{{ buildroot.task_id }}</a></td>
|
||||
<td><a href="taginfo?tagID={{ buildroot.tag_id }}">{{ buildroot.tag_name }}</a></td>
|
||||
#set stateName = util.brStateName(buildroot.state)
|
||||
<td class="{{ stateName }}">{{ util.brStateImage(buildroot.state) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="5">No buildroots</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="5">
|
||||
#if $len($buildrootPages) > 1
|
||||
#if (buildrootPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildrootRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $buildrootPages
|
||||
<option value="$pageNum"#if $pageNum == $buildrootCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * {{ buildrootRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in buildrootPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildrootCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildrootStart > 0
|
||||
<a href="builds?start=#echo $buildrootStart - $buildrootRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalBuildroots != 0
|
||||
<strong>Buildroots #echo $buildrootStart + 1 # through #echo $buildrootStart + $buildrootCount # of $totalBuildroots</strong>
|
||||
#end if
|
||||
#if $buildrootStart + $buildrootCount < $totalBuildroots
|
||||
<a href="builds?start=#echo $buildrootStart + $buildrootRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildrootStart > 0
|
||||
<a href="builds?start={{ buildrootStart - buildrootRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalBuildroots != 0
|
||||
<strong>Buildroots {{ buildrootStart + 1 }} through {{ buildrootStart + buildrootCount }} of {{ totalBuildroots }}</strong>
|
||||
#endif
|
||||
#if buildrootStart + buildrootCount < totalBuildroots
|
||||
<a href="builds?start={{ buildrootStart + buildrootRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,70 +1,67 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
|
||||
#attr _PASSTHROUGH = ['userID', 'tagID', 'packageID', 'order', 'prefix', 'state', 'inherited', 'latest', 'type']
|
||||
#set _PASSTHROUGH = ['userID', 'tagID', 'packageID', 'order', 'prefix', 'state', 'inherited', 'latest', 'type']
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#@util.safe_return
|
||||
#def getDescription()
|
||||
#if $latest
|
||||
#macro getDescription()
|
||||
#if latest
|
||||
Latest
|
||||
#elif $state != None
|
||||
$util.stateName($state).capitalize()
|
||||
#end if
|
||||
#if $type
|
||||
$type.capitalize()
|
||||
#end if
|
||||
#elif state != None
|
||||
{{ util.stateName(state)|capitalize }}
|
||||
#endif
|
||||
#if type
|
||||
{{ type|capitalize }}
|
||||
#endif
|
||||
Builds
|
||||
#if $package
|
||||
of <a href="packageinfo?packageID=$package.id">$package.name</a>
|
||||
#end if
|
||||
#if $user
|
||||
by <a href="userinfo?userID=$user.id">$user.name</a>
|
||||
#end if
|
||||
#if $prefix
|
||||
starting with "$prefix"
|
||||
#end if
|
||||
#if $tag
|
||||
in tag <a href="taginfo?tagID=$tag.id">$tag.name</a>
|
||||
#end if
|
||||
#end def
|
||||
#if package
|
||||
of <a href="packageinfo?packageID={{ package.id }}">{{ package.name }}</a>
|
||||
#endif
|
||||
#if user
|
||||
by <a href="userinfo?userID={{ user.id }}">{{ user.name }}</a>
|
||||
#endif
|
||||
#if prefix
|
||||
starting with "{{ prefix }}"
|
||||
#endif
|
||||
#if tag
|
||||
in tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a>
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
<h4>$getDescription()</h4>
|
||||
<h4>{{ getDescription() }}</h4>
|
||||
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td colspan="#if $tag then '6' else '5'#">
|
||||
<td colspan="{{ '6' if tag else '5' }}">
|
||||
<table class="nested">
|
||||
<tr><td>
|
||||
#if $tag
|
||||
#if tag
|
||||
<strong>Latest</strong>:
|
||||
</td><td>
|
||||
<select name="latest" class="filterlist" onchange="javascript: window.location = 'builds?latest=' + this.value + '$util.passthrough_except($self, 'latest')';">
|
||||
<option value="1" #if $latest then 'selected' else ''#>yes</option>
|
||||
<option value="0" #if not $latest then 'selected' else ''#>no</option>
|
||||
<select name="latest" class="filterlist" onchange="javascript: window.location = 'builds?latest=' + this.value + '{{ util.passthrough_except('latest') }}';">
|
||||
<option value="1" {{ 'selected' if latest else '' }}>yes</option>
|
||||
<option value="0" {{ 'selected' if not latest else '' }}>no</option>
|
||||
</select>
|
||||
#else
|
||||
<strong>State</strong>:
|
||||
</td><td>
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'builds?state=' + this.value + '$util.passthrough_except($self, 'state')';">
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'builds?state=' + this.value + '{{ util.passthrough_except('state') }}';">
|
||||
<option value="all">all</option>
|
||||
#for $stateOpt in ['BUILDING', 'COMPLETE', 'FAILED', 'CANCELED']
|
||||
<option value="$koji.BUILD_STATES[$stateOpt]" #if $state == $koji.BUILD_STATES[$stateOpt] then 'selected' else ''#>$stateOpt.lower()</option>
|
||||
#end for
|
||||
#for stateOpt in ['BUILDING', 'COMPLETE', 'FAILED', 'CANCELED']
|
||||
<option value="{{ koji.BUILD_STATES[stateOpt] }}"{{ ' selected' if state == koji.BUILD_STATES[stateOpt] else '' }}>{{ stateOpt|lower }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
#end if
|
||||
#endif
|
||||
</td><td>
|
||||
<strong>Built by</strong>:
|
||||
</td><td>
|
||||
<select name="userID" class="filterlist" onchange="javascript: window.location = 'builds?userID=' + this.value + '$util.passthrough_except($self, 'userID')';">
|
||||
<option value="" #if not $user then 'selected' else ''#>everyone</option>
|
||||
#if $loggedInUser
|
||||
<option value="$loggedInUser.name">me</option>
|
||||
#end if
|
||||
#for $userOption in $users
|
||||
<option value="$userOption.name" #if $userOption.name == ($user and $user.name or None) then 'selected' else ''#>$userOption.name</option>
|
||||
#end for
|
||||
<select name="userID" class="filterlist" onchange="javascript: window.location = 'builds?userID=' + this.value + '{{ util.passthrough_except('userID') }}';">
|
||||
<option value="" {{ 'selected' if not user else '' }}>everyone</option>
|
||||
#if loggedInUser
|
||||
<option value="{{ loggedInUser.name }}">me</option>
|
||||
#endif
|
||||
#for userOption in users
|
||||
<option value="{{ userOption.name }}" {{ 'selected' if userOption.name == (user and user.name or None) else '' }}>{{ userOption.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr>
|
||||
|
|
@ -72,119 +69,119 @@ in tag <a href="taginfo?tagID=$tag.id">$tag.name</a>
|
|||
<strong>Type</strong>:
|
||||
</td>
|
||||
<td>
|
||||
<select name="type" class="filterlist" onchange="javascript: window.location='builds?type=' + this.value + '$util.passthrough_except($self, 'type')';">
|
||||
<option value="all" #if not $type then 'selected' else ''#>all</option>
|
||||
#for $btype in $btypes
|
||||
<option value="$btype" #if $type == $btype then 'selected' else ''#>$btype</option>
|
||||
#end for
|
||||
<select name="type" class="filterlist" onchange="javascript: window.location='builds?type=' + this.value + '{{ util.passthrough_except('type') }}';">
|
||||
<option value="all" {{ 'selected' if not type else '' }}>all</option>
|
||||
#for btype in btypes
|
||||
<option value="{{ btype }}" {{ 'selected' if type == btype else '' }}>{{ btype }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
#if $tag
|
||||
#if tag
|
||||
<td>
|
||||
<strong>Inherited</strong>:
|
||||
</td><td>
|
||||
<select name="inherited" class="filterlist" onchange="javascript: window.location = 'builds?inherited=' + this.value + '$util.passthrough_except($self, 'inherited')';">
|
||||
<option value="1" #if $inherited then 'selected' else ''#>yes</option>
|
||||
<option value="0" #if not $inherited then 'selected' else ''#>no</option>
|
||||
<select name="inherited" class="filterlist" onchange="javascript: window.location = 'builds?inherited=' + this.value + '{{ util.passthrough_except('inherited') }}';">
|
||||
<option value="1" {{ 'selected' if inherited else '' }}>yes</option>
|
||||
<option value="0" {{ 'selected' if not inherited else '' }}>no</option>
|
||||
</select>
|
||||
</td>
|
||||
#end if
|
||||
#endif
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charlist" colspan="#if $tag then '6' else '5'#">
|
||||
#for $char in $chars
|
||||
#if $prefix == $char
|
||||
<strong>$char</strong>
|
||||
<td class="charlist" colspan="{{ '6' if tag else '5' }}">
|
||||
#for char in chars
|
||||
#if prefix == char
|
||||
<strong>{{ char }}</strong>
|
||||
#else
|
||||
<a href="builds?prefix=$char$util.passthrough_except($self, 'prefix')">$char</a>
|
||||
#end if
|
||||
<a href="builds?prefix={{ char }}{{ util.passthrough_except('prefix') }}">{{ char }}</a>
|
||||
#endif
|
||||
|
|
||||
#end for
|
||||
#if $prefix
|
||||
<a href="builds?${util.passthrough_except($self, 'prefix', prefix='')}">all</a>
|
||||
#endfor
|
||||
#if prefix
|
||||
<a href="builds?{{ util.passthrough_except('prefix', prefix='') }}">all</a>
|
||||
#else
|
||||
<strong>all</strong>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="#if $tag then '6' else '5'#">
|
||||
#if $len($buildPages) > 1
|
||||
<td class="paginate" colspan="{{ '6' if tag else '5' }}">
|
||||
#if (buildPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $buildPages
|
||||
<option value="$pageNum"#if $pageNum == $buildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * {{ buildRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in buildPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildStart > 0
|
||||
<a href="builds?start=#echo $buildStart - $buildRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalBuilds != 0
|
||||
<strong>Builds #echo $buildStart + 1 # through #echo $buildStart + $buildCount # of $totalBuilds</strong>
|
||||
#end if
|
||||
#if $buildStart + $buildCount < $totalBuilds
|
||||
<a href="builds?start=#echo $buildStart + $buildRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildStart > 0
|
||||
<a href="builds?start={{ buildStart - buildRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalBuilds != 0
|
||||
<strong>Builds {{ buildStart + 1 }} through {{ buildStart + buildCount }} of {{ totalBuilds }}</strong>
|
||||
#endif
|
||||
#if buildStart + buildCount < totalBuilds
|
||||
<a href="builds?start={{ buildStart + buildRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="builds?order=$util.toggleOrder($self, 'build_id')$util.passthrough_except($self, 'order')">ID</a> $util.sortImage($self, 'build_id')</th>
|
||||
<th><a href="builds?order=$util.toggleOrder($self, 'nvr')$util.passthrough_except($self, 'order')">NVR</a> $util.sortImage($self, 'nvr')</th>
|
||||
#if $tag
|
||||
<th><a href="builds?order=$util.toggleOrder($self, 'tag_name')$util.passthrough_except($self, 'order')">Tag</a> $util.sortImage($self, 'tag_name')</th>
|
||||
#end if
|
||||
<th><a href="builds?order=$util.toggleOrder($self, 'owner_name')$util.passthrough_except($self, 'order')">Built by</a> $util.sortImage($self, 'owner_name')</th>
|
||||
<th><a href="builds?order=$util.toggleOrder($self, 'completion_time')$util.passthrough_except($self, 'order')">Finished</a> $util.sortImage($self, 'completion_time')</th>
|
||||
<th><a href="builds?order=$util.toggleOrder($self, 'state')$util.passthrough_except($self, 'order')">State</a> $util.sortImage($self, 'state')</th>
|
||||
<th><a href="builds?order={{ util.toggleOrder('build_id') }}{{ util.passthrough_except('order') }}">ID</a> {{ util.sortImage('build_id') }}</th>
|
||||
<th><a href="builds?order={{ util.toggleOrder('nvr') }}{{ util.passthrough_except('order') }}">NVR</a> {{ util.sortImage('nvr') }}</th>
|
||||
#if tag
|
||||
<th><a href="builds?order={{ util.toggleOrder('tag_name') }}{{ util.passthrough_except('order') }}">Tag</a> {{ util.sortImage('tag_name') }}</th>
|
||||
#endif
|
||||
<th><a href="builds?order={{ util.toggleOrder('owner_name') }}{{ util.passthrough_except('order') }}">Built by</a> {{ util.sortImage('owner_name') }}</th>
|
||||
<th><a href="builds?order={{ util.toggleOrder('completion_time') }}{{ util.passthrough_except('order') }}">Finished</a> {{ util.sortImage('completion_time') }}</th>
|
||||
<th><a href="builds?order={{ util.toggleOrder('state') }}{{ util.passthrough_except('order') }}">State</a> {{ util.sortImage('state') }}</th>
|
||||
</tr>
|
||||
#if $len($builds) > 0
|
||||
#for $build in $builds
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$build.build_id</td>
|
||||
<td><a href="buildinfo?buildID=$build.build_id">$koji.buildLabel($build)</a></td>
|
||||
#if $tag
|
||||
<td><a href="taginfo?tagID=$build.tag_id">$build.tag_name</a></td>
|
||||
#end if
|
||||
<td class="user-$build.owner_name"><a href="userinfo?userID=$build.owner_id">$build.owner_name</a></td>
|
||||
<td>$util.formatTime($build.completion_time)</td>
|
||||
#set $stateName = $util.stateName($build.state)
|
||||
<td class="$stateName">$util.stateImage($build.state)</td>
|
||||
#if (builds |length) > 0
|
||||
#for build in builds
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ build.build_id }}</td>
|
||||
<td><a href="buildinfo?buildID={{ build.build_id }}">{{ koji.buildLabel(build) }}</a></td>
|
||||
#if tag
|
||||
<td><a href="taginfo?tagID={{ build.tag_id }}">{{ build.tag_name }}</a></td>
|
||||
#endif
|
||||
<td class="user-{{ build.owner_name }}"><a href="userinfo?userID={{ build.owner_id }}">{{ build.owner_name }}</a></td>
|
||||
<td>{{ util.formatTime(build.completion_time) }}</td>
|
||||
#set stateName = util.stateName(build.state)
|
||||
<td class="{{ stateName }}">{{ util.stateImage(build.state) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="#if $tag then '6' else '5'#">No builds</td>
|
||||
<td colspan="{{ '6' if tag else '5' }}">No builds</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="#if $tag then '6' else '5'#">
|
||||
#if $len($buildPages) > 1
|
||||
<td class="paginate" colspan="{{ '6' if tag else '5' }}">
|
||||
#if (buildPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $buildPages
|
||||
<option value="$pageNum"#if $pageNum == $buildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'builds?start=' + this.value * {{ buildRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in buildPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildStart > 0
|
||||
<a href="builds?start=#echo $buildStart - $buildRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalBuilds != 0
|
||||
<strong>Builds #echo $buildStart + 1 # through #echo $buildStart + $buildCount # of $totalBuilds</strong>
|
||||
#end if
|
||||
#if $buildStart + $buildCount < $totalBuilds
|
||||
<a href="builds?start=#echo $buildStart + $buildRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildStart > 0
|
||||
<a href="builds?start={{ buildStart - buildRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalBuilds != 0
|
||||
<strong>Builds {{ buildStart + 1 }} through {{ buildStart + buildCount }} of {{ totalBuilds }}</strong>
|
||||
#endif
|
||||
#if buildStart + buildCount < totalBuilds
|
||||
<a href="builds?start={{ buildStart + buildRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,36 +1,34 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#@util.safe_return
|
||||
#def printOption(value, label=None)
|
||||
#if not $label
|
||||
#set $label = $value
|
||||
#end if
|
||||
<option value="$value"#if $value == $days then ' selected' else ''#>$label</option>
|
||||
#end def
|
||||
#macro printOption(value, label=None)
|
||||
#if not label
|
||||
#set label = value
|
||||
#endif
|
||||
<option value="{{ value }}"{{ ' selected' if value == days else '' }}>{{ label }}</option>
|
||||
#endmacro
|
||||
|
||||
#set $numTotal = $numSucceeded + $numFailed + $numCanceled
|
||||
#set numTotal = numSucceeded + numFailed + numCanceled
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Succeeded/Failed/Canceled Builds#if $days != -1 then ' in the last %i days' % $days else ''#</h4>
|
||||
<h4>Succeeded/Failed/Canceled Builds{{ ' in the last %i days' % days if days != -1 else '' }}</h4>
|
||||
<table class="data-list">
|
||||
<tr style="text-align: left">
|
||||
<td colspan="3">
|
||||
<form action="">
|
||||
Show last
|
||||
<select onchange="javascript: window.location = 'buildsbystatus?days=' + this.value;">
|
||||
$printOption(1)
|
||||
$printOption(3)
|
||||
$printOption(5)
|
||||
$printOption(7)
|
||||
$printOption(14)
|
||||
$printOption(30)
|
||||
$printOption(60)
|
||||
$printOption(90)
|
||||
$printOption(120)
|
||||
$printOption(180)
|
||||
$printOption(365)
|
||||
$printOption(-1, 'all')
|
||||
{{ printOption(1) }}
|
||||
{{ printOption(3) }}
|
||||
{{ printOption(5) }}
|
||||
{{ printOption(7) }}
|
||||
{{ printOption(14) }}
|
||||
{{ printOption(30) }}
|
||||
{{ printOption(60) }}
|
||||
{{ printOption(90) }}
|
||||
{{ printOption(120) }}
|
||||
{{ printOption(180) }}
|
||||
{{ printOption(365) }}
|
||||
{{ printOption(-1, 'all') }}
|
||||
</select> days
|
||||
</form>
|
||||
</td>
|
||||
|
|
@ -42,24 +40,24 @@
|
|||
</tr>
|
||||
<tr class="row-odd taskclosed">
|
||||
<td>Succeeded</td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $numSucceeded#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$numSucceeded</td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * numSucceeded }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ numSucceeded }}</td>
|
||||
</tr>
|
||||
<tr class="row-even taskfailed">
|
||||
<td>Failed</td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $numFailed#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$numFailed</td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * numFailed }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ numFailed }}</td>
|
||||
</tr>
|
||||
<tr class="row-odd taskcanceled">
|
||||
<td>Canceled</td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $numCanceled#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$numCanceled</td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * numCanceled }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ numCanceled }}</td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td>Total</td>
|
||||
<td></td>
|
||||
<td>$numTotal</td>
|
||||
<td>{{ numTotal }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,101 +1,98 @@
|
|||
#from kojiweb import util
|
||||
#from urllib.parse import quote
|
||||
|
||||
#@util.safe_return
|
||||
#def printOption(value, label=None)
|
||||
#if not $label
|
||||
#set $label = $value
|
||||
#end if
|
||||
<option value="$value"#if $value == $days then ' selected' else ''#>$label</option>
|
||||
#end def
|
||||
#macro printOption(value, label=None)
|
||||
#if not label
|
||||
#set label = value
|
||||
#endif
|
||||
<option value="{{ value }}"{{ ' selected' if value == days else '' }}>{{ label }}</option>
|
||||
#endmacro
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Builds by Target#if $days != -1 then ' in the last %i days' % $days else ''#</h4>
|
||||
<h4>Builds by Target{{ ' in the last %i days' % days if days != -1 else '' }}</h4>
|
||||
<table class="data-list">
|
||||
<tr style="text-align: left">
|
||||
<td colspan="3">
|
||||
<form action="">
|
||||
Show last
|
||||
<select onchange="javascript: window.location = 'buildsbytarget?days=' + this.value + '$util.passthrough($self, 'order')';">
|
||||
$printOption(1)
|
||||
$printOption(3)
|
||||
$printOption(5)
|
||||
$printOption(7)
|
||||
$printOption(14)
|
||||
$printOption(30)
|
||||
$printOption(60)
|
||||
$printOption(90)
|
||||
$printOption(120)
|
||||
$printOption(-1, 'all')
|
||||
<select onchange="javascript: window.location = 'buildsbytarget?days=' + this.value + '{{ util.passthrough('order') }}';">
|
||||
{{ printOption(1) }}
|
||||
{{ printOption(3) }}
|
||||
{{ printOption(5) }}
|
||||
{{ printOption(7) }}
|
||||
{{ printOption(14) }}
|
||||
{{ printOption(30) }}
|
||||
{{ printOption(60) }}
|
||||
{{ printOption(90) }}
|
||||
{{ printOption(120) }}
|
||||
{{ printOption(-1, 'all') }}
|
||||
</select> days
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($targetPages) > 1
|
||||
#if (targetPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'buildsbytarget?start=' + this.value * $targetRange + '$util.passthrough($self, 'days', 'order')';">
|
||||
#for $pageNum in $targetPages
|
||||
<option value="$pageNum"#if $pageNum == $targetCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'buildsbytarget?start=' + this.value * {{ targetRange }} + '{{ util.passthrough('days', 'order') }}';">
|
||||
#for pageNum in targetPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == targetCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $targetStart > 0
|
||||
<a href="buildsbytarget?start=#echo $targetStart - $targetRange #$util.passthrough($self, 'days', 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalTargets != 0
|
||||
<strong>Build Targets #echo $targetStart + 1 # through #echo $targetStart + $targetCount # of $totalTargets</strong>
|
||||
#end if
|
||||
#if $targetStart + $targetCount < $totalTargets
|
||||
<a href="buildsbytarget?start=#echo $targetStart + $targetRange#$util.passthrough($self, 'days', 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if targetStart > 0
|
||||
<a href="buildsbytarget?start={{ targetStart - targetRange }}{{ util.passthrough('days', 'order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalTargets != 0
|
||||
<strong>Build Targets {{ targetStart + 1 }} through {{ targetStart + targetCount }} of {{ totalTargets }}</strong>
|
||||
#endif
|
||||
#if targetStart + targetCount < totalTargets
|
||||
<a href="buildsbytarget?start={{ targetStart + targetRange }}{{ util.passthrough('days', 'order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="buildsbytarget?order=$util.toggleOrder($self, 'name')$util.passthrough($self, 'days')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="buildsbytarget?order=$util.toggleOrder($self, 'builds')$util.passthrough($self, 'days')">Builds</a> $util.sortImage($self, 'builds')</th>
|
||||
<th><a href="buildsbytarget?order={{ util.toggleOrder('name') }}{{ util.passthrough('days') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th><a href="buildsbytarget?order={{ util.toggleOrder('builds') }}{{ util.passthrough('days') }}">Builds</a> {{ util.sortImage('builds') }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
#if $len($targets) > 0
|
||||
#for $target in $targets
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="buildtargetinfo?name=$quote($target.name)">$target.name</a></td>
|
||||
<td width="#echo $graphWidth + 5#"><img src=$util.themePath('images/1px.gif') width="#echo $increment * $target.builds#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$target.builds</td>
|
||||
#if (targets |length) > 0
|
||||
#for target in targets
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="buildtargetinfo?name={{ target.name|urlencode }}">{{ target.name }}</a></td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src={{ util.themePath('images/1px.gif') }} width="{{ increment * target.builds }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ target.builds }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No builds</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($targetPages) > 1
|
||||
#if (targetPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'buildsbytarget?start=' + this.value * $targetRange + '$util.passthrough($self, 'days', 'order')';">
|
||||
#for $pageNum in $targetPages
|
||||
<option value="$pageNum"#if $pageNum == $targetCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'buildsbytarget?start=' + this.value * {{ targetRange }} + '{{ util.passthrough('days', 'order') }}';">
|
||||
#for pageNum in targetPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == targetCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $targetStart > 0
|
||||
<a href="buildsbytarget?start=#echo $targetStart - $targetRange #$util.passthrough($self, 'days', 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalTargets != 0
|
||||
<strong>Build Targets #echo $targetStart + 1 # through #echo $targetStart + $targetCount # of $totalTargets</strong>
|
||||
#end if
|
||||
#if $targetStart + $targetCount < $totalTargets
|
||||
<a href="buildsbytarget?start=#echo $targetStart + $targetRange#$util.passthrough($self, 'days', 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if targetStart > 0
|
||||
<a href="buildsbytarget?start={{ targetStart - targetRange }}{{ util.passthrough('days', 'order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalTargets != 0
|
||||
<strong>Build Targets {{ targetStart + 1 }} through {{ targetStart + targetCount }} of {{ totalTargets }}</strong>
|
||||
#endif
|
||||
#if targetStart + targetCount < totalTargets
|
||||
<a href="buildsbytarget?start={{ targetStart + targetRange }}{{ util.passthrough('days', 'order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,73 +1,72 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Builds by User</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($userBuildPages) > 1
|
||||
#if (userBuildPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'buildsbyuser?start=' + this.value * $userBuildRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $userBuildPages
|
||||
<option value="$pageNum"#if $pageNum == $userBuildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'buildsbyuser?start=' + this.value * {{ userBuildRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in userBuildPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == userBuildCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userBuildStart > 0
|
||||
<a href="buildsbyuser?start=#echo $userBuildStart - $userBuildRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalUserBuilds != 0
|
||||
<strong>Users #echo $userBuildStart + 1 # through #echo $userBuildStart + $userBuildCount # of $totalUserBuilds</strong>
|
||||
#end if
|
||||
#if $userBuildStart + $userBuildCount < $totalUserBuilds
|
||||
<a href="buildsbyuser?start=#echo $userBuildStart + $userBuildRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userBuildStart > 0
|
||||
<a href="buildsbyuser?start={{ userBuildStart - userBuildRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUserBuilds != 0
|
||||
<strong>Users {{ userBuildStart + 1 }} through {{ userBuildStart + userBuildCount }} of {{ totalUserBuilds }}</strong>
|
||||
#endif
|
||||
#if userBuildStart + userBuildCount < totalUserBuilds
|
||||
<a href="buildsbyuser?start={{ userBuildStart + userBuildRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="buildsbyuser?order=$util.toggleOrder($self, 'name')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="buildsbyuser?order=$util.toggleOrder($self, 'builds')">Builds</a> $util.sortImage($self, 'builds')</th>
|
||||
<th><a href="buildsbyuser?order={{ util.toggleOrder('name') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th><a href="buildsbyuser?order={{ util.toggleOrder('builds') }}">Builds</a> {{ util.sortImage('builds') }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
#if $len($userBuilds) > 0
|
||||
#for $userBuild in $userBuilds
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="userinfo?userID=$userBuild.id">$userBuild.name</a></td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $userBuild.builds#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$userBuild.builds</td>
|
||||
#if (userBuilds |length) > 0
|
||||
#for userBuild in userBuilds
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="userinfo?userID={{ userBuild.id }}">{{ userBuild.name }}</a></td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * userBuild.builds }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ userBuild.builds }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No users</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($userBuildPages) > 1
|
||||
#if (userBuildPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'buildsbyuser?start=' + this.value * $userBuildRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $userBuildPages
|
||||
<option value="$pageNum"#if $pageNum == $userBuildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'buildsbyuser?start=' + this.value * {{ userBuildRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in userBuildPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == userBuildCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userBuildStart > 0
|
||||
<a href="buildsbyuser?start=#echo $userBuildStart - $userBuildRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalUserBuilds != 0
|
||||
<strong>Users #echo $userBuildStart + 1 # through #echo $userBuildStart + $userBuildCount # of $totalUserBuilds</strong>
|
||||
#end if
|
||||
#if $userBuildStart + $userBuildCount < $totalUserBuilds
|
||||
<a href="buildsbyuser?start=#echo $userBuildStart + $userBuildRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userBuildStart > 0
|
||||
<a href="buildsbyuser?start={{ userBuildStart - userBuildRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUserBuilds != 0
|
||||
<strong>Users {{ userBuildStart + 1 }} through {{ userBuildStart + userBuildCount }} of {{ totalUserBuilds }}</strong>
|
||||
#endif
|
||||
#if userBuildStart + userBuildCount < totalUserBuilds
|
||||
<a href="buildsbyuser?start={{ userBuildStart + userBuildRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,38 +1,37 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#if $target
|
||||
<h4>Edit target $target.name</h4>
|
||||
#if target
|
||||
<h4>Edit target {{ target.name }}</h4>
|
||||
#else
|
||||
<h4>Create build target</h4>
|
||||
#end if
|
||||
#endif
|
||||
|
||||
<form action="#if $target then 'buildtargetedit' else 'buildtargetcreate'#">
|
||||
$util.authToken($self, form=True)
|
||||
#if $target
|
||||
<input type="hidden" name="targetID" value="$target.id"/>
|
||||
#end if
|
||||
<form action="{{ 'buildtargetedit' if target else 'buildtargetcreate' }}">
|
||||
{{ util.authToken(form=True) }}
|
||||
#if target
|
||||
<input type="hidden" name="targetID" value="{{ target.id }}"/>
|
||||
#endif
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>
|
||||
<input type="text" name="name" size="50" value="#if $target then $target.name else ''#"/>
|
||||
<input type="text" name="name" size="50" value="{{ target.name if target else '' }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
#if $target
|
||||
#if target
|
||||
<tr>
|
||||
<th>ID</th><td>$target.id</td>
|
||||
<th>ID</th><td>{{ target.id }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Build Tag</th>
|
||||
<td>
|
||||
<select name="buildTag">
|
||||
<option value="">select tag</option>
|
||||
#for $tag in $tags
|
||||
<option value="$tag.id"#if $target and $target.build_tag == $tag.id then ' selected' else ''#>$tag.name</option>
|
||||
#end for
|
||||
#for tag in tags
|
||||
<option value="{{ tag.id }}"{{ ' selected' if target and target.build_tag == tag.id else '' }}>{{ tag.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -41,23 +40,23 @@
|
|||
<td>
|
||||
<select name="destTag">
|
||||
<option value="">select tag</option>
|
||||
#for $tag in $tags
|
||||
<option value="$tag.id"#if $target and $target.dest_tag == $tag.id then ' selected' else ''#>$tag.name</option>
|
||||
#end for
|
||||
#for tag in tags
|
||||
<option value="{{ tag.id }}"{{ ' selected' if target and target.dest_tag == tag.id else '' }}>{{ tag.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
#if $target
|
||||
#if target
|
||||
<button type="submit" name="save" value="Save">Save</button>
|
||||
#else
|
||||
<button type="submit" name="add" value="Add">Add</button>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
<td><button type="submit" name="cancel" value="Cancel">Cancel</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,30 +1,28 @@
|
|||
#from kojiweb import util
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#include "includes/header.chtml"
|
||||
|
||||
<h4>Information for target <a href="buildtargetinfo?targetID=$target.id">$target.name</a></h4>
|
||||
<h4>Information for target <a href="buildtargetinfo?targetID={{ target.id }}">{{ target.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$target.name</td>
|
||||
<th>Name</th><td>{{ target.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$target.id</td>
|
||||
<th>ID</th><td>{{ target.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Build Tag</th><td><a href="taginfo?tagID=$buildTag.id">$buildTag.name</a></td>
|
||||
<th>Build Tag</th><td><a href="taginfo?tagID={{ buildTag.id }}">{{ buildTag.name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Destination Tag</th><td><a href="taginfo?tagID=$destTag.id">$destTag.name</a></td>
|
||||
<th>Destination Tag</th><td><a href="taginfo?tagID={{ destTag.id }}">{{ destTag.name }}</a></td>
|
||||
</tr>
|
||||
#if 'admin' in $perms
|
||||
#if "admin" in perms
|
||||
<tr>
|
||||
<td colspan="2"><a href="buildtargetedit?targetID=$target.id$util.authToken($self)">Edit</a></td>
|
||||
<td colspan="2"><a href="buildtargetedit?targetID={{ target.id }}{{ util.authToken() }}">Edit</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><a href="buildtargetdelete?targetID=$target.id$util.authToken($self)">Delete</a></td>
|
||||
<td colspan="2"><a href="buildtargetdelete?targetID={{ target.id }}{{ util.authToken() }}">Delete</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,76 +1,75 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Build Targets</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($targetPages) > 1
|
||||
#if (targetPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'buildtargets?start=' + this.value * $targetRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $targetPages
|
||||
<option value="$pageNum"#if $pageNum == $targetCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'buildtargets?start=' + this.value * {{ targetRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in targetPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == targetCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $targetStart > 0
|
||||
<a href="buildtargets?start=#echo $targetStart - $targetRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalTargets != 0
|
||||
<strong>Targets #echo $targetStart + 1 # through #echo $targetStart + $targetCount # of $totalTargets</strong>
|
||||
#end if
|
||||
#if $targetStart + $targetCount < $totalTargets
|
||||
<a href="buildtargets?start=#echo $targetStart + $targetRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if targetStart > 0
|
||||
<a href="buildtargets?start={{ targetStart - targetRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalTargets != 0
|
||||
<strong>Targets {{ targetStart + 1 }} through {{ targetStart + targetCount }} of {{ totalTargets }}</strong>
|
||||
#endif
|
||||
#if targetStart + targetCount < totalTargets
|
||||
<a href="buildtargets?start={{ targetStart + targetRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="buildtargets?order=$util.toggleOrder($self, 'id')">ID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="buildtargets?order=$util.toggleOrder($self, 'name')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="buildtargets?order={{ util.toggleOrder('id') }}">ID</a> {{ util.sortImage('id') }}</th>
|
||||
<th><a href="buildtargets?order={{ util.toggleOrder('name') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
</tr>
|
||||
#if $len($targets) > 0
|
||||
#for $target in $targets
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$target.id</td>
|
||||
<td><a href="buildtargetinfo?targetID=$target.id">$target.name</a></td>
|
||||
#if (targets |length) > 0
|
||||
#for target in targets
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ target.id }}</td>
|
||||
<td><a href="buildtargetinfo?targetID={{ target.id }}">{{ target.name }}</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="2">No build targets</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($targetPages) > 1
|
||||
#if (targetPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'buildtargets?start=' + this.value * $targetRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $targetPages
|
||||
<option value="$pageNum"#if $pageNum == $targetCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'buildtargets?start=' + this.value * {{ targetRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in targetPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == targetCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $targetStart > 0
|
||||
<a href="buildtargets?start=#echo $targetStart - $targetRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalTargets != 0
|
||||
<strong>Targets #echo $targetStart + 1 # through #echo $targetStart + $targetCount # of $totalTargets</strong>
|
||||
#end if
|
||||
#if $targetStart + $targetCount < $totalTargets
|
||||
<a href="buildtargets?start=#echo $targetStart + $targetRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if targetStart > 0
|
||||
<a href="buildtargets?start={{ targetStart - targetRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalTargets != 0
|
||||
<strong>Targets {{ targetStart + 1 }} through {{ targetStart + targetCount }} of {{ totalTargets }}</strong>
|
||||
#endif
|
||||
#if targetStart + targetCount < totalTargets
|
||||
<a href="buildtargets?start={{ targetStart + targetRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#if 'admin' in $perms
|
||||
#if 'admin' in perms
|
||||
<br/>
|
||||
<a href="buildtargetcreate$util.authToken($self, first=True)">Create new Build Target</a>
|
||||
#end if
|
||||
<a href="buildtargetcreate{{ util.authToken(first=True) }}">Create new Build Target</a>
|
||||
#endif
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,60 +1,59 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for channel <a href="channelinfo?channelID=$channel.id">$channel.name</a></h4>
|
||||
<h4>Information for channel <a href="channelinfo?channelID={{ channel.id }}">{{ channel.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$channel.name</td>
|
||||
<th>Name</th><td>{{ channel.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$channel.id</td>
|
||||
<th>ID</th><td>{{ channel.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th><td>$channel.description</td>
|
||||
<th>Description</th><td>{{ channel.description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#set $enabled = $channel.enabled and 'yes' or 'no'
|
||||
#set enabled = channel.enabled and 'yes' or 'no'
|
||||
<th>Enabled?</th>
|
||||
<td class="$enabled">
|
||||
$util.imageTag($enabled)
|
||||
<td class="{{ enabled }}">
|
||||
{{ util.imageTag(enabled) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Comment</th><td>$channel.comment</td>
|
||||
<th>Comment</th><td>{{ channel.comment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Active Tasks</th><td><a href="tasks?view=flat&channelID=$channel.id">$taskCount</a></td>
|
||||
<th>Active Tasks</th><td><a href="tasks?view=flat&channelID={{ channel.id }}">{{ taskCount }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Hosts</th>
|
||||
<td>
|
||||
#if $len($hosts) > 0
|
||||
#if hosts | length > 0
|
||||
<table class="data-list">
|
||||
<tr class="list-header">
|
||||
<th>Hostname</th>
|
||||
<th>Enabled</th>
|
||||
<th>Ready</th>
|
||||
</tr>
|
||||
#for $host in $hosts
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="hostinfo?hostID=$host.id">$host.name</a></td>
|
||||
<td class="$str($bool($host.enabled)).lower()">#if $host.enabled then $util.imageTag('yes') else $util.imageTag('no')#</td>
|
||||
<td class="$str($bool($host.ready)).lower()">#if $host.ready then $util.imageTag('yes') else $util.imageTag('no')#</td>
|
||||
#for host in hosts
|
||||
<tr class="{{ util.rowToggle }}({{ self }})">
|
||||
<td><a href="hostinfo?hostID={{ host.id }}">{{ host.name }}</a></td>
|
||||
<td class="{{ host.enabled |string |lower }}">{{ util.imageTag('yes') if host.enabled else util.imageTag('no') }}</td>
|
||||
<td class="{{ host.ready |string |lower }}">{{ util.imageTag('yes') if host.ready else util.imageTag('no') }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
<tr>
|
||||
<th>Total</th>
|
||||
<td>$enabled_hosts</td>
|
||||
<td>$ready_hosts</td>
|
||||
<td>{{ enabled_hosts }}</td>
|
||||
<td>{{ ready_hosts }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
#else
|
||||
No hosts
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#@util.safe_return
|
||||
#def printOption(value, label=None)
|
||||
#if not $label
|
||||
#set $label = $value
|
||||
#end if
|
||||
<option value="$value"#if $value == $arch then ' selected' else ''#>$label</option>
|
||||
#end def
|
||||
#macro printOption(value, label=None)
|
||||
#if not label
|
||||
#set label = value
|
||||
#endif
|
||||
<option value="{{ value }}"{{ ' selected' if value == arch else '' }}>{{ label }}</option>
|
||||
#endmacro
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
<style>
|
||||
span {
|
||||
display: inline-block;
|
||||
|
|
@ -43,11 +41,11 @@
|
|||
<td colspan="3">
|
||||
<form action="">
|
||||
Architecture:
|
||||
<select onchange="javascript: window.location = 'clusterhealth?arch=' + this.value + '$util.passthrough($self, 'order')';">
|
||||
$printOption('__all__', 'all')
|
||||
#for $arch in $arches
|
||||
$printOption($arch)
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'clusterhealth?arch=' + this.value + '{{ util.passthrough('order') }}';">
|
||||
{{ printOption('__all__', 'all') }}
|
||||
#for arch in arches
|
||||
{{ printOption(arch) }}
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
</td>
|
||||
|
|
@ -57,29 +55,29 @@
|
|||
<th>Load/Capacity</th>
|
||||
<th>Builder readiness</th>
|
||||
</tr>
|
||||
#for $channel in $channels
|
||||
#if $channel['enabled_channel']
|
||||
#for channel in channels
|
||||
#if channel['enabled_channel']
|
||||
<tr>
|
||||
<th>
|
||||
<a href="channelinfo?channelID=$channel['id']">$channel['name']</a>
|
||||
<a href="channelinfo?channelID={{ channel.id }}">{{ channel.name }}</a>
|
||||
</th>
|
||||
<td width="$graphWidth" class="graph">
|
||||
#if $channel['capacityPerc']
|
||||
<span style="width: $channel['capacityPerc']%">
|
||||
<span style="width: #echo $channel['perc_load']#%" class="busy" title="Load: #echo int($channel['load'])#"></span>
|
||||
<span style="width: #echo 100 - $channel['perc_load']#%" class="free" title="Free capacity: #echo int($channel['capacity'] - $channel['load'])#">#echo int(100 - $channel['perc_load'])#% </span>
|
||||
<td width="{{ graphWidth }}" class="graph">
|
||||
#if channel['capacityPerc']
|
||||
<span style="width: {{ channel.capacityPerc }}%">
|
||||
<span style="width: {{ channel.perc_load }}%" class="busy" title="Load: {{ channel.load|int }}"></span>
|
||||
<span style="width: {{ 100 - channel.perc_load }}%" class="free" title="Free capacity: {{ (channel.capacity - channel.load)|int }}">{{ (100 - channel.perc_load)|int }}% </span>
|
||||
</span>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
<td width="$graphWidth" class="graph">
|
||||
<span style="width: #echo $channel['enabledPerc']#%">
|
||||
<span style="width: #echo 100 - $channel['perc_ready']#%" class="busy" title="Busy builders: #echo $channel['enabled'] - $channel['ready']#"></span>
|
||||
<span style="width: #echo $channel['perc_ready']#%" class="free" title="Ready builders: $channel['ready']"">#echo int($channel['ready'])# </span>
|
||||
<td width="{{ graphWidth }}" class="graph">
|
||||
<span style="width: {{ channel.enabledPerc }}%">
|
||||
<span style="width: {{ 100 - channel.perc_ready }}%" class="busy" title="Busy builders: {{ channel.enabled - channel.ready }}"></span>
|
||||
<span style="width: {{ channel.perc_ready }}%" class="free" title="Ready builders: {{ channel.ready }}"">{{ channel.ready|int }} </span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
#end for
|
||||
#endif
|
||||
#endfor
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,29 +1,27 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Error</h4>
|
||||
|
||||
<div>
|
||||
$explanation
|
||||
{{ explanation }}
|
||||
</div>
|
||||
|
||||
#if $debug_level >= 1
|
||||
#if debug_level >= 1
|
||||
<div>
|
||||
#else
|
||||
<div style="visibility: hidden">
|
||||
#end if
|
||||
$tb_short
|
||||
#endif
|
||||
{{ tb_short }}
|
||||
</div>
|
||||
|
||||
#if $debug_level >= 2
|
||||
#if debug_level >= 2
|
||||
<div>
|
||||
#else
|
||||
<div style="visibility: hidden">
|
||||
#end if
|
||||
#endif
|
||||
<pre>
|
||||
#echo $tb_long
|
||||
{{ tb_long }}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,31 +1,29 @@
|
|||
#from kojiweb import util
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#include "includes/header.chtml"
|
||||
|
||||
<h4>Information for external repo <a href="externalrepoinfo?extrepoID=$extRepo.id">$extRepo.name</a></h4>
|
||||
<h4>Information for external repo <a href="externalrepoinfo?extrepoID={{ extRepo.id }}">{{ extRepo.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$extRepo.name</td>
|
||||
<th>Name</th><td>{{ extRepo.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$extRepo.id</td>
|
||||
<th>ID</th><td>{{ extRepo.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>URL</th><td><a href="$extRepo.url">$extRepo.url</a></td>
|
||||
<th>URL</th><td><a href="{{ extRepo.url }}">{{ extRepo.url }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Tags using this external repo</th>
|
||||
<td>
|
||||
#if $len($repoTags)
|
||||
#for $tag in $repoTags
|
||||
<a href="taginfo?tagID=$tag.tag_id">$tag.tag_name</a><br/>
|
||||
#end for
|
||||
#if repoTags|length
|
||||
#for tag in repoTags
|
||||
<a href="taginfo?tagID={{ tag.tag_id }}">{{ tag.tag_name }}</a><br/>
|
||||
#endfor
|
||||
#else
|
||||
No tags
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,64 +1,61 @@
|
|||
#import datetime
|
||||
#from kojiweb import util
|
||||
#from urllib.parse import quote
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#if $rpm
|
||||
<h4>Information for file <a href="fileinfo?rpmID=$rpm.id&filename=$quote($file.name)">$file.name</a></h4>
|
||||
#elif $archive
|
||||
<h4>Information for file <a href="fileinfo?archiveID=$archive.id&filename=$quote($file.name)">$file.name</a></h4>
|
||||
#end if
|
||||
#include "includes/header2.chtml"
|
||||
#if rpm
|
||||
<h4>Information for file <a href="fileinfo?rpmID={{ rpm.id }}&filename={{ file.name|urlencode }}">{{ file.name }}</a></h4>
|
||||
#elif archive
|
||||
<h4>Information for file <a href="fileinfo?archiveID={{ archive.id }}&filename={{ file.name|urlencode }}">{{ file.name }}</a></h4>
|
||||
#endif
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$file.name</td>
|
||||
<th>Name</th><td>{{ file.name }}</td>
|
||||
</tr>
|
||||
#if $rpm
|
||||
#if rpm
|
||||
<tr>
|
||||
<th>Digest ($file.digest_algo)</th><td>$file.digest</td>
|
||||
<th>Digest ({{ file.digest_algo }})</th><td>{{ file.digest }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Size</th><td><span title="$util.formatThousands($file.size)">$util.formatNatural($file.size)</span></td>
|
||||
<th>Size</th><td><span title="{{ util.formatThousands(file.size) }}">{{ util.formatNatural(file.size) }}</span></td>
|
||||
</tr>
|
||||
#if 'mtime' in $file and $file.mtime
|
||||
#if 'mtime' in file and file.mtime
|
||||
<tr>
|
||||
<th>Modification time</th><td>$util.formatTimeLong($file.mtime)</td>
|
||||
<th>Modification time</th><td>{{ util.formatTimeLong(file.mtime) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if 'user' in $file and $file.user
|
||||
#endif
|
||||
#if 'user' in file and file.user
|
||||
<tr>
|
||||
<th>User</th><td>$file.user</td>
|
||||
<th>User</th><td>{{ file.user }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if 'group' in $file and $file.group
|
||||
#endif
|
||||
#if 'group' in file and file.group
|
||||
<tr>
|
||||
<th>Group</th><td>$file.group</td>
|
||||
<th>Group</th><td>{{ file.group }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if 'mode' in $file and $file.mode
|
||||
#endif
|
||||
#if 'mode' in file and file.mode
|
||||
<tr>
|
||||
<th>Mode</th><td class="rpmheader">$util.formatMode($file.mode)</td>
|
||||
<th>Mode</th><td class="rpmheader">{{ util.formatMode(file.mode) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $rpm
|
||||
#endif
|
||||
#if rpm
|
||||
<tr>
|
||||
<th>Flags</th>
|
||||
<td>
|
||||
#for flag in $util.formatFileFlags($file.flags)
|
||||
$flag<br/>
|
||||
#end for
|
||||
#for flag in util.formatFileFlags(file.flags)
|
||||
{{ flag }}<br/>
|
||||
#endfor
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#set $epoch = ($rpm.epoch != None and $str($rpm.epoch) + ':' or '')
|
||||
<th>RPM</th><td><a href="rpminfo?rpmID=$rpm.id">$rpm.name-$epoch$rpm.version-$rpm.release.${rpm.arch}.rpm</a></td>
|
||||
#set epoch = (rpm.epoch != None and str(rpm.epoch) + ':' or '')
|
||||
<th>RPM</th><td><a href="rpminfo?rpmID={{ rpm.id }}">{{ rpm.name }}-{{ epoch }}{{ rpm.version }}-{{ rpm.release }}{{ rpm.arch }}.rpm</a></td>
|
||||
</tr>
|
||||
#elif $archive
|
||||
#elif archive
|
||||
<tr>
|
||||
<th>Archive</th><td><a href="archiveinfo?archiveID=$archive.id">$archive.filename</a></td>
|
||||
<th>Archive</th><td><a href="archiveinfo?archiveID={{ archive.id }}">{{ archive.filename }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,50 +1,49 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Edit host $host.name</h4>
|
||||
<h4>Edit host {{ host.name }}</h4>
|
||||
|
||||
<form action="hostedit">
|
||||
$util.authToken($self, form=True)
|
||||
{{ util.authToken(form=True) }}
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>$host.name</td>
|
||||
<td>{{ host.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<td>
|
||||
$host.id
|
||||
<input type="hidden" name="hostID" value="$host.id"/>
|
||||
{{ host.id }}
|
||||
<input type="hidden" name="hostID" value="{{ host.id }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arches</th>
|
||||
<td><input type="text" name="arches" value="$host.arches"/></td>
|
||||
<td><input type="text" name="arches" value="{{ host.arches }}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Capacity</th>
|
||||
<td><input type="text" name="capacity" value="$host.capacity"/></td>
|
||||
<td><input type="text" name="capacity" value="{{ host.capacity }}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<td><textarea name="description" rows="6" cols="50">$host.description</textarea></td>
|
||||
<td><textarea name="description" rows="6" cols="50">{{ host.description }}</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Comment</th>
|
||||
<td><textarea name="comment" rows="2" cols="50">$host.comment</textarea></td>
|
||||
<td><textarea name="comment" rows="2" cols="50">{{ host.comment }}</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Enabled?</th>
|
||||
<td><input type="checkbox" name="enabled" value="yes" #if $host.enabled then 'checked="checked"' else ''#/>
|
||||
<td><input type="checkbox" name="enabled" value="yes" {{ 'checked="checked"' if host.enabled else '' }}/>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Channels</th>
|
||||
<td>
|
||||
<select name="channels" multiple="multiple">
|
||||
#for $channel in $allChannels
|
||||
<option value="$channel.name" #if $channel in $hostChannels then 'selected' else ''#>$channel.name</option>
|
||||
#end for
|
||||
#for channel in allChannels
|
||||
<option value="{{ channel.name }}" {{ 'selected' if channel in hostChannels else '' }}>{{ channel.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
<tr>
|
||||
|
|
@ -54,4 +53,4 @@
|
|||
</table>
|
||||
</form>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,91 +1,90 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for host <a href="hostinfo?hostID=$host.id">$host.name</a></h4>
|
||||
<h4>Information for host <a href="hostinfo?hostID={{ host.id }}">{{ host.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$host.name</td>
|
||||
<th>Name</th><td>{{ host.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$host.id</td>
|
||||
<th>ID</th><td>{{ host.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arches</th><td>$host.arches</td>
|
||||
<th>Arches</th><td>{{ host.arches }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Capacity</th><td>$host.capacity</td>
|
||||
<th>Capacity</th><td>{{ host.capacity }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Task Load</th><td><a href="tasks?hostID=$host.id">#echo '%.2f' % $host.task_load#</a></td>
|
||||
<th>Task Load</th><td><a href="tasks?hostID={{ host.id }}">{{ '%.2f' % host.task_load }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th><td class="usertext">$host.description</td>
|
||||
<th>Description</th><td class="usertext">{{ host.description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Comment</th><td class="usertext">$host.comment</td>
|
||||
<th>Comment</th><td class="usertext">{{ host.comment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#set $enabled = $host.enabled and 'yes' or 'no'
|
||||
#set enabled = host.enabled and 'yes' or 'no'
|
||||
<th>Enabled?</th>
|
||||
<td class="$enabled">
|
||||
$util.imageTag($enabled)
|
||||
#if 'admin' in $perms
|
||||
#if $host.enabled
|
||||
<span class="adminLink">(<a href="disablehost?hostID=$host.id$util.authToken($self)">disable</a>)</span>
|
||||
<td class="{{ enabled }}">
|
||||
{{ util.imageTag(enabled) }}
|
||||
#if 'admin' in perms
|
||||
#if host.enabled
|
||||
<span class="adminLink">(<a href="disablehost?hostID={{ host.id }}{{ util.authToken() }}">disable</a>)</span>
|
||||
#else
|
||||
<span class="adminLink">(<a href="enablehost?hostID=$host.id$util.authToken($self)">enable</a>)</span>
|
||||
#end if
|
||||
#end if
|
||||
<span class="adminLink">(<a href="enablehost?hostID={{ host.id }}{{ util.authToken() }}">enable</a>)</span>
|
||||
#endif
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#set $ready = $host.ready and 'yes' or 'no'
|
||||
<th>Ready?</th><td class="$ready">$util.imageTag($ready)</td>
|
||||
#set ready = host.ready and 'yes' or 'no'
|
||||
<th>Ready?</th><td class="{{ ready }}">{{ util.imageTag(ready) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Last Update</th><td>$util.formatTime($lastUpdate)</td>
|
||||
<th>Last Update</th><td>{{ util.formatTime(lastUpdate) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Channels</th>
|
||||
<td>
|
||||
#for $channel in $channels
|
||||
<a href="channelinfo?channelID=$channel.id" class="$channel.enabled">$channel.name</a><br/>
|
||||
#end for
|
||||
#if not $channels
|
||||
#for channel in channels
|
||||
<a href="channelinfo?channelID={{ channel.id }}" class="{{ channel.enabled }}">{{ channel.name }}</a><br/>
|
||||
#endfor
|
||||
#if not channels
|
||||
No channels
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Active Buildroots</th>
|
||||
#if $buildroots
|
||||
#if buildroots
|
||||
<td class="container">
|
||||
<table class="nested data-list">
|
||||
<tr class="list-header">
|
||||
<th>Buildroot</th><th>Created</th><th>State</th>
|
||||
</tr>
|
||||
#for $buildroot in $buildroots
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="buildrootinfo?buildrootID=$buildroot.id">$buildroot.tag_name-$buildroot.id-$buildroot.repo_id</a></td>
|
||||
<td>$util.formatTime($buildroot.create_event_time)</td>
|
||||
<td>$util.imageTag($util.brStateName($buildroot.state))</td>
|
||||
#for buildroot in buildroots
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ buildroot.tag_name }}-{{ buildroot.id }}-{{ buildroot.repo_id }}</a></td>
|
||||
<td>{{ util.formatTime(buildroot.create_event_time) }}</td>
|
||||
<td>{{ util.imageTag(util.brStateName(buildroot.state)) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
</td>
|
||||
#else
|
||||
<td>
|
||||
No buildroots
|
||||
</td>
|
||||
#end if
|
||||
#endif
|
||||
</tr>
|
||||
#if 'admin' in $perms
|
||||
#if 'admin' in perms
|
||||
<tr>
|
||||
<td colspan="2"><a href="hostedit?hostID=$host.id$util.authToken($self)">Edit host</a></td>
|
||||
<td colspan="2"><a href="hostedit?hostID={{ host.id }}{{ util.authToken() }}">Edit host</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,48 +1,43 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#@util.safe_return
|
||||
#def headerState($state)
|
||||
#if $state == 'enabled'
|
||||
#macro headerState(state)
|
||||
#if state == 'enabled'
|
||||
Enabled hosts
|
||||
#elif $state == 'disabled'
|
||||
#elif state == 'disabled'
|
||||
Disabled hosts
|
||||
#else
|
||||
Hosts
|
||||
#end if
|
||||
#end def
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def headerReady($ready)
|
||||
#if $ready == 'ready'
|
||||
#macro headerReady(ready)
|
||||
#if ready == 'ready'
|
||||
which are ready
|
||||
#elif $ready == 'notready'
|
||||
#elif ready == 'notready'
|
||||
which are not ready
|
||||
#end if
|
||||
#end def
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def headerArch($arch)
|
||||
#if $arch == 'all'
|
||||
#macro headerArch(arch)
|
||||
#if arch == 'all'
|
||||
on all arches
|
||||
#else
|
||||
on $arch arch
|
||||
#end if
|
||||
#end def
|
||||
on {{ arch }} arch
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def headerChannel($channel)
|
||||
#if $channel == 'all'
|
||||
#macro headerChannel(channel)
|
||||
#if channel == 'all'
|
||||
in all channels
|
||||
#else
|
||||
in $channel channel
|
||||
#end if
|
||||
#end def
|
||||
in {{ channel }} channel
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#attr _PASSTHROUGH = ['state', 'order', 'ready', 'channel', 'arch']
|
||||
#set _PASSTHROUGH = ['state', 'order', 'ready', 'channel', 'arch']
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>$headerState($state) $headerReady($ready) $headerArch($arch) $headerChannel($channel)</h4>
|
||||
<h4>{{ headerState(state) }} {{ headerReady(ready) }} {{ headerArch(arch) }} {{ headerChannel(channel) }}</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
|
|
@ -50,39 +45,39 @@ in $channel channel
|
|||
<tr><td>
|
||||
<strong>State</strong>:
|
||||
</td><td>
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'hosts?state=' + this.value + '$util.passthrough_except($self, 'state')';">
|
||||
<option value="enabled" #if $state == 'enabled' then 'selected' else ''#>enabled</option>
|
||||
<option value="disabled" #if $state == 'disabled' then 'selected' else ''#>disabled</option>
|
||||
<option value="all" #if $state == 'all' then 'selected' else ''#>all</option>
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'hosts?state=' + this.value + '{{ util.passthrough_except('state') }}';">
|
||||
<option value="enabled" {{ 'selected' if state == 'enabled' else '' }}>enabled</option>
|
||||
<option value="disabled" {{ 'selected' if state == 'disabled' else '' }}>disabled</option>
|
||||
<option value="all" {{ 'selected' if state == 'all' else '' }}>all</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<strong>Channels</strong>:
|
||||
</td><td>
|
||||
<select name="channel" class="filterlist" onchange="javascript: window.location = 'hosts?channel=' + this.value + '$util.passthrough_except($self, 'channel')';">
|
||||
<option value="all" #if not $channel then 'selected' else ''#>all</option>
|
||||
#for $chan in $channels
|
||||
<option value="$chan.name" #if $chan.name == $channel then 'selected' else ''#>$chan.name</option>
|
||||
#end for
|
||||
<select name="channel" class="filterlist" onchange="javascript: window.location = 'hosts?channel=' + this.value + '{{ util.passthrough_except('channel') }}';">
|
||||
<option value="all" {{ 'selected' if not channel else '' }}>all</option>
|
||||
#for chan in channels
|
||||
<option value="{{ chan.name }}" {{ 'selected' if chan.name == channel else '' }}>{{ chan.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
<strong>Ready</strong>:
|
||||
</td><td>
|
||||
<select name="ready" class="filterlist" onchange="javascript: window.location = 'hosts?ready=' + this.value + '$util.passthrough_except($self, 'ready')';">
|
||||
<option value="yes" #if $ready == 'yes' then 'selected' else ''#>yes</option>
|
||||
<option value="no" #if $ready == 'no' then 'selected' else ''#>no</option>
|
||||
<option value="all" #if $ready== 'all' then 'selected' else ''#>all</option>
|
||||
<select name="ready" class="filterlist" onchange="javascript: window.location = 'hosts?ready=' + this.value + '{{ util.passthrough_except('ready') }}';">
|
||||
<option value="yes" {{ 'selected' if ready == 'yes' else '' }}>yes</option>
|
||||
<option value="no" {{ 'selected' if ready == 'no' else '' }}>no</option>
|
||||
<option value="all" {{ 'selected' if ready== 'all' else '' }}>all</option>
|
||||
</select>
|
||||
</td><td>
|
||||
<strong>Arches</strong>:
|
||||
</td><td>
|
||||
<select name="arch" class="filterlist" onchange="javascript: window.location = 'hosts?arch=' + this.value + '$util.passthrough_except($self, 'arch')';">
|
||||
<option value="all" #if not $arch then 'selected' else ''#>all</option>
|
||||
#for $arch_item in $arches
|
||||
<option value="$arch_item" #if $arch_item == $arch then 'selected' else ''#>$arch_item</option>
|
||||
#end for
|
||||
<select name="arch" class="filterlist" onchange="javascript: window.location = 'hosts?arch=' + this.value + '{{ util.passthrough_except('arch') }}';">
|
||||
<option value="all" {{ 'selected' if not arch else '' }}>all</option>
|
||||
#for arch_item in arches
|
||||
<option value="{{ arch_item }}" {{ 'selected' if arch_item == arch else '' }}>{{ arch_item }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
|
@ -90,84 +85,84 @@ in $channel channel
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="9">
|
||||
#if $len($hostPages) > 1
|
||||
#if (hostPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'hosts?start=' + this.value * $hostRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $hostPages
|
||||
<option value="$pageNum"#if $pageNum == $hostCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'hosts?start=' + this.value * {{ hostRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in hostPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $hostStart > 0
|
||||
<a href="hosts?start=#echo $hostStart - $hostRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalHosts != 0
|
||||
<strong>Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts</strong>
|
||||
#end if
|
||||
#if $hostStart + $hostCount < $totalHosts
|
||||
<a href="hosts?start=#echo $hostStart + $hostRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if hostStart > 0
|
||||
<a href="hosts?start={{ hostStart - hostRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalHosts != 0
|
||||
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
||||
#endif
|
||||
#if hostStart + hostCount < totalHosts
|
||||
<a href="hosts?start={{ hostStart + hostRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'id')$util.passthrough_except($self, 'order')">ID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'name')$util.passthrough_except($self, 'order')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'arches')$util.passthrough_except($self, 'order')">Arches</a> $util.sortImage($self, 'arches')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'channels')$util.passthrough_except($self, 'order')">Channels</a> $util.sortImage($self, 'channels')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'enabled')$util.passthrough_except($self, 'order')">Enabled?</a> $util.sortImage($self, 'enabled')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'ready')$util.passthrough_except($self, 'order')">Ready?</a> $util.sortImage($self, 'ready')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'task_load')$util.passthrough_except($self, 'order')">Load</a> $util.sortImage($self, 'task_load')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'capacity')$util.passthrough_except($self, 'order')">Cap.</a> $util.sortImage($self, 'capacity')</th>
|
||||
<th><a href="hosts?order=$util.toggleOrder($self, 'last_update')$util.passthrough_except($self, 'order')">Last Update</a> $util.sortImage($self, 'last_update')</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('id') }}{{ util.passthrough_except('order') }}">ID</a> {{ util.sortImage('id') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('name') }}{{ util.passthrough_except('order') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('arches') }}{{ util.passthrough_except('order') }}">Arches</a> {{ util.sortImage('arches') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('channels') }}{{ util.passthrough_except('order') }}">Channels</a> {{ util.sortImage('channels') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('enabled') }}{{ util.passthrough_except('order') }}">Enabled?</a> {{ util.sortImage('enabled') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('ready') }}{{ util.passthrough_except('order') }}">Ready?</a> {{ util.sortImage('ready') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('task_load') }}{{ util.passthrough_except('order') }}">Load</a> {{ util.sortImage('task_load') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('capacity') }}{{ util.passthrough_except('order') }}">Cap.</a> {{ util.sortImage('capacity') }}</th>
|
||||
<th><a href="hosts?order={{ util.toggleOrder('last_update') }}{{ util.passthrough_except('order') }}">Last Update</a> {{ util.sortImage('last_update') }}</th>
|
||||
</tr>
|
||||
#if $len($hosts) > 0
|
||||
#for $host in $hosts
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$host.id</td>
|
||||
<td><a href="hostinfo?hostID=$host.id">$host.name</a></td>
|
||||
<td>$host.arches</td>
|
||||
#if (hosts |length) > 0
|
||||
#for host in hosts
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ host.id }}</td>
|
||||
<td><a href="hostinfo?hostID={{ host.id }}">{{ host.name }}</a></td>
|
||||
<td>{{ host.arches }}</td>
|
||||
<td>
|
||||
#for $channame, $chan_id, $chan_enabled in zip($host.channels, $host.channels_id, $host.channels_enabled)
|
||||
<a href="channelinfo?channelID=$chan_id" class="$chan_enabled">$channame</a>
|
||||
#end for
|
||||
#for channame, chan_id, chan_enabled in zip(host.channels, host.channels_id, host.channels_enabled)
|
||||
<a href="channelinfo?channelID={{ chan_id }}" class="{{ chan_enabled }}">{{ channame }}</a>
|
||||
#endfor
|
||||
</td>
|
||||
<td class="$str($bool($host.enabled)).lower()">#if $host.enabled then $util.imageTag('yes') else $util.imageTag('no')#</td>
|
||||
<td class="$str($bool($host.ready)).lower()">#if $host.ready then $util.imageTag('yes') else $util.imageTag('no')#</td>
|
||||
<td>#echo '%.2f' % $host.task_load#</td>
|
||||
<td>$host.capacity</td>
|
||||
<td>$util.formatTime($host.last_update)</td>
|
||||
<td class="{{ 'true' if host.enabled else 'false' }}">{{ util.imageTag('yes') if host.enabled else util.imageTag('no') }}</td>
|
||||
<td class="{{ 'true' if host.ready else 'false' }}">{{ util.imageTag('yes') if host.ready else util.imageTag('no') }}</td>
|
||||
<td>{{ '%.2f' % host.task_load }}</td>
|
||||
<td>{{ host.capacity }}</td>
|
||||
<td>{{ util.formatTime(host.last_update) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="9">No hosts</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="9">
|
||||
#if $len($hostPages) > 1
|
||||
#if (hostPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'hosts?start=' + this.value * $hostRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $hostPages
|
||||
<option value="$pageNum"#if $pageNum == $hostCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'hosts?start=' + this.value * {{ hostRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in hostPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $hostStart > 0
|
||||
<a href="hosts?start=#echo $hostStart - $hostRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalHosts != 0
|
||||
<strong>Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts</strong>
|
||||
#end if
|
||||
#if $hostStart + $hostCount < $totalHosts
|
||||
<a href="hosts?start=#echo $hostStart + $hostRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if hostStart > 0
|
||||
<a href="hosts?start={{ hostStart - hostRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalHosts != 0
|
||||
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
||||
#endif
|
||||
#if hostStart + hostCount < totalHosts
|
||||
<a href="hosts?start={{ hostStart + hostRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
#import koji
|
||||
#import koji.util
|
||||
#from os.path import basename
|
||||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
|
||||
<h4>Information for image <a href="imageinfo?imageID=$image.id">$image.filename</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th><td>$image.id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>File Name</th><td>$image.filename</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>File Size</th><td><span title="$util.formatThousands($image.filesize)">$util.formatNatural($image.filesize)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arch</th><td>$image.arch</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Media Type</th><td>$image.mediatype</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#if $len($image.hash) == 32
|
||||
<th>Digest (md5)</th><td>$image.hash</td>
|
||||
#elif $len($image.hash) == 40
|
||||
<th>Digest (sha1)</th><td>$image.hash</td>
|
||||
#elif $len($image.hash) == 64
|
||||
<th>Digest (sha256)</th><td>$image.hash</td>
|
||||
#elif $len($image.hash) == 96
|
||||
<th>Digest (sha384)</th><td>$image.hash</td>
|
||||
#elif $len($image.hash) == 128
|
||||
<th>Digest (sha512)</th><td>$image.hash</td>
|
||||
#else
|
||||
<th>Hash </th><td>$image.hash</td>
|
||||
#end if
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Task</th><td><a href="taskinfo?taskID=$task.id" class="task$util.taskState($task.state)">$koji.taskLabel($task)</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Buildroot</th><td><a href="buildrootinfo?buildrootID=$buildroot.id">/var/lib/mock/$buildroot.tag_name-$buildroot.id-$buildroot.repo_id</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="rpmlist?imageID=$image.id&type=image" title="RPMs that where installed into the LiveCD">Included RPMs</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><a href="$imageBase/$image.filename">Download Image</a> (<a href="$imageBase/data/logs/$image.arch/">build logs</a>)</th>
|
||||
</tr>
|
||||
#if $image.get('xmlfile', None)
|
||||
<tr>
|
||||
<th colspan="2"><a href="$imageBase/$image.xmlfile">Download XML Description</a></th>
|
||||
</tr>
|
||||
#end if
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
#from kojiweb import util
|
||||
</div>
|
||||
|
||||
<p id="footer">
|
||||
Copyright © 2006-2016 Red Hat, Inc.
|
||||
<a href="https://pagure.io/koji/"><img src="$util.themePath('images/powered-by-koji.png')" alt="Powered By Koji" id="PoweredByKojiLogo"/></a>
|
||||
</p>
|
||||
|
||||
#set $localfooterpath=$util.themePath("extra-footer.html", local=True)
|
||||
#if os.path.exists($localfooterpath)
|
||||
#if $literalFooter
|
||||
#set $localfooter=$util.SafeValue("".join(open($localfooterpath, 'rt', encoding='utf-8').readlines()))
|
||||
$localfooter
|
||||
#else
|
||||
#include $localfooterpath
|
||||
#end if
|
||||
#end if
|
||||
|
||||
</div>
|
||||
</div>
|
||||
#set $localbottompath=$util.themePath("extra-bottom.html", local=True)
|
||||
#if os.path.exists($localbottompath)
|
||||
#set $localbottom=$util.SafeValue("".join(open($localbottompath, 'rt', encoding='utf-8').readlines()))
|
||||
$localbottom
|
||||
#end if
|
||||
</body>
|
||||
</html>
|
||||
12
www/kojiweb/includes/footer2.chtml
Normal file
12
www/kojiweb/includes/footer2.chtml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
</div>
|
||||
|
||||
<p id="footer">
|
||||
Copyright © 2006-2016 Red Hat, Inc.
|
||||
<a href="https://pagure.io/koji/"><img src="{{ themePath('images/powered-by-koji.png') }}" alt="Powered By Koji" id="PoweredByKojiLogo"/></a>
|
||||
</p>
|
||||
{{ localfooter }}
|
||||
</div>
|
||||
</div>
|
||||
{{ localbottom }}
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
#encoding UTF-8
|
||||
#import koji
|
||||
#from kojiweb import util
|
||||
#from koji_cli.lib import greetings
|
||||
#import random
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
#def greeting()
|
||||
#echo $random.choice($greetings)##slurp
|
||||
#end def
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>$title | $siteName</title>
|
||||
<link rel="shortcut icon" href="$util.themePath('images/koji.ico')"/>
|
||||
<link rel="stylesheet" type="text/css" media="screen" title="Koji Style" href="$util.themePath('koji.css')"/>
|
||||
<link rel="alternate stylesheet" type="text/css" media="screen" title="Debug" href="$util.themePath('debug.css')"/>
|
||||
<link rel="alternate" type="application/rss+xml" title="Koji: recent builds" href="/koji/recentbuilds"/>
|
||||
</head>
|
||||
<body id="$pageID">
|
||||
|
||||
<div id="wrap">
|
||||
<div id="innerwrap">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div id="header">
|
||||
<img src="$util.themePath('images/koji.png')" alt="Koji Logo" id="kojiLogo"/>
|
||||
#set $localnavpath=$util.themePath("extra-nav.html", local=True)
|
||||
#if os.path.exists($localnavpath)
|
||||
#set $localnav=$util.SafeValue("".join(open($localnavpath, 'rt', encoding='utf-8').readlines()))
|
||||
$localnav
|
||||
#end if
|
||||
<form action="search" id="headerSearch">
|
||||
<input type="hidden" name="match" value="glob"/>
|
||||
<select name="type">
|
||||
<option $util.toggleSelected($self, $type, "package") value="package">Packages</option>
|
||||
<option $util.toggleSelected($self, $type, "build") value="build">Builds</option>
|
||||
<option $util.toggleSelected($self, $type, "tag") value="tag">Tags</option>
|
||||
<option $util.toggleSelected($self, $type, "target") value="target">Build Targets</option>
|
||||
<option $util.toggleSelected($self, $type, "user") value="user">Users</option>
|
||||
<option $util.toggleSelected($self, $type, "host") value="host">Hosts</option>
|
||||
<option $util.toggleSelected($self, $type, "rpm") value="rpm">RPMs</option>
|
||||
#if $mavenEnabled
|
||||
<option $util.toggleSelected($self, $type, "maven") value="maven">Maven Artifacts</option>
|
||||
#end if
|
||||
#if $winEnabled
|
||||
<option $util.toggleSelected($self, $type, "win") value="win">Windows Artifacts</option>
|
||||
#end if
|
||||
</select>
|
||||
<input type="text" name="terms" title="You can use glob expressions here (e.g. 'bash-*')" value="$terms"/>
|
||||
<input type="submit" value="Search"/>
|
||||
</form>
|
||||
</div><!-- end header -->
|
||||
|
||||
<!-- MAIN NAVIGATION -->
|
||||
<div id="mainNav">
|
||||
<h4 class="hide">Main Site Links:</h4>
|
||||
<ul>
|
||||
<li id="summaryTab"><a href="index">Summary</a></li>
|
||||
<li id="packagesTab"><a href="packages">Packages</a></li>
|
||||
<li id="buildsTab"><a href="builds">Builds</a></li>
|
||||
<li id="tasksTab"><a href="tasks">Tasks</a></li>
|
||||
<li id="tagsTab"><a href="tags">Tags</a></li>
|
||||
<li id="buildtargetsTab"><a href="buildtargets">Build Targets</a></li>
|
||||
<li id="usersTab"><a href="users">Users</a></li>
|
||||
<li id="hostsTab"><a href="hosts">Hosts</a></li>
|
||||
<li id="reportsTab"><a href="reports">Reports</a></li>
|
||||
<li id="searchTab"><a href="search">Search</a></li>
|
||||
<li id="apiTab"><a href="api">API</a></li>
|
||||
</ul>
|
||||
</div><!-- end mainNav -->
|
||||
|
||||
<span id="loginInfo">
|
||||
$koji.formatTimeLong($currentDate)
|
||||
#if not $LoginDisabled
|
||||
|
|
||||
#if $currentUser
|
||||
$greeting(), <a href="userinfo?userID=$currentUser.id">$currentUser.name</a> | <a href="logout">logout</a>
|
||||
#else
|
||||
<a href="login">login</a>
|
||||
#end if
|
||||
#end if
|
||||
</span>
|
||||
|
||||
<div id="content">
|
||||
75
www/kojiweb/includes/header2.chtml
Normal file
75
www/kojiweb/includes/header2.chtml
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>{{ title }} | {{ siteName }}</title>
|
||||
<link rel="shortcut icon" href="{{ themePath('images/koji.ico') }}"/>
|
||||
<link rel="stylesheet" type="text/css" media="screen" title="Koji Style" href="{{ themePath('koji.css') }}"/>
|
||||
<link rel="alternate stylesheet" type="text/css" media="screen" title="Debug" href="{{ themePath('debug.css') }}"/>
|
||||
<link rel="alternate" type="application/rss+xml" title="Koji: recent builds" href="/koji/recentbuilds"/>
|
||||
</head>
|
||||
<body id="{{ pageID }}">
|
||||
|
||||
<div id="wrap">
|
||||
<div id="innerwrap">
|
||||
|
||||
<!-- HEADER -->
|
||||
<div id="header">
|
||||
<img src="{{ themePath('images/koji.png') }}" alt="Koji Logo" id="kojiLogo"/>
|
||||
{{ localnav }}
|
||||
<form action="search" id="headerSearch">
|
||||
<input type="hidden" name="match" value="glob"/>
|
||||
<select name="type">
|
||||
<option {{ toggleSelected("", type, "package") }} value="package">Packages</option>
|
||||
<option {{ toggleSelected("", type, "build") }} value="build">Builds</option>
|
||||
<option {{ toggleSelected("", type, "tag") }} value="tag">Tags</option>
|
||||
<option {{ toggleSelected("", type, "target") }} value="target">Build Targets</option>
|
||||
<option {{ toggleSelected("", type, "user") }} value="user">Users</option>
|
||||
<option {{ toggleSelected("", type, "host") }} value="host">Hosts</option>
|
||||
<option {{ toggleSelected("", type, "rpm") }} value="rpm">RPMs</option>
|
||||
{% if mavenEnabled %}
|
||||
<option {{ toggleSelected("", type, "maven") }} value="maven">Maven Artifacts</option>
|
||||
{% endif %}
|
||||
{% if winEnabled %}
|
||||
<option {{ toggleSelected("", type, "win") }} value="win">Windows Artifacts</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
<input type="text" name="terms" title="You can use glob expressions here (e.g. 'bash-*')" value="{{ terms }}"/>
|
||||
<input type="submit" value="Search"/>
|
||||
</form>
|
||||
</div><!-- end header -->
|
||||
|
||||
<!-- MAIN NAVIGATION -->
|
||||
<div id="mainNav">
|
||||
<h4 class="hide">Main Site Links:</h4>
|
||||
<ul>
|
||||
<li id="summaryTab"><a href="index">Summary</a></li>
|
||||
<li id="packagesTab"><a href="packages">Packages</a></li>
|
||||
<li id="buildsTab"><a href="builds">Builds</a></li>
|
||||
<li id="tasksTab"><a href="tasks">Tasks</a></li>
|
||||
<li id="tagsTab"><a href="tags">Tags</a></li>
|
||||
<li id="buildtargetsTab"><a href="buildtargets">Build Targets</a></li>
|
||||
<li id="usersTab"><a href="users">Users</a></li>
|
||||
<li id="hostsTab"><a href="hosts">Hosts</a></li>
|
||||
<li id="reportsTab"><a href="reports">Reports</a></li>
|
||||
<li id="searchTab"><a href="search">Search</a></li>
|
||||
<li id="apiTab"><a href="api">API</a></li>
|
||||
</ul>
|
||||
</div><!-- end mainNav -->
|
||||
|
||||
<span id="loginInfo">
|
||||
{{ date_str }}
|
||||
{% if not LoginDisabled %}
|
||||
|
|
||||
{% if currentUser %}
|
||||
{{ greeting }}, <a href="userinfo?userID={{ currentUser.id }}">{{ currentUser.name }}</a> | <a href="logout">logout</a>
|
||||
{% else %}
|
||||
<a href="login">login</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
<div id="content">
|
||||
|
|
@ -1,127 +1,125 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<div class="pageHeader">$welcomeMessage</div>
|
||||
<div class="pageHeader">{{ welcomeMessage }}</div>
|
||||
|
||||
<div class="dataHeader noPaginate" id="buildlist">#if $user then 'Your ' else ''#Recent Builds</div>
|
||||
<div class="dataHeader noPaginate" id="buildlist">{{ 'Your ' if user else '' }}Recent Builds</div>
|
||||
<table class="data-list">
|
||||
<tr class="list-header">
|
||||
<th>ID $util.sortImage(self, 'id')</th>
|
||||
<th>ID {{ util.sortImage('id') }}</th>
|
||||
<th>NVR</th>
|
||||
#if not $user
|
||||
#if not user
|
||||
<th>Built by</th>
|
||||
#end if
|
||||
#endif
|
||||
<th>Finished</th>
|
||||
<th>State</th>
|
||||
</tr>
|
||||
#for $build in $builds
|
||||
<tr class="$util.rowToggle($self)">
|
||||
#set $stateName = $util.stateName($build.state)
|
||||
<td>$build.build_id</td>
|
||||
<td><a href="buildinfo?buildID=$build.build_id">$build.nvr</a></td>
|
||||
#if not $user
|
||||
<td class="user-$build.owner_name"><a href="userinfo?userID=$build.owner_id">$build.owner_name</a></td>
|
||||
#end if
|
||||
<td>$util.formatTime($build.completion_ts)</td>
|
||||
<td class="$stateName">$util.stateImage($build.state)</td>
|
||||
#for build in builds
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
#set stateName = util.stateName(build.state)
|
||||
<td>{{ build.build_id }}</td>
|
||||
<td><a href="buildinfo?buildID={{ build.build_id }}">{{ build.nvr }}</a></td>
|
||||
#if not user
|
||||
<td class="user-{{ build.owner_name }}"><a href="userinfo?userID={{ build.owner_id }}">{{ build.owner_name }}</a></td>
|
||||
#endif
|
||||
<td>{{ util.formatTime(build.completion_ts) }}</td>
|
||||
<td class="{{ stateName }}">{{ util.stateImage(build.state) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#if not $builds
|
||||
#endfor
|
||||
#if not builds
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No builds</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="dataHeader noPaginate" id="tasklist">#if $user then 'Your ' else ''#Recent Tasks</div>
|
||||
<div class="dataHeader noPaginate" id="tasklist">{{ 'Your ' if user else '' }}Recent Tasks</div>
|
||||
<table class="data-list">
|
||||
<tr class="list-header">
|
||||
<th>ID $util.sortImage($self, 'id')</th>
|
||||
<th>ID {{ util.sortImage('id') }}</th>
|
||||
<th>Type</th>
|
||||
#if not $user
|
||||
#if not user
|
||||
<th>Owner</th>
|
||||
#end if
|
||||
#endif
|
||||
<th>Arch</th>
|
||||
<th>Finished</th>
|
||||
<th>State</th>
|
||||
</tr>
|
||||
#for $task in $tasks
|
||||
#set $scratch = $util.taskScratchClass($task)
|
||||
<tr class="$util.rowToggle($self) $scratch">
|
||||
#set $state = $util.taskState($task.state)
|
||||
<td>$task.id</td>
|
||||
<td><a href="taskinfo?taskID=$task.id" class="task$state" title="$state">$koji.taskLabel($task)</a></td>
|
||||
#if not $user
|
||||
<td class="user-$task.owner_name">
|
||||
#if $task.owner_type == $koji.USERTYPES['HOST']
|
||||
<a href="hostinfo?userID=$task.owner">$task.owner_name</a>
|
||||
#for task in tasks
|
||||
#set scratch = util.taskScratchClass(task)
|
||||
<tr class="{{ util.rowToggle() }} {{ scratch }}">
|
||||
#set state = util.taskState(task.state)
|
||||
<td>{{ task.id }}</td>
|
||||
<td><a href="taskinfo?taskID={{ task.id }}" class="task{{ state }}" title="{{ state }}">{{ koji.taskLabel(task) }}</a></td>
|
||||
#if not user
|
||||
<td class="user-{{ task.owner_name }}">
|
||||
#if task.owner_type == koji.USERTYPES['HOST']
|
||||
<a href="hostinfo?userID={{ task.owner }}">{{ task.owner_name }}</a>
|
||||
#else
|
||||
<a href="userinfo?userID=$task.owner">$task.owner_name</a>
|
||||
#end if
|
||||
<a href="userinfo?userID={{ task.owner }}">{{ task.owner_name }}</a>
|
||||
#endif
|
||||
</td>
|
||||
#end if
|
||||
<td>$task.arch</td>
|
||||
<td>$util.formatTime($task.completion_ts)</td>
|
||||
<td class="task$state">$util.imageTag($state)</td>
|
||||
#endif
|
||||
<td>{{ task.arch }}</td>
|
||||
<td>{{ util.formatTime(task.completion_ts) }}</td>
|
||||
<td class="task{{ state }}">{{ util.imageTag(state) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#if not $tasks
|
||||
#endfor
|
||||
#if not tasks
|
||||
<tr class="row-odd">
|
||||
<td colspan="5">No tasks</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
#if $user
|
||||
#if user
|
||||
<br/>
|
||||
|
||||
<div class="dataHeader" id="packagelist">Your Packages</div>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($packagePages) > 1
|
||||
#if (packagePages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'index?packageStart=' + this.value * $packageRange + '$util.passthrough($self, 'packageOrder', 'buildOrder', 'buildStart', 'taskOrder', 'taskStart')#packagelist';">
|
||||
#for $pageNum in $packagePages
|
||||
<option value="$pageNum"#if $pageNum == $packageCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'index?packageStart=' + this.value * {{ packageRange }} + '{{ util.passthrough('packageOrder', 'buildOrder', 'buildStart', 'taskOrder', 'taskStart') }}#packagelist';">
|
||||
#for pageNum in packagePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == packageCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $packageStart > 0
|
||||
<a href="index?packageStart=#echo $packageStart - $packageRange #$util.passthrough($self, 'packageOrder', 'buildOrder', 'buildStart', 'taskOrder', 'taskStart')#packagelist"><<<</a>
|
||||
#end if
|
||||
#if $totalPackages != 0
|
||||
<strong>Package #echo $packageStart + 1 # through #echo $packageStart + $packageCount # of $totalPackages</strong>
|
||||
#end if
|
||||
#if $packageStart + $packageCount < $totalPackages
|
||||
<a href="index?packageStart=#echo $packageStart + $packageRange#$util.passthrough($self, 'packageOrder', 'buildOrder', 'buildStart', 'taskOrder', 'taskStart')#packagelist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if packageStart > 0
|
||||
<a href="index?packageStart={{ packageStart - packageRange }}{{ util.passthrough('packageOrder', 'buildOrder', 'buildStart', 'taskOrder', 'taskStart') }}#packagelist"><<<</a>
|
||||
#endif
|
||||
#if totalPackages != 0
|
||||
<strong>Package {{ packageStart + 1 }} through {{ packageStart + packageCount }} of {{ totalPackages }}</strong>
|
||||
#endif
|
||||
#if packageStart + packageCount < totalPackages
|
||||
<a href="index?packageStart={{ packageStart + packageRange }}{{ util.passthrough('packageOrder', 'buildOrder', 'buildStart', 'taskOrder', 'taskStart') }}#packagelist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="index?packageOrder=$util.toggleOrder($self, 'package_name', 'packageOrder')$util.passthrough($self, 'buildOrder', 'buildStart', 'taskOrder', 'taskStart')#packagelist">Name</a> $util.sortImage($self, 'package_name', 'packageOrder')</th>
|
||||
<th><a href="index?packageOrder=$util.toggleOrder($self, 'tag_name', 'packageOrder')$util.passthrough($self, 'buildOrder', 'buildStart', 'taskOrder', 'taskStart')#packagelist">Tag</a> $util.sortImage($self, 'tag_name', 'packageOrder')</th>
|
||||
<th><a href="index?packageOrder=$util.toggleOrder($self, 'blocked', 'packageOrder')$util.passthrough($self, 'buildOrder', 'buildStart', 'taskOrder', 'taskStart')#packagelist">Included?</a> $util.sortImage($self, 'blocked', 'packageOrder')</th>
|
||||
<th><a href="index?packageOrder={{ util.toggleOrder('package_name', 'packageOrder') }}{{ util.passthrough('buildOrder', 'buildStart', 'taskOrder', 'taskStart') }}#packagelist">Name</a> {{ util.sortImage('package_name', 'packageOrder') }}</th>
|
||||
<th><a href="index?packageOrder={{ util.toggleOrder('tag_name', 'packageOrder') }}{{ util.passthrough('buildOrder', 'buildStart', 'taskOrder', 'taskStart') }}#packagelist">Tag</a> {{ util.sortImage('tag_name', 'packageOrder') }}</th>
|
||||
<th><a href="index?packageOrder={{ util.toggleOrder('blocked', 'packageOrder') }}{{ util.passthrough('buildOrder', 'buildStart', 'taskOrder', 'taskStart') }}#packagelist">Included?</a> {{ util.sortImage('blocked', 'packageOrder') }}</th>
|
||||
</tr>
|
||||
#for $package in $packages
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="packageinfo?packageID=$package.package_id">$package.package_name</a></td>
|
||||
<td><a href="taginfo?tagID=$package.tag_id">$package.tag_name</a></td>
|
||||
#set $included = $package.blocked and 'no' or 'yes'
|
||||
<td>$util.imageTag($included)</td>
|
||||
#for package in packages
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="packageinfo?packageID={{ package.package_id }}">{{ package.package_name }}</a></td>
|
||||
<td><a href="taginfo?tagID={{ package.tag_id }}">{{ package.tag_name }}</a></td>
|
||||
#set included = package.blocked and 'no' or 'yes'
|
||||
<td>{{ util.imageTag(included) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#if $totalPackages == 0
|
||||
#endfor
|
||||
#if totalPackages == 0
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No packages</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
|
@ -138,24 +136,24 @@
|
|||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
#for $notif in $notifs
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>#if $notif.package then $notif.package.name else 'all'#</td>
|
||||
<td>#if $notif.tag then $notif.tag.name else 'all'#</td>
|
||||
<td>#if $notif.success_only then 'success only' else 'all'#</td>
|
||||
<td><a href="notificationedit?notificationID=$notif.id$util.authToken($self)">edit</a></td>
|
||||
<td><a href="notificationdelete?notificationID=$notif.id$util.authToken($self)">delete</a></td>
|
||||
#for notif in notifs
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ notif.package.name if notif.package else 'all' }}</td>
|
||||
<td>{{ notif.tag.name if notif.tag else 'all' }}</td>
|
||||
<td>{{ 'success only' if notif.success_only else 'all' }}</td>
|
||||
<td><a href="notificationedit?notificationID={{ notif.id }}{{ util.authToken() }}">edit</a></td>
|
||||
<td><a href="notificationdelete?notificationID={{ notif.id }}{{ util.authToken() }}">delete</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#if $len($notifs) == 0
|
||||
#endfor
|
||||
#if (notifs |length) == 0
|
||||
<tr class="row-odd">
|
||||
<td colspan="5">No notifications</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<a href="notificationcreate$util.authToken($self, first=True)">Add a Notification</a>
|
||||
#end if
|
||||
<a href="notificationcreate{{ util.authToken(first=True) }}">Add a Notification</a>
|
||||
#endif
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -384,7 +384,9 @@ def index(environ, packageOrder='package_name', packageStart=None):
|
|||
values['user'] = user
|
||||
values['welcomeMessage'] = environ['koji.options']['KojiGreeting']
|
||||
|
||||
return _genHTML(environ, 'index.chtml')
|
||||
values['koji'] = koji
|
||||
|
||||
return _genHTML(environ, 'index.chtml', jinja=True)
|
||||
|
||||
|
||||
def notificationedit(environ, notificationID):
|
||||
|
|
@ -430,7 +432,7 @@ def notificationedit(environ, notificationID):
|
|||
tags = server.listTags(queryOpts={'order': 'name'})
|
||||
values['tags'] = tags
|
||||
|
||||
return _genHTML(environ, 'notificationedit.chtml')
|
||||
return _genHTML(environ, 'notificationedit.chtml', jinja=True)
|
||||
|
||||
|
||||
def notificationcreate(environ):
|
||||
|
|
@ -475,7 +477,7 @@ def notificationcreate(environ):
|
|||
tags = server.listTags(queryOpts={'order': 'name'})
|
||||
values['tags'] = tags
|
||||
|
||||
return _genHTML(environ, 'notificationedit.chtml')
|
||||
return _genHTML(environ, 'notificationedit.chtml', jinja=True)
|
||||
|
||||
|
||||
def notificationdelete(environ, notificationID):
|
||||
|
|
@ -635,7 +637,10 @@ def tasks(environ, owner=None, state='active', view='tree', method='all', hostID
|
|||
for task, [descendents] in zip(tasks, descendentList):
|
||||
task['descendents'] = descendents
|
||||
|
||||
return _genHTML(environ, 'tasks.chtml')
|
||||
values['S'] = SafeValue
|
||||
values['koji'] = koji
|
||||
|
||||
return _genHTML(environ, 'tasks.chtml', jinja=True)
|
||||
|
||||
|
||||
def taskinfo(environ, taskID):
|
||||
|
|
@ -792,7 +797,10 @@ def taskinfo(environ, taskID):
|
|||
else:
|
||||
values['perms'] = []
|
||||
|
||||
return _genHTML(environ, 'taskinfo.chtml')
|
||||
values['koji'] = koji
|
||||
values['S'] = SafeValue
|
||||
|
||||
return _genHTML(environ, 'taskinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def taskstatus(environ, taskID):
|
||||
|
|
@ -929,7 +937,7 @@ def tags(environ, start=None, order=None, childID=None):
|
|||
else:
|
||||
values['childID'] = int(childID)
|
||||
|
||||
return _genHTML(environ, 'tags.chtml')
|
||||
return _genHTML(environ, 'tags.chtml', jinja=True)
|
||||
|
||||
|
||||
_PREFIX_CHARS = [chr(char) for char in list(range(48, 58)) + list(range(97, 123))]
|
||||
|
|
@ -972,7 +980,7 @@ def packages(environ, tagID=None, userID=None, order='package_name', start=None,
|
|||
|
||||
values['chars'] = _PREFIX_CHARS
|
||||
|
||||
return _genHTML(environ, 'packages.chtml')
|
||||
return _genHTML(environ, 'packages.chtml', jinja=True)
|
||||
|
||||
|
||||
def packageinfo(environ, packageID, tagOrder='name', tagStart=None, buildOrder='-completion_time',
|
||||
|
|
@ -996,7 +1004,7 @@ def packageinfo(environ, packageID, tagOrder='name', tagStart=None, buildOrder='
|
|||
start=buildStart, dataName='builds', prefix='build',
|
||||
order=buildOrder)
|
||||
|
||||
return _genHTML(environ, 'packageinfo.chtml')
|
||||
return _genHTML(environ, 'packageinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def taginfo(environ, tagID, all='0', packageOrder='package_name', packageStart=None,
|
||||
|
|
@ -1012,7 +1020,7 @@ def taginfo(environ, tagID, all='0', packageOrder='package_name', packageStart=N
|
|||
values['tagID'] = tag['id']
|
||||
if 'revoke_event' in tag:
|
||||
values['delete_ts'] = server.getEvent(tag['revoke_event'])['ts']
|
||||
return _genHTML(environ, 'taginfo_deleted.chtml')
|
||||
return _genHTML(environ, 'taginfo_deleted.chtml', jinja=True)
|
||||
|
||||
all = int(all)
|
||||
|
||||
|
|
@ -1060,7 +1068,7 @@ def taginfo(environ, tagID, all='0', packageOrder='package_name', packageStart=N
|
|||
allPerms = dict([(perm['id'], perm['name']) for perm in permList])
|
||||
values['allPerms'] = allPerms
|
||||
|
||||
return _genHTML(environ, 'taginfo.chtml')
|
||||
return _genHTML(environ, 'taginfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def tagcreate(environ):
|
||||
|
|
@ -1096,7 +1104,7 @@ def tagcreate(environ):
|
|||
values['tag'] = None
|
||||
values['permissions'] = server.getAllPerms()
|
||||
|
||||
return _genHTML(environ, 'tagedit.chtml')
|
||||
return _genHTML(environ, 'tagedit.chtml', jinja=True)
|
||||
|
||||
|
||||
def tagedit(environ, tagID):
|
||||
|
|
@ -1126,7 +1134,7 @@ def tagedit(environ, tagID):
|
|||
params['maven_support'] = bool('maven_support' in form)
|
||||
params['maven_include_all'] = bool('maven_include_all' in form)
|
||||
|
||||
server.editTag2(tag['id'], **params)
|
||||
server.editTag(tag['id'], **params)
|
||||
|
||||
_redirect(environ, 'taginfo?tagID=%i' % tag['id'])
|
||||
elif 'cancel' in form:
|
||||
|
|
@ -1139,7 +1147,7 @@ def tagedit(environ, tagID):
|
|||
values['tag'] = tag
|
||||
values['permissions'] = server.getAllPerms()
|
||||
|
||||
return _genHTML(environ, 'tagedit.chtml')
|
||||
return _genHTML(environ, 'tagedit.chtml', jinja=True)
|
||||
|
||||
|
||||
def tagdelete(environ, tagID):
|
||||
|
|
@ -1205,7 +1213,7 @@ def tagparent(environ, tagID, parentID, action):
|
|||
'tag %i has tag %i listed as a parent more than once' %
|
||||
(tag['id'], parent['id']))
|
||||
|
||||
return _genHTML(environ, 'tagparent.chtml')
|
||||
return _genHTML(environ, 'tagparent.chtml', jinja=True)
|
||||
elif action == 'remove':
|
||||
data = server.getInheritanceData(tag['id'])
|
||||
for datum in data:
|
||||
|
|
@ -1234,7 +1242,7 @@ def externalrepoinfo(environ, extrepoID):
|
|||
values['extRepo'] = extRepo
|
||||
values['repoTags'] = repoTags
|
||||
|
||||
return _genHTML(environ, 'externalrepoinfo.chtml')
|
||||
return _genHTML(environ, 'externalrepoinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildinfo(environ, buildID):
|
||||
|
|
@ -1381,7 +1389,8 @@ def buildinfo(environ, buildID):
|
|||
values['estCompletion'] = None
|
||||
|
||||
values['pathinfo'] = pathinfo
|
||||
return _genHTML(environ, 'buildinfo.chtml')
|
||||
values['koji'] = koji
|
||||
return _genHTML(environ, 'buildinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def builds(environ, userID=None, tagID=None, packageID=None, state=None, order='-build_id',
|
||||
|
|
@ -1467,8 +1476,9 @@ def builds(environ, userID=None, tagID=None, packageID=None, state=None, order='
|
|||
start=start, dataName='builds', prefix='build', order=order)
|
||||
|
||||
values['chars'] = _PREFIX_CHARS
|
||||
values['koji'] = koji
|
||||
|
||||
return _genHTML(environ, 'builds.chtml')
|
||||
return _genHTML(environ, 'builds.chtml', jinja=True)
|
||||
|
||||
|
||||
def users(environ, order='name', start=None, prefix=None):
|
||||
|
|
@ -1488,7 +1498,7 @@ def users(environ, order='name', start=None, prefix=None):
|
|||
|
||||
values['chars'] = _PREFIX_CHARS
|
||||
|
||||
return _genHTML(environ, 'users.chtml')
|
||||
return _genHTML(environ, 'users.chtml', jinja=True)
|
||||
|
||||
|
||||
def userinfo(environ, userID, packageOrder='package_name', packageStart=None,
|
||||
|
|
@ -1516,7 +1526,7 @@ def userinfo(environ, userID, packageOrder='package_name', packageStart=None,
|
|||
start=buildStart, dataName='builds', prefix='build',
|
||||
order=buildOrder, pageSize=10)
|
||||
|
||||
return _genHTML(environ, 'userinfo.chtml')
|
||||
return _genHTML(environ, 'userinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
# headers shown in rpminfo and buildinfo pages
|
||||
|
|
@ -1576,7 +1586,10 @@ def rpminfo(environ, rpmID, fileOrder='name', fileStart=None, buildrootOrder='-i
|
|||
kojiweb.util.paginateMethod(server, values, 'listRPMFiles', args=[rpm['id']],
|
||||
start=fileStart, dataName='files', prefix='file', order=fileOrder)
|
||||
|
||||
return _genHTML(environ, 'rpminfo.chtml')
|
||||
values['koji'] = koji
|
||||
values['time'] = time # TODO rework template so it doesn't need this
|
||||
|
||||
return _genHTML(environ, 'rpminfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def archiveinfo(environ, archiveID, fileOrder='name', fileStart=None, buildrootOrder='-id',
|
||||
|
|
@ -1620,7 +1633,9 @@ def archiveinfo(environ, archiveID, fileOrder='name', fileStart=None, buildrootO
|
|||
values['show_archive_components'] = server.listArchives(imageID=archive['id'],
|
||||
queryOpts={'limit': 1})
|
||||
|
||||
return _genHTML(environ, 'archiveinfo.chtml')
|
||||
values['koji'] = koji
|
||||
|
||||
return _genHTML(environ, 'archiveinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def fileinfo(environ, filename, rpmID=None, archiveID=None):
|
||||
|
|
@ -1655,7 +1670,7 @@ def fileinfo(environ, filename, rpmID=None, archiveID=None):
|
|||
|
||||
values['file'] = file
|
||||
|
||||
return _genHTML(environ, 'fileinfo.chtml')
|
||||
return _genHTML(environ, 'fileinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def cancelbuild(environ, buildID):
|
||||
|
|
@ -1737,7 +1752,9 @@ def hosts(environ, state='enabled', start=None, order='name', ready='all', chann
|
|||
# Paginate after retrieving last update info so we can sort on it
|
||||
kojiweb.util.paginateList(values, hosts, start, 'hosts', 'host', order)
|
||||
|
||||
return _genHTML(environ, 'hosts.chtml')
|
||||
values['zip'] = zip # TODO FIXME
|
||||
|
||||
return _genHTML(environ, 'hosts.chtml', jinja=True)
|
||||
|
||||
|
||||
def hostinfo(environ, hostID=None, userID=None):
|
||||
|
|
@ -1783,7 +1800,7 @@ def hostinfo(environ, hostID=None, userID=None):
|
|||
else:
|
||||
values['perms'] = []
|
||||
|
||||
return _genHTML(environ, 'hostinfo.chtml')
|
||||
return _genHTML(environ, 'hostinfo.chtml', jinja=2)
|
||||
|
||||
|
||||
def hostedit(environ, hostID):
|
||||
|
|
@ -1833,7 +1850,7 @@ def hostedit(environ, hostID):
|
|||
values['allChannels'] = allChannels
|
||||
values['hostChannels'] = server.listChannels(hostID=host['id'])
|
||||
|
||||
return _genHTML(environ, 'hostedit.chtml')
|
||||
return _genHTML(environ, 'hostedit.chtml', jinja=True)
|
||||
|
||||
|
||||
def disablehost(environ, hostID):
|
||||
|
|
@ -1883,7 +1900,7 @@ def channelinfo(environ, channelID):
|
|||
values['enabled_hosts'] = len([h for h in hosts if h['enabled']])
|
||||
values['ready_hosts'] = len([h for h in hosts if h['ready']])
|
||||
|
||||
return _genHTML(environ, 'channelinfo.chtml')
|
||||
return _genHTML(environ, 'channelinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildrootinfo(environ, buildrootID):
|
||||
|
|
@ -1906,8 +1923,9 @@ def buildrootinfo(environ, buildrootID):
|
|||
|
||||
values['title'] = '%s | Buildroot Info' % kojiweb.util.brLabel(buildroot)
|
||||
values['buildroot'] = buildroot
|
||||
values['koji'] = koji
|
||||
|
||||
return _genHTML(environ, template)
|
||||
return _genHTML(environ, template, jinja=True)
|
||||
|
||||
|
||||
def rpmlist(environ, type, buildrootID=None, imageID=None, start=None, order='nvr'):
|
||||
|
|
@ -1962,7 +1980,7 @@ def rpmlist(environ, type, buildrootID=None, imageID=None, start=None, order='nv
|
|||
values['type'] = type
|
||||
values['order'] = order
|
||||
|
||||
return _genHTML(environ, 'rpmlist.chtml')
|
||||
return _genHTML(environ, 'rpmlist.chtml', jinja=True)
|
||||
|
||||
|
||||
def archivelist(environ, type, buildrootID=None, imageID=None, start=None, order='filename'):
|
||||
|
|
@ -2009,7 +2027,7 @@ def archivelist(environ, type, buildrootID=None, imageID=None, start=None, order
|
|||
values['type'] = type
|
||||
values['order'] = order
|
||||
|
||||
return _genHTML(environ, 'archivelist.chtml')
|
||||
return _genHTML(environ, 'archivelist.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildtargets(environ, start=None, order='name'):
|
||||
|
|
@ -2025,7 +2043,7 @@ def buildtargets(environ, start=None, order='name'):
|
|||
else:
|
||||
values['perms'] = []
|
||||
|
||||
return _genHTML(environ, 'buildtargets.chtml')
|
||||
return _genHTML(environ, 'buildtargets.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildtargetinfo(environ, targetID=None, name=None):
|
||||
|
|
@ -2055,7 +2073,7 @@ def buildtargetinfo(environ, targetID=None, name=None):
|
|||
else:
|
||||
values['perms'] = []
|
||||
|
||||
return _genHTML(environ, 'buildtargetinfo.chtml')
|
||||
return _genHTML(environ, 'buildtargetinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildtargetedit(environ, targetID):
|
||||
|
|
@ -2095,7 +2113,7 @@ def buildtargetedit(environ, targetID):
|
|||
values['target'] = target
|
||||
values['tags'] = tags
|
||||
|
||||
return _genHTML(environ, 'buildtargetedit.chtml')
|
||||
return _genHTML(environ, 'buildtargetedit.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildtargetcreate(environ):
|
||||
|
|
@ -2155,7 +2173,7 @@ def reports(environ):
|
|||
values['loggedInUser'] = True
|
||||
else:
|
||||
values['loggedInUser'] = False
|
||||
return _genHTML(environ, 'reports.chtml')
|
||||
return _genHTML(environ, 'reports.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildsbyuser(environ, start=None, order='-builds'):
|
||||
|
|
@ -2183,7 +2201,7 @@ def buildsbyuser(environ, start=None, order='-builds'):
|
|||
values['increment'] = graphWidth / maxBuilds
|
||||
kojiweb.util.paginateList(values, users, start, 'userBuilds', 'userBuild', order)
|
||||
|
||||
return _genHTML(environ, 'buildsbyuser.chtml')
|
||||
return _genHTML(environ, 'buildsbyuser.chtml', jinja=True)
|
||||
|
||||
|
||||
def rpmsbyhost(environ, start=None, order=None, hostArch=None, rpmArch=None):
|
||||
|
|
@ -2228,7 +2246,7 @@ def rpmsbyhost(environ, start=None, order=None, hostArch=None, rpmArch=None):
|
|||
values['increment'] = graphWidth / maxRPMs
|
||||
kojiweb.util.paginateList(values, hosts, start, 'hosts', 'host', order)
|
||||
|
||||
return _genHTML(environ, 'rpmsbyhost.chtml')
|
||||
return _genHTML(environ, 'rpmsbyhost.chtml', jinja=True)
|
||||
|
||||
|
||||
def packagesbyuser(environ, start=None, order=None):
|
||||
|
|
@ -2258,7 +2276,7 @@ def packagesbyuser(environ, start=None, order=None):
|
|||
values['increment'] = graphWidth / maxPackages
|
||||
kojiweb.util.paginateList(values, users, start, 'users', 'user', order)
|
||||
|
||||
return _genHTML(environ, 'packagesbyuser.chtml')
|
||||
return _genHTML(environ, 'packagesbyuser.chtml', jinja=True)
|
||||
|
||||
|
||||
def tasksbyhost(environ, start=None, order='-tasks', hostArch=None):
|
||||
|
|
@ -2296,7 +2314,7 @@ def tasksbyhost(environ, start=None, order='-tasks', hostArch=None):
|
|||
values['increment'] = graphWidth / maxTasks
|
||||
kojiweb.util.paginateList(values, hosts, start, 'hosts', 'host', order)
|
||||
|
||||
return _genHTML(environ, 'tasksbyhost.chtml')
|
||||
return _genHTML(environ, 'tasksbyhost.chtml', jinja=True)
|
||||
|
||||
|
||||
def tasksbyuser(environ, start=None, order='-tasks'):
|
||||
|
|
@ -2325,7 +2343,7 @@ def tasksbyuser(environ, start=None, order='-tasks'):
|
|||
values['increment'] = graphWidth / maxTasks
|
||||
kojiweb.util.paginateList(values, users, start, 'users', 'user', order)
|
||||
|
||||
return _genHTML(environ, 'tasksbyuser.chtml')
|
||||
return _genHTML(environ, 'tasksbyuser.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildsbystatus(environ, days='7'):
|
||||
|
|
@ -2364,7 +2382,7 @@ def buildsbystatus(environ, days='7'):
|
|||
values['maxBuilds'] = maxBuilds
|
||||
values['increment'] = graphWidth / maxBuilds
|
||||
|
||||
return _genHTML(environ, 'buildsbystatus.chtml')
|
||||
return _genHTML(environ, 'buildsbystatus.chtml', jinja=True)
|
||||
|
||||
|
||||
def buildsbytarget(environ, days='7', start=None, order='-builds'):
|
||||
|
|
@ -2404,7 +2422,7 @@ def buildsbytarget(environ, days='7', start=None, order='-builds'):
|
|||
values['maxBuilds'] = maxBuilds
|
||||
values['increment'] = graphWidth / maxBuilds
|
||||
|
||||
return _genHTML(environ, 'buildsbytarget.chtml')
|
||||
return _genHTML(environ, 'buildsbytarget.chtml', jinja=True)
|
||||
|
||||
|
||||
def _filter_hosts_by_arch(hosts, arch):
|
||||
|
|
@ -2464,7 +2482,7 @@ def clusterhealth(environ, arch='__all__'):
|
|||
values['arches'] = sorted(arches)
|
||||
values['graphWidth'] = graphWidth
|
||||
values['channels'] = sorted(channels, key=lambda x: x['name'])
|
||||
return _genHTML(environ, 'clusterhealth.chtml')
|
||||
return _genHTML(environ, 'clusterhealth.chtml', jinja=True)
|
||||
|
||||
|
||||
def recentbuilds(environ, user=None, tag=None, package=None):
|
||||
|
|
@ -2532,8 +2550,10 @@ def recentbuilds(environ, user=None, tag=None, package=None):
|
|||
values['builds'] = builds
|
||||
values['weburl'] = _getBaseURL(environ)
|
||||
|
||||
values['koji'] = koji
|
||||
|
||||
environ['koji.headers'].append(['Content-Type', 'text/xml'])
|
||||
return _genHTML(environ, 'recentbuilds.chtml')
|
||||
return _genHTML(environ, 'recentbuilds.chtml', jinja=True)
|
||||
|
||||
|
||||
_infoURLs = {'package': 'packageinfo?packageID=%(id)i',
|
||||
|
|
@ -2610,9 +2630,9 @@ def search(environ, start=None, order=None):
|
|||
else:
|
||||
typeLabel = '%ss' % type
|
||||
values['typeLabel'] = typeLabel
|
||||
return _genHTML(environ, 'search.chtml')
|
||||
return _genHTML(environ, 'search.chtml', jinja=True)
|
||||
else:
|
||||
return _genHTML(environ, 'search.chtml')
|
||||
return _genHTML(environ, 'search.chtml', jinja=True)
|
||||
|
||||
|
||||
def api(environ):
|
||||
|
|
@ -2621,12 +2641,13 @@ def api(environ):
|
|||
|
||||
values['koji_hub_url'] = environ['koji.options']['KojiHubURL']
|
||||
values['methods'] = sorted(server._listapi(), key=lambda x: x['name'])
|
||||
values['web_version'] = koji.__version__
|
||||
try:
|
||||
values['koji_version'] = server.getKojiVersion()
|
||||
except koji.GenericError:
|
||||
values['koji_version'] = "Can't determine (older then 1.23)"
|
||||
|
||||
return _genHTML(environ, 'api.chtml')
|
||||
return _genHTML(environ, 'api.chtml', jinja=True)
|
||||
|
||||
|
||||
def watchlogs(environ, taskID):
|
||||
|
|
@ -2677,7 +2698,9 @@ def repoinfo(environ, repoID):
|
|||
pathinfo.repo(repo_info['id'], repo_info['tag_name']), 'repo.json')
|
||||
num_buildroots = len(server.listBuildroots(repoID=repoID)) or 0
|
||||
values['numBuildroots'] = num_buildroots
|
||||
return _genHTML(environ, 'repoinfo.chtml')
|
||||
values['state_name'] = kojiweb.util.repoState(repo_info['state'])
|
||||
values['create_time'] = kojiweb.util.formatTimeLong(repo_info['create_ts'])
|
||||
return _genHTML(environ, 'repoinfo.chtml', jinja=True)
|
||||
|
||||
|
||||
def activesession(environ, start=None, order=None):
|
||||
|
|
@ -2687,10 +2710,10 @@ def activesession(environ, start=None, order=None):
|
|||
values['loggedInUser'] = environ['koji.currentUser']
|
||||
|
||||
values['order'] = order
|
||||
activesess = server.getSessionInfo(details=True, user_id=values['loggedInUser']['id'])
|
||||
if not activesess:
|
||||
activesess = []
|
||||
else:
|
||||
activesess = []
|
||||
if environ['koji.currentUser']:
|
||||
activesess = server.getSessionInfo(details=True, user_id=values['loggedInUser']['id'])
|
||||
if activesess:
|
||||
current_timestamp = datetime.datetime.utcnow().timestamp()
|
||||
for a in activesess:
|
||||
a['lengthSession'] = kojiweb.util.formatTimestampDifference(
|
||||
|
|
@ -2698,7 +2721,7 @@ def activesession(environ, start=None, order=None):
|
|||
|
||||
kojiweb.util.paginateList(values, activesess, start, 'activesess', order=order)
|
||||
|
||||
return _genHTML(environ, 'activesession.chtml')
|
||||
return _genHTML(environ, 'activesession.chtml', jinja=True)
|
||||
|
||||
|
||||
def activesessiondelete(environ, sessionID):
|
||||
|
|
@ -2727,4 +2750,6 @@ def buildroots(environ, repoID=None, order='id', start=None, state=None):
|
|||
kw={'repoID': repoID, 'state': state}, start=start,
|
||||
dataName='buildroots', prefix='buildroot', order=order)
|
||||
|
||||
return _genHTML(environ, 'buildroots.chtml')
|
||||
values['koji'] = koji
|
||||
|
||||
return _genHTML(environ, 'buildroots.chtml', jinja=True)
|
||||
|
|
|
|||
|
|
@ -1,27 +1,26 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#if $notif
|
||||
#if notif
|
||||
<h4>Edit notification</h4>
|
||||
#else
|
||||
<h4>Create notification</h4>
|
||||
#end if
|
||||
#endif
|
||||
|
||||
<form action="#if $notif then 'notificationedit' else 'notificationcreate'#">
|
||||
$util.authToken($self, form=True)
|
||||
#if $notif
|
||||
<input type="hidden" name="notificationID" value="$notif.id"/>
|
||||
#end if
|
||||
<form action="{{ 'notificationedit' if notif else 'notificationcreate' }}">
|
||||
{{ util.authToken(form=True) }}
|
||||
#if notif
|
||||
<input type="hidden" name="notificationID" value="{{ notif.id }}"/>
|
||||
#endif
|
||||
<table>
|
||||
<tr>
|
||||
<th>Package</th>
|
||||
<td>
|
||||
<select name="package">
|
||||
<option value="all"#if $notif and not $notif.package_id then ' selected' else ''#>all</option>
|
||||
#for $package in $packages
|
||||
<option value="$package.package_id"#if $notif and $notif.package_id == $package.package_id then ' selected' else ''#>$package.package_name</option>
|
||||
#end for
|
||||
<option value="all"{{ ' selected' if notif and not notif.package_id else '' }}>all</option>
|
||||
#for package in packages
|
||||
<option value="{{ package.package_id }}"{{ ' selected' if notif and notif.package_id == package.package_id else '' }}>{{ package.package_name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -29,28 +28,28 @@
|
|||
<th>Tag</th>
|
||||
<td>
|
||||
<select name="tag">
|
||||
<option value="all"#if $notif and not $notif.tag_id then ' selected' else ''#>all</option>
|
||||
#for $tag in $tags
|
||||
<option value="$tag.id"#if $notif and $notif.tag_id == $tag.id then ' selected' else ''#>$tag.name</option>
|
||||
#end for
|
||||
<option value="all"{{ ' selected' if notif and not notif.tag_id else '' }}>all</option>
|
||||
#for tag in tags
|
||||
<option value="{{ tag.id }}"{{ ' selected' if notif and notif.tag_id == tag.id else '' }}>{{ tag.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Success Only?</th>
|
||||
<td><input type="checkbox" name="success_only" value="yes"#if $notif and $notif.success_only then ' checked="checked"' else ''#/></td>
|
||||
<td><input type="checkbox" name="success_only" value="yes"{{ ' checked="checked"' if notif and notif.success_only else '' }}/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
#if $notif
|
||||
#if notif
|
||||
<button type="submit" name="save" value="Save">Save</button>
|
||||
#else
|
||||
<button type="submit" name="add" value="Add">Add</button>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
<td><button type="submit" name="cancel" value="Cancel">Cancel</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,127 +1,126 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for package <a href="packageinfo?packageID=$package.id">$package.name</a></h4>
|
||||
<h4>Information for package <a href="packageinfo?packageID={{ package.id }}">{{ package.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$package.name</td>
|
||||
<th>Name</th><td>{{ package.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$package.id</td>
|
||||
<th>ID</th><td>{{ package.id }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th id="buildlist">Builds</th>
|
||||
<td class="container">
|
||||
#if $len($builds) > 0
|
||||
#if (builds |length) > 0
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="4">
|
||||
#if $len($buildPages) > 1
|
||||
#if (buildPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'packageinfo?buildStart=' + this.value * $buildRange + '$util.passthrough($self, 'packageID', 'buildOrder', 'tagOrder', 'tagStart')#buildlist';">
|
||||
#for $pageNum in $buildPages
|
||||
<option value="$pageNum"#if $pageNum == $buildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'packageinfo?buildStart=' + this.value * {{ buildRange }} + '{{ util.passthrough('packageID', 'buildOrder', 'tagOrder', 'tagStart') }}#buildlist';">
|
||||
#for pageNum in buildPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildStart > 0
|
||||
<a href="packageinfo?buildStart=#echo $buildStart - $buildRange#$util.passthrough($self, 'packageID', 'buildOrder', 'tagOrder', 'tagStart')#buildlist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $buildStart + 1 # through #echo $buildStart + $buildCount # of $totalBuilds</strong>
|
||||
#if $buildStart + $buildCount < $totalBuilds
|
||||
<a href="packageinfo?buildStart=#echo $buildStart + $buildRange#$util.passthrough($self, 'packageID', 'buildOrder', 'tagOrder', 'tagStart')#buildlist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildStart > 0
|
||||
<a href="packageinfo?buildStart={{ buildStart - buildRange }}{{ util.passthrough('packageID', 'buildOrder', 'tagOrder', 'tagStart') }}#buildlist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ buildStart + 1 }} through {{ buildStart + buildCount }} of {{ totalBuilds }}</strong>
|
||||
#if buildStart + buildCount < totalBuilds
|
||||
<a href="packageinfo?buildStart={{ buildStart + buildRange }}{{ util.passthrough('packageID', 'buildOrder', 'tagOrder', 'tagStart') }}#buildlist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="packageinfo?buildOrder=$util.toggleOrder($self, 'nvr', 'buildOrder')$util.passthrough($self, 'packageID', 'tagOrder', 'tagStart')#buildlist">NVR</a> $util.sortImage($self, 'nvr', 'buildOrder')</th>
|
||||
<th><a href="packageinfo?buildOrder=$util.toggleOrder($self, 'owner_name', 'buildOrder')$util.passthrough($self, 'packageID', 'tagOrder', 'tagStart')#buildlist">Built by</a> $util.sortImage($self, 'owner_name', 'buildOrder')</th>
|
||||
<th><a href="packageinfo?buildOrder=$util.toggleOrder($self, 'completion_time', 'buildOrder')$util.passthrough($self, 'packageID', 'tagOrder', 'tagStart')#buildlist">Finished</a> $util.sortImage($self, 'completion_time', 'buildOrder')</th>
|
||||
<th><a href="packageinfo?buildOrder=$util.toggleOrder($self, 'state', 'buildOrder')$util.passthrough($self, 'packageID', 'tagOrder', 'tagStart')#buildlist">State</a> $util.sortImage($self, 'state', 'buildOrder')</th>
|
||||
<th><a href="packageinfo?buildOrder={{ util.toggleOrder('nvr', 'buildOrder') }}{{ util.passthrough('packageID', 'tagOrder', 'tagStart') }}#buildlist">NVR</a> {{ util.sortImage('nvr', 'buildOrder') }}</th>
|
||||
<th><a href="packageinfo?buildOrder={{ util.toggleOrder('owner_name', 'buildOrder') }}{{ util.passthrough('packageID', 'tagOrder', 'tagStart') }}#buildlist">Built by</a> {{ util.sortImage('owner_name', 'buildOrder') }}</th>
|
||||
<th><a href="packageinfo?buildOrder={{ util.toggleOrder('completion_time', 'buildOrder') }}{{ util.passthrough('packageID', 'tagOrder', 'tagStart') }}#buildlist">Finished</a> {{ util.sortImage('completion_time', 'buildOrder') }}</th>
|
||||
<th><a href="packageinfo?buildOrder={{ util.toggleOrder('state', 'buildOrder') }}{{ util.passthrough('packageID', 'tagOrder', 'tagStart') }}#buildlist">State</a> {{ util.sortImage('state', 'buildOrder') }}</th>
|
||||
</tr>
|
||||
#for $build in $builds
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="buildinfo?buildID=$build.build_id">$build.nvr</a></td>
|
||||
<td class="user-$build.owner_name"><a href="userinfo?userID=$build.owner_id">$build.owner_name</a></td>
|
||||
<td>$util.formatTime($build.completion_ts)</td>
|
||||
#set $stateName = $util.stateName($build.state)
|
||||
<td class="$stateName">$util.stateImage($build.state)</td>
|
||||
#for build in builds
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="buildinfo?buildID={{ build.build_id }}">{{ build.nvr }}</a></td>
|
||||
<td class="user-{{ build.owner_name }}"><a href="userinfo?userID={{ build.owner_id }}">{{ build.owner_name }}</a></td>
|
||||
<td>{{ util.formatTime(build.completion_ts) }}</td>
|
||||
#set stateName = util.stateName(build.state)
|
||||
<td class="{{ stateName }}">{{ util.stateImage(build.state) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#if $buildStart > 0
|
||||
<a href="packageinfo?buildStart=#echo $buildStart - $buildRange#$util.passthrough($self, 'packageID', 'buildOrder', 'tagOrder', 'tagStart')#buildlist"><<<</a>
|
||||
#end if
|
||||
<strong>Builds #echo $buildStart + 1 # through #echo $buildStart + $buildCount # of $totalBuilds</strong>
|
||||
#if $buildStart + $buildCount < $totalBuilds
|
||||
<a href="packageinfo?buildStart=#echo $buildStart + $buildRange#$util.passthrough($self, 'packageID', 'buildOrder', 'tagOrder', 'tagStart')#buildlist">>>></a>
|
||||
#end if
|
||||
#if buildStart > 0
|
||||
<a href="packageinfo?buildStart={{ buildStart - buildRange }}{{ util.passthrough('packageID', 'buildOrder', 'tagOrder', 'tagStart') }}#buildlist"><<<</a>
|
||||
#endif
|
||||
<strong>Builds {{ buildStart + 1 }} through {{ buildStart + buildCount }} of {{ totalBuilds }}</strong>
|
||||
#if buildStart + buildCount < totalBuilds
|
||||
<a href="packageinfo?buildStart={{ buildStart + buildRange }}{{ util.passthrough('packageID', 'buildOrder', 'tagOrder', 'tagStart') }}#buildlist">>>></a>
|
||||
#endif
|
||||
#else
|
||||
No builds
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th id="taglist">Tags</th>
|
||||
<td class="container">
|
||||
#if $len($tags) > 0
|
||||
#if (tags |length) > 0
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="4">
|
||||
#if $len($tagPages) > 1
|
||||
#if (tagPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'packageinfo?tagStart=' + this.value * $tagRange + '$util.passthrough($self, 'packageID', 'tagOrder', 'buildOrder', 'buildStart')#taglist';">
|
||||
#for $pageNum in $tagPages
|
||||
<option value="$pageNum"#if $pageNum == $tagCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'packageinfo?tagStart=' + this.value * {{ tagRange }} + '{{ util.passthrough('packageID', 'tagOrder', 'buildOrder', 'buildStart') }}#taglist';">
|
||||
#for pageNum in tagPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == tagCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $tagStart > 0
|
||||
<a href="packageinfo?tagStart=#echo $tagStart - $tagRange#$util.passthrough($self, 'packageID', 'tagOrder', 'buildOrder', 'buildStart')#taglist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $tagStart + 1 # through #echo $tagStart + $tagCount # of $totalTags</strong>
|
||||
#if $tagStart + $tagCount < $totalTags
|
||||
<a href="packageinfo?tagStart=#echo $tagStart + $tagRange#$util.passthrough($self, 'packageID', 'tagOrder', 'buildOrder', 'buildStart')#taglist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if tagStart > 0
|
||||
<a href="packageinfo?tagStart={{ tagStart - tagRange }}{{ util.passthrough('packageID', 'tagOrder', 'buildOrder', 'buildStart') }}#taglist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ tagStart + 1 }} through {{ tagStart + tagCount }} of {{ totalTags }}</strong>
|
||||
#if tagStart + tagCount < totalTags
|
||||
<a href="packageinfo?tagStart={{ tagStart + tagRange }}{{ util.passthrough('packageID', 'tagOrder', 'buildOrder', 'buildStart') }}#taglist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="packageinfo?tagOrder=$util.toggleOrder($self, 'name', 'tagOrder')$util.passthrough($self, 'packageID', 'buildOrder', 'buildStart')#taglist">Name</a> $util.sortImage($self, 'name', 'tagOrder')</th>
|
||||
<th><a href="packageinfo?tagOrder=$util.toggleOrder($self, 'owner_name', 'tagOrder')$util.passthrough($self, 'packageID', 'buildOrder', 'buildStart')#taglist">Owner</a> $util.sortImage($self, 'owner_name', 'tagOrder')</th>
|
||||
<th><a href="packageinfo?tagOrder=$util.toggleOrder($self, 'blocked', 'tagOrder')$util.passthrough($self, 'packageID', 'buildOrder', 'buildStart')#taglist">Included?</a> $util.sortImage($self, 'blocked', 'tagOrder')</th>
|
||||
<th><a href="packageinfo?tagOrder=$util.toggleOrder($self, 'extra_arches', 'tagOrder')$util.passthrough($self, 'packageID', 'buildOrder', 'buildStart')#taglist">Extra Arches</a> $util.sortImage($self, 'extra_arches', 'tagOrder')</th>
|
||||
<th><a href="packageinfo?tagOrder={{ util.toggleOrder('name', 'tagOrder') }}{{ util.passthrough('packageID', 'buildOrder', 'buildStart') }}#taglist">Name</a> {{ util.sortImage('name', 'tagOrder') }}</th>
|
||||
<th><a href="packageinfo?tagOrder={{ util.toggleOrder('owner_name', 'tagOrder') }}{{ util.passthrough('packageID', 'buildOrder', 'buildStart') }}#taglist">Owner</a> {{ util.sortImage('owner_name', 'tagOrder') }}</th>
|
||||
<th><a href="packageinfo?tagOrder={{ util.toggleOrder('blocked', 'tagOrder') }}{{ util.passthrough('packageID', 'buildOrder', 'buildStart') }}#taglist">Included?</a> {{ util.sortImage('blocked', 'tagOrder') }}</th>
|
||||
<th><a href="packageinfo?tagOrder={{ util.toggleOrder('extra_arches', 'tagOrder') }}{{ util.passthrough('packageID', 'buildOrder', 'buildStart') }}#taglist">Extra Arches</a> {{ util.sortImage('extra_arches', 'tagOrder') }}</th>
|
||||
</tr>
|
||||
#for $tag in $tags
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="taginfo?tagID=$tag.id">$tag.name</a></td>
|
||||
<td><a href="userinfo?userID=$tag.owner_id">$tag.owner_name</a></td>
|
||||
#set $included = $tag.blocked and 'no' or 'yes'
|
||||
<td>$util.imageTag($included)</td>
|
||||
<td>$tag.extra_arches</td>
|
||||
#for tag in tags
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a></td>
|
||||
<td><a href="userinfo?userID={{ tag.owner_id }}">{{ tag.owner_name }}</a></td>
|
||||
#set included = tag.blocked and 'no' or 'yes'
|
||||
<td>{{ util.imageTag(included) }}</td>
|
||||
<td>{{ tag.extra_arches }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#if $tagStart > 0
|
||||
<a href="packageinfo?tagStart=#echo $tagStart - $tagRange#$util.passthrough($self, 'packageID', 'tagOrder', 'buildOrder', 'buildStart')#taglist"><<<</a>
|
||||
#end if
|
||||
<strong>Tags #echo $tagStart + 1 # through #echo $tagStart + $tagCount # of $totalTags</strong>
|
||||
#if $tagStart + $tagCount < $totalTags
|
||||
<a href="packageinfo?tagStart=#echo $tagStart + $tagRange#$util.passthrough($self, 'packageID', 'tagOrder', 'buildOrder', 'buildStart')#taglist">>>></a>
|
||||
#end if
|
||||
#if tagStart > 0
|
||||
<a href="packageinfo?tagStart={{ tagStart - tagRange }}{{ util.passthrough('packageID', 'tagOrder', 'buildOrder', 'buildStart') }}#taglist"><<<</a>
|
||||
#endif
|
||||
<strong>Tags {{ tagStart + 1 }} through {{ tagStart + tagCount }} of {{ totalTags }}</strong>
|
||||
#if tagStart + tagCount < totalTags
|
||||
<a href="packageinfo?tagStart={{ tagStart + tagRange }}{{ util.passthrough('packageID', 'tagOrder', 'buildOrder', 'buildStart') }}#taglist">>>></a>
|
||||
#endif
|
||||
#else
|
||||
No tags
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,139 +1,136 @@
|
|||
#from kojiweb import util
|
||||
#from kojiweb.util import safe_return
|
||||
|
||||
#attr _PASSTHROUGH = ['userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked']
|
||||
#set _PASSTHROUGH = ['userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked']
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#@safe_return
|
||||
#def getDescription()
|
||||
#macro getDescription()
|
||||
Packages
|
||||
#if $prefix
|
||||
starting with $prefix
|
||||
#end if
|
||||
#if $tag
|
||||
in tag <a href="taginfo?tagID=$tag.id">$tag.name</a>
|
||||
#end if
|
||||
#if $user
|
||||
owned by <a href="userinfo?userID=$user.id">$user.name</a>
|
||||
#end if
|
||||
#end def
|
||||
#if prefix
|
||||
starting with {{ prefix }}
|
||||
#endif
|
||||
#if tag
|
||||
in tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a>
|
||||
#endif
|
||||
#if user
|
||||
owned by <a href="userinfo?userID={{ user.id }}">{{ user.name }}</a>
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
<h4>$getDescription()</h4>
|
||||
<h4>{{ getDescription() }}</h4>
|
||||
|
||||
<table class="data-list">
|
||||
#if $tag
|
||||
#if tag
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<table class="nested">
|
||||
<tr><td>
|
||||
<strong>Inherited</strong>:
|
||||
</td><td>
|
||||
<select name="inherited" class="filterlist" onchange="javascript: window.location = 'packages?inherited=' + this.value + '$util.passthrough_except($self, 'inherited')';">
|
||||
<option value="1" #if $inherited then 'selected' else ''#>yes</option>
|
||||
<option value="0" #if not $inherited then 'selected' else ''#>no</option>
|
||||
<select name="inherited" class="filterlist" onchange="javascript: window.location = 'packages?inherited=' + this.value + '{{ util.passthrough_except('inherited') }}';">
|
||||
<option value="1" {{ 'selected' if inherited else '' }}>yes</option>
|
||||
<option value="0" {{ 'selected' if not inherited else '' }}>no</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<strong>With blocked</strong>:
|
||||
</td><td>
|
||||
<select name="blocked" class="filterlist" onchange="javascript: window.location = 'packages?blocked=' + this.value + '$util.passthrough_except($self, 'blocked')';">
|
||||
<option value="1" #if $blocked then 'selected' else ''#>yes</option>
|
||||
<option value="0" #if not $blocked then 'selected' else ''#>no</option>
|
||||
<select name="blocked" class="filterlist" onchange="javascript: window.location = 'packages?blocked=' + this.value + '{{ util.passthrough_except('blocked') }}';">
|
||||
<option value="1" {{ 'selected' if blocked else '' }}>yes</option>
|
||||
<option value="0" {{ 'selected' if not blocked else '' }}>no</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
</table>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="charlist" colspan="#if $tag or $user then '5' else '2'#">
|
||||
#for $char in $chars
|
||||
#if $prefix == $char
|
||||
<strong>$char</strong>
|
||||
<td class="charlist" colspan="{{ '5' if tag or user else '2' }}">
|
||||
#for char in chars
|
||||
#if prefix == char
|
||||
<strong>{{ char }}</strong>
|
||||
#else
|
||||
<a href="packages?prefix=$char$util.passthrough($self, 'userID', 'tagID', 'order', 'inherited', 'blocked')">$char</a>
|
||||
#end if
|
||||
<a href="packages?prefix={{ char }}{{ util.passthrough('userID', 'tagID', 'order', 'inherited', 'blocked') }}">{{ char }}</a>
|
||||
#endif
|
||||
|
|
||||
#end for
|
||||
#if $prefix
|
||||
<a href="packages?${util.passthrough($self, 'userID', 'tagID', 'order', 'inherited', 'blocked', prefix='')}">all</a>
|
||||
#endfor
|
||||
#if prefix
|
||||
<a href="packages?{{ util.passthrough('userID', 'tagID', 'order', 'inherited', 'blocked', prefix='') }}">all</a>
|
||||
#else
|
||||
<strong>all</strong>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="#if $tag or $user then '5' else '2'#">
|
||||
#if $len($packagePages) > 1
|
||||
<td class="paginate" colspan="{{ '5' if tag or user else '2' }}">
|
||||
#if (packagePages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'packages?start=' + this.value * $packageRange + '$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked')';">
|
||||
#for $pageNum in $packagePages
|
||||
<option value="$pageNum"#if $pageNum == $packageCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'packages?start=' + this.value * {{ packageRange }} + '{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}';">
|
||||
#for pageNum in packagePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == packageCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $packageStart > 0
|
||||
<a href="packages?start=#echo $packageStart - $packageRange #$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked')"><<<</a>
|
||||
#end if
|
||||
#if $totalPackages != 0
|
||||
<strong>Packages #echo $packageStart + 1 # through #echo $packageStart + $packageCount # of $totalPackages</strong>
|
||||
#end if
|
||||
#if $packageStart + $packageCount < $totalPackages
|
||||
<a href="packages?start=#echo $packageStart + $packageRange#$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if packageStart > 0
|
||||
<a href="packages?start={{ packageStart - packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}"><<<</a>
|
||||
#endif
|
||||
#if totalPackages != 0
|
||||
<strong>Packages {{ packageStart + 1 }} through {{ packageStart + packageCount }} of {{ totalPackages }}</strong>
|
||||
#endif
|
||||
#if packageStart + packageCount < totalPackages
|
||||
<a href="packages?start={{ packageStart + packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="packages?order=$util.toggleOrder($self, 'package_id')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'blocked')">ID</a> $util.sortImage($self, 'package_id')</th>
|
||||
<th><a href="packages?order=$util.toggleOrder($self, 'package_name')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'blocked')">Name</a> $util.sortImage($self, 'package_name')</th>
|
||||
#if $tag or $user
|
||||
<th><a href="packages?order=$util.toggleOrder($self, 'tag_name')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'blocked')">Tag</a> $util.sortImage($self, 'tag_name')</th>
|
||||
<th><a href="packages?order=$util.toggleOrder($self, 'owner_name')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'blocked')">Owner</a> $util.sortImage($self, 'owner_name')</th>
|
||||
<th><a href="packages?order=$util.toggleOrder($self, 'blocked')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'blocked')">Included?</a> $util.sortImage($self, 'blocked')</th>
|
||||
#end if
|
||||
<th><a href="packages?order={{ util.toggleOrder('package_id') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">ID</a> {{ util.sortImage('package_id') }}</th>
|
||||
<th><a href="packages?order={{ util.toggleOrder('package_name') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Name</a> {{ util.sortImage('package_name') }}</th>
|
||||
#if tag or user
|
||||
<th><a href="packages?order={{ util.toggleOrder('tag_name') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Tag</a> {{ util.sortImage('tag_name') }}</th>
|
||||
<th><a href="packages?order={{ util.toggleOrder('owner_name') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Owner</a> {{ util.sortImage('owner_name') }}</th>
|
||||
<th><a href="packages?order={{ util.toggleOrder('blocked') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Included?</a> {{ util.sortImage('blocked') }}</th>
|
||||
#endif
|
||||
</tr>
|
||||
#if $len($packages) > 0
|
||||
#for $package in $packages
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$package.package_id</td>
|
||||
<td><a href="packageinfo?packageID=$package.package_id">$package.package_name</a></td>
|
||||
#if $tag or $user
|
||||
<td><a href="taginfo?tagID=$package.tag_id">$package.tag_name</a></td>
|
||||
<td class="user-$package.owner_name"><a href="userinfo?userID=$package.owner_id">$package.owner_name</a></td>
|
||||
<td class="$str(not $package.blocked).lower()">#if $package.blocked then $util.imageTag('no') else $util.imageTag('yes')#</td>
|
||||
#end if
|
||||
#if (packages |length) > 0
|
||||
#for package in packages
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ package.package_id }}</td>
|
||||
<td><a href="packageinfo?packageID={{ package.package_id }}">{{ package.package_name }}</a></td>
|
||||
#if tag or user
|
||||
<td><a href="taginfo?tagID={{ package.tag_id }}">{{ package.tag_name }}</a></td>
|
||||
<td class="user-{{ package.owner_name }}"><a href="userinfo?userID={{ package.owner_id }}">{{ package.owner_name }}</a></td>
|
||||
<td class="{{ str(not package.blocked) }}.lower()">{{ util.imageTag('no') if package.blocked else util.imageTag('yes') }}</td>
|
||||
#endif
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="#if $tag or $user then '5' else '2'#">No packages</td>
|
||||
<td colspan="{{ '5' if tag or user else '2' }}">No packages</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="#if $tag or $user then '5' else '2'#">
|
||||
#if $len($packagePages) > 1
|
||||
<td class="paginate" colspan="{{ '5' if tag or user else '2' }}">
|
||||
#if (packagePages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'packages?start=' + this.value * $packageRange + '$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked')';">
|
||||
#for $pageNum in $packagePages
|
||||
<option value="$pageNum"#if $pageNum == $packageCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'packages?start=' + this.value * {{ packageRange }} + '{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}';">
|
||||
#for pageNum in packagePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == packageCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $packageStart > 0
|
||||
<a href="packages?start=#echo $packageStart - $packageRange #$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked')"><<<</a>
|
||||
#end if
|
||||
#if $totalPackages != 0
|
||||
<strong>Packages #echo $packageStart + 1 # through #echo $packageStart + $packageCount # of $totalPackages</strong>
|
||||
#end if
|
||||
#if $packageStart + $packageCount < $totalPackages
|
||||
<a href="packages?start=#echo $packageStart + $packageRange#$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if packageStart > 0
|
||||
<a href="packages?start={{ packageStart - packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}"><<<</a>
|
||||
#endif
|
||||
#if totalPackages != 0
|
||||
<strong>Packages {{ packageStart + 1 }} through {{ packageStart + packageCount }} of {{ totalPackages }}</strong>
|
||||
#endif
|
||||
#if packageStart + packageCount < totalPackages
|
||||
<a href="packages?start={{ packageStart + packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,73 +1,72 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Packages by User</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($userPages) > 1
|
||||
#if (userPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'packagesbyuser?start=' + this.value * $userRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $userPages
|
||||
<option value="$pageNum"#if $pageNum == $userCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'packagesbyuser?start=' + this.value * {{ userRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in userPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == userCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userStart > 0
|
||||
<a href="packagesbyuser?start=#echo $userStart - $userRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalUsers != 0
|
||||
<strong>Users #echo $userStart + 1 # through #echo $userStart + $userCount # of $totalUsers</strong>
|
||||
#end if
|
||||
#if $userStart + $userCount < $totalUsers
|
||||
<a href="packagesbyuser?start=#echo $userStart + $userRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userStart > 0
|
||||
<a href="packagesbyuser?start={{ userStart - userRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUsers != 0
|
||||
<strong>Users {{ userStart + 1 }} through {{ userStart + userCount }} of {{ totalUsers }}</strong>
|
||||
#endif
|
||||
#if userStart + userCount < totalUsers
|
||||
<a href="packagesbyuser?start={{ userStart + userRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="packagesbyuser?order=$util.toggleOrder($self, 'name')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="packagesbyuser?order=$util.toggleOrder($self, 'packages')">Packages</a> $util.sortImage($self, 'packages')</th>
|
||||
<th><a href="packagesbyuser?order={{ util.toggleOrder('name') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th><a href="packagesbyuser?order={{ util.toggleOrder('packages') }}">Packages</a> {{ util.sortImage('packages') }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
#if $len($users) > 0
|
||||
#for $user in $users
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="userinfo?userID=$user.id">$user.name</a></td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $user.packages#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$user.packages</td>
|
||||
#if (users |length) > 0
|
||||
#for user in users
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="userinfo?userID={{ user.id }}">{{ user.name }}</a></td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * user.packages }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ user.packages }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No users</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($userPages) > 1
|
||||
#if (userPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'packagesbyuser?start=' + this.value * $userRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $userPages
|
||||
<option value="$pageNum"#if $pageNum == $userCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'packagesbyuser?start=' + this.value * {{ userRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in userPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == userCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userStart > 0
|
||||
<a href="packagesbyuser?start=#echo $userStart - $userRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalUsers != 0
|
||||
<strong>Users #echo $userStart + 1 # through #echo $userStart + $userCount # of $totalUsers</strong>
|
||||
#end if
|
||||
#if $userStart + $userCount < $totalUsers
|
||||
<a href="packagesbyuser?start=#echo $userStart + $userRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userStart > 0
|
||||
<a href="packagesbyuser?start={{ userStart - userRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUsers != 0
|
||||
<strong>Users {{ userStart + 1 }} through {{ userStart + userCount }} of {{ totalUsers }}</strong>
|
||||
#endif
|
||||
#if userStart + userCount < totalUsers
|
||||
<a href="packagesbyuser?start={{ userStart + userRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,55 +1,51 @@
|
|||
#import koji
|
||||
#import koji.util
|
||||
#from kojiweb import util
|
||||
|
||||
#@util.safe_return
|
||||
#def linkURL()
|
||||
#set $query = []
|
||||
#if $tag
|
||||
#silent $query.append('tagID=%i' % $tag.id)
|
||||
#end if
|
||||
#if $user
|
||||
#silent $query.append('userID=%i' % $user.id)
|
||||
#end if
|
||||
#if $package
|
||||
#silent $query.append('packageID=%i' % $package.id)
|
||||
#end if
|
||||
#if $query
|
||||
#echo '%s/%s?%s' % ($weburl, 'builds', '&'.join($query))
|
||||
#macro linkURL()
|
||||
#set query = []
|
||||
#if tag
|
||||
#set _tmp = query.append('tagID=%i' % (tag.id|urlencode))
|
||||
#endif
|
||||
#if user
|
||||
#set _tmp = query.append('userID=%i' % (user.id|urlencode))
|
||||
#endif
|
||||
#if package
|
||||
#set _tmp = query.append('packageID=%i' % (package.id|urlencode))
|
||||
#endif
|
||||
#if query
|
||||
{{ '%s/%s?%s' % (weburl, 'builds', '&'.join(query)) }}
|
||||
#else
|
||||
#echo '%s/%s' % ($weburl, 'builds')
|
||||
#end if
|
||||
#end def
|
||||
{{ '%s/%s' % (weburl, 'builds') }}
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>$siteName: recent builds#if $package then ' of package ' + $package.name else ''##if $tag then ' into tag ' + $tag.name else ''##if $user then ' by user ' + $user.name else ''#</title>
|
||||
<link>$linkURL()</link>
|
||||
<title>{{ siteName }}: recent builds{{ ' of package ' + package.name if package else '' }}{{ ' into tag ' + tag.name if tag else '' }}{{ ' by user ' + user.name if user else '' }}</title>
|
||||
<link>{{ linkURL() }}</link>
|
||||
<description>
|
||||
A list of the most recent builds
|
||||
#if $package
|
||||
of package $package.name
|
||||
#end if
|
||||
#if $tag
|
||||
into tag $tag.name
|
||||
#end if
|
||||
#if $user
|
||||
by user $user.name
|
||||
#end if
|
||||
in the $siteName Build System. The list is sorted in reverse chronological order by build completion time.
|
||||
#if package
|
||||
of package {{ package.name }}
|
||||
#endif
|
||||
#if tag
|
||||
into tag {{ tag.name }}
|
||||
#endif
|
||||
#if user
|
||||
by user {{ user.name }}
|
||||
#endif
|
||||
in the {{ siteName }} Build System. The list is sorted in reverse chronological order by build completion time.
|
||||
</description>
|
||||
<pubDate>$util.formatTimeRSS($currentDate)</pubDate>
|
||||
#for $build in $builds
|
||||
<pubDate>{{ util.formatTimeRSS(currentDate) }}</pubDate>
|
||||
#for build in builds
|
||||
<item>
|
||||
<title>$koji.BUILD_STATES[$build.state].lower(): $koji.buildLabel($build)#if $build.task then ', target: ' + $build.task.request[1] else ''#</title>
|
||||
<link>$weburl/buildinfo?buildID=$build.build_id</link>
|
||||
#if $build.completion_time
|
||||
<pubDate>$util.formatTimeRSS($build.completion_ts)</pubDate>
|
||||
#end if
|
||||
#if $build.state == $koji.BUILD_STATES['COMPLETE'] and $build.changelog
|
||||
<description><pre>$koji.util.formatChangelog($build.changelog)</pre></description>
|
||||
#end if
|
||||
<title>{{ koji.BUILD_STATES[build.state]|lower }}: {{ koji.buildLabel(build) }}{{ ', target: ' + build.task.request[1] if build.task else '' }}</title>
|
||||
<link>{{ weburl }}/buildinfo?buildID={{ build.build_id }}</link>
|
||||
#if build.completion_time
|
||||
<pubDate>{{ util.formatTimeRSS(build.completion_ts) }}</pubDate>
|
||||
#endif
|
||||
#if build.state == koji.BUILD_STATES['COMPLETE'] and build.changelog
|
||||
<description><pre>{{ koji.util.formatChangelog(build.changelog) }}</pre></description>
|
||||
#endif
|
||||
</item>
|
||||
#end for
|
||||
#endfor
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
|
|||
|
|
@ -1,30 +1,26 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
{% include "includes/header2.chtml" %}
|
||||
|
||||
#include "includes/header.chtml"
|
||||
<h4>Information for repo {{ repo_id }}</h4>
|
||||
|
||||
<h4>Information for repo $repo_id</h4>
|
||||
|
||||
#if $repo
|
||||
{% if repo %}
|
||||
<table>
|
||||
<tr><th>ID</th><td>$repo.id</td><th></tr>
|
||||
<tr><th>Tag</th><td><a href="taginfo?tagID=$repo.tag_id">$repo.tag_name</a></td></tr>
|
||||
#if $repo.task_id
|
||||
<tr><th>Task ID</th><td><a href="taskinfo?taskID=$repo.task_id">$repo.task_id</a></td></tr>
|
||||
#end if
|
||||
#set $state = $util.repoState($repo.state)
|
||||
<tr><th>State</th><td class="repo$state">$state</td></tr>
|
||||
<tr><th>Event</th><td>$repo.create_event ($util.formatTimeLong($repo.create_ts))</td></tr>
|
||||
#if $repo.state != koji.REPO_STATES['DELETED']
|
||||
<tr><th>URL</th><td><a href="$url">repodata</a></td></tr>
|
||||
<tr><th>Repo json</th><td><a href="$repo_json">repo.json</a></td></tr>
|
||||
#end if
|
||||
<tr><th>Dist repo?</th><td class="$str($repo.dist).lower()">#if $repo.dist then 'yes' else 'no'#</td></tr>
|
||||
<tr><th>Number of buildroots: </th><td><a href="buildroots?repoID=$repo.id">$numBuildroots</a></td></tr>
|
||||
<tr><th>ID</th><td>{{ repo.id }}</td><th></tr>
|
||||
<tr><th>Tag</th><td><a href="taginfo?tagID={{ repo.tag_id }}">{{ repo.tag_name }}</a></td></tr>
|
||||
{% if repo.task_id %}
|
||||
<tr><th>Task ID</th><td><a href="taskinfo?taskID={{ repo.task_id }}">{{ repo.task_id }}</a></td></tr>
|
||||
{% endif %}
|
||||
<tr><th>State</th><td class="repo{{ state_name }}">{{ state_name }}</td></tr>
|
||||
<tr><th>Event</th><td>{{ repo.create_event }} ({{ create_time }})</td></tr>
|
||||
{% if state_name != 'DELETED' %}
|
||||
<tr><th>URL</th><td><a href="{{ url }}">repodata</a></td></tr>
|
||||
<tr><th>Repo json</th><td><a href="{{ repo_json }}">repo.json</a></td></tr>
|
||||
{% endif %}
|
||||
<tr><th>Dist repo?</th><td class="{{ repo.dist | lower }}">{{ repo.dist }}</td></tr>
|
||||
<tr><th>Number of buildroots: </th><td><a href="buildroots?repoID={{ repo.id }}">{{ numBuildroots }}</a></td></tr>
|
||||
</table>
|
||||
#else
|
||||
Repo $repo_id not found.
|
||||
#end if
|
||||
{% else %}
|
||||
Repo {{ repo_id }} not found.
|
||||
{% endif %}
|
||||
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
{% include "includes/footer2.chtml" %}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Reports</h4>
|
||||
|
||||
|
|
@ -13,9 +11,9 @@
|
|||
<li><a href="buildsbystatus">Succeeded/failed/canceled builds</a></li>
|
||||
<li><a href="buildsbytarget">Number of builds in each target</a></li>
|
||||
<li><a href="clusterhealth">Cluster health</a></li>
|
||||
#if $loggedInUser
|
||||
#if loggedInUser
|
||||
<li><a href="activesession">Active sessions</a></li>
|
||||
#end if
|
||||
#endif
|
||||
</ul>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,320 +1,315 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
#from pprint import pformat
|
||||
#import time
|
||||
#from urllib.parse import quote
|
||||
|
||||
#attr _PASSTHROUGH = ['rpmID', 'fileOrder', 'fileStart', 'buildrootOrder', 'buildrootStart']
|
||||
#set _PASSTHROUGH = ['rpmID', 'fileOrder', 'fileStart', 'buildrootOrder', 'buildrootStart']
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#set $epoch = ($rpm.epoch != None and $str($rpm.epoch) + ':' or '')
|
||||
<h4>Information for RPM <a href="rpminfo?rpmID=$rpm.id">$rpm.name-$epoch$rpm.version-$rpm.release.${rpm.arch}.rpm</a></h4>
|
||||
#include "includes/header2.chtml"
|
||||
#set epoch = (rpm.epoch|string + ':' if rpm.epoch != None else '')
|
||||
<h4>Information for RPM <a href="rpminfo?rpmID={{ rpm.id }}">{{ rpm.name }}-{{ epoch }}{{ rpm.version }}-{{ rpm.release }}.{{rpm.arch}}.rpm</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th><td>$rpm.id</td>
|
||||
<th>ID</th><td>{{ rpm.id }}</td>
|
||||
</tr>
|
||||
#if $build
|
||||
#if build
|
||||
<tr>
|
||||
<th>Build</th><td><a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a></td>
|
||||
<th>Build</th><td><a href="buildinfo?buildID={{ build.id }}">{{ koji.buildLabel(build) }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
#if $build
|
||||
<th>Name</th><td><a href="packageinfo?packageID=$build.package_id">$rpm.name</a></td>
|
||||
#if build
|
||||
<th>Name</th><td><a href="packageinfo?packageID={{ build.package_id }}">{{ rpm.name }}</a></td>
|
||||
#else
|
||||
<th>Name</th><td>$rpm.name</td>
|
||||
#end if
|
||||
<th>Name</th><td>{{ rpm.name }}</td>
|
||||
#endif
|
||||
</tr>
|
||||
<tr>
|
||||
#if $build
|
||||
<th>Version</th><td><a href="buildinfo?buildID=$build.id">$rpm.version</a></td>
|
||||
#if build
|
||||
<th>Version</th><td><a href="buildinfo?buildID={{ build.id }}">{{ rpm.version }}</a></td>
|
||||
#else
|
||||
<th>Version</th><td>$rpm.version</td>
|
||||
#end if
|
||||
<th>Version</th><td>{{ rpm.version }}</td>
|
||||
#endif
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Release</th><td>$rpm.release</td>
|
||||
<th>Release</th><td>{{ rpm.release }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Epoch</th><td>$rpm.epoch</td>
|
||||
<th>Epoch</th><td>{{ rpm.epoch }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arch</th><td>$rpm.arch</td>
|
||||
<th>Arch</th><td>{{ rpm.arch }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#if $rpm.draft
|
||||
#if rpm.draft
|
||||
<th>Draft</th><td>True</td>
|
||||
#else
|
||||
<th>Draft</th><td>False</td>
|
||||
#end if
|
||||
#if $rpm.external_repo_id == 0
|
||||
#endif
|
||||
#if rpm.external_repo_id == 0
|
||||
<tr>
|
||||
<th>Summary</th><td class="rpmheader">$summary</td>
|
||||
<th>Summary</th><td class="rpmheader">{{ summary }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th><td class="rpmheader">$description</td>
|
||||
<th>Description</th><td class="rpmheader">{{ description }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Build Time</th><td>$time.strftime('%Y-%m-%d %H:%M:%S', $time.gmtime($rpm.buildtime)) GMT</td>
|
||||
<th>Build Time</th><td>{{ time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(rpm.buildtime)) }} GMT</td>
|
||||
</tr>
|
||||
#if $build and $build.state == $koji.BUILD_STATES.DELETED
|
||||
#if build and build.state == koji.BUILD_STATES.DELETED
|
||||
<tr>
|
||||
<th>State</th><td class="deleted">deleted</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $rpm.external_repo_id
|
||||
#endif
|
||||
#if rpm.external_repo_id
|
||||
<tr>
|
||||
<th>External Repository</th><td><a href="externalrepoinfo?extrepoID=$rpm.external_repo_id">$rpm.external_repo_name</a></td>
|
||||
<th>External Repository</th><td><a href="externalrepoinfo?extrepoID={{ rpm.external_repo_id }}">{{ rpm.external_repo_name }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Size</th><td><span title="$util.formatThousands($rpm.size)">$util.formatNatural($rpm.size)</span></td>
|
||||
<th>Size</th><td><span title="{{ util.formatThousands(rpm.size) }}">{{ util.formatNatural(rpm.size) }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label title="The MD5 digest of the combined header and payload contents. You can query it by `rpmkeys -Kv foo.rpm`">SIGMD5</label></th><td>$rpm.payloadhash</td>
|
||||
<th><label title="The MD5 digest of the combined header and payload contents. You can query it by `rpmkeys -Kv foo.rpm`">SIGMD5</label></th><td>{{ rpm.payloadhash }}</td>
|
||||
</tr>
|
||||
#if $rpm.external_repo_id == 0
|
||||
#if rpm.external_repo_id == 0
|
||||
<tr>
|
||||
<th>License</th><td>$license</td>
|
||||
<th>License</th><td>{{ license }}</td>
|
||||
</tr>
|
||||
#if $vcs
|
||||
#if vcs
|
||||
<tr>
|
||||
<th><label title="Package source code VCS location">VCS</label></th><td>$util.formatLink($vcs)</td>
|
||||
<th><label title="Package source code VCS location">VCS</label></th><td>{{ util.formatLink(vcs) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $disturl
|
||||
#endif
|
||||
#if disturl
|
||||
<tr>
|
||||
<th>DistURL</th><td>$util.formatLink($disturl)</td>
|
||||
<th>DistURL</th><td>{{ util.formatLink(disturl) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#end if
|
||||
#if $builtInRoot
|
||||
#endif
|
||||
#endif
|
||||
#if builtInRoot
|
||||
<tr>
|
||||
<th>Buildroot</th><td><a href="buildrootinfo?buildrootID=$builtInRoot.id">$util.brLabel($builtInRoot)</a></td>
|
||||
<th>Buildroot</th><td><a href="buildrootinfo?buildrootID={{ builtInRoot.id }}">{{ util.brLabel(builtInRoot) }}</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $rpm.get('extra')
|
||||
#endif
|
||||
#if rpm.get('extra')
|
||||
<tr>
|
||||
<th>Extra</th><td class="usertext">$pformat($rpm.extra)</td>
|
||||
<th>Extra</th><td class="usertext">{{ pformat(rpm.extra) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $rpm.external_repo_id == 0
|
||||
#endif
|
||||
#if rpm.external_repo_id == 0
|
||||
<tr>
|
||||
<th>Provides</th>
|
||||
<td class="container">
|
||||
#if $len($provides) > 0
|
||||
#if (provides |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $provides
|
||||
#for dep in provides
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Provides
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Obsoletes</th>
|
||||
<td class="container">
|
||||
#if $len($obsoletes) > 0
|
||||
#if (obsoletes |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $obsoletes
|
||||
#for dep in obsoletes
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Obsoletes
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Conflicts</th>
|
||||
<td class="container">
|
||||
#if $len($conflicts) > 0
|
||||
#if (conflicts |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $conflicts
|
||||
#for dep in conflicts
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Conflicts
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Requires</th>
|
||||
<td class="container">
|
||||
#if $len($requires) > 0
|
||||
#if (requires |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $requires
|
||||
#for dep in requires
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Requires
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Recommends</th>
|
||||
<td class="container">
|
||||
#if $len($recommends) > 0
|
||||
#if (recommends |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $recommends
|
||||
#for dep in recommends
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Recommends
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Suggests</th>
|
||||
<td class="container">
|
||||
#if $len($suggests) > 0
|
||||
#if (suggests |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $suggests
|
||||
#for dep in suggests
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Suggests
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Supplements</th>
|
||||
<td class="container">
|
||||
#if $len($supplements) > 0
|
||||
#if (supplements |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $supplements
|
||||
#for dep in supplements
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Supplements
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Enhances</th>
|
||||
<td class="container">
|
||||
#if $len($enhances) > 0
|
||||
#if (enhances |length) > 0
|
||||
<table class="nested">
|
||||
#for $dep in $enhances
|
||||
#for dep in enhances
|
||||
<tr>
|
||||
<td>$util.formatDep($dep.name, $dep.version, $dep.flags)</td>
|
||||
<td>{{ util.formatDep(dep.name, dep.version, dep.flags) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Enhances
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id="filelist">Files</th>
|
||||
<td class="container">
|
||||
#if $len($files) > 0
|
||||
#if (files |length) > 0
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($filePages) > 1
|
||||
#if (filePages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'rpminfo?fileStart=' + this.value * $fileRange + '$util.passthrough_except($self, 'fileStart')#filelist';">
|
||||
#for $pageNum in $filePages
|
||||
<option value="$pageNum"#if $pageNum == $fileCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'rpminfo?fileStart=' + this.value * {{ fileRange }} + '{{ util.passthrough_except('fileStart') }}#filelist';">
|
||||
#for pageNum in filePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == fileCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $fileStart > 0
|
||||
<a href="rpminfo?fileStart=#echo $fileStart - $fileRange #$util.passthrough_except($self, 'fileStart')#filelist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $fileStart + 1 # through #echo $fileStart + $fileCount # of $totalFiles</strong>
|
||||
#if $fileStart + $fileCount < $totalFiles
|
||||
<a href="rpminfo?fileStart=#echo $fileStart + $fileRange#$util.passthrough_except($self, 'fileStart')#filelist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if fileStart > 0
|
||||
<a href="rpminfo?fileStart={{ fileStart - fileRange }}{{ util.passthrough_except('fileStart') }}#filelist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ fileStart + 1 }} through {{ fileStart + fileCount }} of {{ totalFiles }}</strong>
|
||||
#if fileStart + fileCount < totalFiles
|
||||
<a href="rpminfo?fileStart={{ fileStart + fileRange }}{{ util.passthrough_except('fileStart') }}#filelist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="rpminfo?fileOrder=$util.toggleOrder($self, 'name', 'fileOrder')$util.passthrough_except($self, 'fileOrder', 'fileStart')#filelist">Name</a> $util.sortImage($self, 'name', 'fileOrder')</th>
|
||||
<th align="right"><a href="rpminfo?fileOrder=$util.toggleOrder($self, 'size', 'fileOrder')$util.passthrough_except($self, 'fileOrder', 'fileStart')#filelist">Size</a> $util.sortImage($self, 'size', 'fileOrder')</th>
|
||||
<th><a href="rpminfo?fileOrder={{ util.toggleOrder('name', 'fileOrder') }}{{ util.passthrough_except('fileOrder', 'fileStart') }}#filelist">Name</a> {{ util.sortImage('name', 'fileOrder') }}</th>
|
||||
<th align="right"><a href="rpminfo?fileOrder={{ util.toggleOrder('size', 'fileOrder') }}{{ util.passthrough_except('fileOrder', 'fileStart') }}#filelist">Size</a> {{ util.sortImage('size', 'fileOrder') }}</th>
|
||||
</tr>
|
||||
#for $file in $files
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="fileinfo?rpmID=$rpm.id&filename=$quote($file.name.encode('utf-8'))">$file.name</a></td><td align="right"><span title="$util.formatThousands($file.size)">$util.formatNatural($file.size)</span></td>
|
||||
#for file in files
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="fileinfo?rpmID={{ rpm.id }}&filename={{ file.name|urlencode }}">{{ file.name }}</a></td><td align="right"><span title="{{ util.formatThousands(file.size) }}">{{ util.formatNatural(file.size) }}</span></td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Files
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th id="buildrootlist">Component of</th>
|
||||
<td class="container">
|
||||
#if $len($buildroots) > 0
|
||||
#if (buildroots |length) > 0
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($buildrootPages) > 1
|
||||
#if (buildrootPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'rpminfo?buildrootStart=' + this.value * $buildrootRange + '$util.passthrough_except($self, 'buildrootStart')#buildrootlist';">
|
||||
#for $pageNum in $buildrootPages
|
||||
<option value="$pageNum"#if $pageNum == $buildrootCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'rpminfo?buildrootStart=' + this.value * {{ buildrootRange }} + '{{ util.passthrough_except('buildrootStart') }}#buildrootlist';">
|
||||
#for pageNum in buildrootPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildrootCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildrootStart > 0
|
||||
<a href="rpminfo?buildrootStart=#echo $buildrootStart - $buildrootRange #$util.passthrough_except($self, 'buildrootStart')#buildrootlist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $buildrootStart + 1 # through #echo $buildrootStart + $buildrootCount # of $totalBuildroots</strong>
|
||||
#if $buildrootStart + $buildrootCount < $totalBuildroots
|
||||
<a href="rpminfo?buildrootStart=#echo $buildrootStart + $buildrootRange#$util.passthrough_except($self, 'buildrootStart')#buildrootlist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildrootStart > 0
|
||||
<a href="rpminfo?buildrootStart={{ buildrootStart - buildrootRange }}{{ util.passthrough_except('buildrootStart') }}#buildrootlist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ buildrootStart + 1 }} through {{ buildrootStart + buildrootCount }} of {{ totalBuildroots }}</strong>
|
||||
#if buildrootStart + buildrootCount < totalBuildroots
|
||||
<a href="rpminfo?buildrootStart={{ buildrootStart + buildrootRange }}{{ util.passthrough_except('buildrootStart') }}#buildrootlist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="rpminfo?buildrootOrder=$util.toggleOrder($self, 'id', 'buildrootOrder')$util.passthrough_except($self, 'buildrootOrder', 'buildrootStart')#buildrootlist">Buildroot</a> $util.sortImage($self, 'id', 'buildrootOrder')</th>
|
||||
<th><a href="rpminfo?buildrootOrder=$util.toggleOrder($self, 'create_event_time', 'buildrootOrder')$util.passthrough_except($self, 'buildrootOrder', 'buildrootStart')#buildrootlist">Created</a> $util.sortImage($self, 'create_event_time', 'buildrootOrder')</th>
|
||||
<th><a href="rpminfo?buildrootOrder=$util.toggleOrder($self, 'state', 'buildrootOrder')$util.passthrough_except($self, 'buildrootOrder', 'buildrootStart')#buildrootlist">State</a> $util.sortImage($self, 'state', 'buildrootOrder')</th>
|
||||
<th><a href="rpminfo?buildrootOrder={{ util.toggleOrder('id', 'buildrootOrder') }}{{ util.passthrough_except('buildrootOrder', 'buildrootStart') }}#buildrootlist">Buildroot</a> {{ util.sortImage('id', 'buildrootOrder') }}</th>
|
||||
<th><a href="rpminfo?buildrootOrder={{ util.toggleOrder('create_event_time', 'buildrootOrder') }}{{ util.passthrough_except('buildrootOrder', 'buildrootStart') }}#buildrootlist">Created</a> {{ util.sortImage('create_event_time', 'buildrootOrder') }}</th>
|
||||
<th><a href="rpminfo?buildrootOrder={{ util.toggleOrder('state', 'buildrootOrder') }}{{ util.passthrough_except('buildrootOrder', 'buildrootStart') }}#buildrootlist">State</a> {{ util.sortImage('state', 'buildrootOrder') }}</th>
|
||||
</tr>
|
||||
#for $buildroot in $buildroots
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></td>
|
||||
<td>$util.formatTime($buildroot.create_event_time)</td>
|
||||
<td>$util.imageTag($util.brStateName($buildroot.state))</td>
|
||||
#for buildroot in buildroots
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></td>
|
||||
<td>{{ util.formatTime(buildroot.create_event_time) }}</td>
|
||||
<td>{{ util.imageTag(util.brStateName(buildroot.state)) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No Buildroots
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,114 +1,109 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#@util.safe_return
|
||||
#def getID()
|
||||
#if $type == 'image'
|
||||
imageID=$image.id #slurp
|
||||
#macro getID()
|
||||
#if type == 'image'
|
||||
imageID={{ image.id }}
|
||||
#else
|
||||
buildrootID=$buildroot.id #slurp
|
||||
#end if
|
||||
#end def
|
||||
buildrootID={{ buildroot.id }}
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def getColspan()
|
||||
#if $type == 'component'
|
||||
colspan="3" #slurp
|
||||
#elif $type == 'image'
|
||||
colspan="2" #slurp
|
||||
#else
|
||||
#pass
|
||||
#end if
|
||||
#end def
|
||||
#macro getColspan()
|
||||
#if type == 'component'
|
||||
colspan="3"
|
||||
#elif type == 'image'
|
||||
colspan="2"
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#if $type == 'component'
|
||||
<h4>Component RPMs of buildroot <a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></h4>
|
||||
#elif $type == 'image'
|
||||
<h4>RPMs installed in <a href="archiveinfo?archiveID=$image.id">$image.filename</a></h4>
|
||||
#if type == 'component'
|
||||
<h4>Component RPMs of buildroot <a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></h4>
|
||||
#elif type == 'image'
|
||||
<h4>RPMs installed in <a href="archiveinfo?archiveID={{ image.id }}">{{ image.filename }}</a></h4>
|
||||
#else
|
||||
<h4>RPMs built in buildroot <a href="buildrootinfo?buildrootID=$buildroot.id">$util.brLabel($buildroot)</a></h4>
|
||||
#end if
|
||||
<h4>RPMs built in buildroot <a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ util.brLabel(buildroot) }}</a></h4>
|
||||
#endif
|
||||
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" $getColspan()>
|
||||
#if $len($rpmPages) > 1
|
||||
<td class="paginate" {{ getColspan()|trim }}>
|
||||
#if (rpmPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'rpmlist?$getID()&start=' + this.value * $rpmRange + '$util.passthrough($self, 'order', 'type')';">
|
||||
#for $pageNum in $rpmPages
|
||||
<option value="$pageNum"#if $pageNum == $rpmCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'rpmlist?{{ getID()|trim }}&start=' + this.value * {{ rpmRange }} + '{{ util.passthrough('order', 'type') }}';">
|
||||
#for pageNum in rpmPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == rpmCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $rpmStart > 0
|
||||
<a href="rpmlist?$getID()&start=#echo $rpmStart - $rpmRange #$util.passthrough($self, 'order', 'type')"><<<</a>
|
||||
#end if
|
||||
#if $totalRpms != 0
|
||||
<strong>RPMs #echo $rpmStart + 1 # through #echo $rpmStart + $rpmCount # of $totalRpms</strong>
|
||||
#end if
|
||||
#if $rpmStart + $rpmCount < $totalRpms
|
||||
<a href="rpmlist?$getID()&start=#echo $rpmStart + $rpmRange#$util.passthrough($self, 'order', 'type')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if rpmStart > 0
|
||||
<a href="rpmlist?{{ getID()|trim }}&start={{ rpmStart - rpmRange }}{{ util.passthrough('order', 'type') }}"><<<</a>
|
||||
#endif
|
||||
#if totalRpms != 0
|
||||
<strong>RPMs {{ rpmStart + 1 }} through {{ rpmStart + rpmCount }} of {{ totalRpms }}</strong>
|
||||
#endif
|
||||
#if rpmStart + rpmCount < totalRpms
|
||||
<a href="rpmlist?{{ getID()|trim }}&start={{ rpmStart + rpmRange }}{{ util.passthrough('order', 'type') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="rpmlist?$getID()&order=$util.toggleOrder($self, 'nvr')$util.passthrough($self, 'type')">NVR</a> $util.sortImage($self, 'nvr')</th>
|
||||
#if $type in ['component', 'image']
|
||||
<th><a href="rpmlist?$getID()&order=$util.toggleOrder($self, 'external_repo_name')$util.passthrough($self, 'type')">Origin</a> $util.sortImage($self, 'external_repo_name')</th>
|
||||
#end if
|
||||
#if $type == 'component'
|
||||
<th><a href="rpmlist?$getID()&order=$util.toggleOrder($self, 'is_update')$util.passthrough($self, 'type')">Update?</a> $util.sortImage($self, 'is_update')</th>
|
||||
#end if
|
||||
<th><a href="rpmlist?{{ getID()|trim }}&order={{ util.toggleOrder('nvr') }}{{ util.passthrough('type') }}">NVR</a> {{ util.sortImage('nvr') }}</th>
|
||||
#if type in ['component', 'image']
|
||||
<th><a href="rpmlist?{{ getID()|trim }}&order={{ util.toggleOrder('external_repo_name') }}{{ util.passthrough('type') }}">Origin</a> {{ util.sortImage('external_repo_name') }}</th>
|
||||
#endif
|
||||
#if type == 'component'
|
||||
<th><a href="rpmlist?{{ getID()|trim }}&order={{ util.toggleOrder('is_update') }}{{ util.passthrough('type') }}">Update?</a> {{ util.sortImage('is_update') }}</th>
|
||||
#endif
|
||||
</tr>
|
||||
#if $len($rpms) > 0
|
||||
#for $rpm in $rpms
|
||||
<tr class="$util.rowToggle($self)">
|
||||
#set $epoch = ($rpm.epoch != None and $str($rpm.epoch) + ':' or '')
|
||||
<td>$util.formatRPM($rpm)</td>
|
||||
#if $type in ['component', 'image']
|
||||
#if $rpm.external_repo_id == 0
|
||||
#if (rpms |length) > 0
|
||||
#for rpm in rpms
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
#set epoch = (rpm.epoch|string + ':' if rpm.epoch != None else '')
|
||||
<td>{{ util.formatRPM(rpm) }}</td>
|
||||
#if type in ['component', 'image']
|
||||
#if rpm.external_repo_id == 0
|
||||
<td>internal</td>
|
||||
#else
|
||||
<td><a href="externalrepoinfo?extrepoID=$rpm.external_repo_id">$rpm.external_repo_name</a></td>
|
||||
#end if
|
||||
#end if
|
||||
#if $type == 'component'
|
||||
#set $update = $rpm.is_update and 'yes' or 'no'
|
||||
<td class="$update">$util.imageTag($update)</td>
|
||||
#end if
|
||||
<td><a href="externalrepoinfo?extrepoID={{ rpm.external_repo_id }}">{{ rpm.external_repo_name }}</a></td>
|
||||
#endif
|
||||
#endif
|
||||
#if type == 'component'
|
||||
#set update = rpm.is_update and 'yes' or 'no'
|
||||
<td class="{{ update }}">{{ util.imageTag(update) }}</td>
|
||||
#endif
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td $getColspan()>No RPMs</td>
|
||||
<td {{ getColspan()|trim }}>No RPMs</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" $getColspan()>
|
||||
#if $len($rpmPages) > 1
|
||||
<td class="paginate" {{ getColspan()|trim }}>
|
||||
#if (rpmPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'rpmlist?$getID()&start=' + this.value * $rpmRange + '$util.passthrough($self, 'order', 'type')';">
|
||||
#for $pageNum in $rpmPages
|
||||
<option value="$pageNum"#if $pageNum == $rpmCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'rpmlist?{{ getID()|trim }}&start=' + this.value * {{ rpmRange }} + '{{ util.passthrough('order', 'type') }}';">
|
||||
#for pageNum in rpmPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == rpmCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $rpmStart > 0
|
||||
<a href="rpmlist?$getID()&start=#echo $rpmStart - $rpmRange #$util.passthrough($self, 'order', 'type')"><<<</a>
|
||||
#end if
|
||||
#if $totalRpms != 0
|
||||
<strong>RPMs #echo $rpmStart + 1 # through #echo $rpmStart + $rpmCount # of $totalRpms</strong>
|
||||
#end if
|
||||
#if $rpmStart + $rpmCount < $totalRpms
|
||||
<a href="rpmlist?$getID()&start=#echo $rpmStart + $rpmRange#$util.passthrough($self, 'order', 'type')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if rpmStart > 0
|
||||
<a href="rpmlist?{{ getID()|trim }}&start={{ rpmStart - rpmRange }}{{ util.passthrough('order', 'type') }}"><<<</a>
|
||||
#endif
|
||||
#if totalRpms != 0
|
||||
<strong>RPMs {{ rpmStart + 1 }} through {{ rpmStart + rpmCount }} of {{ totalRpms }}</strong>
|
||||
#endif
|
||||
#if rpmStart + rpmCount < totalRpms
|
||||
<a href="rpmlist?{{ getID()|trim }}&start={{ rpmStart + rpmRange }}{{ util.passthrough('order', 'type') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,105 +1,106 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>#if $rpmArch then $rpmArch + ' ' else ''#RPMs by Host#if $hostArch then ' (%s)' % $hostArch else ''#</h4>
|
||||
<h4>{{ rpmArch + ' ' if rpmArch else '' }}RPMs by Host{{ ' (%s)' % hostArch if hostArch else '' }}</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="archlist" colspan="3">
|
||||
<strong>Host arch:</strong> #for $arch in $hostArchList
|
||||
#if $arch == $hostArch
|
||||
<strong>$arch</strong> |
|
||||
<strong>Host arch:</strong>
|
||||
#for arch in hostArchList
|
||||
#if arch == hostArch
|
||||
<strong>{{ arch }}</strong> |
|
||||
#else
|
||||
<a href="rpmsbyhost?hostArch=$arch$util.passthrough($self, 'order', 'rpmArch')">$arch</a> |
|
||||
#end if
|
||||
#end for
|
||||
#if $hostArch
|
||||
<a href="rpmsbyhost?${util.passthrough($self, 'order', 'rpmArch', prefix='')}">all</a>
|
||||
<a href="rpmsbyhost?hostArch={{ arch }}{{ util.passthrough('order', 'rpmArch') }}">{{ arch }}</a> |
|
||||
#endif
|
||||
#endfor
|
||||
#if hostArch
|
||||
<a href="rpmsbyhost?{{ util.passthrough('order', 'rpmArch', prefix='') }}">all</a>
|
||||
#else
|
||||
<strong>all</strong>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="archlist" colspan="3">
|
||||
<strong>RPM arch:</strong> #for $arch in $rpmArchList
|
||||
#if $arch == $rpmArch
|
||||
<strong>$arch</strong> |
|
||||
<strong>RPM arch:</strong>
|
||||
#for arch in rpmArchList
|
||||
#if arch == rpmArch
|
||||
<strong>{{ arch }}</strong> |
|
||||
#else
|
||||
<a href="rpmsbyhost?rpmArch=$arch$util.passthrough($self, 'order', 'hostArch')">$arch</a> |
|
||||
#end if
|
||||
#end for
|
||||
#if $rpmArch
|
||||
<a href="rpmsbyhost?${util.passthrough($self, 'order', 'hostArch', prefix='')}">all</a>
|
||||
<a href="rpmsbyhost?rpmArch={{ arch }}{{ util.passthrough('order', 'hostArch') }}">{{ arch }}</a> |
|
||||
#endif
|
||||
#endfor
|
||||
#if rpmArch
|
||||
<a href="rpmsbyhost?{{ util.passthrough('order', 'hostArch', prefix='') }}">all</a>
|
||||
#else
|
||||
<strong>all</strong>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($hostPages) > 1
|
||||
#if (hostPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'rpmsbyhost?start=' + this.value * $hostRange + '$util.passthrough($self, 'order', 'hostArch', 'rpmArch')';">
|
||||
#for $pageNum in $hostPages
|
||||
<option value="$pageNum"#if $pageNum == $hostCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'rpmsbyhost?start=' + this.value * {{ hostRange }} + '{{ util.passthrough('order', 'hostArch', 'rpmArch') }}';">
|
||||
#for pageNum in hostPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $hostStart > 0
|
||||
<a href="rpmsbyhost?start=#echo $hostStart - $hostRange #$util.passthrough($self, 'order', 'hostArch', 'rpmArch')"><<<</a>
|
||||
#end if
|
||||
#if $totalHosts != 0
|
||||
<strong>Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts</strong>
|
||||
#end if
|
||||
#if $hostStart + $hostCount < $totalHosts
|
||||
<a href="rpmsbyhost?start=#echo $hostStart + $hostRange#$util.passthrough($self, 'order', 'hostArch', 'rpmArch')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if hostStart > 0
|
||||
<a href="rpmsbyhost?start={{ hostStart - hostRange }}{{ util.passthrough('order', 'hostArch', 'rpmArch') }}"><<<</a>
|
||||
#endif
|
||||
#if totalHosts != 0
|
||||
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
||||
#endif
|
||||
#if hostStart + hostCount < totalHosts
|
||||
<a href="rpmsbyhost?start={{ hostStart + hostRange }}{{ util.passthrough('order', 'hostArch', 'rpmArch') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="rpmsbyhost?order=$util.toggleOrder($self, 'name')$util.passthrough($self, 'hostArch', 'rpmArch')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="rpmsbyhost?order=$util.toggleOrder($self, 'rpms')$util.passthrough($self, 'hostArch', 'rpmArch')">RPMs</a> $util.sortImage($self, 'rpms')</th>
|
||||
<th><a href="rpmsbyhost?order={{ util.toggleOrder('name') }}{{ util.passthrough('hostArch', 'rpmArch') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th><a href="rpmsbyhost?order={{ util.toggleOrder('rpms') }}{{ util.passthrough('hostArch', 'rpmArch') }}">RPMs</a> {{ util.sortImage('rpms') }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
#if $len($hosts) > 0
|
||||
#for $host in $hosts
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="hostinfo?hostID=$host.id">$host.name</a></td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $host.rpms#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$host.rpms</td>
|
||||
#if (hosts |length) > 0
|
||||
#for host in hosts
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="hostinfo?hostID={{ host.id }}">{{ host.name }}</a></td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * host.rpms }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ host.rpms }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No hosts</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($hostPages) > 1
|
||||
#if (hostPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'rpmsbyhost?start=' + this.value * $hostRange + '$util.passthrough($self, 'order', 'hostArch', 'rpmArch')';">
|
||||
#for $pageNum in $hostPages
|
||||
<option value="$pageNum"#if $pageNum == $hostCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'rpmsbyhost?start=' + this.value * {{ hostRange }} + '{{ util.passthrough('order', 'hostArch', 'rpmArch') }}';">
|
||||
#for pageNum in hostPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $hostStart > 0
|
||||
<a href="rpmsbyhost?start=#echo $hostStart - $hostRange #$util.passthrough($self, 'order', 'hostArch', 'rpmArch')"><<<</a>
|
||||
#end if
|
||||
#if $totalHosts != 0
|
||||
<strong>Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts</strong>
|
||||
#end if
|
||||
#if $hostStart + $hostCount < $totalHosts
|
||||
<a href="rpmsbyhost?start=#echo $hostStart + $hostRange#$util.passthrough($self, 'order', 'hostArch', 'rpmArch')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if hostStart > 0
|
||||
<a href="rpmsbyhost?start={{ hostStart - hostRange }}{{ util.passthrough('order', 'hostArch', 'rpmArch') }}"><<<</a>
|
||||
#endif
|
||||
#if totalHosts != 0
|
||||
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
||||
#endif
|
||||
#if hostStart + hostCount < totalHosts
|
||||
<a href="rpmsbyhost?start={{ hostStart + hostRange }}{{ util.passthrough('order', 'hostArch', 'rpmArch') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,42 +1,39 @@
|
|||
#from kojiweb import util
|
||||
#from urllib.parse import quote
|
||||
|
||||
#include "includes/header.chtml"
|
||||
{% include "includes/header2.chtml" %}
|
||||
|
||||
|
||||
<h4>Search</h4>
|
||||
<form action="search">
|
||||
<table>
|
||||
<tr>
|
||||
#if $error
|
||||
<tr><td colspan="5" class="error">$error</td></tr>
|
||||
#end if
|
||||
{% if error %}
|
||||
<tr><td colspan="5" class="error">{{ error }}</td></tr>
|
||||
{% endif %}
|
||||
<th>Search</th>
|
||||
<td><input type="text" name="terms" value="$terms"/></td>
|
||||
<td><input type="text" name="terms" value="{{ terms }}"/></td>
|
||||
<td>
|
||||
<select name="type">
|
||||
<option $util.toggleSelected($self, $type, "package") value="package">Packages</option>
|
||||
<option $util.toggleSelected($self, $type, "build") value="build">Builds</option>
|
||||
<option $util.toggleSelected($self, $type, "tag") value="tag">Tags</option>
|
||||
<option $util.toggleSelected($self, $type, "target") value="target">Build Targets</option>
|
||||
<option $util.toggleSelected($self, $type, "user") value="user">Users</option>
|
||||
<option $util.toggleSelected($self, $type, "host") value="host">Hosts</option>
|
||||
<option $util.toggleSelected($self, $type, "rpm") value="rpm">RPMs</option>
|
||||
#if $mavenEnabled
|
||||
<option $util.toggleSelected($self, $type, "maven") value="maven">Maven Artifacts</option>
|
||||
#end if
|
||||
#if $winEnabled
|
||||
<option $util.toggleSelected($self, $type, "win") value="win">Windows Artifacts</option>
|
||||
#end if
|
||||
<option {{ toggleSelected(type, "package") }} value="package">Packages</option>
|
||||
<option {{ toggleSelected(type, "build") }} value="build">Builds</option>
|
||||
<option {{ toggleSelected(type, "tag") }} value="tag">Tags</option>
|
||||
<option {{ toggleSelected(type, "target") }} value="target">Build Targets</option>
|
||||
<option {{ toggleSelected(type, "user") }} value="user">Users</option>
|
||||
<option {{ toggleSelected(type, "host") }} value="host">Hosts</option>
|
||||
<option {{ toggleSelected(type, "rpm") }} value="rpm">RPMs</option>
|
||||
{% if mavenEnabled %}
|
||||
<option {{ toggleSelected(type, "maven") }} value="maven">Maven Artifacts</option>
|
||||
{% endif %}
|
||||
{% if winEnabled %}
|
||||
<option {{ toggleSelected(type, "win") }} value="win">Windows Artifacts</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
#if not $varExists('match')
|
||||
#set $match='glob'
|
||||
#end if
|
||||
<input type="radio" name="match" value="glob" $util.toggleSelected($self, $match, "glob", True) id="radioglob"/><abbr title="? will match any single character, * will match any sequence of zero or more characters" id="abbrglob">glob</abbr>
|
||||
<input type="radio" name="match" value="regexp" $util.toggleSelected($self, $match, "regexp", True) id="radioregexp"/><abbr title="full POSIX regular expressions" id="abbrregexp">regexp</abbr>
|
||||
<input type="radio" name="match" value="exact" $util.toggleSelected($self, $match, "exact", True) id="radioexact"/><abbr title="exact matches only" id="abbrexact">exact</abbr>
|
||||
{% if match is not defined %}
|
||||
{% set match='glob' %}
|
||||
{% endif %}
|
||||
<input type="radio" name="match" value="glob" {{ toggleSelected(match, "glob", True) }} id="radioglob"/><abbr title="? will match any single character, * will match any sequence of zero or more characters" id="abbrglob">glob</abbr>
|
||||
<input type="radio" name="match" value="regexp" {{ toggleSelected(match, "regexp", True) }} id="radioregexp"/><abbr title="full POSIX regular expressions" id="abbrregexp">regexp</abbr>
|
||||
<input type="radio" name="match" value="exact" {{ toggleSelected(match, "exact", True) }} id="radioexact"/><abbr title="exact matches only" id="abbrexact">exact</abbr>
|
||||
</td>
|
||||
<td colspan="2"><input type="submit" value="Search"/></td>
|
||||
</tr>
|
||||
|
|
@ -47,72 +44,72 @@
|
|||
</form>
|
||||
|
||||
|
||||
#if $varExists('results')
|
||||
{% if results is defined %}
|
||||
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($resultPages) > 1
|
||||
{% if resultPages|length > 1 %}
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'search?start=' + this.value * $resultRange + '$util.passthrough($self, 'order', 'terms', 'type', 'match')';">
|
||||
#for $pageNum in $resultPages
|
||||
<option value="$pageNum"#if $pageNum == $resultCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'search?start=' + this.value * {{ resultRange }} + '{{ passthrough('order', 'terms', 'type', 'match') }}';">
|
||||
{% for pageNum in resultPages %}
|
||||
<option value="{{ pageNum }}"{{ 'selected' if pageNum == resultCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $resultStart > 0
|
||||
<a href="search?start=#echo $resultStart - $resultRange #$util.passthrough($self, 'order', 'terms', 'type', 'match')"><<<</a>
|
||||
#end if
|
||||
#if $totalResults != 0
|
||||
<strong>Results #echo $resultStart + 1 # through #echo $resultStart + $resultCount # of $totalResults</strong>
|
||||
#end if
|
||||
#if $resultStart + $resultCount < $totalResults
|
||||
<a href="search?start=#echo $resultStart + $resultRange#$util.passthrough($self, 'order', 'terms', 'type', 'match')">>>></a>
|
||||
#end if
|
||||
{% endif %}
|
||||
{% if resultStart > 0 %}
|
||||
<a href="search?start={{ resultStart - resultRange }}{{ passthrough('order', 'terms', 'type', 'match') }}"><<<</a>
|
||||
{% endif %}
|
||||
{% if totalResults %}
|
||||
<strong>Results {{ resultStart + 1 }} through {{ resultStart + resultCount }} of {{ totalResults }}</strong>
|
||||
{% endif %}
|
||||
{% if resultStart + resultCount < totalResults %}
|
||||
<a href="search?start={{ resultStart + resultRange }}{{ passthrough('order', 'terms', 'type', 'match') }}">>>></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="search?order=$util.toggleOrder($self, 'id')$util.passthrough($self, 'terms', 'type', 'match')">ID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="search?order=$util.toggleOrder($self, 'name')$util.passthrough($self, 'terms', 'type', 'match')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="search?order={{ toggleOrder('id') }}{{ passthrough('terms', 'type', 'match') }}">ID</a> {{ sortImage('id') }}</th>
|
||||
<th><a href="search?order={{ toggleOrder('name') }}{{ passthrough('terms', 'type', 'match') }}">Name</a> {{ sortImage('name') }}</th>
|
||||
</tr>
|
||||
#if $len($results) > 0
|
||||
#for $result in $results
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$result.id</td>
|
||||
<td><a href="${infoURL % $result}">$result.name</a></td>
|
||||
{% if results %}
|
||||
{% for result in results %}
|
||||
<tr class="{{ rowToggle() }}">
|
||||
<td>{{ result.id }}</td>
|
||||
<td><a href="{{ infoURL % result }}">{{ result.name }}</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#else
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr class="row-odd">
|
||||
<td colspan="2">No search results</td>
|
||||
</tr>
|
||||
#end if
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($resultPages) > 1
|
||||
{% if resultPages|length > 1 %}
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'search?start=' + this.value * $resultRange + '$util.passthrough($self, 'order', 'terms', 'type', 'match')';">
|
||||
#for $pageNum in $resultPages
|
||||
<option value="$pageNum"#if $pageNum == $resultCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'search?start=' + this.value * {{ resultRange }} + '{{ passthrough('order', 'terms', 'type', 'match') }}';">
|
||||
{% for pageNum in resultPages %}
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == resultCurrentPage }}>{{ pageNum + 1 }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $resultStart > 0
|
||||
<a href="search?start=#echo $resultStart - $resultRange #$util.passthrough($self, 'order', 'terms', 'type', 'match')"><<<</a>
|
||||
#end if
|
||||
#if $totalResults != 0
|
||||
<strong>Results #echo $resultStart + 1 # through #echo $resultStart + $resultCount # of $totalResults</strong>
|
||||
#end if
|
||||
#if $resultStart + $resultCount < $totalResults
|
||||
<a href="search?start=#echo $resultStart + $resultRange#$util.passthrough($self, 'order', 'terms', 'type', 'match')">>>></a>
|
||||
#end if
|
||||
{% endif %}
|
||||
{% if resultStart > 0 %}
|
||||
<a href="search?start={{ resultStart - resultRange }}{{ passthrough('order', 'terms', 'type', 'match') }}"><<<</a>
|
||||
{% endif %}
|
||||
{% if totalResults != 0 %}
|
||||
<strong>Results {{ resultStart + 1 }} through {{ resultStart + resultCount }} of {{ totalResults }}</strong>
|
||||
{% endif %}
|
||||
{% if resultStart + resultCount < totalResults %}
|
||||
<a href="search?start={{ resultStart + resultRange }}{{ passthrough('order', 'terms', 'type', 'match') }}">>>></a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
#end if
|
||||
{% endif %}
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
{% include "includes/footer2.chtml" %}
|
||||
|
|
|
|||
|
|
@ -1,65 +1,64 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#if $tag
|
||||
<h4>Edit tag $tag.name</h4>
|
||||
#if tag
|
||||
<h4>Edit tag {{ tag.name }}</h4>
|
||||
#else
|
||||
<h4>Create tag</h4>
|
||||
#end if
|
||||
#endif
|
||||
|
||||
<form action="#if $tag then 'tagedit' else 'tagcreate'#">
|
||||
$util.authToken($self, form=True)
|
||||
<form action="{{ 'tagedit' if tag else 'tagcreate' }}">
|
||||
{{ util.authToken(form=True) }}
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>
|
||||
<input type="text" name="name" value="#if $tag then $tag.name else ''#"/>
|
||||
#if $tag
|
||||
<input type="hidden" name="tagID" value="$tag.id"/>
|
||||
#end if
|
||||
<input type="text" name="name" value="{{ tag.name if tag else '' }}"/>
|
||||
#if tag
|
||||
<input type="hidden" name="tagID" value="{{ tag.id }}"/>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arches</th>
|
||||
<td><input type="text" name="arches" value="#if $tag then $tag.arches else ''#"/></td>
|
||||
<td><input type="text" name="arches" value="{{ tag.arches if tag else '' }}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Locked</th>
|
||||
<td><input type="checkbox" name="locked" value="yes" #if $tag and $tag.locked then 'checked="checked"' else ''#/></td>
|
||||
<td><input type="checkbox" name="locked" value="yes" {{ 'checked="checked"' if tag and tag.locked else '' }}/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Permission</th>
|
||||
<td>
|
||||
<select name="permission">
|
||||
<option value="none" #if $tag and not $tag.perm_id then 'selected' else ''#>none</option>
|
||||
#for $permission in $permissions
|
||||
<option value="$permission.id" #if $tag and $tag.perm_id == $permission.id then 'selected' else ''#>$permission.name</option>
|
||||
#end for
|
||||
<option value="none" {{ 'selected' if tag and not tag.perm_id else '' }}>none</option>
|
||||
#for permission in permissions
|
||||
<option value="{{ permission.id }}" {{ 'selected' if tag and tag.perm_id == permission.id else '' }}>{{ permission.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
#if $mavenEnabled
|
||||
#if mavenEnabled
|
||||
<tr>
|
||||
<th>Maven Support?</th>
|
||||
<td><input type="checkbox" name="maven_support" value="yes" #if $tag and $tag.maven_support then 'checked="checked"' else ''#>
|
||||
<td><input type="checkbox" name="maven_support" value="yes" {{ 'checked="checked"' if tag and tag.maven_support else '' }}>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Include All Maven Builds?</th>
|
||||
<td><input type="checkbox" name="maven_include_all" value="yes" #if $tag and $tag.maven_include_all then 'checked="checked"' else ''#>
|
||||
<td><input type="checkbox" name="maven_include_all" value="yes" {{ 'checked="checked"' if tag and tag.maven_include_all else '' }}>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td>
|
||||
#if $tag
|
||||
#if tag
|
||||
<button type="submit" name="save" value="Save">Save</button>
|
||||
#else
|
||||
<button type="submit" name="add" value="Add">Add</button>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
<td><button type="submit" name="cancel" value="Cancel">Cancel</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,180 +1,177 @@
|
|||
#from kojiweb import util
|
||||
#from urllib.parse import quote
|
||||
#import pprint
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for tag <a href="taginfo?tagID=$tag.id">$tag.name</a></h4>
|
||||
<h4>Information for tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
#if $child and 'admin' in $perms
|
||||
#if child and 'admin' in perms
|
||||
<tr>
|
||||
<th colspan="2"><a href="tagparent?tagID=$child.id&parentID=$tag.id&action=add$util.authToken($self)">Add $tag.name as parent of $child.name</a></th>
|
||||
<th colspan="2"><a href="tagparent?tagID={{ child.id }}&parentID={{ tag.id }}&action=add{{ util.authToken() }}">Add {{ tag.name }} as parent of {{ child.name }}</a></th>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Name</th><td>$tag.name</td>
|
||||
<th>Name</th><td>{{ tag.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$tag.id</td>
|
||||
<th>ID</th><td>{{ tag.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arches</th><td>$tag.arches</td>
|
||||
<th>Arches</th><td>{{ tag.arches }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Locked</th><td class="$str(not $tag.locked).lower()">#if $tag.locked then 'yes' else 'no'#</td>
|
||||
<th>Locked</th><td class="{{ (not tag.locked)|lower }}">{{ 'yes' if tag.locked else 'no' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Permission</th><td>#if $tag.perm_id then $allPerms[$tag.perm_id] else 'none'#</td>
|
||||
<th>Permission</th><td>{{ allPerms[tag.perm_id] if tag.perm_id else 'none' }}</td>
|
||||
</tr>
|
||||
#if $mavenEnabled
|
||||
#if mavenEnabled
|
||||
<tr>
|
||||
<th>Maven Support?</th><td class="$str($tag.maven_support).lower()">#if $tag.maven_support then 'yes' else 'no'#</td>
|
||||
<th>Maven Support?</th><td class="{{ tag.maven_support|lower }}">{{ 'yes' if tag.maven_support else 'no' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Include All Maven Builds?</th><td class="$str($tag.maven_include_all).lower()">#if $tag.maven_include_all then 'yes' else 'no'#</td>
|
||||
<th>Include All Maven Builds?</th><td class="{{ tag.maven_include_all|lower }}">{{ 'yes' if tag.maven_include_all else 'no' }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Inheritance</th>
|
||||
<td class="tree">
|
||||
<span class="root">$tag.name</span>
|
||||
#set $numParents = $len($inheritance)
|
||||
#set $iter = 0
|
||||
#set $maxDepth = 0
|
||||
#set $TRUNC_DEPTH = 7
|
||||
<span class="root">{{ tag.name }}</span>
|
||||
#set numParents = (inheritance |length)
|
||||
#set iter = 0
|
||||
#set all_depths = []
|
||||
#set TRUNC_DEPTH = 7
|
||||
<ul>
|
||||
#for $parent in $inheritance
|
||||
#set $iter += 1
|
||||
#set $nextDepth = ($iter < $numParents and $inheritance[$iter].currdepth or 1)
|
||||
#set $depth = $parent.currdepth
|
||||
#if $depth > $maxDepth
|
||||
#set $maxDepth = $depth
|
||||
#end if
|
||||
#if $depth == $TRUNC_DEPTH and not $all
|
||||
#for parent in inheritance
|
||||
#set iter = iter + 1
|
||||
#set nextDepth = (loop.nextitem.currdepth if not loop.last else 1)
|
||||
#set depth = parent.currdepth
|
||||
#set _junk = all_depths.append(depth)
|
||||
## ^ TODO FIXME
|
||||
#if depth == TRUNC_DEPTH and not all
|
||||
<li><span class="treeBranch"><span class="treeToggle treeLabel">...</span></span></li>
|
||||
<li class="hidden">
|
||||
#else if $len($tagsByChild[$parent.child_id]) > 1
|
||||
#elif tagsByChild[parent.child_id]|length > 1
|
||||
<li class="sibling">
|
||||
#else
|
||||
<li>
|
||||
#end if
|
||||
#silent $tagsByChild[$parent.child_id].pop()
|
||||
#endif
|
||||
#set _junk = tagsByChild[parent.child_id].pop()
|
||||
## ^ TODO FIXME
|
||||
<span class="treeBranch">
|
||||
<span class="treeLabel">
|
||||
<a href="taginfo?tagID=$parent.parent_id">$parent.name</a>
|
||||
#if $depth == 1 and 'admin' in $perms
|
||||
<span class="treeLink">(<a href="tagparent?tagID=$tag.id&parentID=$parent.parent_id&action=edit$util.authToken($self)">edit</a>) (<a href="tagparent?tagID=$tag.id&parentID=$parent.parent_id&action=remove$util.authToken($self)">remove</a>)</span>
|
||||
#end if
|
||||
<a href="taginfo?tagID={{ parent.parent_id }}">{{ parent.name }}</a>
|
||||
#if depth == 1 and 'admin' in perms
|
||||
<span class="treeLink">(<a href="tagparent?tagID={{ tag.id }}&parentID={{ parent.parent_id }}&action=edit{{ util.authToken() }}">edit</a>) (<a href="tagparent?tagID={{ tag.id }}&parentID={{ parent.parent_id }}&action=remove{{ util.authToken() }}">remove</a>)</span>
|
||||
#endif
|
||||
</span>
|
||||
</span>
|
||||
#if $nextDepth > $depth
|
||||
#if nextDepth > depth
|
||||
<ul>
|
||||
#else
|
||||
</li>
|
||||
#end if
|
||||
#while $nextDepth < $depth
|
||||
#endif
|
||||
#for _tail in range(nextDepth, depth)
|
||||
</ul>
|
||||
</li>
|
||||
#set $depth -= 1
|
||||
#end while
|
||||
#end for
|
||||
#endfor
|
||||
#endfor
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
#if $maxDepth >= $TRUNC_DEPTH
|
||||
#set maxDepth = all_depths|max
|
||||
#if maxDepth >= TRUNC_DEPTH
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
#if $all
|
||||
<a href="taginfo?tagID=$tag.id$util.passthrough($self, 'inherited')">Show abbreviated tree</a>
|
||||
#if all
|
||||
<a href="taginfo?tagID={{ tag.id }}{{ util.passthrough('inherited') }}">Show abbreviated tree</a>
|
||||
#else
|
||||
<a href="taginfo?tagID=$tag.id$util.passthrough($self, 'inherited')&all=1">Show full tree</a>
|
||||
#end if
|
||||
<a href="taginfo?tagID={{ tag.id }}{{ util.passthrough('inherited') }}&all=1">Show full tree</a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
#if 'admin' in $perms
|
||||
#endif
|
||||
#if 'admin' in perms
|
||||
<tr>
|
||||
<td colspan="2"><a href="tags?childID=$tag.id">Add parent</a></td>
|
||||
<td colspan="2"><a href="tags?childID={{ tag.id }}">Add parent</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $external_repos
|
||||
#endif
|
||||
#if external_repos
|
||||
<tr>
|
||||
<th>External repos</th>
|
||||
<td>
|
||||
#for $external_repo in $external_repos
|
||||
<a href="externalrepoinfo?extrepoID=$external_repo.external_repo_id">$external_repo.external_repo_name</a> [$external_repo.merge_mode]
|
||||
#if $external_repo.tag_id != $tag.id
|
||||
<span class="smaller">(inherited from <a href="taginfo?tagID=$external_repo.tag_id">$external_repo.tag_name</a>)</span>
|
||||
#end if
|
||||
#for external_repo in external_repos
|
||||
<a href="externalrepoinfo?extrepoID={{ external_repo.external_repo_id }}">{{ external_repo.external_repo_name }}</a> [{{ external_repo.merge_mode }}]
|
||||
#if external_repo.tag_id != tag.id
|
||||
<span class="smaller">(inherited from <a href="taginfo?tagID={{ external_repo.tag_id }}">{{ external_repo.tag_name }}</a>)</span>
|
||||
#endif
|
||||
<br/>
|
||||
#end for
|
||||
#endfor
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Repo created</th>
|
||||
<td>
|
||||
#if $repo
|
||||
<a href="repoinfo?repoID=$repo.id">$util.formatTimeRSS($repo.create_ts)</a>
|
||||
#end if
|
||||
#if repo
|
||||
<a href="repoinfo?repoID={{ repo.id }}">{{ util.formatTimeRSS(repo.create_ts) }}</a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Packages</th>
|
||||
<td><a href="packages?blocked=0&tagID=$tag.id">$numPackages</a></td>
|
||||
<td><a href="packages?blocked=0&tagID={{ tag.id }}">{{ numPackages }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Packages (blocked packages included)</th>
|
||||
<td><a href="packages?tagID=$tag.id">$numPackagesBlocked</a></td>
|
||||
<td><a href="packages?tagID={{ tag.id }}">{{ numPackagesBlocked }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Builds</th>
|
||||
<td><a href="builds?tagID=$tag.id">$numBuilds</a></td>
|
||||
<td><a href="builds?tagID={{ tag.id }}">{{ numBuilds }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Targets building from this tag</th>
|
||||
<td>
|
||||
#if $len($srcTargets)
|
||||
#for $target in $srcTargets
|
||||
<a href="buildtargetinfo?name=$quote($target.name)">$target.name</a><br/>
|
||||
#end for
|
||||
#if (srcTargets |length)
|
||||
#for target in srcTargets
|
||||
<a href="buildtargetinfo?name={{ quote(target.name) }}">{{ target.name }}</a><br/>
|
||||
#endfor
|
||||
#else
|
||||
No build targets
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Targets building to this tag</th>
|
||||
<td>
|
||||
#if $len($destTargets)
|
||||
#for $target in $destTargets
|
||||
<a href="buildtargetinfo?name=$quote($target.name)">$target.name</a><br/>
|
||||
#end for
|
||||
#if (destTargets |length)
|
||||
#for target in destTargets
|
||||
<a href="buildtargetinfo?name={{ quote(target.name) }}">{{ target.name }}</a><br/>
|
||||
#endfor
|
||||
#else
|
||||
No build targets
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#if 'admin' in $perms
|
||||
#if 'admin' in perms
|
||||
<tr>
|
||||
<td colspan="2"><a href="tagedit?tagID=$tag.id$util.authToken($self)">Edit tag</a></td>
|
||||
<td colspan="2"><a href="tagedit?tagID={{ tag.id }}{{ util.authToken() }}">Edit tag</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><a href="tagdelete?tagID=$tag.id$util.authToken($self)">Delete tag</a></td>
|
||||
<td colspan="2"><a href="tagdelete?tagID={{ tag.id }}{{ util.authToken() }}">Delete tag</a></td>
|
||||
</tr>
|
||||
#end if
|
||||
#if $tag.get('extra')
|
||||
#endif
|
||||
#if tag.get('extra')
|
||||
<tr>
|
||||
<th>Extra options:</th>
|
||||
</tr>
|
||||
#for $key in $tag['extra']
|
||||
#for key in tag['extra']
|
||||
<tr>
|
||||
<th>$key</th>
|
||||
<td>$pprint.pformat($tag['extra'][$key])</td>
|
||||
<th>{{ key }}</th>
|
||||
<td>{{ pprint.pformat(tag.extra[key]) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#end if
|
||||
#endfor
|
||||
#endif
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,21 +1,17 @@
|
|||
#from kojiweb import util
|
||||
#from urllib.parse import quote
|
||||
#import pprint
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#include "includes/header.chtml"
|
||||
|
||||
<h4>Information for deleted tag <a href="taginfo?tagID=$tag.id">$tag.name</a></h4>
|
||||
<h4>Information for deleted tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$tag.name</td>
|
||||
<th>Name</th><td>{{ tag.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$tag.id</td>
|
||||
<th>ID</th><td>{{ tag.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Deleted</th><td>$util.formatTimeLong($delete_ts)</td>
|
||||
<th>Deleted</th><td>{{ util.formatTimeLong(delete_ts) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,72 +1,71 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#if $inheritanceData
|
||||
#if inheritanceData
|
||||
<h4>Edit Parent</h4>
|
||||
#else
|
||||
<h4>Add Parent</h4>
|
||||
#end if
|
||||
#endif
|
||||
|
||||
<form action="tagparent">
|
||||
$util.authToken($self, form=True)
|
||||
<input type="hidden" name="action" value="#if $inheritanceData then 'edit' else 'add'#"/>
|
||||
{{ util.authToken(form=True) }}
|
||||
<input type="hidden" name="action" value="{{ 'edit' if inheritanceData else 'add' }}"/>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Tag Name</th>
|
||||
<td>
|
||||
$tag.name
|
||||
<input type="hidden" name="tagID" value="$tag.id"/>
|
||||
{{ tag.name }}
|
||||
<input type="hidden" name="tagID" value="{{ tag.id }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Parent Tag Name</th>
|
||||
<td>
|
||||
$parent.name
|
||||
<input type="hidden" name="parentID" value="$parent.id"/>
|
||||
{{ parent.name }}
|
||||
<input type="hidden" name="parentID" value="{{ parent.id }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Priority</th>
|
||||
<td>
|
||||
<input type="text" name="priority" value="#if $inheritanceData then $inheritanceData.priority else $maxPriority + 1#"/>
|
||||
<input type="text" name="priority" value="{{ inheritanceData.priority if inheritanceData else maxPriority + 1 }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Max Depth</th>
|
||||
<td>
|
||||
<input type="text" name="maxdepth" value="#if $inheritanceData then $inheritanceData.maxdepth else ''#"/>
|
||||
<input type="text" name="maxdepth" value="{{ inheritanceData.maxdepth if inheritanceData else '' }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Intransitive</th>
|
||||
<td>
|
||||
<input type="checkbox" name="intransitive" value="yes" #if $inheritanceData and $inheritanceData.intransitive then 'checked="checked"' else ''#/>
|
||||
<input type="checkbox" name="intransitive" value="yes" {{ 'checked="checked"' if inheritanceData and inheritanceData.intransitive else '' }}/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Packages Only</th>
|
||||
<td>
|
||||
<input type="checkbox" name="noconfig" value="yes" #if $inheritanceData and $inheritanceData.noconfig then 'checked="checked"' else ''#/>
|
||||
<input type="checkbox" name="noconfig" value="yes" {{ 'checked="checked"' if inheritanceData and inheritanceData.noconfig else '' }}/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Package Filter</th>
|
||||
<td>
|
||||
<input type="text" name="pkg_filter" value="#if $inheritanceData then $inheritanceData.pkg_filter else ''#"/>
|
||||
<input type="text" name="pkg_filter" value="{{ inheritanceData.pkg_filter if inheritanceData else '' }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
#if $inheritanceData
|
||||
#if inheritanceData
|
||||
<button type="submit" name="save" value="Save">Save</button>
|
||||
#else
|
||||
<button type="submit" name="add" value="Add">Add</button>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
<td><button type="submit" name="cancel" value="Cancel">Cancel</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,76 +1,75 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Tags</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($tagPages) > 1
|
||||
#if tagPages |length > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tags?start=' + this.value * $tagRange + '$util.passthrough($self, 'userID', 'tagID', 'order', 'childID')';">
|
||||
#for $pageNum in $tagPages
|
||||
<option value="$pageNum"#if $pageNum == $tagCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tags?start=' + this.value * {{ tagRange }} + '{{ passthrough('userID', 'tagID', 'order', 'childID') }}';">
|
||||
#for pageNum in tagPages
|
||||
<option value="{{ pageNum }}"{{ 'selected' if pageNum == tagCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $tagStart > 0
|
||||
<a href="tags?start=#echo $tagStart - $tagRange #$util.passthrough($self, 'userID', 'tagID', 'order', 'childID')"><<<</a>
|
||||
#end if
|
||||
#if $totalTags != 0
|
||||
<strong>Tags #echo $tagStart + 1 # through #echo $tagStart + $tagCount # of $totalTags</strong>
|
||||
#end if
|
||||
#if $tagStart + $tagCount < $totalTags
|
||||
<a href="tags?start=#echo $tagStart + $tagRange#$util.passthrough($self, 'userID', 'tagID', 'order', 'childID')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if tagStart > 0
|
||||
<a href="tags?start={{ tagStart - tagRange }}{{ passthrough('userID', 'tagID', 'order', 'childID') }}"><<<</a>
|
||||
#endif
|
||||
#if totalTags != 0
|
||||
<strong>Tags {{ tagStart + 1 }} through {{ tagStart + tagCount }} of {{ totalTags }}</strong>
|
||||
#endif
|
||||
#if tagStart + tagCount < totalTags
|
||||
<a href="tags?start={{ tagStart + tagRange }}{{ passthrough('userID', 'tagID', 'order', 'childID') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="tags?order=$util.toggleOrder($self, 'id')">ID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="tags?order=$util.toggleOrder($self, 'name')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="tags?order={{ util.toggleOrder('id') }}">ID</a> {{ util.sortImage('id') }}</th>
|
||||
<th><a href="tags?order={{ util.toggleOrder('name') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
</tr>
|
||||
#if $len($tags) > 0
|
||||
#for $tag in $tags
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$tag.id</td>
|
||||
<td><a href="taginfo?tagID=$tag.id$util.passthrough($self, 'childID')">$tag.name</a></td>
|
||||
#if tags | length > 0
|
||||
#for tag in tags
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ tag.id }}</td>
|
||||
<td><a href="taginfo?tagID={{ tag.id }}{{ passthrough('childID') }}">{{ tag.name }}</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="2">No tags</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="2">
|
||||
#if $len($tagPages) > 1
|
||||
#if tagPages |length > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tags?start=' + this.value * $tagRange + '$util.passthrough($self, 'userID', 'tagID', 'order', 'childID')';">
|
||||
#for $pageNum in $tagPages
|
||||
<option value="$pageNum"#if $pageNum == $tagCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tags?start=' + this.value * {{ tagRange }} + '{{ passthrough('userID', 'tagID', 'order', 'childID') }}';">
|
||||
#for pageNum in tagPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == tagCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $tagStart > 0
|
||||
<a href="tags?start=#echo $tagStart - $tagRange #$util.passthrough($self, 'userID', 'tagID', 'order', 'childID')"><<<</a>
|
||||
#end if
|
||||
#if $totalTags != 0
|
||||
<strong>Tags #echo $tagStart + 1 # through #echo $tagStart + $tagCount # of $totalTags</strong>
|
||||
#end if
|
||||
#if $tagStart + $tagCount < $totalTags
|
||||
<a href="tags?start=#echo $tagStart + $tagRange#$util.passthrough($self, 'userID', 'tagID', 'order', 'childID')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if tagStart > 0
|
||||
<a href="tags?start={{ tagStart - tagRange }}{{ passthrough('userID', 'tagID', 'order', 'childID') }}"><<<</a>
|
||||
#endif
|
||||
#if totalTags != 0
|
||||
<strong>Tags {{ tagStart + 1 }} through {{ tagStart + tagCount }} of {{ totalTags }}</strong>
|
||||
#endif
|
||||
#if tagStart + tagCount < totalTags
|
||||
<a href="tags?start={{ tagStart + tagRange }}{{ passthrough('userID', 'tagID', 'order', 'childID') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#if 'admin' in $perms
|
||||
#if 'admin' in perms
|
||||
<br/>
|
||||
<a href="tagcreate$util.authToken($self, first=True)">Create new Tag</a>
|
||||
#end if
|
||||
<a href="tagcreate{{ util.authToken(first=True) }}">Create new Tag</a>
|
||||
#endif
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,292 +1,290 @@
|
|||
#import koji
|
||||
#import koji.util as kojiutil
|
||||
#from kojiweb import util
|
||||
#from urllib.parse import quote
|
||||
#import datetime
|
||||
|
||||
#@util.safe_return
|
||||
#def printChildren($taskID, $childMap)
|
||||
#set $iter = 0
|
||||
#set $children = $childMap[$str($taskID)]
|
||||
#if $children
|
||||
#macro printChildren(taskID, childMap)
|
||||
#set iter = 0
|
||||
#set children = childMap[taskID|string]
|
||||
#if children
|
||||
<ul>
|
||||
#for $child in $children
|
||||
#set $iter += 1
|
||||
#if $iter < $len($children)
|
||||
#for child in children
|
||||
#set iter = iter + 1
|
||||
#if iter < children|length
|
||||
<li class="sibling">
|
||||
#else
|
||||
<li>
|
||||
#end if
|
||||
#set $childState = $util.taskState($child.state)
|
||||
#endif
|
||||
#set childState = util.taskState(child.state)
|
||||
<span class="treeBranch">
|
||||
<span class="treeLabel">
|
||||
<span class="task$childState">$util.imageTag($childState)</span>
|
||||
<a href="taskinfo?taskID=$child.id" class="task$childState" title="$childState">$koji.taskLabel($child)</a>
|
||||
<span class="task{{ childState }}">{{ util.imageTag(childState) }}</span>
|
||||
<a href="taskinfo?taskID={{ child.id }}" class="task{{ childState }}" title="{{ childState }}">{{ koji.taskLabel(child) }}</a>
|
||||
</span>
|
||||
</span>
|
||||
$printChildren($child.id, $childMap)
|
||||
{{ printChildren(child.id, childMap) }}
|
||||
</li>
|
||||
#end for
|
||||
#endfor
|
||||
</ul>
|
||||
#end if
|
||||
#end def
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def printMap($vals, $prefix='')
|
||||
#for $key, $value in $vals.items()
|
||||
#if $key == 'properties'
|
||||
${prefix}properties = $printProperties($value)<br/>
|
||||
#elif $key != '__starstar'
|
||||
$prefix$key = $printValue($key, $value)<br/>
|
||||
#end if
|
||||
#end for
|
||||
#end def
|
||||
#macro printMap(vals, prefix='')
|
||||
#for key, value in vals.items()
|
||||
#if key == 'properties'
|
||||
{{ prefix }}properties = {{ printProperties(value) }}<br/>
|
||||
#elif key != '__starstar'
|
||||
{{ prefix }}{{ key }} = {{ printValue(key, value) }}<br/>
|
||||
#endif
|
||||
#endfor
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def printOpts($opts)
|
||||
#if $opts
|
||||
#macro printOpts(opts)
|
||||
#if opts
|
||||
<strong>Options:</strong><br/>
|
||||
$printMap($opts, ' ')
|
||||
#end if
|
||||
#end def
|
||||
{{ printMap(opts, S(' ')) }}
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def printValue($key, $value, $sep=', ')
|
||||
#if $value is None
|
||||
#macro printValue(key, value, sep=', ')
|
||||
#if value is none
|
||||
None
|
||||
#elif $key == 'user'
|
||||
<a href="userinfo?userID=$value['id']">$value['name']</a>
|
||||
#elif $key == 'task'
|
||||
<a href="taskinfo?taskID=$value['id']">$value['id']</a>
|
||||
#elif $key == 'host'
|
||||
<a href="hostinfo?hostID=$value['id']">$value['name']</a>
|
||||
#elif $key == 'build'
|
||||
<a href="buildinfo?buildID=$value['id']">$value['nvr']</a>
|
||||
#elif $key == 'buildroot'
|
||||
<a href="buildrootinfo?buildrootID=$value['id']">$value['id']</a>
|
||||
#elif $key in ('tag', 'destination_tag', 'build_tag')
|
||||
<a href="taginfo?tagID=$value['id']">$value['name']</a>
|
||||
#elif $key in ('build_target', 'target_info')
|
||||
<a href="buildtargetinfo?targetID=$value['id']">$value['name']</a>
|
||||
#elif $key in ('repo_info', 'oldrepo', 'repo')
|
||||
#if $key == 'repo' and isinstance($value, list)
|
||||
$sep.join([$str($val) for $val in $value])
|
||||
#elif key == 'user'
|
||||
<a href="userinfo?userID={{ value['id'] }}">{{ value['name'] }}</a>
|
||||
#elif key == 'task'
|
||||
<a href="taskinfo?taskID={{ value['id'] }}">{{ value['id'] }}</a>
|
||||
#elif key == 'host'
|
||||
<a href="hostinfo?hostID={{ value['id'] }}">{{ value['name'] }}</a>
|
||||
#elif key == 'build'
|
||||
<a href="buildinfo?buildID={{ value['id'] }}">{{ value['nvr'] }}</a>
|
||||
#elif key == 'buildroot'
|
||||
<a href="buildrootinfo?buildrootID={{ value['id'] }}">{{ value['id'] }}</a>
|
||||
#elif key in ('tag', 'destination_tag', 'build_tag')
|
||||
<a href="taginfo?tagID={{ value['id'] }}">{{ value['name'] }}</a>
|
||||
#elif key in ('build_target', 'target_info')
|
||||
<a href="buildtargetinfo?targetID={{ value['id'] }}">{{ value['name'] }}</a>
|
||||
#elif key in ('repo_info', 'oldrepo', 'repo')
|
||||
#if key == 'repo' and value is sequence and value is not string
|
||||
{{ value|join(sep) }}
|
||||
#else
|
||||
<a href="repoinfo?repoID=$value.id">$value.id</a> ($koji.formatTimeLong($value.create_ts))
|
||||
#end if
|
||||
#elif $key == 'task_list'
|
||||
#for $task in $params['task_list']
|
||||
<a href="repoinfo?repoID={{ value.id }}">{{ value.id }}</a> ({{ koji.formatTimeLong(value.create_ts) }})
|
||||
#endif
|
||||
#elif key == 'task_list'
|
||||
#for task in params['task_list']
|
||||
<br/><strong> Task:</strong><br/>
|
||||
$printMap($task, ' ')
|
||||
#end for
|
||||
#elif $isinstance($value, list)
|
||||
$sep.join([$str($val) for $val in $value])
|
||||
#elif $isinstance($value, dict)
|
||||
$sep.join(['%s=%s' % (($n == '' and "''" or $n), $v) for $n, $v in $value.items()])
|
||||
{{ printMap(task, S(' ')) }}
|
||||
#endfor
|
||||
#elif value is mapping
|
||||
##{{ sep.join(['%s=%s' % ((n == '' and "''" or n), v) for n, v in value.items()])
|
||||
{{ value }} TODO FIXME
|
||||
#elif value is sequence and value is not string
|
||||
## XXX this logic doesn't quite convert
|
||||
{{ value|join(sep) }}
|
||||
#else
|
||||
$value
|
||||
#end if
|
||||
#end def
|
||||
{{ value }}
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def printProperties($props)
|
||||
#echo ', '.join([$v is not None and '%s=%s' % ($n, $v) or $str($n) for $n, $v in $props.items()])
|
||||
#end def
|
||||
#macro printProperties(props)
|
||||
##{{ ', '.join([v is not None and '%s=%s' % (n, v) or n|string for n, v in props.items() ]) }}
|
||||
TODO FIXME
|
||||
{{ props | pprint }}
|
||||
#endmacro
|
||||
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for task <a href="taskinfo?taskID=$task.id">$koji.taskLabel($task)</a></h4>
|
||||
<h4>Information for task <a href="taskinfo?taskID={{ task.id }}">{{ koji.taskLabel(task) }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th><td>$task.id</td>
|
||||
<th>ID</th><td>{{ task.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Method</th><td>$task.method</td>
|
||||
<th>Method</th><td>{{ task.method }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Parameters</th>
|
||||
<td>
|
||||
#for key in $sorted($params)
|
||||
#if $params[$key] is not None
|
||||
<strong>$key.capitalize().replace('_', ' ')</strong>: $printValue($key, $params[$key])<br/>
|
||||
#end if
|
||||
#end for
|
||||
$printOpts($opts)
|
||||
#for key in params|sort
|
||||
#if params[key] is not none
|
||||
<strong>{{ key | capitalize |replace('_', ' ') }}</strong>: {{ printValue(key, params[key]) }}<br/>
|
||||
#endif
|
||||
#endfor
|
||||
{{ printOpts(opts) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
#set $state = $util.taskState($task.state)
|
||||
#set state = util.taskState(task.state)
|
||||
<th>State</th>
|
||||
<td class="task$state">$state
|
||||
#if $currentUser and ('admin' in $perms or $task.owner == $currentUser.id)
|
||||
#if $task.state in ($koji.TASK_STATES.FREE, $koji.TASK_STATES.OPEN, $koji.TASK_STATES.ASSIGNED)
|
||||
<span class="adminLink">(<a href="canceltask?taskID=$task.id$util.authToken($self)">cancel</a>)</span>
|
||||
#elif $task.state in ($koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and (not $parent)
|
||||
<span class="adminLink">(<a href="resubmittask?taskID=$task.id$util.authToken($self)">resubmit</a>)</span>
|
||||
#end if
|
||||
#end if
|
||||
#if $currentUser and 'admin' in $perms and $task.state in ($koji.TASK_STATES.OPEN, $koji.TASK_STATES.ASSIGNED)
|
||||
<span class="adminLink">(<a href="freetask?taskID=$task.id$util.authToken($self)">free</a>)</span>
|
||||
#end if
|
||||
<td class="task{{ state }}">{{ state }}
|
||||
#if currentUser and ('admin' in perms or task.owner == currentUser.id)
|
||||
#if task.state in (koji.TASK_STATES.FREE, koji.TASK_STATES.OPEN, koji.TASK_STATES.ASSIGNED)
|
||||
<span class="adminLink">(<a href="canceltask?taskID={{ task.id }}{{ util.authToken() }}">cancel</a>)</span>
|
||||
#elif task.state in (koji.TASK_STATES.CANCELED, koji.TASK_STATES.FAILED) and (not parent)
|
||||
<span class="adminLink">(<a href="resubmittask?taskID={{ task.id }}{{ util.authToken() }}">resubmit</a>)</span>
|
||||
#endif
|
||||
#endif
|
||||
#if currentUser and 'admin' in perms and task.state in (koji.TASK_STATES.OPEN, koji.TASK_STATES.ASSIGNED)
|
||||
<span class="adminLink">(<a href="freetask?taskID={{ task.id }}{{ util.authToken() }}">free</a>)</span>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
#if $taskBuilds
|
||||
#for $build in $taskBuilds
|
||||
#if taskBuilds
|
||||
#for build in taskBuilds
|
||||
<tr>
|
||||
<th>Build</th><td><a href="buildinfo?buildID=$build.build_id">$koji.buildLabel($build)</a></td>
|
||||
<th>Build</th><td><a href="buildinfo?buildID={{ build.build_id }}">{{ koji.buildLabel(build) }}</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#end if
|
||||
#endfor
|
||||
#endif
|
||||
<tr>
|
||||
<th>Created</th><td>$util.formatTimeLong($task.create_ts)</td>
|
||||
<th>Created</th><td>{{ util.formatTimeLong(task.create_ts) }}</td>
|
||||
</tr>
|
||||
#if $task.start_time
|
||||
#if task.start_time
|
||||
<tr>
|
||||
<th>Started</th><td>$util.formatTimeLong($task.start_ts)</td>
|
||||
#end if
|
||||
#set $end_ts = None
|
||||
#if $task.state == $koji.TASK_STATES.OPEN
|
||||
#if $estCompletion
|
||||
<th>Started</th><td>{{ util.formatTimeLong(task.start_ts) }}</td>
|
||||
#endif
|
||||
#set end_ts = None
|
||||
#if task.state == koji.TASK_STATES.OPEN
|
||||
#if estCompletion
|
||||
<tr>
|
||||
<th title="Estimation based on previous builds of same package">Est. Completion</th>
|
||||
<td>$util.formatTimeLong($estCompletion)</td>
|
||||
<td>{{ util.formatTimeLong(estCompletion) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#elif $task.completion_time
|
||||
#endif
|
||||
#elif task.completion_time
|
||||
<tr>
|
||||
<th>Completed</th><td>$util.formatTimeLong($task.completion_ts)</td>
|
||||
<th>Completed</th><td>{{ util.formatTimeLong(task.completion_ts) }}</td>
|
||||
</tr>
|
||||
#set $end_ts = $task.completion_ts
|
||||
#end if
|
||||
#if not $end_ts
|
||||
#set $end_ts = $kojiutil.parseTime($kojiutil.encode_datetime(datetime.datetime.utcnow()))
|
||||
#end if
|
||||
#set end_ts = task.completion_ts
|
||||
#endif
|
||||
#if not end_ts
|
||||
##set end_ts = koji.util.parseTime(koji.util.encode_datetime(datetime.datetime.utcnow()))
|
||||
#set end_ts = koji.time.time()
|
||||
## XXX is this right?
|
||||
#endif
|
||||
<tr>
|
||||
<th title="From task's creation">Total time</th>
|
||||
<td>$util.formatTimestampDifference($task.create_ts, $end_ts)</td>
|
||||
<td>{{ util.formatTimestampDifference(task.create_ts, end_ts) }}</td>
|
||||
</tr>
|
||||
#if $task.start_time
|
||||
#if task.start_time
|
||||
<tr>
|
||||
<th title="From task's start">Task time</th>
|
||||
<td>$util.formatTimestampDifference($task.start_ts, $end_ts)</td>
|
||||
<td>{{ util.formatTimestampDifference(task.start_ts, end_ts) }}</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Owner</th>
|
||||
<td>
|
||||
#if $owner
|
||||
#if $owner.usertype == $koji.USERTYPES['HOST']
|
||||
<a href="hostinfo?userID=$owner.id">$owner.name</a>
|
||||
#if owner
|
||||
#if owner.usertype == koji.USERTYPES['HOST']
|
||||
<a href="hostinfo?userID={{ owner.id }}">{{ owner.name }}</a>
|
||||
#else
|
||||
<a href="userinfo?userID=$owner.id">$owner.name</a>
|
||||
#end if
|
||||
#end if
|
||||
<a href="userinfo?userID={{ owner.id }}">{{ owner.name }}</a>
|
||||
#endif
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Channel</th>
|
||||
<td>
|
||||
#if $task.channel_id
|
||||
<a href="channelinfo?channelID=$task.channel_id">$channelName</a>
|
||||
#end if
|
||||
#if task.channel_id
|
||||
<a href="channelinfo?channelID={{ task.channel_id }}">{{ channelName }}</a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Host</th>
|
||||
<td>
|
||||
#if $task.host_id
|
||||
<a href="hostinfo?hostID=$task.host_id">$hostName</a>
|
||||
#end if
|
||||
#if task.host_id
|
||||
<a href="hostinfo?hostID={{ task.host_id }}">{{ hostName }}</a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Arch</th><td>$task.arch</td>
|
||||
<th>Arch</th><td>{{ task.arch }}</td>
|
||||
</tr>
|
||||
#if $buildroots
|
||||
#if buildroots
|
||||
<tr>
|
||||
<th>Buildroot#if $len($buildroots) > 1 then 's' else ''#</th>
|
||||
<th>Buildroot{{ 's' if buildroots|length > 1 else '' }}</th>
|
||||
<td>
|
||||
#for $buildroot in $buildroots
|
||||
<a href="buildrootinfo?buildrootID=$buildroot.id">#if $task.method == 'vmExec' then '' else '/var/lib/mock/'#$buildroot.tag_name-$buildroot.id-$buildroot.repo_id</a><br/>
|
||||
#end for
|
||||
#for buildroot in buildroots
|
||||
<a href="buildrootinfo?buildrootID={{ buildroot.id }}">{{ '' if task.method == 'vmExec' else '/var/lib/mock/' }}{{ buildroot.tag_name }}-{{ buildroot.id }}-{{ buildroot.repo_id }}</a><br/>
|
||||
#endfor
|
||||
</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<th>Parent</th>
|
||||
<td>
|
||||
#if $parent
|
||||
<a href="taskinfo?taskID=$parent.id" class="task$util.taskState($parent.state)">$koji.taskLabel($parent)</a>
|
||||
#end if
|
||||
#if parent
|
||||
<a href="taskinfo?taskID={{ parent.id }}" class="task{{ util.taskState(parent.state) }}">{{ koji.taskLabel(parent) }}</a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Descendants</th>
|
||||
<td class="tree">
|
||||
#if $len($descendents[$str($task.id)]) > 0
|
||||
#set $taskState = $util.taskState($task.state)
|
||||
<span class="task$taskState">$util.imageTag($taskState)</span>
|
||||
<span class="root">$task.method</span>
|
||||
#end if
|
||||
$printChildren($task.id, $descendents)
|
||||
#if descendents[task.id|string]
|
||||
#set taskState = util.taskState(task.state)
|
||||
<span class="task{{ taskState }}">{{ util.imageTag(taskState) }}</span>
|
||||
<span class="root">{{ task.method }}</span>
|
||||
#endif
|
||||
{{ printChildren(task.id, descendents) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Waiting?</th><td>#if $task.waiting then 'yes' else 'no'#</td>
|
||||
<th>Waiting?</th><td>{{ 'yes' if task.waiting else 'no' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Awaited?</th><td>#if $task.awaited then 'yes' else 'no'#</td>
|
||||
<th>Awaited?</th><td>{{ 'yes' if task.awaited else 'no' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Priority</th><td>$task.priority</td>
|
||||
<th>Priority</th><td>{{ task.priority }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Weight</th><td>#echo '%.2f' % $task.weight#</td>
|
||||
<th>Weight</th><td>{{ '%.2f' % task.weight }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Result</th>
|
||||
<td>
|
||||
#if $abbr_result_text
|
||||
#if abbr_result_text
|
||||
<div id="abbr-result">
|
||||
$abbr_result_text
|
||||
{{ abbr_result_text }}
|
||||
</div>
|
||||
<div id="full-result">
|
||||
$full_result_text
|
||||
{{ full_result_text }}
|
||||
</div>
|
||||
<a href="#" collapse" id="toggle-abbreviated-result" style="display: none;">Show abbreviated results</a>
|
||||
<a href="#" collapse" id="toggle-full-result" style="display: none;">Show complete results</a>
|
||||
#else
|
||||
<div id="result">
|
||||
$full_result_text
|
||||
{{ full_result_text }}
|
||||
</div>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Output</th>
|
||||
<td>
|
||||
#for $volume, $filename in $output
|
||||
<a href="$pathinfo.task($task.id, volume=$volume)/$quote($filename)">$filename</a>
|
||||
#if $filename.endswith('.log')
|
||||
(<a href="getfile?taskID=$task.id&volume=$volume&name=$quote($filename)&offset=-4000">tail</a>)
|
||||
#end if
|
||||
#for pair in output
|
||||
#set volume = pair[0]
|
||||
#set filename = pair[1]
|
||||
<a href="{{ pathinfo.task(task.id, volume=volume) }}/{{ filename|urlencode }}">{{ filename }}</a>
|
||||
#if filename.endswith('.log')
|
||||
(<a href="getfile?taskID={{ task.id }}&volume={{ volume }}&name={{ filename|urlencode }}&offset=-4000">tail</a>)
|
||||
#endif
|
||||
<br/>
|
||||
#end for
|
||||
#if not $output
|
||||
#endfor
|
||||
#if not output
|
||||
<div title="Not all tasks produce outputs, and task outputs are not retained indefinitely.">No outputs reported</div>
|
||||
#end if
|
||||
#if $task.state not in ($koji.TASK_STATES.CLOSED, $koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and \
|
||||
$task.method in ('buildSRPMFromSCM', 'buildArch', 'createLiveMedia', 'buildMaven', 'wrapperRPM', 'vmExec', 'createrepo', 'runroot', 'createAppliance', 'createLiveCD')
|
||||
#endif
|
||||
{% if task.state not in (koji.TASK_STATES.CLOSED, koji.TASK_STATES.CANCELED, koji.TASK_STATES.FAILED) and
|
||||
task.method in ('buildSRPMFromSCM', 'buildArch', 'createLiveMedia', 'buildMaven', 'wrapperRPM', 'vmExec', 'createrepo', 'runroot', 'createAppliance', 'createLiveCD') %}
|
||||
<br/>
|
||||
<a href="watchlogs?taskID=$task.id">Watch logs</a>
|
||||
#end if
|
||||
<a href="watchlogs?taskID={{ task.id }}">Watch logs</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#if $abbr_result_text
|
||||
#if abbr_result_text
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var abbr = document.getElementById('abbr-result');
|
||||
|
|
@ -317,5 +315,5 @@ $value
|
|||
link_to_show_abbr.onclick = trigger
|
||||
})();
|
||||
</script>
|
||||
#end if
|
||||
#include "includes/footer.chtml"
|
||||
#endif
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,69 +1,63 @@
|
|||
#import koji
|
||||
#from kojiweb import util
|
||||
#from kojiweb.util import SafeValue as S
|
||||
|
||||
#@util.safe_return
|
||||
#def printChildren($taskID, $childMap)
|
||||
#set $iter = 0
|
||||
#set $children = $childMap[$str($taskID)]
|
||||
#if $children
|
||||
#macro printChildren(taskID, childMap)
|
||||
#set iter = 0
|
||||
#set children = childMap[taskID|string]
|
||||
#if children
|
||||
<ul>
|
||||
#for $child in $children
|
||||
#set $iter += 1
|
||||
#if $iter < $len($children)
|
||||
#for child in children
|
||||
#set iter = iter + 1
|
||||
#if iter < children|length
|
||||
<li class="sibling">
|
||||
#else
|
||||
<li>
|
||||
#end if
|
||||
#set $childState = $util.taskState($child.state)
|
||||
#endif
|
||||
#set childState = util.taskState(child.state)
|
||||
<span class="treeBranch">
|
||||
<span class="treeLabel">
|
||||
<a href="taskinfo?taskID=$child.id" class="task$childState" title="$childState">$koji.taskLabel($child)</a>
|
||||
<a href="taskinfo?taskID={{ child.id }}" class="task{{ childState }}" title="{{ childState }}">{{ koji.taskLabel(child) }}</a>
|
||||
</span>
|
||||
</span>
|
||||
$printChildren($child.id, $childMap)
|
||||
{{ printChildren(child.id, childMap ) }}
|
||||
</li>
|
||||
#end for
|
||||
#endfor
|
||||
</ul>
|
||||
#end if
|
||||
#end def
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#@util.safe_return
|
||||
#def headerPrefix($state)
|
||||
#if $state == 'active'
|
||||
#macro headerPrefix(state)
|
||||
#if state == 'active'
|
||||
Active
|
||||
#elif $state == 'all'
|
||||
#elif state == 'all'
|
||||
All
|
||||
#else
|
||||
#echo $state.capitalize()
|
||||
#end if
|
||||
#end def
|
||||
{{ state|capitalize }}
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
#attr _PASSTHROUGH = ['owner', 'state', 'view', 'method', 'hostID', 'channelID', 'order']
|
||||
#set _PASSTHROUGH = ['owner', 'state', 'view', 'method', 'hostID', 'channelID', 'order']
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
#@util.safe_return
|
||||
#def getDescription()
|
||||
$headerPrefix($state)
|
||||
#if $view == 'toplevel'
|
||||
#macro getDescription()
|
||||
{{ headerPrefix(state) }}
|
||||
#if view == 'toplevel'
|
||||
toplevel
|
||||
#end if
|
||||
#if $method != 'all'
|
||||
$method Tasks
|
||||
#end if
|
||||
#if $ownerObj
|
||||
owned by <a href="userinfo?userID=$ownerObj.id">$ownerObj.name</a>
|
||||
#end if
|
||||
#if $host
|
||||
on host <a href="hostinfo?hostID=$host.id">$host.name</a>
|
||||
#end if
|
||||
#if $channel
|
||||
in channel <a href="channelinfo?channelID=$channel.id">$channel.name</a>
|
||||
#end if
|
||||
#end def
|
||||
#endif
|
||||
#if method != 'all'
|
||||
{{ method }} Tasks
|
||||
#endif
|
||||
#if ownerObj
|
||||
owned by <a href="userinfo?userID={{ ownerObj.id }}">{{ ownerObj.name }}</a>
|
||||
#endif
|
||||
#if host
|
||||
on host <a href="hostinfo?hostID={{ host.id }}">{{ host.name }}</a>
|
||||
#endif
|
||||
#if channel
|
||||
in channel <a href="channelinfo?channelID={{ channel.id }}">{{ channel.name }}</a>
|
||||
#endif
|
||||
#endmacro
|
||||
|
||||
<h4>$getDescription()</h4>
|
||||
<h4>{{ getDescription() }}</h4>
|
||||
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
|
|
@ -73,53 +67,53 @@ in channel <a href="channelinfo?channelID=$channel.id">$channel.name</a>
|
|||
<tr><td>
|
||||
<strong>State</strong>:
|
||||
</td><td>
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'tasks?state=' + this.value + '$util.passthrough_except($self, 'state')';">
|
||||
<option value="active" $util.toggleSelected($self, $state, 'active')>active</option>
|
||||
<option value="all" $util.toggleSelected($self, $state, 'all')>all</option>
|
||||
<option value="free" #if $state == 'free' then 'selected' else ''#>free</option>
|
||||
<option value="open" #if $state == 'open' then 'selected' else ''#>open</option>
|
||||
<option value="closed" #if $state == 'closed' then 'selected' else ''#>closed</option>
|
||||
<option value="failed" #if $state == 'failed' then 'selected' else ''#>failed</option>
|
||||
<option value="canceled" #if $state == 'canceled' then 'selected' else ''#>canceled</option>
|
||||
<option value="assigned" #if $state == 'assigned' then 'selected' else ''#>assigned</option>
|
||||
<select name="state" class="filterlist" onchange="javascript: window.location = 'tasks?state=' + this.value + '{{ util.passthrough_except('state') }}';">
|
||||
<option value="active" {{ util.toggleSelected(state, 'active') }}>active</option>
|
||||
<option value="all" {{ util.toggleSelected(state, 'all') }}>all</option>
|
||||
<option value="free" {{ 'selected' if state == 'free' else '' }}>free</option>
|
||||
<option value="open" {{ 'selected' if state == 'open' else '' }}>open</option>
|
||||
<option value="closed" {{ 'selected' if state == 'closed' else '' }}>closed</option>
|
||||
<option value="failed" {{ 'selected' if state == 'failed' else '' }}>failed</option>
|
||||
<option value="canceled" {{ 'selected' if state == 'canceled' else '' }}>canceled</option>
|
||||
<option value="assigned" {{ 'selected' if state == 'assigned' else '' }}>assigned</option>
|
||||
</select>
|
||||
</td><td>
|
||||
<strong>Owner</strong>:
|
||||
</td><td>
|
||||
<select name="owner" class="filterlist" onchange="javascript: window.location = 'tasks?owner=' + this.value + '$util.passthrough_except($self, 'owner')';">
|
||||
<option value="" #if not $owner then 'selected' else ''#>everyone</option>
|
||||
#if $loggedInUser
|
||||
<option value="$loggedInUser.name">me</option>
|
||||
#end if
|
||||
#for $user in $users
|
||||
<option value="$user.name" #if $user.name == $owner then 'selected' else ''#>$user.name</option>
|
||||
#end for
|
||||
<select name="owner" class="filterlist" onchange="javascript: window.location = 'tasks?owner=' + this.value + '{{ util.passthrough_except('owner') }}';">
|
||||
<option value="" {{ 'selected' if not owner else '' }}>everyone</option>
|
||||
#if loggedInUser
|
||||
<option value="{{ loggedInUser.name }}">me</option>
|
||||
#endif
|
||||
#for user in users
|
||||
<option value="{{ user.name }}" {{ 'selected' if user.name == owner else '' }}>{{ user.name }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<strong>Method</strong>:
|
||||
</td><td>
|
||||
<select name="method" class="filterlist" onchange="javascript: window.location = 'tasks?method=' + this.value + '$util.passthrough_except($self, 'method')';">
|
||||
<option value="all" $util.toggleSelected($self, $method, 'all')>all</option>
|
||||
#for $task_type in $alltasks
|
||||
#if $task_type in ('maven', 'buildMaven') and not $mavenEnabled
|
||||
#continue
|
||||
#elif $task_type in ('winbuild', 'vmExec') and not $winEnabled
|
||||
#continue
|
||||
#elif $task_type == 'wrapperRPM' and not ($mavenEnabled or $winEnabled)
|
||||
#continue
|
||||
<select name="method" class="filterlist" onchange="javascript: window.location = 'tasks?method=' + this.value + '{{ util.passthrough_except('method') }}';">
|
||||
<option value="all" {{ util.toggleSelected(method, 'all') }}>all</option>
|
||||
#for task_type in alltasks
|
||||
#if task_type in ('maven', 'buildMaven') and not mavenEnabled
|
||||
## XXX continue
|
||||
#elif task_type in ('winbuild', 'vmExec') and not winEnabled
|
||||
## XXX continue
|
||||
#elif task_type == 'wrapperRPM' and not (mavenEnabled or winEnabled)
|
||||
## XXX continue
|
||||
#else
|
||||
<option value="$task_type" #if $method == $task_type then 'selected' else ''#>$task_type</option>
|
||||
#end if
|
||||
#end for
|
||||
<option value="{{ task_type }}" {{ 'selected' if method == task_type else '' }}>{{ task_type }}</option>
|
||||
#endif
|
||||
#endfor
|
||||
</select>
|
||||
</td><td>
|
||||
<strong>View</strong>:
|
||||
</td><td>
|
||||
<select name="view" class="filterlist" onchange="javascript: window.location = 'tasks?view=' + this.value + '$util.passthrough_except($self, 'view')';">
|
||||
<option value="tree" $util.toggleSelected($self, $view, 'tree') #if not $treeEnabled then 'disabled="disabled"' else ''#>tree</option>
|
||||
<option value="toplevel" $util.toggleSelected($self, $view, 'toplevel') #if not $toplevelEnabled then 'disabled="disabled"' else ''#>toplevel</option>
|
||||
<option value="flat" $util.toggleSelected($self, $view, 'flat')>flat</option>
|
||||
<select name="view" class="filterlist" onchange="javascript: window.location = 'tasks?view=' + this.value + '{{ util.passthrough_except('view') }}';">
|
||||
<option value="tree" {{ util.toggleSelected(view, 'tree') }} {{ 'disabled="disabled"' if not treeEnabled else '' }}>tree</option>
|
||||
<option value="toplevel" {{ util.toggleSelected(view, 'toplevel') }} {{ 'disabled="disabled"' if not toplevelEnabled else '' }}>toplevel</option>
|
||||
<option value="flat" {{ util.toggleSelected(view, 'flat') }}>flat</option>
|
||||
</select>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
|
@ -128,110 +122,110 @@ in channel <a href="channelinfo?channelID=$channel.id">$channel.name</a>
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="6">
|
||||
#if $taskPages is not None
|
||||
#if $len($taskPages) > 1
|
||||
#if taskPages is not none
|
||||
#if taskPages|length > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * $taskRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $taskPages
|
||||
<option value="$pageNum"#if $pageNum == $taskCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * {{ taskRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in taskPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == taskCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $taskStart > 0
|
||||
<a href="tasks?start=#echo $taskStart - $taskRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalTasks != 0
|
||||
<strong>Tasks #echo $taskStart + 1 # through #echo $taskStart + $taskCount # of $totalTasks</strong>
|
||||
#end if
|
||||
#if $taskStart + $taskCount < $totalTasks
|
||||
<a href="tasks?start=#echo $taskStart + $taskRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if taskStart > 0
|
||||
<a href="tasks?start={{ taskStart - taskRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalTasks != 0
|
||||
<strong>Tasks {{ taskStart + 1 }} through {{ taskStart + taskCount }} of {{ totalTasks }}</strong>
|
||||
#endif
|
||||
#if taskStart + taskCount < totalTasks
|
||||
<a href="tasks?start={{ taskStart + taskRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
#else
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * $taskRange + '$util.passthrough_except($self)';">
|
||||
<option value="0"#if 0 == $taskCurrentPage then ' selected' else ''#>#echo 1#</option>
|
||||
<option value="1"#if 1 == $taskCurrentPage then ' selected' else ''#>#echo "load more"#</option>
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * {{ taskRange }} + '{{ util.passthrough_except() }}';">
|
||||
<option value="0"{{ ' selected' if 0 == taskCurrentPage else '' }}>1</option>
|
||||
<option value="1"{{ ' selected' if 1 == taskCurrentPage else '' }}>load more</option>
|
||||
</select>
|
||||
</form>
|
||||
<strong>Tasks #echo $taskStart + 1 # through #echo $taskStart + $taskCount# of ???</strong>
|
||||
<a href="tasks?start=$taskRange$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
<strong>Tasks {{ taskStart + 1 }} through {{ taskStart + taskCount }} of ???</strong>
|
||||
<a href="tasks?start={{ taskRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="tasks?order=$util.toggleOrder($self, 'id')$util.passthrough_except($self, 'order')">ID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="tasks?order=$util.toggleOrder($self, 'method')$util.passthrough_except($self, 'order')">Type</a> $util.sortImage($self, 'method')</th>
|
||||
<th><a href="tasks?order=$util.toggleOrder($self, 'owner')$util.passthrough_except($self, 'order')">Owner</a> $util.sortImage($self, 'owner')</th>
|
||||
<th><a href="tasks?order=$util.toggleOrder($self, 'arch')$util.passthrough_except($self, 'order')">Arch</a> $util.sortImage($self, 'arch')</th>
|
||||
<th><a href="tasks?order=$util.toggleOrder($self, 'completion_time')$util.passthrough_except($self, 'order')">Finished</a> $util.sortImage($self, 'completion_time')</th>
|
||||
<th><a href="tasks?order=$util.toggleOrder($self, 'state')$util.passthrough_except($self, 'order')">State</a> $util.sortImage($self, 'state')</th>
|
||||
<th><a href="tasks?order={{ util.toggleOrder('id') }}{{ util.passthrough_except('order') }}">ID</a> {{ util.sortImage('id') }}</th>
|
||||
<th><a href="tasks?order={{ util.toggleOrder('method') }}{{ util.passthrough_except('order') }}">Type</a> {{ util.sortImage('method') }}</th>
|
||||
<th><a href="tasks?order={{ util.toggleOrder('owner') }}{{ util.passthrough_except('order') }}">Owner</a> {{ util.sortImage('owner') }}</th>
|
||||
<th><a href="tasks?order={{ util.toggleOrder('arch') }}{{ util.passthrough_except('order') }}">Arch</a> {{ util.sortImage('arch') }}</th>
|
||||
<th><a href="tasks?order={{ util.toggleOrder('completion_time') }}{{ util.passthrough_except('order') }}">Finished</a> {{ util.sortImage('completion_time') }}</th>
|
||||
<th><a href="tasks?order={{ util.toggleOrder('state') }}{{ util.passthrough_except('order') }}">State</a> {{ util.sortImage('state') }}</th>
|
||||
</tr>
|
||||
#if $len($tasks) > 0
|
||||
#for $task in $tasks
|
||||
<tr class="$util.rowToggle($self)">
|
||||
#set $taskState = $util.taskState($task.state)
|
||||
<td>$task.id</td>
|
||||
<td#if $treeDisplay then S(' class="tree"') else ''#>
|
||||
#if $treeDisplay then ' ' else ''#<a href="taskinfo?taskID=$task.id" class="task$taskState" title="$taskState">$koji.taskLabel($task)</a>
|
||||
#if $treeDisplay
|
||||
$printChildren($task.id, $task.descendents)
|
||||
#end if
|
||||
#if tasks
|
||||
#for task in tasks
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
#set taskState = util.taskState(task.state)
|
||||
<td>{{ task.id }}</td>
|
||||
<td{{ S(' class="tree"') if treeDisplay else '' }}>
|
||||
{{ S(' ') if treeDisplay else '' }}<a href="taskinfo?taskID={{ task.id }}" class="task{{ taskState }}" title="{{ taskState }}">{{ koji.taskLabel(task) }}</a>
|
||||
#if treeDisplay
|
||||
{{ printChildren(task.id, task.descendents) }}
|
||||
#endif
|
||||
</td>
|
||||
<td class="user-$task.owner_name">
|
||||
#if $task.owner_type == $koji.USERTYPES['HOST']
|
||||
<a href="hostinfo?userID=$task.owner">$task.owner_name</a>
|
||||
<td class="user-{{ task.owner_name }}">
|
||||
#if task.owner_type == koji.USERTYPES['HOST']
|
||||
<a href="hostinfo?userID={{ task.owner }}">{{ task.owner_name }}</a>
|
||||
#else
|
||||
<a href="userinfo?userID=$task.owner">$task.owner_name</a>
|
||||
#end if
|
||||
<a href="userinfo?userID={{ task.owner }}">{{ task.owner_name }}</a>
|
||||
#endif
|
||||
</td>
|
||||
<td>$task.arch</td>
|
||||
<td>$util.formatTime($task.completion_ts)</td>
|
||||
<td class="task$state">$util.imageTag($taskState)</td>
|
||||
<td>{{ task.arch }}</td>
|
||||
<td>{{ util.formatTime(task.completion_ts) }}</td>
|
||||
<td class="task{{ state }}">{{ util.imageTag(taskState) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="6">No tasks</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="6">
|
||||
#if $taskPages is not None
|
||||
#if $len($taskPages) > 1
|
||||
#if taskPages is not none
|
||||
#if taskPages|length > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * $taskRange + '$util.passthrough_except($self)';">
|
||||
#for $pageNum in $taskPages
|
||||
<option value="$pageNum"#if $pageNum == $taskCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * {{ taskRange }} + '{{ util.passthrough_except() }}';">
|
||||
#for pageNum in taskPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == taskCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $taskStart > 0
|
||||
<a href="tasks?start=#echo $taskStart - $taskRange #$util.passthrough_except($self)"><<<</a>
|
||||
#end if
|
||||
#if $totalTasks != 0
|
||||
<strong>Tasks #echo $taskStart + 1 # through #echo $taskStart + $taskCount # of $totalTasks</strong>
|
||||
#end if
|
||||
#if $taskStart + $taskCount < $totalTasks
|
||||
<a href="tasks?start=#echo $taskStart + $taskRange#$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if taskStart > 0
|
||||
<a href="tasks?start={{ taskStart - taskRange }}{{ util.passthrough_except() }}"><<<</a>
|
||||
#endif
|
||||
#if totalTasks != 0
|
||||
<strong>Tasks {{ taskStart + 1 }} through {{ taskStart + taskCount }} of {{ totalTasks }}</strong>
|
||||
#endif
|
||||
#if taskStart + taskCount < totalTasks
|
||||
<a href="tasks?start={{ taskStart + taskRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
#else
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * $taskRange + '$util.passthrough_except($self)';">
|
||||
<option value="0"#if 0 == $taskCurrentPage then ' selected' else ''#>#echo 1#</option>
|
||||
<option value="1"#if 1 == $taskCurrentPage then ' selected' else ''#>#echo "load more"#</option>
|
||||
<select onchange="javascript: window.location = 'tasks?start=' + this.value * {{ taskRange }} + '{{ util.passthrough_except() }}';">
|
||||
<option value="0"{{ ' selected' if 0 == taskCurrentPage else '' }}>1</option>
|
||||
<option value="1"{{ ' selected' if 1 == taskCurrentPage else '' }}>load more</option>
|
||||
</select>
|
||||
</form>
|
||||
<strong>Tasks #echo $taskStart + 1 # through #echo $taskStart + $taskCount# of ???</strong>
|
||||
<a href="tasks?start=$taskRange$util.passthrough_except($self)">>>></a>
|
||||
#end if
|
||||
<strong>Tasks {{ taskStart + 1 }} through {{ taskStart + taskCount }} of ???</strong>
|
||||
<a href="tasks?start={{ taskRange }}{{ util.passthrough_except() }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,89 +1,89 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Tasks by Host#if $hostArch then ' (%s)' % $hostArch else ''#</h4>
|
||||
<h4>Tasks by Host{{ ' (%s)' % hostArch if hostArch else '' }}</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="archlist" colspan="3">
|
||||
<strong>Host arch:</strong> #for $arch in $hostArchList
|
||||
#if $arch == $hostArch
|
||||
<strong>$arch</strong> |
|
||||
<strong>Host arch:</strong>
|
||||
#for arch in hostArchList
|
||||
#if arch == hostArch
|
||||
<strong>{{ arch }}</strong> |
|
||||
#else
|
||||
<a href="tasksbyhost?hostArch=$arch$util.passthrough($self, 'order')">$arch</a> |
|
||||
#end if
|
||||
#end for
|
||||
#if $hostArch
|
||||
<a href="tasksbyhost?${util.passthrough($self, 'order', prefix='')}">all</a>
|
||||
<a href="tasksbyhost?hostArch={{ arch }}{{ util.passthrough('order') }}">{{ arch }}</a> |
|
||||
#endif
|
||||
#endfor
|
||||
#if hostArch
|
||||
<a href="tasksbyhost?{{ util.passthrough('order', prefix='') }}">all</a>
|
||||
#else
|
||||
<strong>all</strong>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($hostPages) > 1
|
||||
#if (hostPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasksbyhost?start=' + this.value * $hostRange + '$util.passthrough($self, 'order', 'hostArch')';">
|
||||
#for $pageNum in $hostPages
|
||||
<option value="$pageNum"#if $pageNum == $hostCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tasksbyhost?start=' + this.value * {{ hostRange }} + '{{ util.passthrough('order', 'hostArch') }}';">
|
||||
#for pageNum in hostPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $hostStart > 0
|
||||
<a href="tasksbyhost?start=#echo $hostStart - $hostRange #$util.passthrough($self, 'order', 'hostArch')"><<<</a>
|
||||
#end if
|
||||
#if $totalHosts != 0
|
||||
<strong>Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts</strong>
|
||||
#end if
|
||||
#if $hostStart + $hostCount < $totalHosts
|
||||
<a href="tasksbyhost?start=#echo $hostStart + $hostRange#$util.passthrough($self, 'order', 'hostArch')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if hostStart > 0
|
||||
<a href="tasksbyhost?start={{ hostStart - hostRange }}{{ util.passthrough('order', 'hostArch') }}"><<<</a>
|
||||
#endif
|
||||
#if totalHosts != 0
|
||||
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
||||
#endif
|
||||
#if hostStart + hostCount < totalHosts
|
||||
<a href="tasksbyhost?start={{ hostStart + hostRange }}{{ util.passthrough('order', 'hostArch') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="tasksbyhost?order=$util.toggleOrder($self, 'name')$util.passthrough($self, 'hostArch')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="tasksbyhost?order=$util.toggleOrder($self, 'tasks')$util.passthrough($self, 'hostArch')">Tasks</a> $util.sortImage($self, 'tasks')</th>
|
||||
<th><a href="tasksbyhost?order={{ util.toggleOrder('name') }}{{ util.passthrough('hostArch') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th><a href="tasksbyhost?order={{ util.toggleOrder('tasks') }}{{ util.passthrough('hostArch') }}">Tasks</a> {{ util.sortImage('tasks') }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
#if $len($hosts) > 0
|
||||
#for $host in $hosts
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="hostinfo?hostID=$host.id">$host.name</a></td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $host.tasks#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$host.tasks</td>
|
||||
#if (hosts |length) > 0
|
||||
#for host in hosts
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="hostinfo?hostID={{ host.id }}">{{ host.name }}</a></td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * host.tasks }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ host.tasks }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No hosts</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($hostPages) > 1
|
||||
#if (hostPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasksbyhost?start=' + this.value * $hostRange + '$util.passthrough($self, 'order', 'hostArch')';">
|
||||
#for $pageNum in $hostPages
|
||||
<option value="$pageNum"#if $pageNum == $hostCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tasksbyhost?start=' + this.value * {{ hostRange }} + '{{ util.passthrough('order', 'hostArch') }}';">
|
||||
#for pageNum in hostPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == hostCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $hostStart > 0
|
||||
<a href="tasksbyhost?start=#echo $hostStart - $hostRange #$util.passthrough($self, 'order', 'hostArch')"><<<</a>
|
||||
#end if
|
||||
#if $totalHosts != 0
|
||||
<strong>Hosts #echo $hostStart + 1 # through #echo $hostStart + $hostCount # of $totalHosts</strong>
|
||||
#end if
|
||||
#if $hostStart + $hostCount < $totalHosts
|
||||
<a href="tasksbyhost?start=#echo $hostStart + $hostRange#$util.passthrough($self, 'order', 'hostArch')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if hostStart > 0
|
||||
<a href="tasksbyhost?start={{ hostStart - hostRange }}{{ util.passthrough('order', 'hostArch') }}"><<<</a>
|
||||
#endif
|
||||
#if totalHosts != 0
|
||||
<strong>Hosts {{ hostStart + 1 }} through {{ hostStart + hostCount }} of {{ totalHosts }}</strong>
|
||||
#endif
|
||||
#if hostStart + hostCount < totalHosts
|
||||
<a href="tasksbyhost?start={{ hostStart + hostRange }}{{ util.passthrough('order', 'hostArch') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,73 +1,72 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Tasks by User</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($userPages) > 1
|
||||
#if (userPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasksbyuser?start=' + this.value * $userRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $userPages
|
||||
<option value="$pageNum"#if $pageNum == $userCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tasksbyuser?start=' + this.value * {{ userRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in userPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == userCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userStart > 0
|
||||
<a href="tasksbyuser?start=#echo $userStart - $userRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalUsers != 0
|
||||
<strong>Users #echo $userStart + 1 # through #echo $userStart + $userCount # of $totalUsers</strong>
|
||||
#end if
|
||||
#if $userStart + $userCount < $totalUsers
|
||||
<a href="tasksbyuser?start=#echo $userStart + $userRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userStart > 0
|
||||
<a href="tasksbyuser?start={{ userStart - userRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUsers != 0
|
||||
<strong>Users {{ userStart + 1 }} through {{ userStart + userCount }} of {{ totalUsers }}</strong>
|
||||
#endif
|
||||
#if userStart + userCount < totalUsers
|
||||
<a href="tasksbyuser?start={{ userStart + userRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="tasksbyuser?order=$util.toggleOrder($self, 'name')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="tasksbyuser?order=$util.toggleOrder($self, 'tasks')">Tasks</a> $util.sortImage($self, 'tasks')</th>
|
||||
<th><a href="tasksbyuser?order={{ util.toggleOrder('name') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th><a href="tasksbyuser?order={{ util.toggleOrder('tasks') }}">Tasks</a> {{ util.sortImage('tasks') }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
#if $len($users) > 0
|
||||
#for $user in $users
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="userinfo?userID=$user.id">$user.name</a></td>
|
||||
<td width="#echo $graphWidth + 5#"><img src="$util.themePath('images/1px.gif')" width="#echo $increment * $user.tasks#" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>$user.tasks</td>
|
||||
#if (users |length) > 0
|
||||
#for user in users
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="userinfo?userID={{ user.id }}">{{ user.name }}</a></td>
|
||||
<td width="{{ graphWidth + 5 }}"><img src="{{ util.themePath('images/1px.gif') }}" width="{{ increment * user.tasks }}" height="15" class="graphrow" alt="graph row"/></td>
|
||||
<td>{{ user.tasks }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="3">No users</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($userPages) > 1
|
||||
#if (userPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'tasksbyuser?start=' + this.value * $userRange + '$util.passthrough($self, 'order')';">
|
||||
#for $pageNum in $userPages
|
||||
<option value="$pageNum"#if $pageNum == $userCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'tasksbyuser?start=' + this.value * {{ userRange }} + '{{ util.passthrough('order') }}';">
|
||||
#for pageNum in userPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == userCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userStart > 0
|
||||
<a href="tasksbyuser?start=#echo $userStart - $userRange #$util.passthrough($self, 'order')"><<<</a>
|
||||
#end if
|
||||
#if $totalUsers != 0
|
||||
<strong>Users #echo $userStart + 1 # through #echo $userStart + $userCount # of $totalUsers</strong>
|
||||
#end if
|
||||
#if $userStart + $userCount < $totalUsers
|
||||
<a href="tasksbyuser?start=#echo $userStart + $userRange#$util.passthrough($self, 'order')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userStart > 0
|
||||
<a href="tasksbyuser?start={{ userStart - userRange }}{{ util.passthrough('order') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUsers != 0
|
||||
<strong>Users {{ userStart + 1 }} through {{ userStart + userCount }} of {{ totalUsers }}</strong>
|
||||
#endif
|
||||
#if userStart + userCount < totalUsers
|
||||
<a href="tasksbyuser?start={{ userStart + userRange }}{{ util.passthrough('order') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,108 +1,107 @@
|
|||
#from kojiweb import util
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Information for user <a href="userinfo?userID=$user.id">$user.name</a></h4>
|
||||
<h4>Information for user <a href="userinfo?userID={{ user.id }}">{{ user.name }}</a></h4>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th><td>$user.name</td>
|
||||
<th>Name</th><td>{{ user.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>ID</th><td>$user.id</td>
|
||||
<th>ID</th><td>{{ user.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Tasks</th><td><a href="tasks?state=all$util.passthrough($self, 'owner')">$taskCount</a></td>
|
||||
<th>Tasks</th><td><a href="tasks?state=all{{ util.passthrough('owner') }}">{{ taskCount }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id="packagelist">Packages</th>
|
||||
<td class="container">
|
||||
#if $len($packages) > 0
|
||||
#if (packages |length) > 0
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($packagePages) > 1
|
||||
#if (packagePages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'userinfo?packageStart=' + this.value * $packageRange + '$util.passthrough($self, 'userID', 'packageOrder', 'buildOrder', 'buildStart')#packagelist';">
|
||||
#for $pageNum in $packagePages
|
||||
<option value="$pageNum"#if $pageNum == $packageCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'userinfo?packageStart=' + this.value * {{ packageRange }} + '{{ util.passthrough('userID', 'packageOrder', 'buildOrder', 'buildStart') }}#packagelist';">
|
||||
#for pageNum in packagePages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == packageCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $packageStart > 0
|
||||
<a href="userinfo?packageStart=#echo $packageStart - $packageRange #$util.passthrough($self, 'userID', 'packageOrder', 'buildOrder', 'buildStart')#packagelist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $packageStart + 1 # through #echo $packageStart + $packageCount # of $totalPackages</strong>
|
||||
#if $packageStart + $packageCount < $totalPackages
|
||||
<a href="userinfo?packageStart=#echo $packageStart + $packageRange#$util.passthrough($self, 'userID', 'packageOrder', 'buildOrder', 'buildStart')#packagelist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if packageStart > 0
|
||||
<a href="userinfo?packageStart={{ packageStart - packageRange }}{{ util.passthrough('userID', 'packageOrder', 'buildOrder', 'buildStart') }}#packagelist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ packageStart + 1 }} through {{ packageStart + packageCount }} of {{ totalPackages }}</strong>
|
||||
#if packageStart + packageCount < totalPackages
|
||||
<a href="userinfo?packageStart={{ packageStart + packageRange }}{{ util.passthrough('userID', 'packageOrder', 'buildOrder', 'buildStart') }}#packagelist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="userinfo?packageOrder=$util.toggleOrder($self, 'package_name', 'packageOrder')$util.passthrough($self, 'userID', 'buildOrder', 'buildStart')#packagelist">Name</a> $util.sortImage($self, 'package_name', 'packageOrder')</th>
|
||||
<th><a href="userinfo?packageOrder=$util.toggleOrder($self, 'tag_name', 'packageOrder')$util.passthrough($self, 'userID', 'buildOrder', 'buildStart')#packagelist">Tag</a> $util.sortImage($self, 'tag_name', 'packageOrder')</th>
|
||||
<th><a href="userinfo?packageOrder=$util.toggleOrder($self, 'blocked', 'packageOrder')$util.passthrough($self, 'userID', 'buildOrder', 'buildStart')#packagelist">Included?</a> $util.sortImage($self, 'blocked', 'packageOrder')</th>
|
||||
<th><a href="userinfo?packageOrder={{ util.toggleOrder('package_name', 'packageOrder') }}{{ util.passthrough('userID', 'buildOrder', 'buildStart') }}#packagelist">Name</a> {{ util.sortImage('package_name', 'packageOrder') }}</th>
|
||||
<th><a href="userinfo?packageOrder={{ util.toggleOrder('tag_name', 'packageOrder') }}{{ util.passthrough('userID', 'buildOrder', 'buildStart') }}#packagelist">Tag</a> {{ util.sortImage('tag_name', 'packageOrder') }}</th>
|
||||
<th><a href="userinfo?packageOrder={{ util.toggleOrder('blocked', 'packageOrder') }}{{ util.passthrough('userID', 'buildOrder', 'buildStart') }}#packagelist">Included?</a> {{ util.sortImage('blocked', 'packageOrder') }}</th>
|
||||
</tr>
|
||||
#for $package in $packages
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td><a href="packageinfo?packageID=$package.package_id">$package.package_name</a></td>
|
||||
<td><a href="taginfo?tagID=$package.tag_id">$package.tag_name</a></td>
|
||||
<td class="$str(not $package.blocked).lower()">#if $package.blocked then $util.imageTag('no') else $util.imageTag('yes')#</td>
|
||||
#for package in packages
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td><a href="packageinfo?packageID={{ package.package_id }}">{{ package.package_name }}</a></td>
|
||||
<td><a href="taginfo?tagID={{ package.tag_id }}">{{ package.tag_name }}</a></td>
|
||||
<td class="{{ package.blocked|lower }}">{{ util.imageTag('no') if package.blocked else util.imageTag('yes') }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No packages
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th id="buildlist">Builds</th>
|
||||
<td class="container">
|
||||
#if $len($builds) > 0
|
||||
#if (builds |length) > 0
|
||||
<table class="nested data-list">
|
||||
<tr>
|
||||
<td class="paginate" colspan="3">
|
||||
#if $len($buildPages) > 1
|
||||
#if (buildPages |length) > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'userinfo?buildStart=' + this.value * $buildRange + '$util.passthrough($self, 'userID', 'buildOrder', 'packageOrder', 'packageStart')#buildlist';">
|
||||
#for $pageNum in $buildPages
|
||||
<option value="$pageNum"#if $pageNum == $buildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'userinfo?buildStart=' + this.value * {{ buildRange }} + '{{ util.passthrough('userID', 'buildOrder', 'packageOrder', 'packageStart') }}#buildlist';">
|
||||
#for pageNum in buildPages
|
||||
<option value="{{ pageNum }}"{{ ' selected' if pageNum == buildCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $buildStart > 0
|
||||
<a href="userinfo?buildStart=#echo $buildStart - $buildRange #$util.passthrough($self, 'userID', 'buildOrder', 'packageOrder', 'packageStart')#buildlist"><<<</a>
|
||||
#end if
|
||||
<strong>#echo $buildStart + 1 # through #echo $buildStart + $buildCount # of $totalBuilds</strong>
|
||||
#if $buildStart + $buildCount < $totalBuilds
|
||||
<a href="userinfo?buildStart=#echo $buildStart + $buildRange#$util.passthrough($self, 'userID', 'buildOrder', 'packageOrder', 'packageStart')#buildlist">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if buildStart > 0
|
||||
<a href="userinfo?buildStart={{ buildStart - buildRange }}{{ util.passthrough('userID', 'buildOrder', 'packageOrder', 'packageStart') }}#buildlist"><<<</a>
|
||||
#endif
|
||||
<strong>{{ buildStart + 1 }} through {{ buildStart + buildCount }} of {{ totalBuilds }}</strong>
|
||||
#if buildStart + buildCount < totalBuilds
|
||||
<a href="userinfo?buildStart={{ buildStart + buildRange }}{{ util.passthrough('userID', 'buildOrder', 'packageOrder', 'packageStart') }}#buildlist">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="userinfo?buildOrder=$util.toggleOrder($self, 'nvr', 'buildOrder')$util.passthrough($self, 'userID', 'packageOrder', 'packageStart')#buildlist">NVR</a> $util.sortImage($self, 'nvr', 'buildOrder')</th>
|
||||
<th><a href="userinfo?buildOrder=$util.toggleOrder($self, 'completion_time', 'buildOrder')$util.passthrough($self, 'userID', 'packageOrder', 'packageStart')#buildlist">Finished</a> $util.sortImage($self, 'completion_time', 'buildOrder')</th>
|
||||
<th><a href="userinfo?buildOrder=$util.toggleOrder($self, 'state', 'buildOrder')$util.passthrough($self, 'userID', 'packageOrder', 'packageStart')#buildlist">State</a> $util.sortImage($self, 'state', 'buildOrder')</th>
|
||||
<th><a href="userinfo?buildOrder={{ util.toggleOrder('nvr', 'buildOrder') }}{{ util.passthrough('userID', 'packageOrder', 'packageStart') }}#buildlist">NVR</a> {{ util.sortImage('nvr', 'buildOrder') }}</th>
|
||||
<th><a href="userinfo?buildOrder={{ util.toggleOrder('completion_time', 'buildOrder') }}{{ util.passthrough('userID', 'packageOrder', 'packageStart') }}#buildlist">Finished</a> {{ util.sortImage('completion_time', 'buildOrder') }}</th>
|
||||
<th><a href="userinfo?buildOrder={{ util.toggleOrder('state', 'buildOrder') }}{{ util.passthrough('userID', 'packageOrder', 'packageStart') }}#buildlist">State</a> {{ util.sortImage('state', 'buildOrder') }}</th>
|
||||
</tr>
|
||||
#for $build in $builds
|
||||
<tr class="$util.rowToggle($self)">
|
||||
#set $stateName = $util.stateName($build.state)
|
||||
<td><a href="buildinfo?buildID=$build.build_id">$build.nvr</a></td>
|
||||
<td>$util.formatTime($build.completion_ts)</td>
|
||||
<td class="$stateName">$util.stateImage($build.state)</td>
|
||||
#for build in builds
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
#set stateName = util.stateName(build.state)
|
||||
<td><a href="buildinfo?buildID={{ build.build_id }}">{{ build.nvr }}</a></td>
|
||||
<td>{{ util.formatTime(build.completion_ts) }}</td>
|
||||
<td class="{{ stateName }}">{{ util.stateImage(build.state) }}</td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
</table>
|
||||
#else
|
||||
No builds
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -1,95 +1,93 @@
|
|||
#from kojiweb import util
|
||||
#from urllib.parse import quote
|
||||
|
||||
#include "includes/header.chtml"
|
||||
#include "includes/header2.chtml"
|
||||
|
||||
<h4>Users#if $prefix then ' starting with "%s"' % $prefix else ''#</h4>
|
||||
<h4>Users {{ ' starting with "%s"' % prefix if prefix else '' }}</h4>
|
||||
<table class="data-list">
|
||||
<tr>
|
||||
<td class="charlist" colspan="5">
|
||||
#for $char in $chars
|
||||
#if $prefix == $char
|
||||
<strong>$char</strong>
|
||||
#for char in chars
|
||||
#if prefix == char
|
||||
<strong>{{ char }}</strong>
|
||||
#else
|
||||
<a href="users?prefix=$char$util.passthrough($self, 'order')">$char</a>
|
||||
#end if
|
||||
<a href="users?prefix={{ char }}{{ util.passthrough('order') }}">{{ char }}</a>
|
||||
#endif
|
||||
|
|
||||
#end for
|
||||
#if $prefix
|
||||
<a href="users?${util.passthrough($self, 'order', prefix='')}">all</a>
|
||||
#endfor
|
||||
#if prefix
|
||||
<a href="users?{{ util.passthrough('order', prefix='') }}">all</a>
|
||||
#else
|
||||
<strong>all</strong>
|
||||
#end if
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paginate" colspan="5">
|
||||
#if $len($userPages) > 1
|
||||
#if userPages |length > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'users?start=' + this.value * $userRange + '$util.passthrough($self, 'order', 'prefix')';">
|
||||
#for $pageNum in $userPages
|
||||
<option value="$pageNum"#if $pageNum == $userCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'users?start=' + this.value * {{ userRange }} + '{{ util.passthrough('order', 'prefix') }}';">
|
||||
#for pageNum in userPages
|
||||
<option value="{{ pageNum }}"{{ 'selected' if pageNum == userCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userStart > 0
|
||||
<a href="users?start=#echo $userStart - $userRange #$util.passthrough($self, 'order', 'prefix')"><<<</a>
|
||||
#end if
|
||||
#if $totalUsers != 0
|
||||
<strong>Users #echo $userStart + 1 # through #echo $userStart + $userCount # of $totalUsers</strong>
|
||||
#end if
|
||||
#if $userStart + $userCount < $totalUsers
|
||||
<a href="users?start=#echo $userStart + $userRange#$util.passthrough($self, 'order', 'prefix')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userStart > 0
|
||||
<a href="users?start={{ userStart - userRange }}{{ util.passthrough('order', 'prefix') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUsers != 0
|
||||
<strong>Users {{ userStart + 1 }} through {{ userStart + userCount }} of {{ totalUsers }}</strong>
|
||||
#endif
|
||||
#if userStart + userCount < totalUsers
|
||||
<a href="users?start={{ userStart + userRange }}{{ util.passthrough('order', 'prefix') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-header">
|
||||
<th><a href="users?order=$util.toggleOrder($self, 'id')$util.passthrough($self, 'prefix')">ID</a> $util.sortImage($self, 'id')</th>
|
||||
<th><a href="users?order=$util.toggleOrder($self, 'name')$util.passthrough($self, 'prefix')">Name</a> $util.sortImage($self, 'name')</th>
|
||||
<th><a href="users?order={{ util.toggleOrder('id') }}{{ util.passthrough('prefix') }}">ID</a> {{ util.sortImage('id') }}</th>
|
||||
<th><a href="users?order={{ util.toggleOrder('name') }}{{ util.passthrough('prefix') }}">Name</a> {{ util.sortImage('name') }}</th>
|
||||
<th>Packages</th>
|
||||
<th>Builds</th>
|
||||
<th>Tasks</th>
|
||||
</tr>
|
||||
#if $len($users) > 0
|
||||
#for $user in $users
|
||||
<tr class="$util.rowToggle($self)">
|
||||
<td>$user.id</td>
|
||||
<td><a href="userinfo?userID=$quote($user.name)">$user.name</a></td>
|
||||
<td><a href="packages?userID=$quote($user.name)">view</a></td>
|
||||
<td><a href="builds?userID=$quote($user.name)">view</a></td>
|
||||
<td><a href="tasks?owner=$quote($user.name)">view</a></td>
|
||||
#if users |length > 0
|
||||
#for user in users
|
||||
<tr class="{{ util.rowToggle() }}">
|
||||
<td>{{ user.id }}</td>
|
||||
<td><a href="userinfo?userID={{ user.name }}">{{ user.name }}</a></td>
|
||||
<td><a href="packages?userID={{ user.name }}">view</a></td>
|
||||
<td><a href="builds?userID={{ user.name }}">view</a></td>
|
||||
<td><a href="tasks?owner={{ user.name }}">view</a></td>
|
||||
</tr>
|
||||
#end for
|
||||
#endfor
|
||||
#else
|
||||
<tr class="row-odd">
|
||||
<td colspan="5">No users</td>
|
||||
</tr>
|
||||
#end if
|
||||
#endif
|
||||
<tr>
|
||||
<td class="paginate" colspan="5">
|
||||
#if $len($userPages) > 1
|
||||
#if userPages |length > 1
|
||||
<form class="pageJump" action="">
|
||||
Page:
|
||||
<select onchange="javascript: window.location = 'users?start=' + this.value * $userRange + '$util.passthrough($self, 'order', 'prefix')';">
|
||||
#for $pageNum in $userPages
|
||||
<option value="$pageNum"#if $pageNum == $userCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
|
||||
#end for
|
||||
<select onchange="javascript: window.location = 'users?start=' + this.value * {{ userRange }} + '{{ util.passthrough('order', 'prefix') }}';">
|
||||
#for pageNum in userPages
|
||||
<option value="{{ pageNum }}"{{ 'selected' if pageNum == userCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
||||
#endfor
|
||||
</select>
|
||||
</form>
|
||||
#end if
|
||||
#if $userStart > 0
|
||||
<a href="users?start=#echo $userStart - $userRange #$util.passthrough($self, 'order', 'prefix')"><<<</a>
|
||||
#end if
|
||||
#if $totalUsers != 0
|
||||
<strong>Users #echo $userStart + 1 # through #echo $userStart + $userCount # of $totalUsers</strong>
|
||||
#end if
|
||||
#if $userStart + $userCount < $totalUsers
|
||||
<a href="users?start=#echo $userStart + $userRange#$util.passthrough($self, 'order', 'prefix')">>>></a>
|
||||
#end if
|
||||
#endif
|
||||
#if userStart > 0
|
||||
<a href="users?start={{ userStart - userRange }}{{ util.passthrough('order', 'prefix') }}"><<<</a>
|
||||
#endif
|
||||
#if totalUsers != 0
|
||||
<strong>Users {{ userStart + 1 }} through {{ userStart + userCount }} of {{ totalUsers }}</strong>
|
||||
#endif
|
||||
#if userStart + userCount < totalUsers
|
||||
<a href="users?start={{ userStart + userRange }}{{ util.passthrough('order', 'prefix') }}">>>></a>
|
||||
#endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#include "includes/footer.chtml"
|
||||
#include "includes/footer2.chtml"
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ class Dispatcher(object):
|
|||
self.options = opts
|
||||
return opts
|
||||
|
||||
def setup_logging2(self, environ):
|
||||
def setup_logging(self, environ):
|
||||
"""Adjust logging based on configuration options"""
|
||||
opts = self.options
|
||||
# determine log level
|
||||
|
|
@ -264,7 +264,7 @@ class Dispatcher(object):
|
|||
import index as kojiweb_handlers
|
||||
import kojiweb
|
||||
self.find_handlers()
|
||||
self.setup_logging2(environ)
|
||||
self.setup_logging(environ)
|
||||
koji.util.setup_rlimits(options)
|
||||
# TODO - plugins?
|
||||
|
||||
|
|
@ -343,7 +343,8 @@ class Dispatcher(object):
|
|||
# FIXME - we need a better fix for this
|
||||
environ['koji.values'].setdefault('mavenEnabled', False)
|
||||
environ['koji.values'].setdefault('winEnabled', False)
|
||||
result = _genHTML(environ, 'error.chtml')
|
||||
# import pdb; pdb.set_trace()
|
||||
result = _genHTML(environ, 'error.chtml', jinja=True)
|
||||
result = self._tobytes(result)
|
||||
headers = [
|
||||
('Allow', 'GET, POST, HEAD'),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
import datetime
|
||||
import hashlib
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import ssl
|
||||
import stat
|
||||
|
|
@ -32,12 +33,16 @@ from socket import error as socket_error
|
|||
from urllib.parse import parse_qs
|
||||
from xml.parsers.expat import ExpatError
|
||||
|
||||
import Cheetah.Template
|
||||
import jinja2
|
||||
from markupsafe import Markup
|
||||
|
||||
import koji
|
||||
import koji.tasks
|
||||
from koji_cli.lib import greetings
|
||||
from koji.xmlrpcplus import xmlrpc_client
|
||||
|
||||
from . import util as this_module
|
||||
|
||||
|
||||
themeInfo = {}
|
||||
themeCache = {}
|
||||
|
|
@ -53,14 +58,41 @@ def _initValues(environ, title='Build System Info', pageID='summary'):
|
|||
values['siteName'] = environ['koji.options'].get('SiteName', 'Koji')
|
||||
values['title'] = title
|
||||
values['pageID'] = pageID
|
||||
values['currentDate'] = str(datetime.datetime.now())
|
||||
now = datetime.datetime.now()
|
||||
values['currentDate'] = str(now)
|
||||
values['date_str'] = koji.formatTimeLong(now)
|
||||
values['literalFooter'] = environ['koji.options'].get('LiteralFooter', True)
|
||||
values['terms'] = ''
|
||||
|
||||
# ???
|
||||
values['themePath'] = themePath
|
||||
values['toggleOrder'] = toggleOrder
|
||||
values['toggleSelected'] = toggleSelected
|
||||
values['rowToggle'] = rowToggle
|
||||
values['sortImage'] = sortImage
|
||||
values['passthrough'] = passthrough
|
||||
values['passthrough_except'] = passthrough_except
|
||||
values['authToken'] = authToken
|
||||
values['util'] = this_module
|
||||
|
||||
themeCache.clear()
|
||||
themeInfo.clear()
|
||||
themeInfo['name'] = environ['koji.options'].get('KojiTheme', None)
|
||||
themeInfo['staticdir'] = environ['koji.options'].get('KojiStaticDir',
|
||||
'/usr/share/koji-web/static')
|
||||
# maybe this part belongs elsewhere??
|
||||
values['localnav'] = ''
|
||||
values['localfooter'] = ''
|
||||
values['localbottom'] = ''
|
||||
localnavpath = themePath('extra-nav.html', local=True)
|
||||
if os.path.exists(localnavpath):
|
||||
values['localnav'] = SafeValue("".join(open(localnavpath, 'rt', encoding='utf-8').readlines()))
|
||||
localfooterpath = themePath("extra-footer.html", local=True)
|
||||
if os.path.exists(localfooterpath):
|
||||
values['localfooter'] = SafeValue("".join(open(localfooterpath, 'rt', encoding='utf-8').readlines()))
|
||||
localbottompath = themePath("extra-bottom.html", local=True)
|
||||
if os.path.exists(localbottompath):
|
||||
values['localbottom'] = SafeValue("".join(open(localbottompath, 'rt', encoding='utf-8').readlines()))
|
||||
|
||||
environ['koji.values'] = values
|
||||
|
||||
|
|
@ -94,44 +126,9 @@ def themePath(path, local=False):
|
|||
return ret
|
||||
|
||||
|
||||
class EscapeFilter(Cheetah.Filters.Filter):
|
||||
def filter(self, val, *args, **kw):
|
||||
"""Apply html escaping to most values"""
|
||||
if isinstance(val, SafeValue):
|
||||
result = str(val.value)
|
||||
else:
|
||||
result = escapeHTML(val)
|
||||
return result
|
||||
|
||||
|
||||
class SafeValue:
|
||||
|
||||
def __init__(self, value):
|
||||
if isinstance(value, SafeValue):
|
||||
self.value = value.value
|
||||
else:
|
||||
self.value = value
|
||||
|
||||
def __str__(self):
|
||||
return str(self.value)
|
||||
|
||||
def __repr__(self):
|
||||
return "SafeValue(%r)" % self.value
|
||||
|
||||
def __add__(self, other):
|
||||
if not isinstance(other, SafeValue):
|
||||
raise ValueError('Adding safe and nonsafe value')
|
||||
return SafeValue(self.value + other.value)
|
||||
|
||||
def __iadd__(self, other):
|
||||
if not isinstance(other, SafeValue):
|
||||
raise ValueError('Adding safe and nonsafe value')
|
||||
self.value += other.value
|
||||
return self
|
||||
|
||||
def __len__(self):
|
||||
# mainly needed for boolean evaluation in templates
|
||||
return len(self.value)
|
||||
# previously we had a custom SafeValue class here, but the Markup class does the same thing better
|
||||
def SafeValue(value):
|
||||
return Markup(value)
|
||||
|
||||
|
||||
def safe_return(func):
|
||||
|
|
@ -144,13 +141,14 @@ def safe_return(func):
|
|||
TEMPLATES = {}
|
||||
|
||||
|
||||
def _genHTML(environ, fileName):
|
||||
def _genHTML(environ, fileName, jinja=True):
|
||||
reqdir = os.path.dirname(environ['SCRIPT_FILENAME'])
|
||||
if os.getcwd() != reqdir:
|
||||
os.chdir(reqdir)
|
||||
|
||||
if 'koji.currentUser' in environ:
|
||||
environ['koji.values']['currentUser'] = environ['koji.currentUser']
|
||||
environ['koji.values']['greeting'] = random.choice(greetings)
|
||||
else:
|
||||
environ['koji.values']['currentUser'] = None
|
||||
environ['koji.values']['authToken'] = _genToken(environ)
|
||||
|
|
@ -170,12 +168,18 @@ def _genHTML(environ, fileName):
|
|||
else:
|
||||
environ['koji.values']['LoginDisabled'] = False
|
||||
|
||||
tmpl_class = TEMPLATES.get(fileName)
|
||||
if not tmpl_class:
|
||||
tmpl_class = Cheetah.Template.Template.compile(file=fileName)
|
||||
TEMPLATES[fileName] = tmpl_class
|
||||
tmpl_inst = tmpl_class(namespaces=[environ['koji.values']], filter=EscapeFilter)
|
||||
return tmpl_inst.respond()
|
||||
if jinja:
|
||||
# TODO clean up and optimize
|
||||
env = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader(reqdir),
|
||||
autoescape=True,
|
||||
line_statement_prefix='#', # for ease of porting Cheetah templates
|
||||
line_comment_prefix='##'
|
||||
)
|
||||
template = env.get_template(fileName)
|
||||
return template.render(**environ['koji.values'])
|
||||
else:
|
||||
raise NotImplementedError('no more Cheetah')
|
||||
|
||||
|
||||
def _truncTime():
|
||||
|
|
@ -261,26 +265,40 @@ class FieldCompat:
|
|||
self.value = value
|
||||
|
||||
|
||||
def toggleOrder(template, sortKey, orderVar='order'):
|
||||
@jinja2.pass_context
|
||||
def toggleOrder(context, sortKey, orderVar='order'):
|
||||
"""Toggle order for jinja templates"""
|
||||
value = context.get(orderVar)
|
||||
return _toggleOrder(value, sortKey, orderVar)
|
||||
|
||||
|
||||
def _toggleOrder(value, sortKey, orderVar):
|
||||
"""
|
||||
If orderVar equals 'sortKey', return '-sortKey', else
|
||||
return 'sortKey'.
|
||||
"""
|
||||
if template.getVar(orderVar) == sortKey:
|
||||
if value == sortKey:
|
||||
return '-' + sortKey
|
||||
elif value == '-' + sortKey:
|
||||
return sortKey
|
||||
elif sortKey == 'id':
|
||||
# sort ids reversed first
|
||||
return '-id'
|
||||
else:
|
||||
return sortKey
|
||||
|
||||
|
||||
@safe_return # avoid escaping quotes
|
||||
def toggleSelected(template, var, option, checked=False):
|
||||
def toggleSelected(var, option, checked=False):
|
||||
"""
|
||||
If the passed in variable var equals the literal value in option,
|
||||
return 'selected="selected"', otherwise return ''. If checked is True,
|
||||
'"checked="checked"' string is returned
|
||||
Used for setting the selected option in select and radio boxes.
|
||||
"""
|
||||
if var == option:
|
||||
# "var" arg is a misnomer. We expect a value to compare
|
||||
value = var
|
||||
if value == option:
|
||||
if checked:
|
||||
return 'checked="checked"'
|
||||
else:
|
||||
|
|
@ -290,12 +308,18 @@ def toggleSelected(template, var, option, checked=False):
|
|||
|
||||
|
||||
@safe_return
|
||||
def sortImage(template, sortKey, orderVar='order'):
|
||||
@jinja2.pass_context
|
||||
def sortImage(context, sortKey, orderVar='order'):
|
||||
"""jinja version"""
|
||||
orderVal = context.get(orderVar)
|
||||
return _sortImage(orderVal, sortKey, orderVar)
|
||||
|
||||
|
||||
def _sortImage(orderVal, sortKey, orderVar):
|
||||
"""
|
||||
Return an html img tag suitable for inclusion in the sortKey of a sortable table,
|
||||
if the sortValue is "sortKey" or "-sortKey".
|
||||
"""
|
||||
orderVal = template.getVar(orderVar)
|
||||
if orderVal == sortKey:
|
||||
return '<img src="%s" class="sort" alt="ascending sort"/>' % \
|
||||
themePath("images/gray-triangle-up.gif")
|
||||
|
|
@ -307,7 +331,18 @@ def sortImage(template, sortKey, orderVar='order'):
|
|||
|
||||
|
||||
@safe_return
|
||||
def passthrough(template, *vars, prefix='&'):
|
||||
@jinja2.pass_context
|
||||
def passthrough(context, *varnames, prefix='&', invert=False):
|
||||
if invert:
|
||||
_PASSTHROUGH = context.get('_PASSTHROUGH', None)
|
||||
if _PASSTHROUGH is None:
|
||||
raise Exception('template does not define _PASSTHROUGH')
|
||||
varnames = {n for n in _PASSTHROUGH if n not in varnames}
|
||||
data = {n: context.get(n, default=None) for n in varnames}
|
||||
return _passthrough(data, prefix)
|
||||
|
||||
|
||||
def _passthrough(data, prefix='&'):
|
||||
"""
|
||||
Construct a url parameter string from template vars
|
||||
|
||||
|
|
@ -322,8 +357,8 @@ def passthrough(template, *vars, prefix='&'):
|
|||
The prefix value (default '&') is prepended if any values were found
|
||||
"""
|
||||
result = []
|
||||
for var in vars:
|
||||
value = template.getVar(var, default=None)
|
||||
for var in data:
|
||||
value = data[var]
|
||||
if value is not None:
|
||||
if isinstance(value, str):
|
||||
if value.isdigit():
|
||||
|
|
@ -339,7 +374,8 @@ def passthrough(template, *vars, prefix='&'):
|
|||
return ''
|
||||
|
||||
|
||||
def passthrough_except(template, *exclude, prefix='&'):
|
||||
@jinja2.pass_context
|
||||
def passthrough_except(context, *exclude, prefix='&'):
|
||||
"""
|
||||
Construct a string suitable for use as URL
|
||||
parameters. The template calling this method must have
|
||||
|
|
@ -349,11 +385,9 @@ def passthrough_except(template, *exclude, prefix='&'):
|
|||
Any variables names passed in will be excluded from the
|
||||
list of variables in the output string.
|
||||
"""
|
||||
passvars = []
|
||||
for var in template._PASSTHROUGH:
|
||||
if var not in exclude:
|
||||
passvars.append(var)
|
||||
return passthrough(template, *passvars, prefix=prefix)
|
||||
# note that we have to pass context ourselves here
|
||||
# the decorator only works when called directly from the template
|
||||
return passthrough(context, *exclude, prefix='&', invert=True)
|
||||
|
||||
|
||||
def sortByKeyFuncNoneGreatest(key):
|
||||
|
|
@ -685,14 +719,16 @@ def formatRPM(rpminfo, link=True):
|
|||
return label
|
||||
|
||||
|
||||
def rowToggle(template):
|
||||
"""If the value of template._rowNum is even, return 'row-even';
|
||||
if it is odd, return 'row-odd'. Increment the value before checking it.
|
||||
If the template does not have that value, set it to 0."""
|
||||
if not hasattr(template, '_rowNum'):
|
||||
template._rowNum = 0
|
||||
template._rowNum += 1
|
||||
if template._rowNum % 2:
|
||||
@jinja2.pass_context
|
||||
def rowToggle(context):
|
||||
# XXX avoid modifying context
|
||||
rowNum = getattr(context, '_rowNum', 0) + 1
|
||||
context._rowNum = rowNum
|
||||
return _rowToggle(rowNum)
|
||||
|
||||
|
||||
def _rowToggle(rowNum):
|
||||
if rowNum % 2:
|
||||
return 'row-odd'
|
||||
else:
|
||||
return 'row-even'
|
||||
|
|
@ -748,8 +784,8 @@ def escapeHTML(value):
|
|||
" : "
|
||||
' : '
|
||||
"""
|
||||
if isinstance(value, SafeValue):
|
||||
return value.value
|
||||
if isinstance(value, Markup):
|
||||
return str(value)
|
||||
if not value:
|
||||
return str(value)
|
||||
|
||||
|
|
@ -762,13 +798,18 @@ def escapeHTML(value):
|
|||
|
||||
|
||||
@safe_return
|
||||
def authToken(template, first=False, form=False):
|
||||
@jinja2.pass_context
|
||||
def authToken(context, first=False, form=False):
|
||||
token = context.get('authToken', None)
|
||||
return _authToken(token, first, form)
|
||||
|
||||
|
||||
def _authToken(token, first, form):
|
||||
"""Return the current authToken if it exists.
|
||||
If form is True, return it enclosed in a hidden input field.
|
||||
Otherwise, return it in a format suitable for appending to a URL.
|
||||
If first is True, prefix it with ?, otherwise prefix it
|
||||
with &. If no authToken exists, return an empty string."""
|
||||
token = template.getVar('authToken', default=None)
|
||||
if token is not None:
|
||||
token = escapeHTML(token)
|
||||
if form:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue