Edgewall Software

Opened 10 years ago

Last modified 8 years ago

#11565 closed task

Reduce code duplication in about and error pages — at Version 5

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.2
Component: general Version: 1.0-stable
Severity: normal Keywords: about error refactoring
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Having to make modifications in both error.html and about.html in #11558, I was looking at the duplicated code and possibilities for re-use.

The major change that will be proposed is the extraction of code to a new template environment_info.html, which is included in both error.html and about.html.

The differences I could see between the information displayed on the two pages and the steps I tool to resolve the differences are:

  1. Headings on tables in about.html, but no headings in error.html - environment_info.html has heading on tables.
  2. Plugins table on about.html also shows disabled plugins - existing behavior preserved on both pages.
  3. Plugins table on error.html links to frames in stacktrace - existing behavior preserved on both pages.
  4. Markup was slightly different, with divs enclosing each table on about.html, and the ids on the divs rather than on the tables, as error.html does - tables in environment_info.html now have enclosing divs.
  5. The plugins section on the error page read Enabled Plugins; on the about page it read Installed Plugins. The environment_info.html template reads Installed Plugins, however the error.html page continues to show only enabled plugins, whereas the about.html page shows both Enabled and Disabled plugins.

The change in markup on error.html in (4) means that these changes should only be made on the trunk. These changes will also help with #11548, in reducing the number of code changes needed for adding templates to the environment info on about.html and error.html (at least on the trunk).

The CSS for #content.error and #content.about was very similar. I merged about.css into trac.css, and merged several of the rules so that they apply to the new template environment_info.html.

Change History (5)

comment:1 by Ryan J Ollos, 10 years ago

I'll wait until the changes in #11558 are committed and rebase my local t11565 branch on those changes before posting log:rjollos.git:t11565.

comment:2 by Ryan J Ollos, 10 years ago

Description: modified (diff)

comment:3 by Ryan J Ollos, 10 years ago

Keywords: refactoring added
Milestone: undecided1.1.2
Owner: set to Ryan J Ollos
Status: newassigned
Version: 1.0-stable

comment:4 by Ryan J Ollos, 10 years ago

When the about.py module was added in [4264] there was a page for each section: /about/config and /about/plugins. In [4593] the sections were combined into a single page. The regex could be simplified after [4593]:

-re.match(r'/about(?:_trac)?(?:/.+)?$', req.path_info)
+re.match(r'/about(?:_trac)?$', req.path_info)

Is there any reason to not make this change on the trunk?

Last edited 10 years ago by Ryan J Ollos (previous) (diff)

comment:5 by Ryan J Ollos, 10 years ago

Description: modified (diff)

Proposed changes can be found in log:rjollos.git:t11565.

Note: See TracTickets for help on using tickets.