Modify ↓
Opened 16 years ago
Closed 8 years ago
#5361 closed defect (wontfix)
[new version] script does not work well with multi-trac installations
| Reported by: | Justin Rovang | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | LoggedInScript |
| Severity: | normal | Keywords: | login |
| Cc: | Justin Rovang | Trac Release: | 0.11 |
Description
If you have multiple instances installed under a single handler it won't pick up the extra path.
e.g.: www.blah.com/trac (works fine) www.blah.com/projects/tracInstance1 (doesn't pick up the dir correctly)
Below may be a slightly more flexible solution
<head py:match="head" py:attrs="select('@*')"> ${select('*')} <script type="text/javascript"> jQuery(document).ready(function($) { $('#metanav li.first:contains("logged in as")').each(function() { var path = $('#mainnav li.first a').attr('href').split('/'); path.pop(); path = path.join('/'); var user = $(this).text().split(' ').pop(); var link = '<a href="' + path + '/wiki/' + user + '">' + user + '</a>'; $(this).html('logged in as ' + link); return false; }); }); </script> </head>
Attachments (0)
Change History (3)
comment:1 Changed 16 years ago by
| Keywords: | login added |
|---|---|
| Summary: | Script does not work well with multi-trac installations → [new version] script does not work well with multi-trac installations |
comment:2 Changed 11 years ago by
| Owner: | Douglas Clifton deleted |
|---|
comment:3 Changed 8 years ago by
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Note: See
TracTickets for help on using
tickets.



I just wanted to reflect in the title, that there is already a solution in here.