Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/api.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/api.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/api.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/api.py Sat Nov 15 01:14:46 2014 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C)2006-2009 Edgewall Software +# Copyright (C) 2006-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which @@ -14,8 +14,8 @@ import doctest import unittest from StringIO import StringIO -import sys +import trac.tests.compat from trac.core import * from trac.test import EnvironmentStub from trac.mimeview import api @@ -112,22 +112,22 @@ class GroupLinesTestCase(unittest.TestCa def test_text_only_stream(self): input = [(TEXT, "test", (None, -1, -1))] lines = list(_group_lines(input)) - self.assertEquals(len(lines), 1) - self.assertTrue(isinstance(lines[0], Stream)) - self.assertEquals(lines[0].events, input) + self.assertEqual(len(lines), 1) + self.assertIsInstance(lines[0], Stream) + self.assertEqual(lines[0].events, input) def test_text_only_stream2(self): input = [(TEXT, "test\n", (None, -1, -1))] lines = list(_group_lines(input)) - self.assertEquals(len(lines), 1) - self.assertTrue(isinstance(lines[0], Stream)) - self.assertEquals(lines[0].events, [(TEXT, "test", (None, -1, -1))]) + self.assertEqual(len(lines), 1) + self.assertIsInstance(lines[0], Stream) + self.assertEqual(lines[0].events, [(TEXT, "test", (None, -1, -1))]) def test_simplespan(self): input = HTMLParser(StringIO(u"<span>test</span>"), encoding=None) lines = list(_group_lines(input)) - self.assertEquals(len(lines), 1) - self.assertTrue(isinstance(lines[0], Stream)) + self.assertEqual(len(lines), 1) + self.assertIsInstance(lines[0], Stream) for (a, b) in zip(lines[0], input): self.assertEqual(a, b) @@ -137,17 +137,17 @@ class GroupLinesTestCase(unittest.TestCa """ input = [(TEXT, "", (None, -1, -1))] lines = list(_group_lines(input)) - self.assertEquals(len(lines), 0) + self.assertEqual(len(lines), 0) def test_newline_stream(self): input = [(TEXT, "\n", (None, -1, -1))] lines = list(_group_lines(input)) - self.assertEquals(len(lines), 1) + self.assertEqual(len(lines), 1) def test_newline_stream2(self): input = [(TEXT, "\n\n\n", (None, -1, -1))] lines = list(_group_lines(input)) - self.assertEquals(len(lines), 3) + self.assertEqual(len(lines), 3) def test_empty_text_in_span(self): """ @@ -172,9 +172,9 @@ class GroupLinesTestCase(unittest.TestCa '<span class="c">b</span>', ] lines = list(_group_lines(input)) - self.assertEquals(len(lines), len(expected)) + self.assertEqual(len(lines), len(expected)) for a, b in zip(lines, expected): - self.assertEquals(a.render('html'), b) + self.assertEqual(a.render('html'), b) def test_newline2(self): """ @@ -187,9 +187,9 @@ class GroupLinesTestCase(unittest.TestCa '<span class="c">b</span>', ] lines = list(_group_lines(input)) - self.assertEquals(len(lines), len(expected)) + self.assertEqual(len(lines), len(expected)) for a, b in zip(lines, expected): - self.assertEquals(a.render('html'), b) + self.assertEqual(a.render('html'), b) def test_multinewline(self): """ @@ -203,17 +203,17 @@ class GroupLinesTestCase(unittest.TestCa '<span class="c">a</span>', ] lines = list(_group_lines(input)) - self.assertEquals(len(lines), len(expected)) + self.assertEqual(len(lines), len(expected)) for a, b in zip(lines, expected): - self.assertEquals(a.render('html'), b) + self.assertEqual(a.render('html'), b) def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(api)) - suite.addTest(unittest.makeSuite(GetMimeTypeTestCase, 'test')) - suite.addTest(unittest.makeSuite(MimeviewTestCase, 'test')) - suite.addTest(unittest.makeSuite(GroupLinesTestCase, 'test')) + suite.addTest(unittest.makeSuite(GetMimeTypeTestCase)) + suite.addTest(unittest.makeSuite(MimeviewTestCase)) + suite.addTest(unittest.makeSuite(GroupLinesTestCase)) return suite if __name__ == '__main__':
Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.html Sat Nov 15 01:14:46 2014 @@ -36,26 +36,26 @@ </thead> <tbody class="unmod"> <tr> - <th>1</th><th>1</th><td class="l"><span>----</span>Â </td> + <th>1</th><th>1</th><td class="l"><span>----</span></td> </tr> </tbody><tbody class="mod"> <tr class="first"> - <th>2</th><th>Â </th><td class="l"><span>b<del>as</del>e</span>Â </td> + <th>2</th><th>Â </th><td class="l"><span>b<del>as</del>e</span></td> </tr><tr> - <th>3</th><th>Â </th><td class="l"><span><del></del>base</span>Â </td> + <th>3</th><th>Â </th><td class="l"><span><del></del>base</span></td> </tr><tr> - <th>4</th><th>Â </th><td class="l"><span>base<del></del></span>Â </td> + <th>4</th><th>Â </th><td class="l"><span>base<del></del></span></td> </tr> <tr> - <th>Â </th><th>2</th><td class="r"><span>b<ins></ins>e</span>Â </td> + <th>Â </th><th>2</th><td class="r"><span>b<ins></ins>e</span></td> </tr><tr> - <th>Â </th><th>3</th><td class="r"><span><ins>the </ins>base</span>Â </td> + <th>Â </th><th>3</th><td class="r"><span><ins>the </ins>base</span></td> </tr><tr class="last"> - <th>Â </th><th>4</th><td class="r"><span>base<ins>Â modified</ins></span>Â </td> + <th>Â </th><th>4</th><td class="r"><span>base<ins>Â modified</ins></span></td> </tr> </tbody><tbody class="unmod"> <tr> - <th>5</th><th>5</th><td class="l"><span>.</span>Â </td> + <th>5</th><th>5</th><td class="l"><span>.</span></td> </tr> </tbody> </table> @@ -88,12 +88,12 @@ </thead> <tbody class="mod"> <tr class="first"> - <th>1</th><th> </th><td class="l"><span>ONELINE</span> </td> + <th>1</th><th> </th><td class="l"><span>ONELINE</span></td> </tr><tr> - <th>2</th><th> </th><td class="l"><span><em> No newline at end of file</em></span> </td> + <th>2</th><th> </th><td class="l"><span><em> No newline at end of file</em></span></td> </tr> <tr class="last"> - <th> </th><th>1</th><td class="r"><span>ONELINE</span> </td> + <th> </th><th>1</th><td class="r"><span>ONELINE</span></td> </tr> </tbody> </table> @@ -126,12 +126,12 @@ </thead> <tbody class="mod"> <tr class="first"> - <th>1</th><th>Â </th><td class="l"><span>ONELINE</span>Â </td> + <th>1</th><th>Â </th><td class="l"><span>ONELINE</span></td> </tr> <tr> - <th>Â </th><th>1</th><td class="r"><span>ONELINE</span>Â </td> + <th>Â </th><th>1</th><td class="r"><span>ONELINE</span></td> </tr><tr class="last"> - <th>Â </th><th>2</th><td class="r"><span><em> No newline at end of file</em></span>Â </td> + <th>Â </th><th>2</th><td class="r"><span><em> No newline at end of file</em></span></td> </tr> </tbody> </table> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/patch.py Sat Nov 15 01:14:46 2014 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C)2006-2009 Edgewall Software +# Copyright (C) 2006-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which @@ -17,7 +17,7 @@ import unittest from genshi.core import Stream from genshi.input import HTMLParser, XML -from trac.mimeview.api import Mimeview, RenderingContext +from trac.mimeview.api import Mimeview from trac.mimeview.patch import PatchRenderer from trac.test import EnvironmentStub, Mock, MockPerm from trac.web.chrome import Chrome, web_context @@ -45,8 +45,8 @@ class PatchRendererTestCase(unittest.Tes result = XML(result.render(encoding='utf-8')).render(encoding='utf-8') expected, result = expected.splitlines(), result.splitlines() for exp, res in zip(expected, result): - self.assertEquals(exp, res) - self.assertEquals(len(expected), len(result)) + self.assertEqual(exp, res) + self.assertEqual(len(expected), len(result)) def test_simple(self): """ @@ -105,10 +105,10 @@ class PatchRendererTestCase(unittest.Tes '@@ -1 +1 @@', '-aa\tb', '+aaxb'], 8) - self.assertEquals('aa<del> </del>b', - str(changes[0]['diffs'][0][0]['base']['lines'][0])) - self.assertEquals('aa<ins>x</ins>b', - str(changes[0]['diffs'][0][0]['changed']['lines'][0])) + self.assertEqual('aa<del> </del>b', + str(changes[0]['diffs'][0][0]['base']['lines'][0])) + self.assertEqual('aa<ins>x</ins>b', + str(changes[0]['diffs'][0][0]['changed']['lines'][0])) def test_diff_to_hdf_leading_ws(self): """Regression test related to #5795""" @@ -118,14 +118,14 @@ class PatchRendererTestCase(unittest.Tes '@@ -1 +1 @@', '-*a', '+ *a'], 8) - self.assertEquals('<del></del>*a', - str(changes[0]['diffs'][0][0]['base']['lines'][0])) - self.assertEquals('<ins> </ins>*a', - str(changes[0]['diffs'][0][0]['changed']['lines'][0])) + self.assertEqual('<del></del>*a', + str(changes[0]['diffs'][0][0]['base']['lines'][0])) + self.assertEqual('<ins> </ins>*a', + str(changes[0]['diffs'][0][0]['changed']['lines'][0])) def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(PatchRendererTestCase, 'test')) + suite.addTest(unittest.makeSuite(PatchRendererTestCase)) return suite if __name__ == '__main__': Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/pygments.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/pygments.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/pygments.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/mimeview/tests/pygments.py Sat Nov 15 01:14:46 2014 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2006-2009 Edgewall Software +# Copyright (C) 2006-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which @@ -23,7 +23,8 @@ try: except ImportError: have_pygments = False -from trac.mimeview.api import Mimeview, RenderingContext +import trac.tests.compat +from trac.mimeview.api import Mimeview if have_pygments: from trac.mimeview.pygments import PygmentsRenderer from trac.test import EnvironmentStub, Mock @@ -56,8 +57,8 @@ class PygmentsRendererTestCase(unittest. #print "\nR: " + repr(result) expected, result = expected.splitlines(), result.splitlines() for exp, res in zip(expected, result): - self.assertEquals(exp, res) - self.assertEquals(len(expected), len(result)) + self.assertEqual(exp, res) + self.assertEqual(len(expected), len(result)) def test_python_hello(self): """ @@ -108,7 +109,7 @@ def hello(): pygments when rendering empty files. """ result = self.pygments.render(self.context, 'text/x-python', '') - self.assertEqual(None, result) + self.assertIsNone(result) def test_extra_mimetypes(self): """ @@ -126,7 +127,7 @@ def hello(): def suite(): suite = unittest.TestSuite() if have_pygments: - suite.addTest(unittest.makeSuite(PygmentsRendererTestCase, 'test')) + suite.addTest(unittest.makeSuite(PygmentsRendererTestCase)) else: print 'SKIP: mimeview/tests/pygments (no pygments installed)' return suite Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/notification.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/notification.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/notification.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/notification.py Sat Nov 15 01:14:46 2014 @@ -22,11 +22,13 @@ import time from genshi.builder import tag from trac import __version__ -from trac.config import BoolOption, ExtensionOption, IntOption, Option +from trac.config import BoolOption, ConfigurationError, ExtensionOption, \ + IntOption, Option from trac.core import * from trac.util.compat import close_fds -from trac.util.text import CRLF, fix_eol -from trac.util.translation import _, deactivate, reactivate +from trac.util.html import to_fragment +from trac.util.text import CRLF, fix_eol, to_unicode +from trac.util.translation import _, deactivate, reactivate, tag_ MAXHEADERLEN = 76 EMAIL_LOOKALIKE_PATTERN = ( @@ -151,11 +153,20 @@ class SmtpEmailSender(Component): self.log.info("Sending notification through SMTP at %s:%d to %s" % (self.smtp_server, self.smtp_port, recipients)) - server = smtplib.SMTP(self.smtp_server, self.smtp_port) + try: + server = smtplib.SMTP(self.smtp_server, self.smtp_port) + except smtplib.socket.error, e: + raise ConfigurationError( + tag_("SMTP server connection error (%(error)s). Please " + "modify %(option1)s or %(option2)s in your " + "configuration.", + error=to_unicode(e), + option1=tag.tt("[notification] smtp_server"), + option2=tag.tt("[notification] smtp_port"))) # server.set_debuglevel(True) if self.use_tls: server.ehlo() - if not server.esmtp_features.has_key('starttls'): + if 'starttls' not in server.esmtp_features: raise TracError(_("TLS enabled but server does not support " \ "TLS")) server.starttls() @@ -201,8 +212,15 @@ class SendmailEmailSender(Component): cmdline = [self.sendmail_path, "-i", "-f", from_addr] cmdline.extend(recipients) self.log.debug("Sendmail command line: %s" % cmdline) - child = Popen(cmdline, bufsize=-1, stdin=PIPE, stdout=PIPE, - stderr=PIPE, close_fds=close_fds) + try: + child = Popen(cmdline, bufsize=-1, stdin=PIPE, stdout=PIPE, + stderr=PIPE, close_fds=close_fds) + except OSError, e: + raise ConfigurationError( + tag_("Sendmail error (%(error)s). Please modify %(option)s " + "in your configuration.", + error=to_unicode(e), + option=tag.tt("[notification] sendmail_path"))) out, err = child.communicate(message) if child.returncode or err: raise Exception("Sendmail failed with (%s, %s), command: '%s'" @@ -227,7 +245,7 @@ class Notify(object): self.data = Chrome(self.env).populate_data(None, {'CRLF': CRLF}) def notify(self, resid): - (torcpts, ccrcpts) = self.get_recipients(resid) + torcpts, ccrcpts = self.get_recipients(resid) self.begin_send() self.send(torcpts, ccrcpts) self.finish_send() @@ -333,30 +351,44 @@ class NotifyEmail(Notify): self.from_email = from_email or self.replyto_email self.from_name = from_name if not self.from_email and not self.replyto_email: - raise TracError(tag( - tag.p(_('Unable to send email due to identity crisis.')), - tag.p(_('Neither %(from_)s nor %(reply_to)s are specified ' - 'in the configuration.', - from_=tag.b('notification.from'), - reply_to=tag.b('notification.reply_to')))), - _('SMTP Notification Error')) + message = tag( + tag.p(_('Unable to send email due to identity crisis.')), + # convert explicitly to `Fragment` to avoid breaking message + # when passing `LazyProxy` object to `Fragment` + tag.p(to_fragment(tag_( + "Neither %(from_)s nor %(reply_to)s are specified in the " + "configuration.", + from_=tag.strong('[notification] smtp_from'), + reply_to=tag.strong('[notification] smtp_replyto'))))) + raise TracError(message, _('SMTP Notification Error')) Notify.notify(self, resid) + _mime_encoding_re = re.compile(r'=\?[^?]+\?[bq]\?[^?]+\?=', re.IGNORECASE) + def format_header(self, key, name, email=None): from email.Header import Header maxlength = MAXHEADERLEN-(len(key)+2) # Do not sent ridiculous short headers if maxlength < 10: raise TracError(_("Header length is too short")) - try: - tmp = name.encode('ascii') - header = Header(tmp, 'ascii', maxlinelen=maxlength) - except UnicodeEncodeError: - header = Header(name, self._charset, maxlinelen=maxlength) + # when it matches mime-encoding, encode as mime even if only + # ascii characters + header = None + if not self._mime_encoding_re.search(name): + try: + tmp = name.encode('ascii') + header = Header(tmp, 'ascii', maxlinelen=maxlength) + except UnicodeEncodeError: + pass + if not header: + header = Header(name.encode(self._charset.output_codec), + self._charset, maxlinelen=maxlength) if not email: return header else: + header = str(header).replace('\\', r'\\') \ + .replace('"', r'\"') return '"%s" <%s>' % (header, email) def add_headers(self, msg, headers): Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/perm.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/perm.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/perm.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/perm.py Sat Nov 15 01:14:46 2014 @@ -31,7 +31,7 @@ from trac.resource import get_resource_n from trac.util import file_or_std from trac.util.text import path_to_unicode, print_table, printout, \ stream_encoding, to_unicode, wrap -from trac.util.translation import _ +from trac.util.translation import _, N_ __all__ = ['IPermissionRequestor', 'IPermissionStore', 'IPermissionPolicy', 'IPermissionGroupProvider', 'PermissionError', 'PermissionSystem'] @@ -40,29 +40,27 @@ __all__ = ['IPermissionRequestor', 'IPer class PermissionError(StandardError): """Insufficient permissions to complete the operation""" + title = N_("Forbidden") + def __init__ (self, action=None, resource=None, env=None, msg=None): - StandardError.__init__(self) self.action = action self.resource = resource self.env = env - self.msg = msg - - def __unicode__ (self): if self.action: if self.resource: - return _('%(perm)s privileges are required to perform ' - 'this operation on %(resource)s. You don\'t have the ' - 'required permissions.', - perm=self.action, - resource=get_resource_name(self.env, self.resource)) + msg = _("%(perm)s privileges are required to perform " + "this operation on %(resource)s. You don't have the " + "required permissions.", + perm=self.action, + resource=get_resource_name(self.env, self.resource)) else: - return _('%(perm)s privileges are required to perform this ' - 'operation. You don\'t have the required ' - 'permissions.', perm=self.action) - elif self.msg: - return self.msg - else: - return _('Insufficient privileges to perform this operation.') + msg = _("%(perm)s privileges are required to perform this " + "operation. You don't have the required " + "permissions.", perm=self.action) + elif msg is None: + msg = _("Insufficient privileges to perform this operation.") + self.msg = msg + StandardError.__init__(self, msg) class IPermissionRequestor(Interface): @@ -595,10 +593,14 @@ class PermissionCache(object): __contains__ = has_permission - def require(self, action, realm_or_resource=None, id=False, version=False): + def require(self, action, realm_or_resource=None, id=False, version=False, + message=None): resource = self._normalize_resource(realm_or_resource, id, version) if not self._has_permission(action, resource): - raise PermissionError(action, resource, self.env) + if message is None: + raise PermissionError(action, resource, self.env) + else: + raise PermissionError(msg=message) assert_permission = require def permissions(self): @@ -707,9 +709,17 @@ class PermissionAdmin(Component): permsys.revoke_permission(u, a) found = True if not found: - raise AdminCommandError( - _("Cannot remove permission %(action)s for user %(user)s.", - action=action, user=user)) + if user in self.get_user_list() and \ + action in permsys.get_user_permissions(user): + msg = _("Cannot remove permission %(action)s for user " + "%(user)s. The permission is granted through " + "a meta-permission or group.", action=action, + user=user) + else: + msg = _("Cannot remove permission %(action)s for user " + "%(user)s. The user has not been granted the " + "permission.", action=action, user=user) + raise AdminCommandError(msg) def _do_export(self, filename=None): try: Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/__init__.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/__init__.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/__init__.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/__init__.py Sat Nov 15 01:14:46 2014 @@ -1 +1,14 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2006-2014 Edgewall Software +# All rights reserved. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://trac.edgewall.org/wiki/TracLicense. +# +# This software consists of voluntary contributions made by many +# individuals. For the exact contribution history, see the revision +# history and logs, available at http://trac.edgewall.org/log/. + from trac.prefs.api import * Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/api.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/api.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/api.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/api.py Sat Nov 15 01:14:46 2014 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C)2006-2009 Edgewall Software +# Copyright (C) 2006-2014 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_advanced.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_advanced.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_advanced.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_advanced.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_datetime.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_datetime.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_datetime.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_datetime.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_general.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_general.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_general.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_general.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_keybindings.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_keybindings.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_keybindings.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_keybindings.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_language.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_language.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_language.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_language.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2008-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -13,22 +23,31 @@ <div class="field" py:with="session_language = settings.session.get('language', '').replace('-', '_')"> <label>Language: - <select name="language"> + <select name="language" disabled="${'disabled' if not languages else None}" + title="${_('Translations are currently unavailable') if not languages else None}"> <option value="">Default language</option> <option py:for="locale, language in languages" selected="${session_language == locale or None}" value="$locale">$language</option> </select> </label> - <p class="hint">Configuring your language will result in all text - displayed on this site to use your language instead of that of the - server.</p> + <span py:if="not has_babel" class="hint"> + Install Babel for extended language support. + </span> + <span py:if="'TRAC_ADMIN' in req.perm and has_babel and not languages" class="hint"> + Message catalogs have not been compiled. + </span> + + <div py:if="languages"> + <p class="hint">Configuring your language will result in all text + displayed on this site to use your language instead of that of the + server.</p> - <p class="hint" i18n:msg="">The <strong>Default language</strong> option uses the browser's + <p class="hint" i18n:msg="">The <strong>Default language</strong> option uses the browser's language negotiation feature to select the appropriate language.</p> + </div> <p py:if="not languages" class="hint" xml:lang="en"> - <strong>Note:</strong> Translations are currently unavailable. <py:choose> <py:when test="'TRAC_ADMIN' in req.perm"> Trac has been localized to more than a dozen of languages but in order Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_pygments.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_pygments.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_pygments.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_pygments.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_userinterface.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_userinterface.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_userinterface.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/templates/prefs_userinterface.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2012-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/__init__.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/__init__.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/__init__.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/__init__.py Sat Nov 15 01:14:46 2014 @@ -1 +1,14 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2008-2013 Edgewall Software +# All rights reserved. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://trac.edgewall.org/wiki/TracLicense. +# +# This software consists of voluntary contributions made by many +# individuals. For the exact contribution history, see the revision +# history and logs, available at http://trac.edgewall.org/log/. + from trac.prefs.tests.functional import functionalSuite Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/functional.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/functional.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/functional.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/tests/functional.py Sat Nov 15 01:14:46 2014 @@ -1,4 +1,17 @@ -#!/usr/bin/python +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright (C) 2008-2013 Edgewall Software +# All rights reserved. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://trac.edgewall.org/wiki/TracLicense. +# +# This software consists of voluntary contributions made by many +# individuals. For the exact contribution history, see the revision +# history and logs, available at http://trac.edgewall.org/log/. + from trac.tests.functional import * @@ -6,37 +19,30 @@ from trac.tests.functional import * class TestPreferences(FunctionalTwillTestCaseSetup): def runTest(self): """Set preferences for admin user""" - prefs_url = self._tester.url + "/prefs" - tc.follow('Preferences') - tc.url(prefs_url) + self._tester.go_to_preferences() tc.notfind('Your preferences have been saved.') tc.formvalue('userprefs', 'name', ' System Administrator ') tc.formvalue('userprefs', 'email', ' ad...@example.com ') tc.submit() tc.find('Your preferences have been saved.') - tc.follow('Date & Time') - tc.url(prefs_url + '/datetime') + self._tester.go_to_preferences("Date & Time") tc.formvalue('userprefs', 'tz', 'GMT -10:00') tc.submit() tc.find('Your preferences have been saved.') - tc.follow('General') - tc.url(prefs_url) + self._tester.go_to_preferences() tc.notfind('Your preferences have been saved.') tc.find('value="System Administrator"') tc.find(r'value="admin@example\.com"') - tc.follow('Date & Time') - tc.url(prefs_url + '/datetime') + self._tester.go_to_preferences("Date & Time") tc.find('GMT -10:00') class RegressionTestRev5785(FunctionalTwillTestCaseSetup): def runTest(self): """Test for regression of the fix in r5785""" - prefs_url = self._tester.url + "/prefs" - tc.follow('Preferences') - tc.url(prefs_url) - tc.follow('Logout') - tc.notfind(internal_error) # See [5785] + self._tester.go_to_preferences() + tc.submit('logout', 'logout') + tc.notfind(internal_error) # See [5785] tc.follow('Login') @@ -45,9 +51,7 @@ class RegressionTestTicket5765(Functiona """Test for regression of http://trac.edgewall.org/ticket/5765 Unable to turn off 'Enable access keys' in Preferences """ - self._tester.go_to_front() - tc.follow('Preferences') - tc.follow('Keyboard Shortcuts') + self._tester.go_to_preferences("Keyboard Shortcuts") tc.formvalue('userprefs', 'accesskeys', True) tc.submit() tc.find('name="accesskeys".*checked="checked"') @@ -56,13 +60,102 @@ class RegressionTestTicket5765(Functiona tc.notfind('name="accesskeys".*checked="checked"') +class RegressionTestTicket11337(FunctionalTwillTestCaseSetup): + def runTest(self): + """Test for regression of http://trac.edgewall.org/ticket/11337 + The preferences panel will only be visible when Babel is installed + or for a user that has `TRAC_ADMIN`. + """ + from trac.util.translation import has_babel, get_available_locales + + babel_hint = "Install Babel for extended language support." + catalog_hint = "Message catalogs have not been compiled." + language_select = '<select name="language">' + disabled_language_select = \ + '<select name="language" disabled="disabled" ' \ + 'title="Translations are currently unavailable">' + + self._tester.go_to_preferences("Language") + if has_babel: + tc.notfind(babel_hint) + if get_available_locales(): + tc.find(language_select) + tc.notfind(catalog_hint) + else: + tc.find(disabled_language_select) + tc.find(catalog_hint) + else: + tc.find(babel_hint) + tc.find(disabled_language_select) + tc.notfind(catalog_hint) + + # For users without TRAC_ADMIN, the Language tab should only be + # present when Babel is installed + self._tester.go_to_preferences() + language_tab = '<li id="tab_language">' + try: + self._tester.logout() + if has_babel: + tc.find(language_tab) + tc.notfind(catalog_hint) + else: + tc.notfind(language_tab) + finally: + self._tester.login('admin') + + +class RegressionTestTicket11515(FunctionalTwillTestCaseSetup): + def runTest(self): + """Test for regression of http://trac.edgewall.org/ticket/11515 + Show a notice message with new language setting after it is changed. + """ + from trac.util.translation import has_babel, get_available_locales + + if not has_babel: + return + for second_locale in (locale for locale in get_available_locales() + if not locale.startswith('en_')): + break + else: + return + + try: + self._tester.go_to_preferences('Language') + tc.formvalue('userprefs', 'language', second_locale) + tc.submit() + tc.notfind('Your preferences have been saved') + finally: + tc.formvalue('userprefs', 'language', '') # revert to default + tc.submit() + tc.find('Your preferences have been saved') + + +class RegressionTestTicket11531(FunctionalTwillTestCaseSetup): + """Test for regression of http://trac.edgewall.org/ticket/11531 + PreferencesModule can be set as the default_handler.""" + def runTest(self): + default_handler = self._testenv.get_config('trac', 'default_handler') + self._testenv.set_config('trac', 'default_handler', + 'PreferencesModule') + try: + tc.go(self._tester.url) + tc.notfind(internal_error) + tc.find(r"\bPreferences\b") + finally: + self._testenv.set_config('trac', 'default_handler', + default_handler) + + def functionalSuite(suite=None): if not suite: - import trac.tests.functional.testcases - suite = trac.tests.functional.testcases.functionalSuite() + import trac.tests.functional + suite = trac.tests.functional.functionalSuite() suite.addTest(TestPreferences()) suite.addTest(RegressionTestRev5785()) suite.addTest(RegressionTestTicket5765()) + suite.addTest(RegressionTestTicket11337()) + suite.addTest(RegressionTestTicket11515()) + suite.addTest(RegressionTestTicket11531()) return suite Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/web_ui.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/web_ui.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/web_ui.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/prefs/web_ui.py Sat Nov 15 01:14:46 2014 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2004-2009 Edgewall Software +# Copyright (C) 2004-2014 Edgewall Software # Copyright (C) 2004-2005 Daniel Lundin <dan...@edgewall.com> # All rights reserved. # @@ -17,20 +17,16 @@ import pkg_resources import re -try: - from babel.core import Locale -except ImportError: - Locale = None - from genshi.builder import tag from trac.core import * from trac.prefs.api import IPreferencePanelProvider from trac.util.datefmt import all_timezones, get_timezone, localtz -from trac.util.translation import _, get_available_locales -from trac.web import HTTPNotFound, IRequestHandler -from trac.web.chrome import add_notice, add_stylesheet, \ - INavigationContributor, ITemplateProvider +from trac.util.translation import _, Locale, deactivate,\ + get_available_locales, make_activable +from trac.web.api import HTTPNotFound, IRequestHandler +from trac.web.chrome import INavigationContributor, ITemplateProvider, \ + add_notice, add_stylesheet class PreferencesModule(Component): @@ -44,7 +40,7 @@ class PreferencesModule(Component): 'newsid', 'name', 'email', 'tz', 'lc_time', 'dateinfo', 'language', 'accesskeys', 'ui.use_symbols', 'ui.hide_help', - ] + ] # INavigationContributor methods @@ -52,8 +48,8 @@ class PreferencesModule(Component): return 'prefs' def get_navigation_items(self, req): - yield ('metanav', 'prefs', - tag.a(_('Preferences'), href=req.href.prefs())) + yield 'metanav', 'prefs', tag.a(_("Preferences"), + href=req.href.prefs()) # IRequestHandler methods @@ -68,7 +64,7 @@ class PreferencesModule(Component): if xhr and req.method == 'POST' and 'save_prefs' in req.args: self._do_save_xhr(req) - panel_id = req.args['panel_id'] + panel_id = req.args.get('panel_id') panels = [] chosen_provider = None @@ -79,8 +75,8 @@ class PreferencesModule(Component): chosen_provider = provider panels.append((name, label)) if not chosen_provider: - self.log.warn('Unknown preference panel %r', panel_id) - raise HTTPNotFound(_('Unknown preference panel')) + self.log.warn("Unknown preference panel %r", panel_id) + raise HTTPNotFound(_("Unknown preference panel")) template, data = chosen_provider.render_preference_panel(req, panel_id) data.update({'active_panel': panel_id, 'panels': panels}) @@ -91,14 +87,14 @@ class PreferencesModule(Component): # IPreferencePanelProvider methods def get_preference_panels(self, req): - yield (None, _('General')) - yield ('datetime', _('Date & Time')) - yield ('keybindings', _('Keyboard Shortcuts')) - yield ('userinterface', _('User Interface')) - if Locale: - yield ('language', _('Language')) + yield (None, _("General")) + yield ('datetime', _("Date & Time")) + yield ('keybindings', _("Keyboard Shortcuts")) + yield ('userinterface', _("User Interface")) + if Locale or 'TRAC_ADMIN' in req.perm: + yield ('language', _("Language")) if not req.authname or req.authname == 'anonymous': - yield ('advanced', _('Advanced')) + yield ('advanced', _("Advanced")) def render_preference_panel(self, req, panel): if req.method == 'POST': @@ -109,18 +105,26 @@ class PreferencesModule(Component): req.redirect(req.href.prefs(panel or None)) data = { - 'settings': {'session': req.session, 'session_id': req.session.sid}, - 'timezones': all_timezones, 'timezone': get_timezone, - 'localtz': localtz + 'settings': {'session': req.session, + 'session_id': req.session.sid}, + 'timezones': all_timezones, + 'timezone': get_timezone, + 'localtz': localtz, + 'has_babel': False } if Locale: - locales = [Locale.parse(locale) - for locale in get_available_locales()] - languages = sorted((str(locale), locale.display_name) - for locale in locales) + locale_ids = get_available_locales() + locales = [Locale.parse(locale) for locale in locale_ids] + # use locale identifiers from get_available_locales() instead + # of str(locale) to prevent storing expanded locale identifier + # to session, e.g. zh_Hans_CN and zh_Hant_TW, since Babel 1.0. + # see #11258. + languages = sorted((id, locale.display_name) + for id, locale in zip(locale_ids, locales)) data['locales'] = locales data['languages'] = languages + data['has_babel'] = True return 'prefs_%s.html' % (panel or 'general'), data @@ -142,6 +146,7 @@ class PreferencesModule(Component): req.send_no_content() def _do_save(self, req): + language = req.session.get('language') for field in self._form_fields: val = req.args.get(field, '').strip() if val: @@ -157,11 +162,16 @@ class PreferencesModule(Component): elif field in req.session and (field in req.args or field + '_cb' in req.args): del req.session[field] - add_notice(req, _('Your preferences have been saved.')) + if Locale and req.session.get('language') != language: + # reactivate translations with new language setting when changed + del req.locale # for re-negotiating locale + deactivate() + make_activable(lambda: req.locale, self.env.path) + add_notice(req, _("Your preferences have been saved.")) def _do_load(self, req): if req.authname == 'anonymous': oldsid = req.args.get('loadsid') if oldsid: req.session.get_session(oldsid) - add_notice(req, _('The session has been loaded.')) + add_notice(req, _("The session has been loaded.")) Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/search/__init__.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/search/__init__.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/search/__init__.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/search/__init__.py Sat Nov 15 01:14:46 2014 @@ -1 +1,14 @@ -from trac.search.api import * \ No newline at end of file +# -*- coding: utf-8 -*- +# +# Copyright (C) 2006-2013 Edgewall Software +# All rights reserved. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://trac.edgewall.org/wiki/TracLicense. +# +# This software consists of voluntary contributions made by many +# individuals. For the exact contribution history, see the revision +# history and logs, available at http://trac.edgewall.org/log/. + +from trac.search.api import * Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/search/templates/search.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/search/templates/search.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/search/templates/search.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/search/templates/search.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -16,9 +26,6 @@ <meta name="totalResults" content="$results.num_items"/> <meta name="itemsPerPage" content="$results.max_per_page"/> </py:if> - <script type="text/javascript"> - jQuery(document).ready(function($) {$("#q").get(0).focus()}); - </script> </head> <body> <div id="content" class="search"> @@ -26,7 +33,7 @@ <h1><label for="q">Search</label></h1> <form id="fullsearch" action="${href.search()}" method="get"> <p> - <input type="text" id="q" name="q" size="40" value="${query}" /> + <input type="text" id="q" name="q" class="trac-autofocus" size="40" value="${query}" /> <input type="hidden" name="noquickjump" value="1" /> <input type="submit" value="${_('Search')}" /> </p> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/search/web_ui.py URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/search/web_ui.py?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/search/web_ui.py (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/search/web_ui.py Sat Nov 15 01:14:46 2014 @@ -21,7 +21,6 @@ from genshi.builder import tag from trac.config import IntOption, ListOption from trac.core import * -from trac.mimeview import RenderingContext from trac.perm import IPermissionRequestor from trac.search.api import ISearchSource from trac.util.datefmt import format_datetime, user_time @@ -29,7 +28,7 @@ from trac.util.html import find_element from trac.util.presentation import Paginator from trac.util.text import quote_query_string from trac.util.translation import _ -from trac.web import IRequestHandler +from trac.web.api import IRequestHandler from trac.web.chrome import (INavigationContributor, ITemplateProvider, add_link, add_stylesheet, add_warning, web_context) @@ -229,7 +228,7 @@ class SearchModule(Component): q=req.args.get('q'), page=shown_page, noquickjump=1) pagedata.append([page_href, None, str(shown_page), - 'page ' + str(shown_page)]) + _("Page %(num)d", num=shown_page)]) fields = ['href', 'class', 'string', 'title'] results.shown_pages = [dict(zip(fields, p)) for p in pagedata] Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/about.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/about.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/about.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/about.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -12,7 +22,9 @@ <script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function ($) { - $("#systeminfo table").append("<tr><th>jQuery</th><td>"+$().jquery+"</td></tr>"); + $("#systeminfo table").append("<tr><th>jQuery</th><td>"+$().jquery+"</td></tr>" + + "<tr><th>jQuery UI</th><td>"+$.ui.version+"</td></tr>" + + "<tr><th>jQuery Timepicker</th><td>"+$.timepicker.version+"</td></tr>"); }); //]]> </script> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attach_file_form.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attach_file_form.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attach_file_form.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attach_file_form.html Sat Nov 15 01:14:46 2014 @@ -1,4 +1,13 @@ -<!--! +<!--! Copyright (C) 2010-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. + Conditionally render an ''Attach File'' button. Arguments: @@ -12,6 +21,8 @@ Arguments: py:if="alist.can_create" method="get" action="${alist.attach_href}" id="attachfile"> <div> <input type="hidden" name="action" value="new" /> - <input type="submit" name="attachfilebutton" value="${value_of('add_button_title', None) or _('Attach file')}" /> + <input type="submit" id="attachfilebutton" + value="${value_of('add_button_title') or + (_('Attach another file') if alist.attachments else _('Attach file'))}"/> </div> </form> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attachment.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attachment.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attachment.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/attachment.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -59,7 +69,7 @@ <input type="hidden" name="action" value="new" /> <input type="hidden" name="realm" value="$parent.realm" /> <input type="hidden" name="id" value="$parent.id" /> - <input type="submit" value="${_('Add attachment')}" /> + <input type="submit" class="trac-disable-on-submit" value="${_('Add attachment')}" /> <input type="submit" name="cancel" value="${_('Cancel')}" /> </div> </form> @@ -73,8 +83,8 @@ <form method="post" action=""> <div id="delete"> <input type="hidden" name="action" value="delete" /> + <input type="submit" class="trac-disable-on-submit" value="${_('Delete attachment')}" /> <input type="submit" name="cancel" value="${_('Cancel')}" /> - <input type="submit" value="${_('Delete attachment')}" /> </div> </form> </div> @@ -83,7 +93,6 @@ <py:when test="'list'"> <h1><a href="${url_of(parent)}">${name_of(parent)}</a></h1> <py:with vars="context = context.child(parent)"> - <?python add_button_title = _('Attach another file') ?> <xi:include href="list_of_attachments.html" py:with="alist = attachments"/> </py:with> </py:when> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_div.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_div.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_div.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_div.html Sat Nov 15 01:14:46 2014 @@ -1,39 +1,48 @@ -<!--! - changes - a list of diff items, each being a dict containing information about - changes for one file: - .href - link for the title (optional) - .title - tooltip for the title link (optional) - .comments - annotation for the change (optional) - .new and .old - information about the files being diffed - .path - path of the file - .rev - rev of the file (for 'sidebyside') - .shortrev - abbreviated form of rev of the file (for 'inline') - .href - link to the full file (optional) - .props - a list of property changes - .name - name of the property - .diff - rendered difference - .old - old value of the property - .new - new value for the property - (both .old and .new have .name, .value and .rendered properties) - .diffs - a sequence of list of blocks - - Each block being a dict: - .type - one of 'unmod', 'add', 'rem' or 'mod' - .base and .changed - information about lines from old and new content - .lines - the lines - .offset - position within the file - - .diffs_title - a sequence of titles for the list of blocks - Note: integrate this into .diffs for 0.12 or 1.0. - - diff - dict specifying diff style and options - .style - can be 'sidebyside' (4 columns) or 'inline' (3 columns) - .options - contexlines, various ignore... - - longcol - "long" column header; e.g. 'Revision' or 'File' or '' (for 'sidebyside') - shortcol - "short" column header: e.g. 'r' or '' (for 'inline') - no_id - skip generation of id attributes in h2 headings +<!--! Copyright (C) 2006-2014 Edgewall Software + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. + +Arguments: + - changes - a list of diff items, each being a dict containing information about + changes for one file: + .href - link for the title (optional) + .title - tooltip for the title link (optional) + .comments - annotation for the change (optional) + .new and .old - information about the files being diffed + .path - path of the file + .rev - rev of the file (for 'sidebyside') + .shortrev - abbreviated form of rev of the file (for 'inline') + .href - link to the full file (optional) + .props - a list of property changes + .name - name of the property + .diff - rendered difference + .old - old value of the property + .new - new value for the property + (both .old and .new have .name, .value and .rendered properties) + .diffs - a sequence of list of blocks + + Each block being a dict: + .type - one of 'unmod', 'add', 'rem' or 'mod' + .base and .changed - information about lines from old and new content + .lines - the lines + .offset - position within the file + + .diffs_title - a sequence of titles for the list of blocks + Note: integrate this into .diffs for 0.12 or 1.0. + + - diff - dict specifying diff style and options + .style - can be 'sidebyside' (4 columns) or 'inline' (3 columns) + .options - contexlines, various ignore... + + - longcol - "long" column header; e.g. 'Revision' or 'File' or '' (for 'sidebyside') + - shortcol - "short" column header: e.g. 'r' or '' (for 'inline') + - no_id - skip generation of id attributes in h2 headings --> <div xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" @@ -132,11 +141,11 @@ clines = block.changed.lines"> <py:choose test="diff.style"> <py:when test="'sidebyside'"> - <th>$from_n</th><td class="l"><span>$line</span> </td> - <th>$to_n</th><td class="r"><span>${clines[idx] if idx < len(clines) else None}</span> </td> + <th>$from_n</th><td class="l"><span>$line</span></td> + <th>$to_n</th><td class="r"><span>${clines[idx] if idx < len(clines) else None}</span></td> </py:when> <py:when test="'inline'"> - <th>$from_n</th><th>$to_n</th><td class="l"><span>$line</span> </td> + <th>$from_n</th><th>$to_n</th><td class="l"><span>$line</span></td> </py:when> </py:choose> </py:with> @@ -149,11 +158,11 @@ <py:with vars="to_n = block.changed.offset+idx+1"> <py:choose test="diff.style"> <py:when test="'sidebyside'"> - <th> </th><td class="l"> </td> - <th>$to_n</th><td class="r"><ins>$line</ins> </td> + <th> </th><td class="l"></td> + <th>$to_n</th><td class="r"><ins>$line</ins></td> </py:when> <py:when test="'inline'"> - <th> </th><th>$to_n</th><td class="r"><ins>$line</ins> </td> + <th> </th><th>$to_n</th><td class="r"><ins>$line</ins></td> </py:when> </py:choose> </py:with> @@ -166,11 +175,11 @@ <py:with vars="from_n = block.base.offset+idx+1"> <py:choose test="diff.style"> <py:when test="'sidebyside'"> - <th>$from_n</th><td class="l"><del>$line</del> </td> - <th> </th><td class="r"> </td> + <th>$from_n</th><td class="l"><del>$line</del></td> + <th> </th><td class="r"></td> </py:when> <py:when test="'inline'"> - <th>$from_n</th><th> </th><td class="l"><del>$line</del> </td> + <th>$from_n</th><th> </th><td class="l"><del>$line</del></td> </py:when> </py:choose> </py:with> @@ -184,10 +193,10 @@ <py:when test="len(block.base.lines) >= len(block.changed.lines)"> <tr py:for="idx, line in enumerate(block.base.lines)"> <th>${block.base.offset+idx+1}</th> - <td class="l"><span>$line</span> </td> + <td class="l"><span>$line</span></td> <py:with vars="within_change = idx < len(block.changed.lines)"> <th>${block.changed.offset + idx + 1 if within_change else ' '}</th> - <td class="r"><span py:if="within_change">${block.changed.lines[idx]}</span> </td> + <td class="r"><span py:if="within_change">${block.changed.lines[idx]}</span></td> </py:with> </tr> </py:when> @@ -195,10 +204,10 @@ <tr py:for="idx, line in enumerate(block.changed.lines)"> <py:with vars="within_change = idx < len(block.base.lines)"> <th>${block.base.offset + idx + 1 if within_change else ' '}</th> - <td class="l"><span py:if="within_change">${block.base.lines[idx]}</span> </td> + <td class="l"><span py:if="within_change">${block.base.lines[idx]}</span></td> </py:with> <th>${block.changed.offset + idx + 1}</th> - <td class="r"><span>$line</span> </td> + <td class="r"><span>$line</span></td> </tr> </py:otherwise> </py:choose> @@ -207,12 +216,12 @@ <!--! First show the "old" lines --> <tr py:for="idx, line in enumerate(block.base.lines)" class="${'first' if idx == 0 else None}"> - <th>${block.base.offset + idx + 1}</th><th> </th><td class="l"><span>$line</span> </td> + <th>${block.base.offset + idx + 1}</th><th> </th><td class="l"><span>$line</span></td> </tr> <!--! Then show the "new" lines --> <tr py:for="idx, line in enumerate(block.changed.lines)" class="${'last' if idx + 1 == len(block.changed.lines) else None}"> - <th> </th><th>${block.changed.offset + idx + 1}</th><td class="r"><span>$line</span> </td> + <th> </th><th>${block.changed.offset + idx + 1}</th><td class="r"><span>$line</span></td> </tr> </py:when> </py:choose> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_options.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_options.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_options.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_options.html Sat Nov 15 01:14:46 2014 @@ -1,6 +1,17 @@ -<!--! Add diff option fields (to be used inside a form) +<!--! Copyright (C) 2009-2014 Edgewall Software - `diff` the datastructure which contains diff options + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. + +Add diff option fields (to be used inside a form) + +Arguments: + - `diff` the datastructure which contains diff options --> <div xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://genshi.edgewall.org/" Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_view.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_view.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_view.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/diff_view.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -18,16 +28,16 @@ <py:when test="old_version"><i18n:msg params="old, new, name">Changes between <a href="${old_url or url_of(resource, version=old_version)}">Version $old_version</a> and <a href="${new_url or url_of(resource, version=new_version)}">Version $new_version</a> of - <a href="${url or url_of(resource)}">${name or name_of(resource)}</a> + <a href="${url or url_of(resource, version=None)}">${name or name_of(resource)}</a> </i18n:msg></py:when> <py:when test="old_version == 0"><i18n:msg params="new, name">Changes between <a href="${old_url or url_of(resource, version=0)}">Initial Version</a> and <a href="${new_url or url_of(resource, version=new_version)}">Version $new_version</a> of - <a href="${url or url_of(resource)}">${name or name_of(resource)}</a> + <a href="${url or url_of(resource, version=None)}">${name or name_of(resource)}</a> </i18n:msg></py:when> <py:otherwise><i18n:msg params="new, name">Changes from <a href="${new_url or url_of(resource, version=new_version)}">Version $new_version</a> of - <a href="${url or url_of(resource)}">${name or name_of(resource)}</a> + <a href="${url or url_of(resource, version=None)}">${name or name_of(resource)}</a> </i18n:msg></py:otherwise> </h1> <form method="post" id="prefs" action="${diff_url or url_of(resource)}"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/error.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/error.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/error.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/error.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -39,7 +49,9 @@ $("#traceback pre").hide(); $("#tbtoggle").parent().show(); - $("#systeminfo").append("<tr><th>jQuery</th><td>" + $().jquery + "</td></tr>"); + $("#systeminfo").append("<tr><th>jQuery</th><td>"+$().jquery+"</td></tr>" + + "<tr><th>jQuery UI</th><td>"+$.ui.version+"</td></tr>" + + "<tr><th>jQuery Timepicker</th><td>"+$.timepicker.version+"</td></tr>"); $("#systeminfo").before("<p>User Agent: <tt>" + navigator.userAgent + "</tt></p>"); }); /*]]>*/</script> @@ -48,7 +60,9 @@ $("form.newticket textarea").each(function() { $(this).val($(this).val() .replace(/#USER_AGENT#/m, navigator.userAgent) - .replace(/#JQUERY#/m, $().jquery)); + .replace(/#JQUERY#/m, $().jquery) + .replace(/#JQUERYUI#/m, $.ui.version) + .replace(/#JQUERYTP#/m, $.timepicker.version)); }); }); /*]]>*/</script> @@ -58,6 +72,7 @@ <input type="hidden" name="reporter" value="${get_reporter_id(req)}" /> <input py:if="url == trac.homepage.strip('/')" type="hidden" name="version" value="${trac.version.split('-', 1)[0] if 'dev' in trac.version else trac.version}" /> + <input type="hidden" name="$arg" value="$value" py:for="arg, value in tracker_args.iteritems()" /> <input type="hidden" name="summary" value="$message" /> <textarea name="description" rows="3" cols="10"> ${description_en if url else description}</textarea> @@ -72,7 +87,7 @@ ${description_en if url else description <py:when test="'TracError'"> <h1>$title</h1> <py:choose test=""> - <p py:when="istext(message)" class="message">$message</p> + <p py:when="not find_element(message, tag='p')" class="message">$message</p> <py:otherwise>$message</py:otherwise> </py:choose> </py:when> @@ -97,13 +112,17 @@ ${description_en if url else description <p>The action that triggered the error was:</p> <pre>${req.method}: ${req.path_info}</pre> </py:when> - <py:otherwise> - <form class="newticket" method="get" action="${project.admin_href.newticket()}#"> + <py:otherwise py:choose=""> + <p py:when="not project.admin_href or project.admin_trac_url == '.'"> + This is probably a local installation issue. + </p> + <form py:otherwise="" + class="newticket" method="get" action="${project.admin_href.newticket()}#"> <p>This is probably a local installation issue. - <py:if test="project.admin_href and project.admin_trac_url != '.'"><i18n:msg params="create"> + <i18n:msg params="create"> You should ${create_ticket()} a ticket at the admin Trac to report the issue. - </i18n:msg></py:if> + </i18n:msg> </p> </form> <h2>Found a bug in Trac?</h2> @@ -139,7 +158,7 @@ ${description_en if url else description <li class="frame" py:for="idx, frame in enumerate(frames)"> <a href="#frame${idx}" id="frame${idx}"><span i18n:msg="file, line, function" py:strip=""> <span class="file">File "${frame.filename}", - line <b>${frame.lineno + 1}</b>, in</span> + line <strong>${frame.lineno + 1}</strong>, in</span> <var>${frame.function}</var></span> </a> <div py:if="frame.line" class="source" style="display: none"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/history_view.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/history_view.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/history_view.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/history_view.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -15,7 +25,7 @@ <div id="content" class="ticket"> <h1 i18n:msg="name">Change History for <a href="${url or url_of(resource)}">${name or name_of(resource)}</a></h1> - <form py:if="history" class="printableform" method="get" action=""> + <form py:if="history" id="history" class="printableform" method="get" action=""> <div class="buttons"> <input type="hidden" name="action" value="${diff_action or 'diff'}" /> <input py:for="k, v in diff_args or []" type="hidden" name="$k" value="$v"/> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/index.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/index.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/index.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/index.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Modified: bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/layout.html URL: http://svn.apache.org/viewvc/bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/layout.html?rev=1639823&r1=1639822&r2=1639823&view=diff ============================================================================== --- bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/layout.html (original) +++ bloodhound/branches/trac-1.0.2-integration/trac/trac/templates/layout.html Sat Nov 15 01:14:46 2014 @@ -1,3 +1,13 @@ +<!--! Copyright (C) 2006-2014 Edgewall Software + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://trac.edgewall.com/license.html. + + This software consists of voluntary contributions made by many + individuals. For the exact contribution history, see the revision + history and logs, available at http://trac.edgewall.org/. +--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -37,12 +47,18 @@ <py:for each="script in chrome.scripts"> ${script.prefix}<script type="${script.type}" charset="${script.charset}" src="${script.href}"></script>${script.suffix} </py:for> - <script py:if="chrome.warnings or chrome.notices" type="text/javascript"> + <script type="text/javascript"> jQuery(document).ready(function($) { + <py:if test="chrome.warnings or chrome.notices"> $(".trac-close-msg").show().click(function () { $(this).closest(".system-message").hide(); return false; }); + </py:if> + $(".trac-autofocus").focus(); + $(".trac-target-new").attr("target", "_blank"); + setTimeout(function() { $(".trac-scroll").scrollToTop() }, 1); + $(".trac-disable-on-submit").disableOnSubmit(); }); </script> ${select("*[local-name() != 'title']|text()|comment()")}