Ticket #1545 (closed defect: worksforme)
Opened 7 years ago
Last modified 4 years ago
Move ticket's status-related visible strings from Python to templates
| Reported by: | pkou at ua.fm | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
There are several places in Trac Python code that define strings/parameters to be displayed in HTML. Areas of interest are the places where HTML text/code depends on ticket status directly. These places need to refactor with the following goals:
- Move HTML formatting from Python code to ClearSilver templates or CSS;
- Make the places status-independant.
The following places have been identified:
- trac/Query.py, function render_macro, preparation of a compact report:
- CSS class name depends on ticket status.
Suggested change: Define CSS styles for every ticket status and specify CSS class regardless of ticket status. - Depending on ticket status, it is added to Summary field.
Suggested change: Add ticket status for all tickets? Or remove?
- CSS class name depends on ticket status.
- trac/wiki/formatter.py, function _make_ticket_link, creating an URL for ticket reference in wiki:
- CSS class name depends on ticket status.
Suggested change: Define CSS styles for every ticket status and specify CSS class regardless of ticket status. - Ticket status is added to popup text for some statuses.
Suggested change: Add ticket status for all tickets.
- CSS class name depends on ticket status.
- trac/Ticket.py, function TicketModule.get_timeline_events, formatting title for an item in timeline:
- Text for timeline title depends on ticket status (verbs variable).
Suggested change: (easy) put ticket status - bad look for new tickets, (hard) - format ticket title in template depending on ticket type.
- Text for timeline title depends on ticket status (verbs variable).
Goal of the changes is to make Trac Python code independent from ticket status. This will allow use existing code without changes when new statuses are introduced or when they are changed.
(In preparation for #869)
Attachments
Change History
comment:1 Changed 7 years ago by pkou at ua.fm
comment:2 Changed 7 years ago by cmlenz
- Status changed from new to assigned
Point 1 was fixed in [1831].
comment:3 Changed 7 years ago by cmlenz
Point 2 fixed in [1948].
Point 3 is tricky indeed. Just putting the status in the title would be bad IMHO. Moving this into the templates is no longer an option as the template no longer does the formatting of the individual timeline event titles. No bright idea here ATM.
comment:4 Changed 6 years ago by cmlenz
- Milestone changed from 0.9 to 1.0
- Status changed from assigned to new
I don't see a good way to resolve point 3 for now. Postponing...
comment:5 Changed 5 years ago by ecarter
What do we need to do with this now that WorkFlow is in trunk?
comment:6 follow-up: ↓ 7 Changed 5 years ago by pkou at ua.fm
I think this should be closed safely.
comment:7 in reply to: ↑ 6 Changed 4 years ago by osimons
- Milestone 1.0 deleted
- Resolution set to worksforme
- Status changed from new to closed
Replying to pkou at ua.fm:
I think this should be closed safely.
Original reporter says 'close', so I'm closing... If nothing else, point 3 should also be resolved by the timeline-refactoring merge of [6158] for 0.11 (and most other things '0.11').



I am not sure that suggested changes are the better way for resolving this problem. Thus, review of the proposed changes is necessary before making them (or just implement as you think it is appropriate).