Modify

Opened 8 years ago

Closed 12 months ago

Last modified 8 months ago

#940 closed enhancement (fixed)

Allow URLs relative to project root

Reported by: anonymous Owned by: rjollos
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 manski 5 years ago.
Patch against r1023 and Trac 0.11.4

Download all attachments as: .zip

Change History (9)

comment:1 Changed 5 years ago by jevans

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 5 years ago by manski

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

Changed 5 years ago by manski

Patch against r1023 and Trac 0.11.4

comment:3 Changed 3 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 12 months ago by rjollos

  • Owner changed from otaku42 to rjollos
  • Status changed from new to assigned

comment:5 Changed 12 months ago by rjollos

In 13383:

Refs #940: Make href project-relative.

comment:6 Changed 12 months ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:7 Changed 12 months ago by rjollos

In 13385:

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

comment:8 Changed 8 months ago by rjollos

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

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.