Edgewall Software

Ticket #1545 (closed defect: worksforme)

Opened 4 years ago

Last modified 11 months 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:

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

Change History

  Changed 4 years ago by pkou at ua.fm

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

  Changed 3 years ago by cmlenz

  • status changed from new to assigned

Point 1 was fixed in [1831].

  Changed 3 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.

  Changed 3 years ago by cmlenz

  • status changed from assigned to new
  • milestone changed from 0.9 to 1.0

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

  Changed 20 months ago by ecarter

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

follow-up: ↓ 7   Changed 19 months ago by pkou at ua.fm

I think this should be closed safely.

in reply to: ↑ 6   Changed 11 months ago by osimons

  • status changed from new to closed
  • resolution set to worksforme
  • milestone 1.0 deleted

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

Add/Change #1545 (Move ticket's status-related visible strings from Python to templates)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cmlenz. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.