gecko-dev/webtools/doctor/templates/edit.tmpl

128 lines
5.4 KiB
Cheetah
Raw Normal View History

[%#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Doctor.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape
# are Copyright (C) 2002 Netscape Communications Corporation.
# All Rights Reserved.
#
# Contributor(s): Myk Melez <myk@mozilla.org>
# %]
[% is_new = (version == "new" ? 1 : 0) %]
[% wysiwyg = content.match("<\?doctor enable_wysiwyg_mode \?>") %]
<html>
<head>
<title>Doctor - [% is_new ? "create" : "edit" %] [%+ (file_url ? file_url : file) FILTER html %]</title>
[% IF wysiwyg %]
<script type="text/javascript">
_editor_url = "/htmlarea/";
_editor_lang = "en";
wysiwyg = true;
</script>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
<script type="text/javascript">
HTMLArea.loadPlugin("FullPage");
</script>
[% ELSE %]
<script type="text/javascript">
wysiwyg = false;
</script>
[% END %]
<script type="text/javascript" src="doctor.js"></script>
<link rel="stylesheet" href="doctor.css" type="text/css"></link>
</head>
<body bgcolor="white" color="black" onload="onLoad();" class="[% "new" IF is_new %]">
<form id="form" method="post" action="doctor.cgi" enctype="multipart/form-data">
<input id="file" type="hidden" name="file" value="[% file FILTER html %]">
<input id="version" type="hidden" name="version" value="[% version %]">
<input id="line_endings" type="hidden" name="line_endings" value="[% line_endings %]">
<input id="is_new" type="hidden" name="is_new" value="[% is_new %]">
<div id="bannernav">
Doctor - [% is_new ? "create" : "edit" %]
[% IF file_url %]
<a href="[% file_url FILTER html %]">[% short_file FILTER html %]</a>
[% ELSE %]
[% short_file FILTER html %]
[% END %]
[% IF !is_new %]
| <a href="doctor.cgi?file=[% file | uri | html %]&amp;action=download">download</a>
[% END %]
| <label for="content_file">upload:</label>
<input id="content_file" type="file" name="content_file">
</div>
<div id="tabs">
<button id="editTab" class="tab [% "wysiwyg" IF wysiwyg %]"
type="button" onclick="switchToTab('edit');" disabled="disabled">Edit</button>
<button id="hackTab" class="tab" type="button" onclick="switchToTab('hack');" disabled="disabled">Edit Source</button>
<button id="originalTab" class="tab" type="button" onclick="switchToTab('original');" disabled="disabled">View Original</button>
<button id="modifiedTab" class="tab" type="button" onclick="switchToTab('modified');" disabled="disabled">View Edited</button>
<button id="diffTab" class="tab" type="button" onclick="switchToTab('diff');" disabled="disabled">Show Diff</button>
<button id="saveTab" class="tab" type="button" onclick="switchToTab('save');" disabled="disabled">Save</button>
</div>
<div id="panels">
<div id="editPanel" class="panel">
<textarea id="content" name="content" rows="16" cols="100">[% content FILTER html %]</textarea><br>
</div>
<iframe id="originalPanel" class="panel" src="doctor.cgi?file=[% file | uri | html %]&amp;action=display"></iframe>
<div id="modifiedPanel" class="panel"></div>
<iframe id="diffPanel" class="panel" name="diffPanel"></iframe>
<div id="savePanel" class="panel">
<label for="comment">Comment:</label><br>
<textarea rows="5" cols="80" name="comment"></textarea>
<table id="submit-changes">
<tr>
<th><label for="username">Username:</label></th>
<td><input type="text" name="username" size="20"></td>
</tr>
<tr>
<th><label for="password">Password:</label></th>
<td><input type="password" name="password" size="20"></td>
</tr>
<tr>
<th>&nbsp;</th>
<td><button type="submit" name="action" value="[% is_new ? "create" : "commit" %]">Commit</button></td>
</tr>
</table>
[% IF config.EDITOR_EMAIL %]
<table id="submit-review">
<tr>
<td colspan="2">Don't have commit privileges?</td>
</tr>
<tr>
<th><label for="email">Your Email:</label></th>
<td><input type="text" name="email" size="30"></td>
</tr>
<tr>
<th>&nbsp;</th>
<td><button type="submit" name="action" value="queue">Submit for Review</button></td>
</tr>
</table>
[% END %]
</div>
</div>
</form>
</body>
</html>