Opened 18 years ago
Last modified 9 years ago
#5227 new enhancement
provide option to insert summary in a ticket link
Reported by: | Eli Carter | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | next-major-releases |
Component: | wiki system | Version: | devel |
Severity: | minor | Keywords: | |
Cc: | Ryan J Ollos, Thijs Triemstra | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
It would be nice to be able to create a ticket link that automatically includes the summary line for the ticket. A possible syntax for this could be [ticket:23:summary]
and have it do the same thing as [ticket:23 #23: Prettier "Access Denied" message.]
, so it would look like #23: Prettier "Access Denied" message..
Attachments (2)
Change History (24)
comment:1 by , 18 years ago
comment:2 by , 17 years ago
+1 to this. I also think the syntax proposed by cboos work would quite well.
comment:3 by , 17 years ago
I'd strongly prefer this being a macro. The wiki links syntax is complicated enough already.
comment:4 by , 17 years ago
With 0.11 it can be a [[Resource]]
macro that takes in realm, id and optionally version, and uses the presentation and link generation from the Resource system. Nice and generic, and will work for anything in Trac or added to Trac via plugins that supports the new resource system.
The Resource API has a get_resource_description()
that supports a format=summary
parameter as input - a nice default, with 'default' and 'compact' as optional args.
A 10-line macro. No further changes needed.
comment:5 by , 17 years ago
Component: | ticket system → wiki |
---|---|
Milestone: | → 0.12 |
Owner: | changed from | to
Priority: | normal → low |
Severity: | normal → minor |
Version: | → devel |
Interesting. A bit more verbose than the original proposal, but as you said, more general.
comment:6 by , 16 years ago
is this "10 line makro" somewhere available? I didn't find it anywhere on trac-hacks or somewhere else. And i am not in writing trac makros, so it would take more time, than i have to do this.
comment:8 by , 14 years ago
OK - I made a few false starts, but I put together a fairly simple Resource macro that might do.
I would guess I am being too lenient for parameters (e.g. stripping whitespace, and allowing parameters to be passed as args or keywords). Removing most of that would make the macro super simple :)
follow-up: 10 comment:9 by , 14 years ago
Oh - and maybe to achieve the proposed return value above how about a 'complete' resource display format? which would also include the defect number? (Summary doesn't contain the #23
in #23: Prettier "Access Denied" message.
i.e. the 'summary' format is defect: Prettier "Access Denied" message.(closed)
comment:10 by , 14 years ago
Replying to Mark Mc Mahon <mark.mcmahon@…>:
Oh - and maybe to achieve the proposed return value above how about a 'complete' resource display format?
Isn't there already a "short" format that returns the short form of the link? This could be used in combination with the default format.
follow-up: 12 comment:11 by , 14 years ago
I guess you could..
[[Resource(ticket,23,format=compact]][[Resource(ticket,23,format=summary]]
would produce something like
#23 defect: Prettier "Access Denied" message.(closed)
I just noticed that the doc string in the patch is incorrect - it mentions 'complete' rather than 'summary' format.
comment:12 by , 14 years ago
Replying to Mark Mc Mahon <mark.mcmahon@…>:
I guess you could..
[[Resource(ticket,23,format=compact]][[Resource(ticket,23,format=summary]]
Or even:
[[Resource(ticket,23,format=compact|summary]]
and have the macro concatenate both.
by , 14 years ago
Attachment: | resource_macro_multiple_formats.patch added |
---|
Allow multiple formats separated with | character
comment:13 by , 14 years ago
I have added a new patch which allows multiple formats to be supplied. To tell the truth I feel that maybe a format string might be a good way to go for Resource.render_resource_link().
realm, version, id would be common parameters across all resource types, and then each individual resource may have other resource types (e.g. summary, status, etc for tickets, due_date for milestones, etc)
comment:14 by , 14 years ago
Cc: | added |
---|
comment:15 by , 14 years ago
#10117 suggested the #10117#
syntax for this feature. Nice!
Note that the syntax I suggested in comment:1 could have an abbreviated form like #10117+
, so quite close.
Note also that the [[TicketQuery(10117)]]
alternative suggested by Remy in that other ticket has the disadvantage to introduce a <div>
, whereas the #10117+
form could just produce an <a>
like #10117
does.
comment:16 by , 14 years ago
Cc: | added |
---|
follow-up: 18 comment:17 by , 12 years ago
follow-up: 19 comment:18 by , 12 years ago
In the end I use the TicketQuery macro:
[[TicketQuery(id=10117)]]
which shows
- #10117
- Reference to ticket should also (optionally) display ticket summary
Hope this helps.
Replying to anonymous:
so the result is ?
I just want not write the title of #23 ,but want display the title of #23 by link.
comment:20 by , 11 years ago
Cc: | added; removed |
---|
comment:22 by , 9 years ago
Owner: | removed |
---|
I have one reserve about this: usually, the ":" is used for separating arguments composing the target of the link (e.g.
comment:1:ticket:5227
,googlegroups:trac-dev:7505cdd4e241b5a8
). In this case, you'd not link to the summary of the ticket, but rather change the presentation of the link. So I think we should come up with another syntax, something that could eventually be generalized to other kinds of label tweaking.E.g.
[ticket:123+summary]
That could be transposed in other contexts:
wiki:TracDev+title
,report:23+title
…