Commit abd483ce authored by kiko%async.com.br's avatar kiko%async.com.br

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.
parent c609afdd
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
# relations can change and screw up the javascript for restoring, collapsing # relations can change and screw up the javascript for restoring, collapsing
# and expanding. Do not change without testing all three of those. # 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 %] [% IF lxr_prefix && !file.is_add %]
<a href="[% lxr_prefix %]">[% file.filename FILTER html %]</a> <a href="[% lxr_prefix %]">[% file.filename FILTER html %]</a>
[% ELSE %] [% ELSE %]
...@@ -76,7 +76,7 @@ incremental_restore() ...@@ -76,7 +76,7 @@ incremental_restore()
&nbsp;&nbsp;[% section.func_info FILTER html IF section.func_info %] &nbsp;&nbsp;[% section.func_info FILTER html IF section.func_info %]
[% END %] [% END %]
</th><th> </th><th>
<a name="[% file.filename FILTER html %]_sec[% section_num %]"><a href="#[% file.filename FILTER html %]_sec[% section_num %]">Link&nbsp;Here</a></a>&nbsp; <a name="[% file.filename FILTER html %]_sec[% section_num %]" href="#[% file.filename FILTER html %]_sec[% section_num %]">Link&nbsp;Here</a>&nbsp;
</th></tr></table> </th></tr></table>
</th></tr> </th></tr>
[% FOREACH group = section.groups %] [% FOREACH group = section.groups %]
......
...@@ -25,60 +25,77 @@ ...@@ -25,60 +25,77 @@
[% title = BLOCK %] [% title = BLOCK %]
[% IF attachid %] [% IF attachid %]
Attachment #[% attachid %] for [% terms.Bug %] #[% bugid %] Attachment #[% attachid %] for [% terms.bug %] #[% bugid %]
[% ELSE %] [% ELSE %]
Interdiff of #[% oldid %] and #[% newid %] for #[% terms.Bug %] #[% bugid %] Interdiff of #[% oldid %] and #[% newid %] for #[% terms.bug %] #[% bugid %]
[% END %] [% END %]
[% END %] [% END %]
[% style = BLOCK %] [% style = BLOCK %]
.file_head { .file_head {
font-size: x-large;
font-weight: bold; font-weight: bold;
background-color: #d3d3d3; font-size: 1em;
background-color: #c3c3c3;
border: 1px solid black; border: 1px solid black;
width: 100%; width: 100%;
} }
.file_head a {
text-decoration: none;
font-family: monospace;
font-size: 1.1em;
}
.file_collapse { .file_collapse {
display: none; display: none;
} }
.section_head { .section_head {
width: 100%; width: 100%;
font-weight: bold; background-color: #f0f0f0;
background-color: #d3d3d3;
border: 1px solid black; border: 1px solid black;
text-align: left; text-align: left;
} }
table.file_table { table.file_table {
table-layout: fixed; table-layout: fixed;
width: 100%; width: 100%;
empty-cells: show; empty-cells: show;
border-spacing: 0px; border-spacing: 0px;
border-collapse: collapse; border-collapse: collapse;
/* draw border below last open context section in listing */
border-bottom: 1px solid black;
} }
tbody.file td { tbody.file td {
border-left: 1px dashed black; border-left: 1px dashed black;
border-right: 1px dashed black; border-right: 1px dashed black;
width: 50%; width: 50%;
} }
tbody.file pre { tbody.file pre {
display: inline; display: inline;
white-space: -moz-pre-wrap; white-space: -moz-pre-wrap;
font-size: 0.9em; font-size: 0.9em;
} }
tbody.file pre:empty { tbody.file pre:empty {
display: block; display: block;
height: 1em; height: 1em;
} }
.changed { .changed {
background-color: lightblue; background-color: lightblue;
} }
.added { .added {
background-color: lightgreen; background-color: lightgreen;
} }
.removed { .removed {
background-color: #FFCC99; background-color: #FFCC99;
} }
.warning { .warning {
color: red color: red
} }
...@@ -186,22 +203,21 @@ tbody.file pre:empty { ...@@ -186,22 +203,21 @@ tbody.file pre:empty {
[% onload = 'restore_all(); document.checkboxform.restore_indicator.checked = true' %] [% onload = 'restore_all(); document.checkboxform.restore_indicator.checked = true' %]
[% BLOCK viewurl %]attachment.cgi?id=[% id %][% END %]
[% BLOCK editurl %][% PROCESS viewurl %]&amp;action=edit[% END %]
[% BLOCK diffurl %][% PROCESS viewurl %]&amp;action=diff[% END %]
[% IF headers %] [% IF headers %]
[% h1 = BLOCK %] [% h1 = BLOCK %]
[% IF attachid %] [% IF attachid %]
[% description FILTER html %] (#[% attachid %]) Attachment #[% attachid %]: [% description FILTER html %]
[% ELSE %] [% ELSE %]
[% USE url %]
[% old_url = url('attachment.cgi', action = 'diff', id = oldid) %]
[% new_url = url('attachment.cgi', action = 'diff', id = newid) %]
Diff Between Diff Between
<a href="[% old_url %]">[% old_desc FILTER html %]</a> #[% oldid %]: <a href="[% PROCESS diffurl id=oldid %]">[% old_desc FILTER html %]</a>
(#[% oldid %])
and and
<a href="[% new_url %]">[% new_desc FILTER html %]</a> #[% newid %]: <a href="[% PROCESS diffurl id=newid %]">[% new_desc FILTER html %]</a>
(#[% newid %])
[% END %] [% 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 %] [% END %]
[% h2 = BLOCK %] [% h2 = BLOCK %]
[% bugsummary FILTER html %] [% bugsummary FILTER html %]
...@@ -226,18 +242,14 @@ tbody.file pre:empty { ...@@ -226,18 +242,14 @@ tbody.file pre:empty {
[% IF attachid %] [% IF attachid %]
[%# HEADER %] [%# HEADER %]
[% IF headers %] [% IF headers %]
[% USE url('attachment.cgi', id = attachid) %] <a href="[% PROCESS viewurl id=attachid %]">View</a>
<a href="[% url() %]">View</a> | <a href="[% PROCESS editurl id=attachid %]">Edit</a>
| <a href="[% url(action = 'edit') %]">Edit</a> | <a href="[% PROCESS diffurl id=attachid %]&amp;context=[% context FILTER html %]&amp;collapsed=[% collapsed FILTER html %]&amp;headers=[% headers FILTER html %]&amp;format=raw">Raw&nbsp;Unified</a>
[% USE url('attachment.cgi', id = attachid, context = context,
collapsed = collapsed, headers = headers,
action = 'diff') %]
| <a href="[% url(format = 'raw') %]">Raw Unified</a>
[% END %] [% END %]
[% IF other_patches %] [% IF other_patches %]
[% IF headers %] |[%END%] [% IF headers %] |[%END%]
Differences between Differences between
<form style="display: inline"> <form style="display: inline" action="">
<select name="oldid"> <select name="oldid">
[% FOREACH patch = other_patches %] [% FOREACH patch = other_patches %]
<option value="[% patch.id %]" <option value="[% patch.id %]"
...@@ -255,13 +267,8 @@ tbody.file pre:empty { ...@@ -255,13 +267,8 @@ tbody.file pre:empty {
<br> <br>
[% ELSE %] [% ELSE %]
[% IF headers %] [% IF headers %]
[% USE url('attachment.cgi', newid = newid, oldid = oldid, action = 'interdiff') %] <a href="attachment.cgi?oldid=[% oldid %]&amp;newid=[% newid %]&amp;action=interdiff&amp;format=raw">Raw Unified</a>
<a href="[% url(format = 'raw') %]">Raw Unified</a>
[% IF attachid %]
<br>
[% ELSE %]
| |
[% END %]
[% END %] [% END %]
[% END %] [% END %]
...@@ -276,23 +283,24 @@ tbody.file pre:empty { ...@@ -276,23 +283,24 @@ tbody.file pre:empty {
onclick="return expand_all()">Expand All</a> onclick="return expand_all()">Expand All</a>
[% IF do_context %] [% IF do_context %]
[%# only happens for normal viewing, not interdiff %]
| <span style='font-weight: bold'>Context:</span> | <span style='font-weight: bold'>Context:</span>
[% IF context == "patch" %] [% IF context == "patch" %]
(<strong>Patch</strong> / (<strong>Patch</strong> /
[% ELSE %] [% ELSE %]
(<a href="[% url(context = '') %]">Patch</a> / (<a href="[% PROCESS diffurl id=attachid %]&amp;headers=[% headers FILTER html %]">Patch</a> /
[% END %] [% END %]
[% IF context == "file" %] [% IF context == "file" %]
<strong>File</strong> / <strong>File</strong> /
[% ELSE %] [% ELSE %]
<a href="[% url(context = 'file') %]">File</a> / <a href="[% PROCESS diffurl id=attachid %]&amp;headers=[% headers FILTER html %]&amp;context=file">File</a> /
[% END %] [% END %]
[% IF context == "patch" || context == "file" %] [% IF context == "patch" || context == "file" %]
[% context = 3 %] [% context = 3 %]
[% END %] [% END %]
[%# textbox for context %] [%# 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 %] [% END %]
[% IF warning %] [% IF warning %]
...@@ -307,10 +315,12 @@ tbody.file pre:empty { ...@@ -307,10 +315,12 @@ tbody.file pre:empty {
[%+ terms.Bugzilla %] when comparing patches made against different revisions. [%+ terms.Bugzilla %] when comparing patches made against different revisions.
[% END %] [% END %]
</h2> </h2>
[% ELSE %]
<br><br>
[% END %] [% END %]
[%# Restore Stuff %] [%# Restore Stuff %]
<form name="checkboxform"> <form name="checkboxform" action="">
<input type="checkbox" name="restore_indicator" style="display: none"> <input type="checkbox" name="restore_indicator" style="display: none">
...@@ -247,9 +247,9 @@ ...@@ -247,9 +247,9 @@
[% IF isviewable %] [% IF isviewable %]
<td width="75%"> <td width="75%">
<textarea id="editFrame" name="comment" style="height: 400px; width: 100%; display: none;" cols="80" wrap="soft"></textarea> <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 %]&amp;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. <b>You cannot view the attachment while editing it because your browser does not support IFRAMEs.
<a href="attachment.cgi?id=[% attachid %]&amp;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> </iframe>
<script type="application/x-javascript" language="JavaScript"> <script type="application/x-javascript" language="JavaScript">
<!-- <!--
...@@ -276,8 +276,7 @@ ...@@ -276,8 +276,7 @@
able to display. able to display.
</b></p> </b></p>
<p><b> <p><b>
<a href="attachment.cgi?id=[% attachid %]&amp;action=view">Download <a href="attachment.cgi?id=[% attachid %]">Download the attachment</a>.
the attachment</a>.
</b></p> </b></p>
</td> </td>
[% END %] [% END %]
......
...@@ -471,9 +471,8 @@ ...@@ -471,9 +471,8 @@
'attachment/diff-header.html.tmpl' => [ 'attachment/diff-header.html.tmpl' => [
'attachid', 'attachid',
'id',
'bugid', 'bugid',
'old_url',
'new_url',
'oldid', 'oldid',
'newid', 'newid',
'style', 'style',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment