Mailing List Archive

Small issues with ticket previewing (with patches)
Hello,

After several month of lurking on this list, I finally crossed the line
and installed my first trac server.
I downloaded all the latest auxiliary packages, rebuilt everything, and
all was fine
(the few errors I came with were quickly corrected with the help of the
material found
on the trac web site).

However, I noticed two small issues while creating a new ticket:
* clicking on preview properly reloads the form data, except for the
'''Keywords''' field
* if an error occurs while processing Wiki text, the error is
displayed in the output, but is not enough highlighted and is easy to miss

The first issue was trivially fixed:
{{{
Index: templates/newticket.cs
===================================================================
--- templates/newticket.cs (revision 923)
+++ templates/newticket.cs (working copy)
@@ -51,7 +51,7 @@
<br />
<label for="keywords">Keywords:</label>
<input type="text" id="keywords" name="keywords" size="20"
- value="<?cs var:ticket.keywords ?>" />
+ value="<?cs var:newticket.keywords ?>" />
</div>
<div class="col2">
<label for="priority">Priority:</label><?cs
}}}

The second was fixed by changing the {{{error}}} class to the
{{{system-message}}} class.
I'm not sure if this is the right fix, though. Certainly the intent was
that the .error class should behave
as the div.system-message, but I'm not savvy enough in CSS to fix
trac.css itself.

{{{
Index: trac/WikiFormatter.py
===================================================================
--- trac/WikiFormatter.py (revision 923)
+++ trac/WikiFormatter.py (working copy)
@@ -290,7 +290,7 @@
def html_processor(hdf, text, env):
if Formatter._htmlproc_disallow_rule.search(text):
err = """\
-<div class="error">Error: HTML block contains disallowed tags.
+<div class="system-message">Error: HTML block contains disallowed tags.
<pre>
%s</pre>
</div>""" % util.escape(text)
@@ -334,7 +334,7 @@
macro = self.load_macro(name)
return macro(self.hdf, args, self.env)
except Exception, e:
- return '<span class="error">Macro %s(%s) failed: %s</span' \
+ return '<div class="system-message">Macro %s(%s) failed:
%s</div>' \
% (name, args, e)

def _heading_formatter(self, match, fullmatch):
@@ -500,7 +500,7 @@
else:
self.code_text += line + os.linesep
self.code_processor =
Formatter.builtin_processors['default']
- self.out.write('<div class="error">Failed
to load processor macro %s: %s t %s</div>' % (name, line, e))
+ self.out.write('<div
class="system-message">Failed to load processor macro %s: %s t %s</div>'
% (name, line, e))
else:
self.code_text += line + os.linesep
self.code_processor =
Formatter.builtin_processors['default']
}}}

... ah, and I nearly forgot: ''Thank you for this amazingly good piece
of software!''
I hope I will be able to contribute usefully (I have to learn Python
first...).

-- chris
-- Christian Boos
-- Consulting Software Engineer at BCT Technology AG, Germany (but hey,
I'm French :)
Small issues with ticket previewing (with patches) [ In reply to ]
Hi Christian,

Am 23.09.2004 um 13:24 schrieb Christian Boos:
> However, I noticed two small issues while creating a new ticket:
> * clicking on preview properly reloads the form data, except for the
> '''Keywords''' field
> * if an error occurs while processing Wiki text, the error is
> displayed in the output, but is not enough highlighted and is easy to
> miss

The fixes looked good (to me at least). I've just checked them in:
<http://projects.edgewall.com/trac/changeset/926>
Thanks!

--
Christopher Lenz
/=/ cmlenz at gmx.de