зеркало из https://github.com/mozilla/pjs.git
114 строки
3.9 KiB
Cheetah
114 строки
3.9 KiB
Cheetah
[%# -*- Mode: perl; indent-tabs-mode: nil -*-
|
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
# Version: MPL 1.1
|
|
#
|
|
# 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 the Application Registry.
|
|
#
|
|
# The Initial Developer of the Original Code is Mozilla Corporation. Portions
|
|
# created by Mozilla Corporation are Copyright (C) 2007 Mozilla Foundation.
|
|
# All Rights Reserved.
|
|
#
|
|
# Contributor(s): Dave Miller <justdave@mozilla.com>
|
|
#
|
|
# ***** END LICENSE BLOCK *****
|
|
|
|
-%]
|
|
[%- USE CGI;
|
|
filename = CGI.param('file');
|
|
dirname = CGI.param('dir');
|
|
cvsroot = CGI.param('cvsroot');
|
|
UNLESS cvsroot == '/cvsroot';
|
|
bonsai_root = bonsai_root _ '-' _ cvsroot.match('^/(.*)$').0;
|
|
END;
|
|
rev = CGI.param('rev');
|
|
prev_rev = CGI.param('prev_rev');
|
|
linked_text = CGI.param('linked_text');
|
|
SET linked_text = filename IF NOT linked_text;
|
|
branch = CGI.param('branch');
|
|
SET branch = rev IF (NOT branch) OR rev.match('[A-Za-z]');
|
|
extralist = [];
|
|
i = 0;
|
|
WHILE CGI.param("u$i") OR CGI.param("t$i");
|
|
u = CGI.param("u$i");
|
|
t = CGI.param("t$i");
|
|
SET t = u IF NOT t;
|
|
extralist.push( { url => u, text => t } );
|
|
i = i + 1;
|
|
END;
|
|
-%]
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>[% linked_text FILTER html %] - Registry</title>
|
|
</head>
|
|
<body>
|
|
<table border="1" cellspacing="1" cellpadding="3">
|
|
<tr>
|
|
<td>
|
|
[% IF extralist.size > 0 %]
|
|
[% FOREACH extra IN extralist %]
|
|
[% IF extra.url %]
|
|
<a href="[% extra.url FILTER html %]">[% extra.text FILTER html %]</a><br>
|
|
[% ELSE %]
|
|
[% extra.text FILTER html %]<br>
|
|
[% END %]
|
|
[% END %]
|
|
<hr>
|
|
[% END %]
|
|
[% linked_text FILTER html %]<br>
|
|
[% FILTER null;
|
|
cgi = CGI.new('');
|
|
cgi.param('file', "$dirname/$filename");
|
|
cgi.param('rev', rev);
|
|
cgi.param('cvsroot', cvsroot);
|
|
END; -%]
|
|
<a href="[% "$bonsai_root/cvsblame.cgi?$cgi.query_string" FILTER html %]">View Blame-Annotated Source</a><br>
|
|
[% IF prev_rev %]
|
|
[% FILTER null;
|
|
cgi = CGI.new('');
|
|
cgi.param('diff_mode', 'context');
|
|
cgi.param('whitespace_mode', 'show');
|
|
cgi.param('root', cvsroot);
|
|
cgi.param('subdir', dirname);
|
|
cgi.param('command', 'DIFF_FRAMESET');
|
|
cgi.param('file', filename);
|
|
cgi.param('rev1', rev);
|
|
cgi.param('rev2', prev_rev);
|
|
END; -%]
|
|
<a href="[% "$bonsai_root/cvsview2.cgi?$cgi.query_string" FILTER html %]">View Diff [% prev_rev FILTER html %] vs. [% rev FILTER html %]</a><br>
|
|
[% ELSE %]
|
|
[% FILTER null;
|
|
cgi = CGI.new('');
|
|
cgi.param('subdir', dirname);
|
|
cgi.param('files', filename);
|
|
cgi.param('command', 'DIRECTORY');
|
|
cgi.param('branch', branch);
|
|
cgi.param('root', cvsroot);
|
|
END; -%]
|
|
<a href="[% "$bonsai_root/cvsview2.cgi?$cgi.query_string" FILTER html %]">View Diffs</a><br>
|
|
[% END %]
|
|
[% FILTER null;
|
|
cgi = CGI.new('');
|
|
cgi.param('file', "$dirname/$filename");
|
|
cgi.param('rev', rev);
|
|
cgi.param('root', cvsroot);
|
|
END; - %]
|
|
<a href="[% "$bonsai_root/cvslog.cgi?$cgi.query_string" FILTER html %]">View Logs</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|