diff options
author | kiko%async.com.br <> | 2004-09-10 05:19:48 +0000 |
---|---|---|
committer | kiko%async.com.br <> | 2004-09-10 05:19:48 +0000 |
commit | abd483cec114d67992c89e72caa9ef53ac662c5f (patch) | |
tree | 4c99b272998c0efeb16857217fcc153c276a4570 | |
parent | c609afdd78ff6f41d1c127e22629ff3136880495 (diff) | |
download | bugs-abd483cec114d67992c89e72caa9ef53ac662c5f.tar bugs-abd483cec114d67992c89e72caa9ef53ac662c5f.tar.gz bugs-abd483cec114d67992c89e72caa9ef53ac662c5f.tar.bz2 bugs-abd483cec114d67992c89e72caa9ef53ac662c5f.tar.xz bugs-abd483cec114d67992c89e72caa9ef53ac662c5f.zip |
Fix for bug 232659: Fix inconsistent attachment links (and clean up diff
viewer UI while we're at it). Do just that. r=myk, a=myk.
-rw-r--r-- | template/en/default/attachment/diff-file.html.tmpl | 4 | ||||
-rw-r--r-- | template/en/default/attachment/diff-header.html.tmpl | 76 | ||||
-rw-r--r-- | template/en/default/attachment/edit.html.tmpl | 7 | ||||
-rw-r--r-- | template/en/default/filterexceptions.pl | 3 |
4 files changed, 49 insertions, 41 deletions
diff --git a/template/en/default/attachment/diff-file.html.tmpl b/template/en/default/attachment/diff-file.html.tmpl index a25c1125a..11fdc6136 100644 --- a/template/en/default/attachment/diff-file.html.tmpl +++ b/template/en/default/attachment/diff-file.html.tmpl @@ -24,7 +24,7 @@ # relations can change and screw up the javascript for restoring, collapsing # and expanding. Do not change without testing all three of those. #%] -<table class="file_table"><thead><tr><td class="file_head" colspan="2"><a style="text-decoration: none" href="#" onclick="return twisty_click(this)">[% collapsed ? '(+)' : '(-)' %]</a><input type="checkbox" name="[% file.filename FILTER html %]"[% collapsed ? '' : ' checked' %] style="display: none"> +<table class="file_table"><thead><tr><td class="file_head" colspan="2"><a href="#" onclick="return twisty_click(this)">[% collapsed ? '(+)' : '(-)' %]</a><input type="checkbox" name="[% file.filename FILTER html %]"[% collapsed ? '' : ' checked' %] style="display: none"> [% IF lxr_prefix && !file.is_add %] <a href="[% lxr_prefix %]">[% file.filename FILTER html %]</a> [% ELSE %] @@ -76,7 +76,7 @@ incremental_restore() [% section.func_info FILTER html IF section.func_info %] [% END %] </th><th> - <a name="[% file.filename FILTER html %]_sec[% section_num %]"><a href="#[% file.filename FILTER html %]_sec[% section_num %]">Link Here</a></a> + <a name="[% file.filename FILTER html %]_sec[% section_num %]" href="#[% file.filename FILTER html %]_sec[% section_num %]">Link Here</a> </th></tr></table> </th></tr> [% FOREACH group = section.groups %] diff --git a/template/en/default/attachment/diff-header.html.tmpl b/template/en/default/attachment/diff-header.html.tmpl index 3d96d0f70..e3ca1ac41 100644 --- a/template/en/default/attachment/diff-header.html.tmpl +++ b/template/en/default/attachment/diff-header.html.tmpl @@ -25,60 +25,77 @@ [% title = BLOCK %] [% IF attachid %] -Attachment #[% attachid %] for [% terms.Bug %] #[% bugid %] +Attachment #[% attachid %] for [% terms.bug %] #[% bugid %] [% ELSE %] -Interdiff of #[% oldid %] and #[% newid %] for #[% terms.Bug %] #[% bugid %] +Interdiff of #[% oldid %] and #[% newid %] for #[% terms.bug %] #[% bugid %] [% END %] [% END %] [% style = BLOCK %] .file_head { - font-size: x-large; font-weight: bold; - background-color: #d3d3d3; + font-size: 1em; + background-color: #c3c3c3; border: 1px solid black; width: 100%; } + +.file_head a { + text-decoration: none; + font-family: monospace; + font-size: 1.1em; +} + .file_collapse { display: none; } + .section_head { width: 100%; - font-weight: bold; - background-color: #d3d3d3; + background-color: #f0f0f0; border: 1px solid black; text-align: left; } + table.file_table { table-layout: fixed; width: 100%; empty-cells: show; border-spacing: 0px; border-collapse: collapse; + /* draw border below last open context section in listing */ + border-bottom: 1px solid black; } + tbody.file td { border-left: 1px dashed black; border-right: 1px dashed black; width: 50%; } + tbody.file pre { display: inline; white-space: -moz-pre-wrap; font-size: 0.9em; } + tbody.file pre:empty { display: block; height: 1em; } + .changed { background-color: lightblue; } + .added { background-color: lightgreen; } + .removed { background-color: #FFCC99; } + .warning { color: red } @@ -186,22 +203,21 @@ tbody.file pre:empty { [% onload = 'restore_all(); document.checkboxform.restore_indicator.checked = true' %] +[% BLOCK viewurl %]attachment.cgi?id=[% id %][% END %] +[% BLOCK editurl %][% PROCESS viewurl %]&action=edit[% END %] +[% BLOCK diffurl %][% PROCESS viewurl %]&action=diff[% END %] + [% IF headers %] [% h1 = BLOCK %] [% IF attachid %] - [% description FILTER html %] (#[% attachid %]) + Attachment #[% attachid %]: [% description FILTER html %] [% ELSE %] - [% USE url %] - [% old_url = url('attachment.cgi', action = 'diff', id = oldid) %] - [% new_url = url('attachment.cgi', action = 'diff', id = newid) %] Diff Between - <a href="[% old_url %]">[% old_desc FILTER html %]</a> - (#[% oldid %]) + #[% oldid %]: <a href="[% PROCESS diffurl id=oldid %]">[% old_desc FILTER html %]</a> and - <a href="[% new_url %]">[% new_desc FILTER html %]</a> - (#[% newid %]) + #[% newid %]: <a href="[% PROCESS diffurl id=newid %]">[% new_desc FILTER html %]</a> [% END %] - for <a href="show_bug.cgi?id=[% bugid %]">[% terms.Bug %] #[% bugid %]</a> + for <a href="show_bug.cgi?id=[% bugid %]">[% terms.bug %] #[% bugid %]</a> [% END %] [% h2 = BLOCK %] [% bugsummary FILTER html %] @@ -226,18 +242,14 @@ tbody.file pre:empty { [% IF attachid %] [%# HEADER %] [% IF headers %] - [% USE url('attachment.cgi', id = attachid) %] - <a href="[% url() %]">View</a> - | <a href="[% url(action = 'edit') %]">Edit</a> - [% USE url('attachment.cgi', id = attachid, context = context, - collapsed = collapsed, headers = headers, - action = 'diff') %] - | <a href="[% url(format = 'raw') %]">Raw Unified</a> + <a href="[% PROCESS viewurl id=attachid %]">View</a> + | <a href="[% PROCESS editurl id=attachid %]">Edit</a> + | <a href="[% PROCESS diffurl id=attachid %]&context=[% context FILTER html %]&collapsed=[% collapsed FILTER html %]&headers=[% headers FILTER html %]&format=raw">Raw Unified</a> [% END %] [% IF other_patches %] [% IF headers %] |[%END%] Differences between - <form style="display: inline"> + <form style="display: inline" action=""> <select name="oldid"> [% FOREACH patch = other_patches %] <option value="[% patch.id %]" @@ -255,13 +267,8 @@ tbody.file pre:empty { <br> [% ELSE %] [% IF headers %] - [% USE url('attachment.cgi', newid = newid, oldid = oldid, action = 'interdiff') %] - <a href="[% url(format = 'raw') %]">Raw Unified</a> - [% IF attachid %] - <br> - [% ELSE %] + <a href="attachment.cgi?oldid=[% oldid %]&newid=[% newid %]&action=interdiff&format=raw">Raw Unified</a> | - [% END %] [% END %] [% END %] @@ -276,23 +283,24 @@ tbody.file pre:empty { onclick="return expand_all()">Expand All</a> [% IF do_context %] + [%# only happens for normal viewing, not interdiff %] | <span style='font-weight: bold'>Context:</span> [% IF context == "patch" %] (<strong>Patch</strong> / [% ELSE %] - (<a href="[% url(context = '') %]">Patch</a> / + (<a href="[% PROCESS diffurl id=attachid %]&headers=[% headers FILTER html %]">Patch</a> / [% END %] [% IF context == "file" %] <strong>File</strong> / [% ELSE %] - <a href="[% url(context = 'file') %]">File</a> / + <a href="[% PROCESS diffurl id=attachid %]&headers=[% headers FILTER html %]&context=file">File</a> / [% END %] [% IF context == "patch" || context == "file" %] [% context = 3 %] [% END %] [%# textbox for context %] - <form style="display: inline"><input type="hidden" name="action" value="diff"><input type="hidden" name="id" value="[% attachid %]"><input type="hidden" name="collapsed" value="[% collapsed FILTER html %]"><input type="hidden" name="headers" value="[% headers FILTER html %]"><input type="text" name="context" value="[% context FILTER html %]" size="3"></form>) + <form style="display: inline" action=""><input type="hidden" name="action" value="diff"><input type="hidden" name="id" value="[% attachid %]"><input type="hidden" name="collapsed" value="[% collapsed FILTER html %]"><input type="hidden" name="headers" value="[% headers FILTER html %]"><input type="text" name="context" value="[% context FILTER html %]" size="3"></form>) [% END %] [% IF warning %] @@ -307,10 +315,12 @@ tbody.file pre:empty { [%+ terms.Bugzilla %] when comparing patches made against different revisions. [% END %] </h2> +[% ELSE %] + <br><br> [% END %] [%# Restore Stuff %] -<form name="checkboxform"> +<form name="checkboxform" action=""> <input type="checkbox" name="restore_indicator" style="display: none"> diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index a05945df0..a4888f80d 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -247,9 +247,9 @@ [% IF isviewable %] <td width="75%"> <textarea id="editFrame" name="comment" style="height: 400px; width: 100%; display: none;" cols="80" wrap="soft"></textarea> - <iframe id="viewFrame" src="attachment.cgi?id=[% attachid %]&action=view" style="height: 400px; width: 100%;"> + <iframe id="viewFrame" src="attachment.cgi?id=[% attachid %]" style="height: 400px; width: 100%;"> <b>You cannot view the attachment while editing it because your browser does not support IFRAMEs. - <a href="attachment.cgi?id=[% attachid %]&action=view">View the attachment on a separate page</a>.</b> + <a href="attachment.cgi?id=[% attachid %]">View the attachment on a separate page</a>.</b> </iframe> <script type="application/x-javascript" language="JavaScript"> <!-- @@ -276,8 +276,7 @@ able to display. </b></p> <p><b> - <a href="attachment.cgi?id=[% attachid %]&action=view">Download - the attachment</a>. + <a href="attachment.cgi?id=[% attachid %]">Download the attachment</a>. </b></p> </td> [% END %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index c1921a908..9c8cd3b5b 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -471,9 +471,8 @@ 'attachment/diff-header.html.tmpl' => [ 'attachid', + 'id', 'bugid', - 'old_url', - 'new_url', 'oldid', 'newid', 'style', |