Changeset 4734
- Timestamp:
- Feb 11, 2007, 1:26:50 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/attachment.html
r4552 r4734 17 17 <!--! TODO: parent.name -> context.parent.name --> 18 18 <py:when test="'new'"> 19 <h1>Add Attachment to <a href="${context.parent. self_href()}">$parent.name</a></h1>19 <h1>Add Attachment to <a href="${context.parent.resource_href()}">$parent.name</a></h1> 20 20 <form id="attachment" method="post" enctype="multipart/form-data" action=""> 21 21 <div class="field"> … … 53 53 54 54 <py:when test="'delete'"> 55 <h1><a href="${context.parent. self_href()}">$parent.name</a>: $attachment.filename</h1>55 <h1><a href="${context.parent.resource_href()}">$parent.name</a>: $attachment.filename</h1> 56 56 <p><strong>Are you sure you want to delete this attachment?</strong><br /> 57 57 This is an irreversible operation.</p> … … 68 68 69 69 <py:when test="'list'"> 70 <h1><a href="${context.parent. self_href()}">$parent.name</a></h1>70 <h1><a href="${context.parent.resource_href()}">$parent.name</a></h1> 71 71 ${list_of_attachments(context.parent, attachments, href.attachment(context.parent.realm, context.parent.id))} 72 72 </py:when> 73 73 74 74 <py:otherwise> <!--! 'render' mode --> 75 <h1><a href="${context.parent. self_href()}">$parent.name</a>: $attachment.filename</h1>75 <h1><a href="${context.parent.resource_href()}">$parent.name</a>: $attachment.filename</h1> 76 76 <table id="info" summary="Description"> 77 77 <tbody> -
trunk/templates/report.rss
r4488 r4734 36 36 </py:with> 37 37 </py:for> 38 <link py:if="row.id">${row.context. self_href()}</link>39 <guid isPermaLink="false" py:if="row.id">${row.context. self_href()}</guid>38 <link py:if="row.id">${row.context.resource_href()}</link> 39 <guid isPermaLink="false" py:if="row.id">${row.context.resource_href()}</guid> 40 40 <category>Report</category> 41 41 </item> -
trunk/templates/report_view.html
r4631 r4734 101 101 <py:when test="col in ('ticket', 'id')"> 102 102 <td class="ticket" py:attrs="td_attrs"> 103 <a title="View ticket" href="${row.context. self_href()}">#$cell.value</a>103 <a title="View ticket" href="${row.context.resource_href()}">#$cell.value</a> 104 104 <hr py:if="fullrow"/> 105 105 </td> … … 108 108 <py:when test="col == 'summary' and row.id"> 109 109 <td class="$col" py:attrs="td_attrs"> 110 <a title="View ticket" href="${row.context. self_href()}">$cell.value</a>110 <a title="View ticket" href="${row.context.resource_href()}">$cell.value</a> 111 111 <hr py:if="fullrow"/> 112 112 </td> -
trunk/trac/attachment.py
r4552 r4734 26 26 from trac import perm, util 27 27 from trac.config import BoolOption, IntOption 28 from trac.context import Context 28 29 from trac.core import * 29 30 from trac.env import IEnvironmentSetupParticipant … … 36 37 from trac.web import HTTPBadRequest, IRequestHandler 37 38 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 38 from trac.wiki.api import IWikiSyntaxProvider , Context39 from trac.wiki.api import IWikiSyntaxProvider 39 40 40 41 … … 381 382 data = self._render_form(req, attachment) 382 383 else: 383 add_link(req, 'up', parent_context. self_href(), pname)384 add_link(req, 'up', parent_context.resource_href(), pname) 384 385 data = self._render_view(context, attachment) 385 386 -
trunk/trac/mimeview/tests/patch.py
r4488 r4734 20 20 from genshi.input import HTMLParser, XML 21 21 22 from trac.test import EnvironmentStub, Mock 23 22 from trac.context import Context 24 23 from trac.mimeview.api import Mimeview 25 24 from trac.mimeview.patch import PatchRenderer 25 from trac.test import EnvironmentStub, Mock 26 26 from trac.web.chrome import Chrome 27 27 from trac.web.href import Href 28 from trac.wiki.api import Context29 28 30 29 -
trunk/trac/mimeview/tests/pygments_renderer.py
r4571 r4734 19 19 from genshi.input import HTMLParser, XML 20 20 21 from trac.test import EnvironmentStub, Mock 22 21 from trac.context import Context 23 22 from trac.mimeview.api import Mimeview 24 23 from trac.mimeview.pygments_renderer import PygmentsRenderer 24 from trac.test import EnvironmentStub, Mock 25 25 from trac.web.chrome import Chrome 26 26 from trac.web.href import Href 27 from trac.wiki.api import Context28 27 29 28 -
trunk/trac/search/web_ui.py
r4451 r4734 21 21 22 22 from trac.config import IntOption 23 from trac.context import Context 23 24 from trac.core import * 24 25 from trac.perm import IPermissionRequestor … … 28 29 from trac.web import IRequestHandler 29 30 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 30 from trac.wiki.api import IWikiSyntaxProvider , Context31 from trac.wiki.api import IWikiSyntaxProvider 31 32 32 33 -
trunk/trac/tests/wikisyntax.py
r4461 r4734 5 5 6 6 from trac.attachment import Attachment 7 from trac.context import Context 7 8 from trac.search.web_ui import SearchModule 8 9 from trac.test import Mock 9 10 from trac.web.href import Href 10 from trac.wiki.api import Context11 11 from trac.wiki.tests import formatter 12 12 -
trunk/trac/ticket/api.py
r4625 r4734 250 250 if context: 251 251 return html.A(label, href="%s#comment:%s" % \ 252 (context. self_href(), cnum),252 (context.resource_href(), cnum), 253 253 title="Comment %s for %s:%s" % \ 254 254 (cnum, context.realm, context.id)) -
trunk/trac/ticket/query.py
r4714 r4734 21 21 from StringIO import StringIO 22 22 23 from trac.context import Context 23 24 from trac.core import * 24 25 from trac.db import get_column_names … … 34 35 from trac.web.chrome import add_link, add_script, add_stylesheet, \ 35 36 INavigationContributor, Chrome 36 from trac.wiki.api import IWikiSyntaxProvider, parse_args , Context37 from trac.wiki.api import IWikiSyntaxProvider, parse_args 37 38 from trac.wiki.macros import WikiMacroBase # TODO: should be moved in .api 38 39 -
trunk/trac/ticket/report.py
r4714 r4734 21 21 from StringIO import StringIO 22 22 23 from trac.context import Context 23 24 from trac.core import * 24 25 from trac.db import get_column_names … … 30 31 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor, \ 31 32 Chrome 32 from trac.wiki import IWikiSyntaxProvider, Context,Formatter33 from trac.wiki import IWikiSyntaxProvider, Formatter 33 34 34 35 class ReportModule(Component): -
trunk/trac/ticket/roadmap.py
r4706 r4734 21 21 22 22 from trac import __version__ 23 from trac.context import Context 23 24 from trac.core import * 24 25 from trac.perm import IPermissionRequestor … … 33 34 from trac.web import IRequestHandler 34 35 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor 35 from trac.wiki.api import IWikiSyntaxProvider , Context36 from trac.wiki.api import IWikiSyntaxProvider 36 37 from trac.config import ExtensionOption 37 38 -
trunk/trac/ticket/tests/query.py
r4714 r4734 1 from trac.context import Context 1 2 from trac.log import logger_factory 2 3 from trac.test import Mock, EnvironmentStub 3 4 from trac.ticket.query import Query, QueryModule 4 from trac.wiki.api import Context5 5 from trac.wiki.formatter import LinkFormatter 6 6 -
trunk/trac/ticket/web_ui.py
r4456 r4734 23 23 from trac.attachment import Attachment, AttachmentModule 24 24 from trac.config import BoolOption, Option 25 from trac.context import Context 25 26 from trac.core import * 26 27 from trac.mimeview.api import Mimeview, IContentConverter … … 38 39 from trac.web.chrome import add_link, add_script, add_stylesheet, \ 39 40 INavigationContributor, Chrome 40 from trac.wiki.api import Context41 41 42 42 class InvalidTicket(TracError): -
trunk/trac/versioncontrol/web_ui/browser.py
r4653 r4734 25 25 26 26 from trac.config import ListOption, BoolOption, Option 27 from trac.context import Context 27 28 from trac.core import * 28 29 from trac.mimeview.api import Mimeview, is_binary, get_mimetype, \ … … 36 37 from trac.web.chrome import add_link, add_script, add_stylesheet, \ 37 38 INavigationContributor 38 from trac.wiki.api import IWikiSyntaxProvider , Context39 from trac.wiki.api import IWikiSyntaxProvider 39 40 from trac.versioncontrol.api import NoSuchChangeset 40 41 from trac.versioncontrol.web_ui.util import * -
trunk/trac/versioncontrol/web_ui/changeset.py
r4687 r4734 29 29 30 30 from trac.config import Option, BoolOption, IntOption 31 from trac.context import Context 31 32 from trac.core import * 32 33 from trac.mimeview import Mimeview, is_binary … … 45 46 from trac.web.chrome import add_link, add_script, add_stylesheet, \ 46 47 INavigationContributor, Chrome 47 from trac.wiki import IWikiSyntaxProvider, Context,Formatter48 from trac.wiki import IWikiSyntaxProvider, Formatter 48 49 49 50 -
trunk/trac/versioncontrol/web_ui/log.py
r4712 r4734 20 20 import urllib 21 21 22 from trac.context import Context 22 23 from trac.core import * 23 24 from trac.perm import IPermissionRequestor … … 32 33 from trac.web.chrome import add_link, add_stylesheet, INavigationContributor, \ 33 34 Chrome 34 from trac.wiki import IWikiSyntaxProvider, Context,Formatter35 from trac.wiki import IWikiSyntaxProvider, Formatter 35 36 36 37 LOG_LIMIT = 100 -
trunk/trac/wiki/api.py
r4725 r4734 209 209 href = property(fget=_get_href) 210 210 211 def self_href(self, rel=None, **kwargs):211 def resource_href(self, rel=None, **kwargs): 212 212 """Return a reference relative to the resource itself. 213 213 … … 215 215 >>> c = Context(EnvironmentStub(), None) 216 216 217 >>> c. self_href()217 >>> c.resource_href() 218 218 '/trac.cgi' 219 219 220 >>> c(abs_urls=True). self_href()220 >>> c(abs_urls=True).resource_href() 221 221 'http://example.org/trac.cgi' 222 222 223 >>> c('wiki', 'Main'). self_href()223 >>> c('wiki', 'Main').resource_href() 224 224 '/trac.cgi/wiki/Main' 225 225 226 226 Relative references start at the current id: 227 227 228 >>> c('wiki', 'Main'). self_href('#anchor')228 >>> c('wiki', 'Main').resource_href('#anchor') 229 229 '/trac.cgi/wiki/Main#anchor' 230 230 231 >>> c('wiki', 'Main'). self_href('./Sub')231 >>> c('wiki', 'Main').resource_href('./Sub') 232 232 '/trac.cgi/wiki/Main/Sub' 233 233 234 >>> c('wiki', 'Main/Sub'). self_href('..')234 >>> c('wiki', 'Main/Sub').resource_href('..') 235 235 '/trac.cgi/wiki/Main' 236 236 237 >>> c('wiki', 'Main'). self_href('../Other')237 >>> c('wiki', 'Main').resource_href('../Other') 238 238 '/trac.cgi/wiki/Other' 239 239 … … 241 241 242 242 >>> main_sub = c('wiki', 'Main/Sub') 243 >>> main_sub. self_href('../..')243 >>> main_sub.resource_href('../..') 244 244 '/trac.cgi/wiki' 245 245 246 >>> main_sub. self_href('../../..')246 >>> main_sub.resource_href('../../..') 247 247 '/trac.cgi/wiki' 248 248 249 249 References with anchors also work 250 250 251 >>> main_sub. self_href('#Check')251 >>> main_sub.resource_href('#Check') 252 252 '/trac.cgi/wiki/Main/Sub#Check' 253 253 -
trunk/trac/wiki/formatter.py
r4693 r4734 25 25 from StringIO import StringIO 26 26 27 from trac.context import Context 27 28 from trac.core import * 28 29 from trac.mimeview import * 29 from trac.wiki.api import WikiSystem , Context30 from trac.wiki.api import WikiSystem 30 31 from trac.util.html import escape, plaintext, Markup, Element, html 31 32 from trac.util.text import shorten_line, to_unicode … … 378 379 path = '/' + path.lstrip('/') 379 380 else: 380 path = self.context.self_href(path) 381 path = self.context.resource_href(path) 382 if '?' in path: 383 query = '&' + query.lstrip('?') 381 384 return html.A(label or rel, href=path + query + fragment) 382 385 else: … … 437 440 438 441 def _make_ext_link(self, url, text, title=''): 439 if not url.startswith(self.context.local_url()): 442 local_url = self.env.config.get('project', 'url') or \ 443 (self.req or self.env).abs_href.base 444 if not url.startswith(local_url): 440 445 return html.A(html.SPAN(text, class_="icon"), 441 446 class_="ext-link", href=url, title=title or None) -
trunk/trac/wiki/intertrac.py
r4621 r4734 17 17 import re 18 18 19 from trac.context import Context 19 20 from trac.core import * 20 21 from trac.util import sorted 21 22 from trac.util.html import Element, html 22 23 from trac.web import IRequestHandler 23 from trac.wiki.api import IWikiMacroProvider , Context24 from trac.wiki.api import IWikiMacroProvider 24 25 25 26 -
trunk/trac/wiki/tests/formatter.py
r4621 r4734 4 4 import unittest 5 5 6 from trac.context import Context 6 7 from trac.core import * 7 from trac.wiki.api import IWikiSyntaxProvider , Context8 from trac.wiki.api import IWikiSyntaxProvider 8 9 from trac.wiki.formatter import Formatter, OneLinerFormatter 9 10 from trac.wiki.macros import WikiMacroBase -
trunk/trac/wiki/tests/wikisyntax.py
r4723 r4734 4 4 import unittest 5 5 6 from trac.context import Context 6 7 from trac.test import Mock 7 8 from trac.util.datefmt import utc 8 9 from trac.web.href import Href 9 from trac.wiki.api import WikiSystem , Context10 from trac.wiki.api import WikiSystem 10 11 from trac.wiki.model import WikiPage 11 12 from trac.wiki.tests import formatter -
trunk/trac/wiki/web_ui.py
r4451 r4734 23 23 24 24 from trac.attachment import Attachment, AttachmentModule 25 from trac.context import Context 25 26 from trac.core import * 26 27 from trac.mimeview.api import Mimeview, IContentConverter … … 36 37 INavigationContributor 37 38 from trac.web import HTTPNotFound, IRequestHandler 38 from trac.wiki.api import IWikiPageManipulator, WikiSystem , Context39 from trac.wiki.api import IWikiPageManipulator, WikiSystem 39 40 from trac.wiki.model import WikiPage 40 41
Note:
See TracChangeset
for help on using the changeset viewer.