Modify

Opened 17 years ago

Closed 11 years ago

Last modified 10 years ago

#940 closed enhancement (fixed)

Allow URLs relative to project root

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: NavAddPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

When hosting several projects on the same server, there is no way currently to add a button through the global trac.ini that will point to a URL relative to each project.

E.g. for one project it would end up pointing to http://domain.com/proj1/report/1, but on the next to http://domain.com/proj2/report/1

Attachments (1)

path-relative.patch (455 bytes) - added by Sebastian Krysmanski 15 years ago.
Patch against r1023 and Trac 0.11.4

Download all attachments as: .zip

Change History (9)

comment:1 Changed 15 years ago by J Evan S

Yes, this would be useful.

For instance I'd like to add a direct link to the query module to the bar. But if I enter '/query', it says "Environment not found."

comment:2 Changed 15 years ago by Sebastian Krysmanski

This was fairly simple. I've added a patch that makes all URLs relative to the project's root URL.

Changed 15 years ago by Sebastian Krysmanski

Attachment: path-relative.patch added

Patch against r1023 and Trac 0.11.4

comment:3 Changed 13 years ago by rlrj60

The attachment:path-relative.patch does not work if url is an absolute URL.

For example, if url = "http://www.example...", it would turn into something like url = "http://my.trac.com/myproj/http://www.example...".

I think it should check for '/' that indicate the root path of the project. Here's my simple fix:

if url[0] == '/':
    url = self.env.href() + url

comment:4 Changed 11 years ago by Ryan J Ollos

Owner: changed from Michael Renzmann to Ryan J Ollos
Status: newassigned

comment:5 Changed 11 years ago by Ryan J Ollos

In 13383:

Refs #940: Make href project-relative.

comment:6 Changed 11 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

comment:7 Changed 11 years ago by Ryan J Ollos

In 13385:

Refs #940: Refactor code to use a ListOption and add doc. Bumped version to 0.2.

comment:8 Changed 10 years ago by Ryan J Ollos

Additional changes relating to this feature were made in #11443.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.