Edgewall Software
Modify

Opened 19 years ago

Closed 17 years ago

#1545 closed defect (worksforme)

Move ticket's status-related visible strings from Python to templates

Reported by: pkou at ua.fm Owned by: Christopher Lenz
Priority: normal Milestone:
Component: ticket system Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal 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:

  1. trac/Query.py, function render_macro, preparation of a compact report:
    1. CSS class name depends on ticket status.
      Suggested change: Define CSS styles for every ticket status and specify CSS class regardless of ticket status.
    2. Depending on ticket status, it is added to Summary field.
      Suggested change: Add ticket status for all tickets? Or remove?
  2. trac/wiki/formatter.py, function _make_ticket_link, creating an URL for ticket reference in wiki:
    1. CSS class name depends on ticket status.
      Suggested change: Define CSS styles for every ticket status and specify CSS class regardless of ticket status.
    2. Ticket status is added to popup text for some statuses.
      Suggested change: Add ticket status for all tickets.
  3. trac/Ticket.py, function TicketModule.get_timeline_events, formatting title for an item in timeline:
    1. 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.

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 (0)

Change History (7)

comment:1 by pkou at ua.fm, 19 years ago

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).

comment:2 by Christopher Lenz, 19 years ago

Status: newassigned

Point 1 was fixed in [1831].

comment:3 by Christopher Lenz, 19 years ago

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 by Christopher Lenz, 19 years ago

Milestone: 0.91.0
Status: assignednew

I don't see a good way to resolve point 3 for now. Postponing…

comment:5 by Eli Carter, 17 years ago

What do we need to do with this now that WorkFlow is in trunk?

comment:6 by pkou at ua.fm, 17 years ago

I think this should be closed safely.

in reply to:  6 comment:7 by osimons, 17 years ago

Milestone: 1.0
Resolution: worksforme
Status: newclosed

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').

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.