Opened 10 years ago
Last modified 10 years ago
#11406 closed defect
diff.css is added twice on the diff_view page — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | css |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
On a page such as /wiki/WikiStart?action=diff&version=2
, the diff.css
stylsheet is added to the page twice. I noticed this when trying to modify the CSS in the browser while working on #11403.
The issue happens for all the cases in which diff_view.html
is used, since for each case there is a call to add_stylesheet
in the Python code.
$ grep -R "diff_view\.html" trac --exclude-dir=locale --exclude=*.pyc trac/ticket/web_ui.py: return 'diff_view.html', data, None trac/ticket/web_ui.py: return 'diff_view.html', data, None trac/wiki/templates/wiki_diff.html: <xi:include href="diff_view.html" />
The proposed change is:
-
trac/templates/diff_view.html
diff --git a/trac/templates/diff_view.html b/trac/templates/diff_view.html index 3c74b8a..40542a2 100644
a b 8 8 <xi:include href="layout.html" /> 9 9 <head> 10 10 <title>$title</title> 11 <link rel="stylesheet" type="text/css" href="${chrome.htdocs_location}css/d12 11 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> 13 12 </head>
The issue seems to have been present ever since the template was added in [4347] (it was named ticket_diff.html
at that time). #11126 also suggests making this change, but doesn't mention that diff.css
is added to the page twice.
It might be better to make the change on the trunk rather than on 1.0-stable since we might be concerned that a plugin utilizing diff_view.html
is expecting diff.css
to be added by the template.