-# Copyright (C) 2009-2012 Chris Ball <cjb@laptop.org>
+# Copyright (C) 2005-2012 Aaron Bentley <abentley@panoramicfeedback.com>
+# Chris Ball <cjb@laptop.org>
# Gianluca Montecchi <gian@grys.it>
+# Marien Zwart <marien.zwart@gmail.com>
# Mathieu Clabaut <mathieu.clabaut@gmail.com>
-# W. Trevor King <wking@drexel.edu>
+# Thomas Gerigk <tgerigk@gmx.de>
+# W. Trevor King <wking@tremily.us>
#
# This file is part of Bugs Everywhere.
#
import libbe
import libbe.command
import libbe.command.depend
+import libbe.command.target
import libbe.command.util
import libbe.comment
import libbe.util.encoding
self.strip_email = strip_email
self.generation_time = generation_time
self._refresh = 0
- self.http_user_error = 418
self._load_templates(template_dir=template_dir)
self._filters = {
'active': lambda bug: bug.active and bug.severity != 'target',
index_type = 'active'
else:
index_type = 'inactive'
+ target = libbe.command.target.bug_target(self.bugdirs, bug)
+ if target == bug: # e.g. when bug.severity == 'target'
+ target = None
up_link = '../../{}?type={}'.format(self._index_file, index_type)
bug.load_comments(load_full=True)
bug.comment_root.sort(cmp=libbe.comment.cmp_time, reverse=True)
'index_type': index_type.capitalize(),
'index_file': self._index_file,
'bug': bug,
+ 'target': target,
'comment_entry': self.template.get_template(
'bug_comment_entry.html'),
'comments': [(depth,comment) for depth,comment
in bug.comment_root.thread(flatten=False)],
+ 'bug_dir': self.bug_dir,
'comment_dir': self._truncated_comment_id,
'format_body': self._format_comment_body,
'div_close': _DivCloser(),
padding-top: 0;
margin-top: 1em;
background-color: #fcfcfc;
- -moz-border-radius: 10px;
+ border-radius: 10px;
}
margin: auto;
background: #305275;
color: #fffee7;
- -moz-border-radius: 10px;
+ border-radius: 10px;
}
div.header {
padding-bottom: 10px;
background: #305275;
color: #fffee7;
- -moz-border-radius: 10px;
+ border-radius: 10px;
}
th.target_name {
background-color: #305275;
color: #fff;
width: auto;
- -moz-border-radius-topleft: 8px;
- -moz-border-radius-topright: 8px;
+ border-top-left-radius: 8px;
+ border-top-right-radius: 8px;
padding-left: 5px;
padding-right: 5px;
}
background-color: #c3d9ff ;
border: 1px solid #c3d9ff;
font-weight:bold;
- -moz-border-radius-topleft: 15px;
- -moz-border-radius-topright: 15px;
+ border-top-left-radius: 15px;
+ border-top-right-radius: 15px;
}
td.nsel.tab {
border: 1px solid #c3d9ff;
font-weight:bold;
- -moz-border-radius-topleft: 5px;
- -moz-border-radius-topright: 5px;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
}
table.bug_list {
<td class="bug_detail">{{ strip_email(bug.creator or '')|e }}</td></tr>
<tr><td class="bug_detail_label">Created :</td>
<td class="bug_detail">{{ (bug.time_string or '')|e }}</td></tr>
+{% if target %}
+ <tr><td class="bug_detail_label">Target :</td>
+ <td class="bug_detail"><a href="../../{{ bug_dir(target) }}/{{ index_file }}">{{ target.summary }}</a></td></tr>
+{% endif %}
<tr><td class="bug_detail_label">Summary :</td>
<td class="bug_detail">{{ bug.summary|e }}</td></tr>
</tbody>
{% if comments %}
{% for depth,comment in comments %}
+{{ div_close(depth) }}
{% if depth == 0 %}
<div class="comment root" id="C{{ comment_dir(comment) }}">
{% else %}
'depth':depth, 'bug': bug, 'comment':comment, 'comment_dir':comment_dir,
'format_body': format_body, 'div_close': div_close,
'strip_email': strip_email}) }}
-{{ div_close(depth) }}
{% endfor %}
-{% if comments[-1][0] > 0 %}
{{ div_close(0) }}
-{% endif %}
{% else %}
<p>No comments.</p>
{% endif %}
name='template-dir', metavar='DIR',
completion_callback=libbe.command.util.complete_path)),
libbe.command.Option(name='title',
- help='Set the bug repository title (%default)',
+ help='Set the bug repository title',
arg=libbe.command.Argument(
name='title', metavar='STRING',
default='Bugs Everywhere Issue Tracker')),
libbe.command.Option(name='index-header',
- help='Set the index page headers (%default)',
+ help='Set the index page headers',
arg=libbe.command.Argument(
name='index-header', metavar='STRING',
default='Bugs Everywhere Bug List')),
libbe.command.Option(name='min-id-length', short_name='l',
help=('Attempt to truncate bug and comment IDs to this '
- 'length. Set to -1 for non-truncated IDs '
- '(%default)'),
+ 'length. Set to -1 for non-truncated IDs'),
arg=libbe.command.Argument(
name='min-id-length', metavar='INT',
default=-1, type='int')),
libbe.command.Option(name='export-html', short_name='e',
help='Export all HTML pages and exit.'),
libbe.command.Option(name='output', short_name='o',
- help='Set the output path for HTML export (%default)',
+ help='Set the output path for HTML export',
arg=libbe.command.Argument(
name='output', metavar='DIR', default='./html_export',
completion_callback=libbe.command.util.complete_path)),
libbe.command.Option(name='export-template', short_name='E',
help='Export the default template and exit.'),
libbe.command.Option(name='export-template-dir', short_name='d',
- help='Set the directory for the template export (%default)',
+ help='Set the directory for the template export',
arg=libbe.command.Argument(
name='export-template-dir', metavar='DIR',
default='./default-templates/',
class _DivCloser (object):
- def __init__(self, depth=0):
+ def __init__(self, depth=-1):
self.depth = depth
def __call__(self, depth):