enhanced source browser by fixing minor bugs and adding a diff view
This commit is contained in:
parent
475cfd028e
commit
00e1d5f401
@ -154,17 +154,20 @@ class Project extends Controller
|
||||
$project = $this->projects->get ($projectid);
|
||||
if ($project === FALSE)
|
||||
{
|
||||
$data['loginid'] = $loginid;
|
||||
$data['message'] = 'DATABASE ERROR';
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else if ($project === NULL)
|
||||
{
|
||||
$data['loginid'] = $loginid;
|
||||
$data['message'] = "NO SUCH PROJECT - $projectid";
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else if (!$this->login->isSysadmin() &&
|
||||
$this->projects->projectHasMember($project->id, $loginid) === FALSE)
|
||||
{
|
||||
$data['loginid'] = $loginid;
|
||||
$data['message'] = "NO PERMISSION - $projectid";
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
@ -243,17 +246,20 @@ class Project extends Controller
|
||||
$project = $this->projects->get ($projectid);
|
||||
if ($project === FALSE)
|
||||
{
|
||||
$data['loginid'] = $loginid;
|
||||
$data['message'] = 'DATABASE ERROR';
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else if ($project === NULL)
|
||||
{
|
||||
$data['loginid'] = $loginid;
|
||||
$data['message'] = "NO SUCH PROJECT - $projectid";
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else if (!$this->login->isSysadmin() &&
|
||||
$this->projects->projectHasMember($project->id, $loginid) === FALSE)
|
||||
{
|
||||
$data['loginid'] = $loginid;
|
||||
$data['message'] = "NO PERMISSION - $projectid";
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ class Source extends Controller
|
||||
var $VIEW_FILE = 'source_file';
|
||||
var $VIEW_BLAME = 'source_blame';
|
||||
var $VIEW_HISTORY = 'source_history';
|
||||
var $VIEW_DIFF = 'source_diff';
|
||||
|
||||
function Source ()
|
||||
{
|
||||
@ -36,6 +37,7 @@ class Source extends Controller
|
||||
$data['loginid'] = $loginid;
|
||||
|
||||
$path = $this->converter->HexToAscii ($path);
|
||||
if ($path == '.') $path = ''; /* treat a period specially */
|
||||
|
||||
$project = $this->projects->get ($projectid);
|
||||
if ($project === FALSE)
|
||||
@ -58,10 +60,17 @@ class Source extends Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$data['project'] = $project;
|
||||
$data['folder'] = $path;
|
||||
$data['files'] = $files;
|
||||
|
||||
$data['revision'] = $rev;
|
||||
$data['prev_revision'] =
|
||||
$this->subversion->getPrevRev ($projectid, $path, $rev);
|
||||
$data['next_revision'] =
|
||||
$this->subversion->getNextRev ($projectid, $path, $rev);
|
||||
|
||||
$this->load->view ($this->VIEW_FOLDER, $data);
|
||||
}
|
||||
}
|
||||
@ -112,11 +121,26 @@ class Source extends Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['project'] = $project;
|
||||
$data['folder'] = substr ($path, 0, strrpos($path, '/'));
|
||||
$data['file'] = $file;
|
||||
$data['revision'] = $rev;
|
||||
$this->load->view ($this->VIEW_FILE, $data);
|
||||
$head_rev = $this->subversion->getHeadRev ($projectid, $path);
|
||||
if ($head_rev === FALSE)
|
||||
{
|
||||
$data['message'] = 'Failed to get head revision';
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$file['head_rev'] = $head_rev;
|
||||
$file['prev_rev'] = $this->subversion->getPrevRev (
|
||||
$projectid, $path, $file['created_rev']);
|
||||
$file['next_rev'] = $this->subversion->getNextRev (
|
||||
$projectid, $path, $file['created_rev']);
|
||||
|
||||
$data['project'] = $project;
|
||||
$data['folder'] = substr ($path, 0, strrpos($path, '/'));
|
||||
$data['file'] = $file;
|
||||
$data['revision'] = $rev;
|
||||
$this->load->view ($this->VIEW_FILE, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,11 +178,26 @@ class Source extends Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['project'] = $project;
|
||||
$data['folder'] = substr ($path, 0, strrpos($path, '/'));
|
||||
$data['file'] = $file;
|
||||
$data['revision'] = $rev;
|
||||
$this->load->view ($this->VIEW_BLAME, $data);
|
||||
$head_rev = $this->subversion->getHeadRev ($projectid, $path);
|
||||
if ($head_rev === FALSE)
|
||||
{
|
||||
$data['message'] = 'Failed to get head revision';
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$file['head_rev'] = $head_rev;
|
||||
$file['prev_rev'] = $this->subversion->getPrevRev (
|
||||
$projectid, $path, $file['created_rev']);
|
||||
$file['next_rev'] = $this->subversion->getNextRev (
|
||||
$projectid, $path, $file['created_rev']);
|
||||
|
||||
$data['project'] = $project;
|
||||
$data['folder'] = substr ($path, 0, strrpos($path, '/'));
|
||||
$data['file'] = $file;
|
||||
$data['revision'] = $rev;
|
||||
$this->load->view ($this->VIEW_BLAME, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -207,4 +246,55 @@ class Source extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
function diff ($projectid, $path, $rev1 = SVN_REVISION_HEAD, $rev2 = SVN_REVISION_PREV)
|
||||
{
|
||||
$this->load->model ('ProjectModel', 'projects');
|
||||
$this->load->model ('SubversionModel', 'subversion');
|
||||
|
||||
$loginid = $this->login->getUserid ();
|
||||
if (CODEPOT_ALWAYS_REQUIRE_SIGNIN && $loginid == '')
|
||||
redirect ('main/signin');
|
||||
$data['loginid'] = $loginid;
|
||||
|
||||
$path = $this->converter->HexToAscii ($path);
|
||||
|
||||
$project = $this->projects->get ($projectid);
|
||||
if ($project === FALSE)
|
||||
{
|
||||
$data['message'] = 'DATABASE ERROR';
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else if ($project === NULL)
|
||||
{
|
||||
$data['message'] = "NO SUCH PROJECT - $projectid";
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$file = $this->subversion->getDiff ($projectid, $path, $rev1, $rev2);
|
||||
if ($file === FALSE)
|
||||
{
|
||||
$data['message'] = 'Failed to get diff';
|
||||
$this->load->view ($this->VIEW_ERROR, $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$file['prev_rev'] =
|
||||
$this->subversion->getPrevRev ($projectid, $path, $file['created_rev']);
|
||||
$file['next_rev'] =
|
||||
$this->subversion->getNextRev ($projectid, $path, $file['created_rev']);
|
||||
$file['against']['prev_rev'] =
|
||||
$this->subversion->getPrevRev ($projectid, $path, $file['against']['created_rev']);
|
||||
$file['against']['next_rev'] =
|
||||
$this->subversion->getNextRev ($projectid, $path, $file['against']['created_rev']);
|
||||
|
||||
$data['project'] = $project;
|
||||
$data['folder'] = substr ($path, 0, strrpos($path, '/'));
|
||||
$data['file'] = $file;
|
||||
$data['revision1'] = $rev1;
|
||||
$data['revision2'] = $rev2;
|
||||
$this->load->view ($this->VIEW_DIFF, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,10 @@ $lang['Created on'] = 'Created on';
|
||||
$lang['Delete'] = 'Delete';
|
||||
$lang['Description'] = 'Description';
|
||||
$lang['Details'] = 'Details';
|
||||
$lang['Difference'] = 'Diff';
|
||||
$lang['Download'] = 'Download';
|
||||
$lang['Edit'] = 'Edit';
|
||||
$lang['Head revision'] = 'Head revision';
|
||||
$lang['History'] = 'History';
|
||||
$lang['Home'] = 'Home';
|
||||
$lang['File'] = 'File';
|
||||
@ -45,6 +47,7 @@ $lang['Username'] = 'Username';
|
||||
$lang['Wiki'] = 'Wiki';
|
||||
$lang['Wikis'] = 'Wikis';
|
||||
|
||||
$lang['MSG_NO_DIFF'] = 'No difference found';
|
||||
$lang['MSG_NO_FILES_AVAIL'] = 'No files available';
|
||||
$lang['MSG_NO_SOURCE_AVAIL'] = 'No source available';
|
||||
$lang['MSG_NO_WIKIS_AVAIL'] = 'No wiki pages available';
|
||||
|
@ -7,8 +7,10 @@ $lang['Created on'] = 'Waktu dibuat';
|
||||
$lang['Delete'] = 'Hapus';
|
||||
$lang['Description'] = 'Penjelasan';
|
||||
$lang['Details'] = 'Detail';
|
||||
$lang['Difference'] = 'Beda';
|
||||
$lang['Download'] = 'Download';
|
||||
$lang['Edit'] = 'Rubah';
|
||||
$lang['Head revision'] = 'Kepala Revisi';
|
||||
$lang['History'] = 'Sejarah';
|
||||
$lang['Home'] = 'Beranda';
|
||||
$lang['File'] = 'File';
|
||||
@ -45,6 +47,7 @@ $lang['Username'] = 'Nama pemakai';
|
||||
$lang['Wiki'] = 'Wiki';
|
||||
$lang['Wikis'] = 'Wiki';
|
||||
|
||||
$lang['MSG_NO_DIFF'] = 'Tidak ada bedanya';
|
||||
$lang['MSG_NO_FILES_AVAIL'] = 'Tidak ada file tersedia';
|
||||
$lang['MSG_NO_SOURCE_AVAIL'] = 'Tidak ada sumber tersedia';
|
||||
$lang['MSG_NO_WIKIS_AVAIL'] = 'Tidak ada halaman wiki tersedia';
|
||||
|
@ -7,9 +7,11 @@ $lang['Created on'] = '최초생성시간';
|
||||
$lang['Delete'] = '삭제';
|
||||
$lang['Description'] = '설명';
|
||||
$lang['Details'] = '상세내역';
|
||||
$lang['Difference'] = '차이점';
|
||||
$lang['Download'] = '내려받기';
|
||||
$lang['Edit'] = '수정';
|
||||
$lang['History'] = '변경내역';
|
||||
$lang['Head revision'] = '최신리비전';
|
||||
$lang['History'] = '변경기록';
|
||||
$lang['Home'] = '홈';
|
||||
$lang['File'] = '파일';
|
||||
$lang['Files'] = '파일';
|
||||
@ -45,6 +47,7 @@ $lang['Username'] = '사용자명';
|
||||
$lang['Wiki'] = '위키';
|
||||
$lang['Wikis'] = '위키';
|
||||
|
||||
$lang['MSG_NO_DIFF'] = '차이점이 없습니다';
|
||||
$lang['MSG_NO_FILES_AVAIL'] = '사용가능한 파일이 없습니다';
|
||||
$lang['MSG_NO_SOURCE_AVAIL'] = '사용가능한 소스가 없습니다';
|
||||
$lang['MSG_NO_WIKIS_AVAIL'] = '사용가능한 위키페이지가 없습니다';
|
||||
|
@ -241,9 +241,9 @@ class ProjectModel extends Model
|
||||
|
||||
function deleteDirectory($dir)
|
||||
{
|
||||
if (is_link($dir)) return unlink($dir);
|
||||
if (is_link($dir)) return @unlink($dir);
|
||||
if (!file_exists($dir)) return TRUE;
|
||||
if (!is_dir($dir)) return unlink($dir);
|
||||
if (!is_dir($dir)) return @unlink($dir);
|
||||
|
||||
foreach ($this->_scandir($dir) as $item)
|
||||
{
|
||||
|
@ -68,6 +68,337 @@ class SubversionModel extends Model
|
||||
$fileinfo['history'] = $str;
|
||||
return $fileinfo;
|
||||
}
|
||||
|
||||
function _get_diff ($diff, $all, $ent)
|
||||
{
|
||||
/* copied from websvn */
|
||||
|
||||
if ($all)
|
||||
{
|
||||
$ofile = fopen ($oldtname, "r");
|
||||
$nfile = fopen ($newtname, "r");
|
||||
}
|
||||
|
||||
// Ignore the 4 header lines
|
||||
$line = fgets($diff);
|
||||
$line = fgets($diff);
|
||||
$line = fgets($diff);
|
||||
$line = fgets($diff);
|
||||
|
||||
// Get the first real line
|
||||
$line = fgets($diff);
|
||||
|
||||
$index = 0;
|
||||
$listing = array();
|
||||
|
||||
$curoline = 1;
|
||||
$curnline = 1;
|
||||
|
||||
while (!feof($diff))
|
||||
{
|
||||
// Get the first line of this range
|
||||
sscanf($line, "@@ -%d", $oline);
|
||||
|
||||
$line = substr($line, strpos($line, "+"));
|
||||
sscanf($line, "+%d", $nline);
|
||||
|
||||
if ($all)
|
||||
{
|
||||
while ($curoline < $oline || $curnline < $nline)
|
||||
{
|
||||
$listing[$index]["rev1diffclass"] = "diff";
|
||||
$listing[$index]["rev2diffclass"] = "diff";
|
||||
|
||||
if ($curoline < $oline)
|
||||
{
|
||||
$nl = fgets($ofile);
|
||||
|
||||
$line = rtrim($nl);
|
||||
if ($ent) $line = replaceEntities($line, $rep);
|
||||
|
||||
//$listing[$index]["rev1line"] = hardspace($line);
|
||||
$listing[$index]["rev1line"] = $line;
|
||||
|
||||
$curoline++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$listing[$index]["rev1line"] = " ";
|
||||
$listing[$index]["rev1line"] = "";
|
||||
}
|
||||
|
||||
if ($curnline < $nline)
|
||||
{
|
||||
$nl = fgets($nfile);
|
||||
|
||||
$line = rtrim($nl);
|
||||
if ($ent) $line = replaceEntities($line, $rep);
|
||||
|
||||
//$listing[$index]["rev2line"] = hardspace($line);
|
||||
$listing[$index]["rev2line"] = $line;
|
||||
$curnline++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$listing[$index]["rev2line"] = " ";
|
||||
$listing[$index]["rev2line"] = "";
|
||||
}
|
||||
|
||||
$listing[$index]["rev1lineno"] = 0;
|
||||
$listing[$index]["rev2lineno"] = 0;
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Output the line numbers
|
||||
$listing[$index]["rev1lineno"] = $oline;
|
||||
$listing[$index]["rev2lineno"] = $nline;
|
||||
$index++;
|
||||
}
|
||||
|
||||
$fin = false;
|
||||
while (!feof($diff) && !$fin)
|
||||
{
|
||||
$line = fgets($diff);
|
||||
if ($line === false || strncmp($line, "@@", 2) == 0)
|
||||
{
|
||||
$fin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$listing[$index]["rev1lineno"] = 0;
|
||||
$listing[$index]["rev2lineno"] = 0;
|
||||
|
||||
$mod = $line{0};
|
||||
|
||||
$line = rtrim(substr($line, 1));
|
||||
if ($ent) $line = replaceEntities($line, $rep);
|
||||
|
||||
//if (strip_tags($line) == '') $line = ' ';
|
||||
//$listing[$index]["rev1line"] = hardspace($line);
|
||||
$listing[$index]["rev1line"] = $line;
|
||||
|
||||
//$text = hardspace($line);
|
||||
$text = $line;
|
||||
|
||||
switch ($mod)
|
||||
{
|
||||
case "-":
|
||||
$listing[$index]["rev1diffclass"] = "diffdeleted";
|
||||
$listing[$index]["rev2diffclass"] = "diff";
|
||||
|
||||
$listing[$index]["rev1line"] = $text;
|
||||
//$listing[$index]["rev2line"] = " ";
|
||||
$listing[$index]["rev2line"] = '';
|
||||
|
||||
if ($all) {
|
||||
fgets($ofile);
|
||||
$curoline++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "+":
|
||||
// Try to mark "changed" line sensibly
|
||||
if (!empty($listing[$index-1]) &&
|
||||
empty($listing[$index-1]["rev1lineno"]) &&
|
||||
@$listing[$index-1]["rev1diffclass"] == "diffdeleted" &&
|
||||
@$listing[$index-1]["rev2diffclass"] == "diff")
|
||||
{
|
||||
$i = $index - 1;
|
||||
while (!empty($listing[$i-1]) &&
|
||||
empty($listing[$i-1]["rev1lineno"]) &&
|
||||
$listing[$i-1]["rev1diffclass"] == "diffdeleted" &&
|
||||
$listing[$i-1]["rev2diffclass"] == "diff")
|
||||
{
|
||||
$i--;
|
||||
}
|
||||
|
||||
$listing[$i]["rev1diffclass"] = "diffchanged";
|
||||
$listing[$i]["rev2diffclass"] = "diffchanged";
|
||||
$listing[$i]["rev2line"] = $text;
|
||||
|
||||
if ($all) {
|
||||
fgets($nfile);
|
||||
$curnline++;
|
||||
}
|
||||
|
||||
// Don't increment the current index count
|
||||
$index--;
|
||||
|
||||
} else {
|
||||
$listing[$index]["rev1diffclass"] = "diff";
|
||||
$listing[$index]["rev2diffclass"] = "diffadded";
|
||||
|
||||
//$listing[$index]["rev1line"] = " ";
|
||||
$listing[$index]["rev1line"] = '';
|
||||
$listing[$index]["rev2line"] = $text;
|
||||
|
||||
if ($all) {
|
||||
fgets($nfile);
|
||||
$curnline++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$listing[$index]["rev1diffclass"] = "diff";
|
||||
$listing[$index]["rev2diffclass"] = "diff";
|
||||
|
||||
$listing[$index]["rev1line"] = $text;
|
||||
$listing[$index]["rev2line"] = $text;
|
||||
|
||||
if ($all) {
|
||||
fgets($ofile);
|
||||
fgets($nfile);
|
||||
$curoline++;
|
||||
$curnline++;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fin) {
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Output the rest of the files
|
||||
if ($all)
|
||||
{
|
||||
while (!feof($ofile) || !feof($nfile))
|
||||
{
|
||||
$listing[$index]["rev1diffclass"] = "diff";
|
||||
$listing[$index]["rev2diffclass"] = "diff";
|
||||
|
||||
$line = rtrim(fgets($ofile));
|
||||
if ($ent) $line = replaceEntities($line, $rep);
|
||||
|
||||
if (!feof($ofile)) {
|
||||
//$listing[$index]["rev1line"] = hardspace($line);
|
||||
$listing[$index]["rev1line"] = $line;
|
||||
}
|
||||
else {
|
||||
//$listing[$index]["rev1line"] = " ";
|
||||
$listing[$index]["rev1line"] = '';
|
||||
}
|
||||
|
||||
$line = rtrim(fgets($nfile));
|
||||
if ($ent) $line = replaceEntities(rtrim(fgets($nfile)), $rep);
|
||||
|
||||
if (!feof($nfile)) {
|
||||
//$listing[$index]["rev2line"] = hardspace($line);
|
||||
$listing[$index]["rev2line"] = $line;
|
||||
}
|
||||
else {
|
||||
//$listing[$index]["rev2line"] = " ";
|
||||
$listing[$index]["rev2line"] = '';
|
||||
}
|
||||
|
||||
$listing[$index]["rev1lineno"] = 0;
|
||||
$listing[$index]["rev2lineno"] = 0;
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
return $listing;
|
||||
}
|
||||
|
||||
function getDiff ($projectid, $file, $rev1, $rev2)
|
||||
{
|
||||
$path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file;
|
||||
|
||||
$info = @svn_ls ($path, $rev1, FALSE);
|
||||
if ($info === FALSE) return FALSE;
|
||||
|
||||
$last = substr(strrchr($path, '/'), 1);
|
||||
if (array_key_exists ($last, $info) === FALSE) return FALSE;
|
||||
$fileinfo = $info[$last];
|
||||
|
||||
$rev1 = $info[$last]['created_rev'];
|
||||
|
||||
if ($rev2 <= 0)
|
||||
{
|
||||
/*
|
||||
$log = @svn_log ($path, $rev1, SVN_REVISION_INITIAL, 2);
|
||||
if ($log === FALSE) return FALSE;
|
||||
if (count($log) < 2) return FALSE;
|
||||
$rev2 = $log[1]['rev'];
|
||||
*/
|
||||
$rev2 = $rev1 - 1;
|
||||
if ($rev2 <= 0) $rev2 = $rev1;
|
||||
}
|
||||
|
||||
$info2 = @svn_ls ($path, $rev2, FALSE);
|
||||
if ($info2 === FALSE)
|
||||
{
|
||||
$rev2 = $rev1;
|
||||
$info2 = @svn_ls ($path, $rev2, FALSE);
|
||||
if ($info2 === FALSE) return FALSE;
|
||||
}
|
||||
|
||||
if (array_key_exists ($last, $info2) === FALSE) return FALSE;
|
||||
$rev2 = $info2[$last]['created_rev'];
|
||||
|
||||
list($diff, $errors) = @svn_diff ($path, $rev2, $path, $rev1);
|
||||
if (!$diff) return FALSE;
|
||||
|
||||
fclose($errors);
|
||||
|
||||
$fileinfo['content'] = $this->_get_diff ($diff, FALSE, FALSE);
|
||||
fclose ($diff);
|
||||
|
||||
/*
|
||||
print_r ($info[$last]);
|
||||
print_r ($info2[$last]);
|
||||
*/
|
||||
$fileinfo['against'] = $info2[$last];
|
||||
return $fileinfo;
|
||||
}
|
||||
|
||||
function getPrevRev ($projectid, $file, $rev)
|
||||
{
|
||||
$path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file;
|
||||
|
||||
$info = @svn_log ($path, $rev, SVN_REVISION_INITIAL, 2, SVN_OMIT_MESSAGES);
|
||||
if ($info === FALSE) return $rev;
|
||||
|
||||
$count = count($info);
|
||||
if ($count <= 0) return $rev;
|
||||
if ($count == 1) return $info[0]['rev'];
|
||||
|
||||
return $info[1]['rev'];
|
||||
}
|
||||
|
||||
function getNextRev ($projectid, $file, $rev)
|
||||
{
|
||||
$path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file;
|
||||
|
||||
$info = @svn_log ($path, SVN_REVISION_HEAD, $rev, 0, SVN_OMIT_MESSAGES);
|
||||
if ($info === FALSE) return $rev;
|
||||
|
||||
$count = count($info);
|
||||
if ($count <= 0) return $rev;
|
||||
if ($count == 1) return $info[0]['rev'];
|
||||
|
||||
return $info[$count-2]['rev'];
|
||||
}
|
||||
|
||||
function getHeadRev ($projectid, $file)
|
||||
{
|
||||
$path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file;
|
||||
|
||||
$info = @svn_log ($path, SVN_REVISION_HEAD, SVN_REVISION_INITIAL, 1, SVN_OMIT_MESSAGES);
|
||||
if ($info === FALSE) return FALSE;
|
||||
if (count($info) != 1) return FALSE;
|
||||
return $info[0]['rev'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -14,6 +14,7 @@ www_DATA = \
|
||||
project_list.php \
|
||||
projectbar.php \
|
||||
source_blame.php \
|
||||
source_diff.php \
|
||||
source_file.php \
|
||||
source_folder.php \
|
||||
source_history.php \
|
||||
|
@ -177,6 +177,7 @@ www_DATA = \
|
||||
project_list.php \
|
||||
projectbar.php \
|
||||
source_blame.php \
|
||||
source_diff.php \
|
||||
source_file.php \
|
||||
source_folder.php \
|
||||
source_history.php \
|
||||
|
@ -34,7 +34,7 @@ $this->load->view (
|
||||
<div class="mainarea" id="project_file_home_mainarea">
|
||||
<div class="title"><?=$this->lang->line('Files')?></div>
|
||||
|
||||
<div id="project_file_home_textarea">
|
||||
<div id="project_file_home_mainarea_result">
|
||||
<?php
|
||||
if (empty($files))
|
||||
{
|
||||
@ -55,8 +55,8 @@ else
|
||||
|
||||
usort ($files, 'comp_files');
|
||||
|
||||
print '<table>';
|
||||
print '<tr>';
|
||||
print '<table id="project_file_home_mainarea_result_table">';
|
||||
print '<tr class="heading">';
|
||||
print '<th>' . $this->lang->line('Tag') . '</th>';
|
||||
print '<th>' . $this->lang->line('Name') . '</th>';
|
||||
print '<th>' . $this->lang->line('Summary') . '</th>';
|
||||
@ -65,10 +65,13 @@ else
|
||||
print '</tr>';
|
||||
|
||||
$oldtag = '';
|
||||
$rownum = 0;
|
||||
$rowclasses = array ('odd', 'even');
|
||||
foreach ($files as $file)
|
||||
{
|
||||
$hexname = $this->converter->AsciiToHex ($file->name);
|
||||
print '<tr>';
|
||||
$rowclass = $rowclasses[$rownum++ % 2];
|
||||
print "<tr class='{$rowclass}'>";
|
||||
print '<td>';
|
||||
if ($file->tag != $oldtag)
|
||||
{
|
||||
@ -82,9 +85,9 @@ else
|
||||
print '<td>';
|
||||
print htmlspecialchars($file->summary);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td><tt>';
|
||||
print $file->md5sum;
|
||||
print '</td>';
|
||||
print '</tt></td>';
|
||||
print '<td>';
|
||||
print anchor ("file/get/{$project->id}/{$hexname}", $this->lang->line('Download'));
|
||||
print '</td>';
|
||||
|
@ -33,31 +33,29 @@ $this->load->view (
|
||||
);
|
||||
?>
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<div class="sidebar" id="project_source_blame_sidebar">
|
||||
|
||||
<div class="box">
|
||||
<div class="boxtitle"><?=$this->lang->line('File')?></div>
|
||||
<ul>
|
||||
<li><?=$this->lang->line('Revision')?>: <?=$file['created_rev']?></li>
|
||||
<li><?=$this->lang->line('Author')?>: <?=htmlspecialchars($file['last_author'])?></li>
|
||||
<li><?=$this->lang->line('Size')?>: <?=$file['size']?></li>
|
||||
<li><?=$this->lang->line('Last updated on')?>: <?=$file['time']?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div> <!-- project_source_blame_sidebar -->
|
||||
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<div class="mainarea" id="project_source_blame_mainarea">
|
||||
|
||||
<div class="title" id="project_source_blame_mainarea_title">
|
||||
<?php
|
||||
$xpar = '/source/folder/' . $project->id;
|
||||
print anchor ($xpar, htmlspecialchars($project->name));
|
||||
if ($revision <= 0)
|
||||
{
|
||||
$revreq = '';
|
||||
$revreqroot = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
//$revreq = ($file['created_rev'] == $file['head_rev'])? '': "/{$file['created_rev']}";
|
||||
//$revreqroot = ($revreq == '')? '': ('/' . $this->converter->AsciiToHex ('.') . $revreq);
|
||||
$revreq = "/{$revision}";
|
||||
$revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq;
|
||||
}
|
||||
|
||||
print anchor (
|
||||
"/source/folder/{$project->id}{$revreqroot}",
|
||||
htmlspecialchars($project->name));
|
||||
|
||||
if ($folder != '')
|
||||
{
|
||||
$exps = explode ('/', $folder);
|
||||
@ -65,39 +63,59 @@ if ($folder != '')
|
||||
$par = '';
|
||||
for ($i = 1; $i < $expsize; $i++)
|
||||
{
|
||||
print '/';
|
||||
|
||||
$par .= '/' . $exps[$i];
|
||||
$hexpar = $this->converter->AsciiToHex ($par);
|
||||
print '/';
|
||||
$xpar = 'source/folder/' . $project->id . '/' . $hexpar;
|
||||
if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision;
|
||||
print anchor ($xpar, htmlspecialchars($exps[$i]));
|
||||
print anchor (
|
||||
"source/folder/{$project->id}/{$hexpar}{$revreq}",
|
||||
htmlspecialchars($exps[$i]));
|
||||
}
|
||||
}
|
||||
$par = $folder . '/' . $file['name'];
|
||||
$par = $this->converter->AsciiTohex ($par);
|
||||
|
||||
print '/';
|
||||
$xpar = '/source/blame/' . $project->id . '/' . $par;
|
||||
if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision;
|
||||
print anchor ($xpar, htmlspecialchars($file['name']));
|
||||
|
||||
$par = $this->converter->AsciiTohex ("{$folder}/{$file['name']}");
|
||||
print anchor (
|
||||
"/source/blame/{$project->id}/{$par}{$revreq}",
|
||||
htmlspecialchars($file['name']));
|
||||
?>
|
||||
</div> <!-- project_source_blame_mainarea_title -->
|
||||
|
||||
<div class="menu" id="project_source_blame_mainarea_menu">
|
||||
<?php
|
||||
$par = $folder . '/' . $file['name'];
|
||||
$par = $this->converter->AsciiTohex ($par);
|
||||
$xpar = 'source/file/' . $project->id . '/' . $par;
|
||||
if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision;
|
||||
print anchor ($xpar, $this->lang->line('Details'));
|
||||
$par = $this->converter->AsciiToHex ("{$folder}/{$file['name']}");
|
||||
|
||||
|
||||
if ($file['created_rev'] != $file['head_rev'])
|
||||
{
|
||||
print anchor ("source/file/{$project->id}/${par}", $this->lang->line('Head revision'));
|
||||
print ' | ';
|
||||
}
|
||||
|
||||
print anchor ("source/file/{$project->id}/${par}{$revreq}", $this->lang->line('Details'));
|
||||
print ' | ';
|
||||
print anchor ('source/history/file/' . $project->id . '/' . $par, $this->lang->line('History'));
|
||||
print anchor ("source/diff/{$project->id}/{$par}{$revreq}", $this->lang->line('Difference'));
|
||||
print ' | ';
|
||||
print anchor ("source/history/file/{$project->id}/{$par}", $this->lang->line('History'));
|
||||
|
||||
?>
|
||||
</div> <!-- project_source_blame_mainarea_menu -->
|
||||
|
||||
<div class="infostrip">
|
||||
<?=anchor ("source/file/{$project->id}/${par}/{$file['prev_rev']}", '<<')?>
|
||||
<?=$this->lang->line('Revision')?>: <?=$file['created_rev']?>
|
||||
<?=anchor ("source/file/{$project->id}/${par}/{$file['next_rev']}", '>>')?> |
|
||||
<?=$this->lang->line('Author')?>: <?=htmlspecialchars($file['last_author'])?> |
|
||||
<?=$this->lang->line('Size')?>: <?=$file['size']?> |
|
||||
<?=$this->lang->line('Last updated on')?>: <?=$file['time']?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$fileext = substr(strrchr($file['name'], '.'), 1);
|
||||
if ($fileext == "") $fileext = "html"
|
||||
?>
|
||||
|
||||
<pre class="prettyprint lang-<?=$fileext?>">
|
||||
<?php
|
||||
|
||||
|
223
codepot/src/codepot/views/source_diff.php
Normal file
223
codepot/src/codepot/views/source_diff.php
Normal file
@ -0,0 +1,223 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css" />
|
||||
<link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/project.css" />
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/prettify/prettify.js"></script>
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/prettify/lang-css.js"></script>
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/prettify/lang-lisp.js"></script>
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/prettify/lang-lua.js"></script>
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/prettify/lang-sql.js"></script>
|
||||
<script type="text/javascript" src="<?=base_url()?>/js/prettify/lang-vb.js"></script>
|
||||
<title><?=htmlspecialchars($project->name)?></title>
|
||||
</head>
|
||||
|
||||
<body onload="prettyPrint()">
|
||||
|
||||
<div class="content" id="project_source_diff_content">
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<?php $this->load->view ('taskbar'); ?>
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<?php
|
||||
$this->load->view (
|
||||
'projectbar',
|
||||
array (
|
||||
'pageid' => 'source',
|
||||
'ctxmenuitems' => array ()
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<div class="mainarea" id="project_source_diff_mainarea">
|
||||
|
||||
<div class="title" id="project_source_diff_mainarea_title">
|
||||
<?php
|
||||
$xpar = '/source/folder/' . $project->id;
|
||||
print anchor ($xpar, htmlspecialchars($project->name));
|
||||
if ($folder != '')
|
||||
{
|
||||
$exps = explode ('/', $folder);
|
||||
$expsize = count($exps);
|
||||
$par = '';
|
||||
for ($i = 1; $i < $expsize; $i++)
|
||||
{
|
||||
$par .= '/' . $exps[$i];
|
||||
$hexpar = $this->converter->AsciiToHex ($par);
|
||||
print '/';
|
||||
$xpar = 'source/folder/' . $project->id . '/' . $hexpar;
|
||||
if ($revision1 != SVN_REVISION_HEAD) $xpar .= '/' . $revision1;
|
||||
print anchor ($xpar, htmlspecialchars($exps[$i]));
|
||||
}
|
||||
}
|
||||
$par = $folder . '/' . $file['name'];
|
||||
$par = $this->converter->AsciiTohex ($par);
|
||||
print '/';
|
||||
$xpar = '/source/file/' . $project->id . '/' . $par;
|
||||
if ($revision1 != SVN_REVISION_HEAD) $xpar .= '/' . $revision1;
|
||||
print anchor ($xpar, htmlspecialchars($file['name']));
|
||||
?>
|
||||
</div> <!-- project_source_diff_mainarea_title -->
|
||||
|
||||
|
||||
<div class="menu" id="project_source_diff_mainarea_menu">
|
||||
<?php
|
||||
$par = $folder . '/' . $file['name'];
|
||||
$par = $this->converter->AsciiTohex ($par);
|
||||
|
||||
$xdetails = "source/file/{$project->id}/{$par}";
|
||||
$xblame = "source/blame/{$project->id}/{$par}";
|
||||
if ($revision1 != SVN_REVISION_HEAD)
|
||||
{
|
||||
$xdetails .= "/{$revision1}";
|
||||
$xblame .= "/{$revision1}";
|
||||
}
|
||||
|
||||
print anchor ($xdetails, $this->lang->line('Details'));
|
||||
print ' | ';
|
||||
print anchor ($xblame, $this->lang->line('Blame'));
|
||||
print ' | ';
|
||||
print anchor ("source/history/file/{$project->id}/{$par}", $this->lang->line('History'));
|
||||
?>
|
||||
</div> <!-- project_source_diff_mainarea_menu -->
|
||||
|
||||
<div class="infostrip" id="project_source_diff_mainarea_infostrip">
|
||||
<?=$this->lang->line('Revision')?>: <?=$file['created_rev']?> |
|
||||
<?=$this->lang->line('Author')?>: <?=htmlspecialchars($file['last_author'])?> |
|
||||
<?=$this->lang->line('Size')?>: <?=$file['size']?> |
|
||||
<?=$this->lang->line('Last updated on')?>: <?=$file['time']?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$fileext = substr(strrchr($file['name'], '.'), 1);
|
||||
if ($fileext == "") $fileext = "html"
|
||||
?>
|
||||
|
||||
<div id="project_source_diff_mainarea_result">
|
||||
<table id="project_source_diff_mainarea_result_table">
|
||||
<?php
|
||||
|
||||
/*
|
||||
print '<pre>';
|
||||
print_r ($file['content']);
|
||||
print '</pre>';
|
||||
*/
|
||||
|
||||
print '<tr class="heading">';
|
||||
print '<th>';
|
||||
|
||||
$currev = $file['created_rev'];
|
||||
$prevrev = $file['against']['prev_rev'];
|
||||
$prevanc = "source/diff/{$project->id}/{$par}/{$currev}/{$prevrev}";
|
||||
print anchor ($prevanc, '<<');
|
||||
print ' ';
|
||||
|
||||
print $this->lang->line('Revision');
|
||||
print ' ';
|
||||
print $file['against']['created_rev'];
|
||||
|
||||
$currev = $file['created_rev'];
|
||||
$nextrev = $file['against']['next_rev'];
|
||||
$nextanc = "source/diff/{$project->id}/{$par}/{$currev}/{$nextrev}";
|
||||
print ' ';
|
||||
print anchor ($nextanc, '>>');
|
||||
|
||||
print '</th>';
|
||||
|
||||
print '<th>';
|
||||
|
||||
$currev = $file['against']['created_rev'];
|
||||
$prevrev = $file['prev_rev'];
|
||||
$prevanc = "source/diff/{$project->id}/{$par}/{$prevrev}/{$currev}";
|
||||
print anchor ($prevanc, '<<');
|
||||
print ' ';
|
||||
|
||||
print $this->lang->line('Revision');
|
||||
print ' ';
|
||||
print $file['created_rev'];
|
||||
|
||||
$currev = $file['against']['created_rev'];
|
||||
$nextrev = $file['next_rev'];
|
||||
$nextanc = "source/diff/{$project->id}/{$par}/{$nextrev}/{$currev}";
|
||||
print ' ';
|
||||
print anchor ($nextanc, '>>');
|
||||
|
||||
print '</th>';
|
||||
print '</tr>';
|
||||
|
||||
if (empty($file['content']))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td colspan=2>';
|
||||
print htmlspecialchars ($this->lang->line('MSG_NO_DIFF'));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($file['content'] as $x)
|
||||
{
|
||||
print '<tr class="diff">';
|
||||
|
||||
if (array_key_exists('rev1line', $x))
|
||||
{
|
||||
$diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff';
|
||||
print "<td class='{$diffclass}'>";
|
||||
print "<pre class='prettyprint lang-{$fileext}'>";
|
||||
print htmlspecialchars($x['rev1line']);
|
||||
print '</pre>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="diffrow">';
|
||||
print $x['rev1lineno'];
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (array_key_exists('rev2line', $x))
|
||||
{
|
||||
$diffclass = array_key_exists('rev2diffclass', $x)? $x['rev2diffclass']: 'diff';
|
||||
print "<td class='{$diffclass}'>";
|
||||
print "<pre class='prettyprint lang-{$fileext}'>";
|
||||
print htmlspecialchars($x['rev2line']);
|
||||
print '</pre>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="diffrow">';
|
||||
print $x['rev2lineno'];
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div> <!-- project_source_diff_mainarea -->
|
||||
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
|
||||
<?php $this->load->view ('footer'); ?>
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
</div> <!-- project_source_diff_content -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -32,30 +32,30 @@ $this->load->view (
|
||||
)
|
||||
);
|
||||
?>
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<div class="sidebar" id="project_source_file_sidebar">
|
||||
<div class="box">
|
||||
<div class="boxtitle"><?=$this->lang->line('File')?></div>
|
||||
<ul>
|
||||
<li><?=$this->lang->line('Revision')?>: <?=$file['created_rev']?></li>
|
||||
<li><?=$this->lang->line('Author')?>: <?=htmlspecialchars($file['last_author'])?></li>
|
||||
<li><?=$this->lang->line('Size')?>: <?=$file['size']?></li>
|
||||
<li><?=$this->lang->line('Last updated on')?>: <?=$file['time']?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div> <!-- project_source_file_sidebar -->
|
||||
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<div class="mainarea" id="project_source_file_mainarea">
|
||||
|
||||
<div class="title" id="project_source_file_title">
|
||||
<div class="title" id="project_source_file_mainarea_title">
|
||||
<?php
|
||||
$xpar = '/source/folder/' . $project->id;
|
||||
print anchor ($xpar, htmlspecialchars($project->name));
|
||||
if ($revision <= 0)
|
||||
{
|
||||
$revreq = '';
|
||||
$revreqroot = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
//$revreq = ($file['created_rev'] == $file['head_rev'])? '': "/{$file['created_rev']}";
|
||||
//$revreqroot = ($revreq == '')? '': ('/' . $this->converter->AsciiToHex ('.') . $revreq);
|
||||
$revreq = "/{$revision}";
|
||||
$revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq;
|
||||
}
|
||||
|
||||
print anchor (
|
||||
"/source/folder/{$project->id}{$revreqroot}",
|
||||
htmlspecialchars($project->name));
|
||||
|
||||
if ($folder != '')
|
||||
{
|
||||
$exps = explode ('/', $folder);
|
||||
@ -63,36 +63,52 @@ if ($folder != '')
|
||||
$par = '';
|
||||
for ($i = 1; $i < $expsize; $i++)
|
||||
{
|
||||
print '/';
|
||||
|
||||
$par .= '/' . $exps[$i];
|
||||
$hexpar = $this->converter->AsciiToHex ($par);
|
||||
print '/';
|
||||
$xpar = 'source/folder/' . $project->id . '/' . $hexpar;
|
||||
if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision;
|
||||
print anchor ($xpar, htmlspecialchars($exps[$i]));
|
||||
print anchor (
|
||||
"source/folder/{$project->id}/{$hexpar}{$revreq}",
|
||||
htmlspecialchars($exps[$i]));
|
||||
}
|
||||
}
|
||||
$par = $folder . '/' . $file['name'];
|
||||
$par = $this->converter->AsciiTohex ($par);
|
||||
|
||||
print '/';
|
||||
$xpar = '/source/file/' . $project->id . '/' . $par;
|
||||
if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision;
|
||||
print anchor ($xpar, htmlspecialchars($file['name']));
|
||||
|
||||
$par = $this->converter->AsciiTohex ("{$folder}/{$file['name']}");
|
||||
print anchor (
|
||||
"/source/file/{$project->id}/{$par}{$revreq}",
|
||||
htmlspecialchars($file['name']));
|
||||
?>
|
||||
</div> <!-- project_source_file_mainarea_title -->
|
||||
|
||||
|
||||
<div class="menu" id="project_source_file_mainarea_menu">
|
||||
<?php
|
||||
$par = $folder . '/' . $file['name'];
|
||||
$par = $this->converter->AsciiTohex ($par);
|
||||
$xpar = 'source/blame/' . $project->id . '/' . $par;
|
||||
if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision;
|
||||
print anchor ($xpar, $this->lang->line('Blame'));
|
||||
$par = $this->converter->AsciiToHex ("{$folder}/{$file['name']}");
|
||||
|
||||
if ($file['created_rev'] != $file['head_rev'])
|
||||
{
|
||||
print anchor ("source/file/{$project->id}/${par}", $this->lang->line('Head revision'));
|
||||
print ' | ';
|
||||
}
|
||||
|
||||
print anchor ("source/blame/{$project->id}/${par}{$revreq}", $this->lang->line('Blame'));
|
||||
print ' | ';
|
||||
print anchor ('source/history/file/' . $project->id . '/' . $par, $this->lang->line('History'));
|
||||
print anchor ("source/diff/{$project->id}/{$par}{$revreq}", $this->lang->line('Difference'));
|
||||
print ' | ';
|
||||
print anchor ("source/history/file/{$project->id}/{$par}", $this->lang->line('History'));
|
||||
?>
|
||||
</div> <!-- project_source_file_mainarea_menu -->
|
||||
|
||||
<div class="infostrip">
|
||||
<?=anchor ("source/file/{$project->id}/${par}/{$file['prev_rev']}", '<<')?>
|
||||
<?=$this->lang->line('Revision')?>: <?=$file['created_rev']?>
|
||||
<?=anchor ("source/file/{$project->id}/${par}/{$file['next_rev']}", '>>')?> |
|
||||
<?=$this->lang->line('Author')?>: <?=htmlspecialchars($file['last_author'])?> |
|
||||
<?=$this->lang->line('Size')?>: <?=$file['size']?> |
|
||||
<?=$this->lang->line('Last updated on')?>: <?=$file['time']?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$fileext = substr(strrchr($file['name'], '.'), 1);
|
||||
if ($fileext == "") $fileext = "html"
|
||||
|
@ -29,14 +29,15 @@ $this->load->view (
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<div class="sidebar" id="project_source_folder_sidebar">
|
||||
<div class="box">
|
||||
<div class="boxtitle"><?=$this->lang->line('Folder')?></div>
|
||||
<ul>
|
||||
<li><?=$this->lang->line('Revision')?>: <?=$revision?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> <!-- project_source_folder_sidebar -->
|
||||
<?php if ($revision >= 0): ?>
|
||||
<div class="sidebar" id="project_source_folder_sidebar">
|
||||
<div class="box">
|
||||
<ul>
|
||||
<li><?=$this->lang->line('Revision')?>: <?=$revision?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> <!-- project_source_folder_sidebar -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<!---------------------------------------------------------------------------->
|
||||
@ -46,7 +47,18 @@ $this->load->view (
|
||||
|
||||
<div class="title">
|
||||
<?php
|
||||
print anchor ('/source/folder/' . $project->id, htmlspecialchars($project->name));
|
||||
if ($revision <= 0)
|
||||
{
|
||||
$revreq = '';
|
||||
$revreqroot = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$revreq = "/{$revision}";
|
||||
$revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq;
|
||||
}
|
||||
|
||||
print anchor ("/source/folder/{$project->id}{$revreqroot}", htmlspecialchars($project->name));
|
||||
if ($folder != '')
|
||||
{
|
||||
$exps = explode ('/', $folder);
|
||||
@ -54,10 +66,11 @@ if ($folder != '')
|
||||
$par = '';
|
||||
for ($i = 1; $i < $expsize; $i++)
|
||||
{
|
||||
print '/';
|
||||
|
||||
$par .= '/' . $exps[$i];
|
||||
$hexpar = $this->converter->AsciiToHex ($par);
|
||||
print '/';
|
||||
print anchor ('source/folder/' . $project->id . '/' . $hexpar, htmlspecialchars($exps[$i]));
|
||||
print anchor ("source/folder/{$project->id}/{$hexpar}{$revreq}", htmlspecialchars($exps[$i]));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -82,32 +95,45 @@ if ($folder != '')
|
||||
else
|
||||
{
|
||||
print '<div class="menu" id="project_source_folder_mainarea_menu">';
|
||||
$par = $this->converter->AsciiTohex ($folder);
|
||||
print anchor ('source/history/folder/' . $project->id . '/' . $par, $this->lang->line('History'));
|
||||
$hexpar = $this->converter->AsciiTohex ($folder);
|
||||
if ($revision > 0 && $revision < $next_revision)
|
||||
{
|
||||
print anchor ("source/folder/{$project->id}", $this->lang->line('Head revision'));
|
||||
print ' | ';
|
||||
}
|
||||
print anchor ("source/history/folder/{$project->id}/{$hexpar}", $this->lang->line('History'));
|
||||
print '</div>';
|
||||
|
||||
usort ($files, 'comp_files');
|
||||
|
||||
print '<table>';
|
||||
print '<tr>';
|
||||
print '<div id="project_source_folder_mainarea_result">';
|
||||
print '<table id="project_source_folder_mainarea_result_table">';
|
||||
print '<tr class="heading">';
|
||||
print '<th>' . $this->lang->line('Name') . '</th>';
|
||||
print '<th>' . $this->lang->line('Revision') . '</th>';
|
||||
print '<th>' . $this->lang->line('Size') . '</th>';
|
||||
print '<th>' . $this->lang->line('Author') . '</th>';
|
||||
print '<th>' . $this->lang->line('Time') . '</th>';
|
||||
print '<th>' . '</th>';
|
||||
print '<th>' . '</th>';
|
||||
print '</tr>';
|
||||
|
||||
$rowclasses = array ('even', 'odd');
|
||||
$rownum = 0;
|
||||
foreach ($files as $f)
|
||||
{
|
||||
$fullpath = $folder . '/' . $f['name'];
|
||||
|
||||
$rowclass = $rowclasses[++$rownum % 2];
|
||||
if ($f['type'] === 'dir')
|
||||
{
|
||||
// directory
|
||||
print '<tr>';
|
||||
$hexpath = $this->converter->AsciiToHex($fullpath);
|
||||
print "<tr class='{$rowclass}'>";
|
||||
print '<td>';
|
||||
$url = 'source/folder/' . $project->id . '/' .
|
||||
$this->converter->AsciiToHex ($fullpath);
|
||||
print anchor ($url, htmlspecialchars($f['name']));
|
||||
print anchor (
|
||||
"source/folder/{$project->id}/{$hexpath}{$revreq}",
|
||||
htmlspecialchars($f['name']));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $f['created_rev'];
|
||||
@ -116,19 +142,22 @@ if ($folder != '')
|
||||
print '<td>';
|
||||
print htmlspecialchars($f['last_author']);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td><code>';
|
||||
print date('r', $f['time_t']);
|
||||
print '</td>';
|
||||
print '</code></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
// file
|
||||
print '<tr>';
|
||||
$hexpath = $this->converter->AsciiToHex($fullpath);
|
||||
print "<tr class='{$rowclass}'>";
|
||||
print '<td>';
|
||||
$url = 'source/file/' . $project->id . '/' .
|
||||
$this->converter->AsciiToHex($fullpath);
|
||||
print anchor ($url, htmlspecialchars($f['name']));
|
||||
print anchor (
|
||||
"source/file/{$project->id}/{$hexpath}{$revreq}",
|
||||
htmlspecialchars($f['name']));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $f['created_rev'];
|
||||
@ -139,13 +168,25 @@ if ($folder != '')
|
||||
print '<td>';
|
||||
print htmlspecialchars($f['last_author']);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td><code>';
|
||||
print date('r', $f['time_t']);
|
||||
print '</code></td>';
|
||||
|
||||
print '<td>';
|
||||
print anchor (
|
||||
"source/blame/{$project->id}/{$hexpath}{$revreq}",
|
||||
$this->lang->line('Blame'));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print anchor (
|
||||
"source/diff/{$project->id}/{$hexpath}{$revreq}",
|
||||
$this->lang->line('Difference'));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -66,19 +66,22 @@ if ($type == 'file')
|
||||
{
|
||||
$par = $folder;
|
||||
$par = $this->converter->AsciiTohex ($par);
|
||||
$xpar = 'source/file/' . $project->id . '/' . $par;
|
||||
$xpar = "source/file/{$project->id}/{$par}";
|
||||
print anchor ($xpar, $this->lang->line('Details'));
|
||||
print ' | ';
|
||||
$xpar = 'source/blame/' . $project->id . '/' . $par;
|
||||
$xpar = "source/blame/{$project->id}/{$par}";
|
||||
print anchor ($xpar, $this->lang->line('Blame'));
|
||||
print ' | ';
|
||||
$xpar = "source/diff/{$project->id}/{$par}";
|
||||
print anchor ($xpar, $this->lang->line('Difference'));
|
||||
}
|
||||
?>
|
||||
</div> <!-- project_source_history_mainarea_menu -->
|
||||
|
||||
|
||||
<div id="project_source_history_mainarea_body">
|
||||
<table>
|
||||
<tr>
|
||||
<div id="project_source_history_mainarea_result">
|
||||
<table id="project_source_history_mainarea_result_table">
|
||||
<tr class='heading'>
|
||||
<th><?=$this->lang->line('Revision')?></th>
|
||||
<th><?=$this->lang->line('Author')?></th>
|
||||
<th><?=$this->lang->line('Time')?></th>
|
||||
@ -86,26 +89,28 @@ if ($type == 'file')
|
||||
<th><?=$this->lang->line('Files')?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$rowclasses = array ('even', 'odd');
|
||||
$history = $file['history'];
|
||||
$history_count = count($history);
|
||||
for ($i = $history_count; $i > 0; )
|
||||
{
|
||||
$h = $history[--$i];
|
||||
|
||||
print '<tr>';
|
||||
$rowclass = $rowclasses[($history_count - $i) % 2];
|
||||
print "<tr class='{$rowclass}'>";
|
||||
|
||||
print '<td>';
|
||||
$hexfolder = $this->converter->AsciiToHex(($folder == '')? '.': $folder);
|
||||
print anchor ("/source/$type/" . $project->id . '/' . $hexfolder . '/' . $h['rev'], $h['rev']);
|
||||
print anchor ("/source/$type/{$project->id}/{$hexfolder}/{$h['rev']}", $h['rev']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print htmlspecialchars($h['author']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print '<td><code>';
|
||||
print date('r', strtotime($h['date']));
|
||||
print '</td>';
|
||||
print '</code></td>';
|
||||
|
||||
print '<td>';
|
||||
print htmlspecialchars($h['msg']);
|
||||
@ -115,15 +120,19 @@ if ($type == 'file')
|
||||
if (count($paths) > 0)
|
||||
{
|
||||
print '<td>';
|
||||
print '<ul id="project_source_history_mainarea_result_table_path_list">';
|
||||
foreach ($paths as $p)
|
||||
{
|
||||
print '<li>';
|
||||
print '<code>';
|
||||
print '[';
|
||||
print $p['action'];
|
||||
print '] ';
|
||||
print_path ($project, $p['path'], 'file', $this->converter, $h['rev']);
|
||||
print '</code>';
|
||||
print '</li>';
|
||||
}
|
||||
print '</ul>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
@ -50,10 +50,28 @@ function load_ini ($file)
|
||||
if (array_key_exists ($idx, $cfg))
|
||||
{
|
||||
$rawval = $cfg[$idx];
|
||||
if ($x[1] == 'string') define ($const, $rawval);
|
||||
else if ($x[1] == 'boolean') define ($const, strcasecmp ($rawval, 'yes') == 0);
|
||||
else if ($x[1] == 'integer') define ($const, intval ($rawval));
|
||||
else define ($const, $x[2]);
|
||||
if ($x[1] == 'string')
|
||||
{
|
||||
define ($const, $rawval);
|
||||
}
|
||||
else if ($x[1] == 'boolean')
|
||||
{
|
||||
if (is_bool($rawval))
|
||||
define ($const, $rawval);
|
||||
else if (is_numeric($rawval) === TRUE)
|
||||
define ($const, $rawval != 0);
|
||||
else
|
||||
define ($const, strcasecmp ($rawval, 'yes') == 0);
|
||||
}
|
||||
else if ($x[1] == 'integer')
|
||||
{
|
||||
define ($const, intval ($rawval));
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the default value
|
||||
define ($const, $x[2]);
|
||||
}
|
||||
}
|
||||
else define ($const, $x[2]);
|
||||
}
|
||||
|
@ -3,7 +3,8 @@ SUBDIRS = images
|
||||
wwwdir=$(WWWDIR)/css
|
||||
www_DATA = \
|
||||
common.css \
|
||||
project.css
|
||||
project.css \
|
||||
websvn.css
|
||||
|
||||
EXTRA_DIST = $(www_DATA)
|
||||
|
||||
|
@ -205,7 +205,8 @@ wwwdir = $(WWWDIR)/css
|
||||
SUBDIRS = images
|
||||
www_DATA = \
|
||||
common.css \
|
||||
project.css
|
||||
project.css \
|
||||
websvn.css
|
||||
|
||||
EXTRA_DIST = $(www_DATA)
|
||||
all: all-recursive
|
||||
|
@ -1,12 +1,10 @@
|
||||
ody {
|
||||
//margin: 0;
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.content
|
||||
{
|
||||
//margin: 2px 2px 2px 2px;
|
||||
font-size: 90%;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
@ -178,109 +176,76 @@ ody {
|
||||
border: 1px solid #BBCCDD;
|
||||
}
|
||||
|
||||
.content .mainarea table {
|
||||
border-collapse:collapse;
|
||||
border-bottom: 2px solid #BBCCDD;
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.content .mainarea .icon {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.content .mainarea table th {
|
||||
color:#FFFFFF;
|
||||
background-color: #7777FF;
|
||||
font-weight: normal;
|
||||
.content .mainarea pre {
|
||||
padding: .3em .3em .3em .3em;
|
||||
border: 1px dashed #BBCCDD;
|
||||
background-color: #F1F1FF;
|
||||
overflow: auto;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.content .mainarea tt {
|
||||
padding: .1em .1em .1em .1em;
|
||||
background-color: #F1F1FF;
|
||||
}
|
||||
|
||||
.content .mainarea tt:hover {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.content .mainarea table {
|
||||
font-size: inherit;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.content .mainarea table tr.heading {
|
||||
color: #FFFFFF;
|
||||
background-color: #7777FF;
|
||||
}
|
||||
|
||||
.content .mainarea table tr.heading a {
|
||||
color: inherit;
|
||||
background-color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.content .mainarea table tr.odd {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.content .mainarea table tr.even {
|
||||
background-color: #EEEEFF;
|
||||
}
|
||||
|
||||
.content .mainarea table tr th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.content .mainarea table tr:hover {
|
||||
background-color: #BBCCFF;
|
||||
}
|
||||
|
||||
.content .mainarea table td {
|
||||
.content .mainarea table tr td {
|
||||
padding-left: 0.2em;
|
||||
padding-right: 0.2em;
|
||||
}
|
||||
|
||||
.content .mainarea table td img {
|
||||
.content .mainarea table tr td img {
|
||||
vertical-align: middle;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
.content .mainarea pre,
|
||||
.content .mainarea tt,
|
||||
.content .mainarea .codebox {
|
||||
padding: .3em .3em .3em .3em;
|
||||
border: 1px dashed #BBCCDD;
|
||||
background-color: #F1F1FF;
|
||||
}
|
||||
|
||||
.content .mainarea .codebox pre,
|
||||
.content .mainarea .codebox tt {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.content .mainarea table td.code {
|
||||
.content .mainarea table tr td.code {
|
||||
white-space: nowarp;
|
||||
}
|
||||
|
||||
.content .mainarea table td.code pre {
|
||||
.content .mainarea table tr td.code pre {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.content .mainarea table td.code pre {
|
||||
padding: 0;
|
||||
border: 0 none;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.content .mainarea table tbody tr.diffcode td.diff pre {
|
||||
display:block;
|
||||
height:100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
border: 0 none;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.content .mainarea table tbody td.diffdeleted pre {
|
||||
border:1px solid #e8d4bc;
|
||||
background-color:#f8e4cc;
|
||||
background-image:url(images/bullet_delete.png);
|
||||
background-position:2px 50%;
|
||||
background-repeat:no-repeat;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.content .mainarea table tbody tr.diffcode td.diffadded pre {
|
||||
border:1px solid #cdf0cd;
|
||||
background-color:#ddffdd;
|
||||
background-image:url(images/bullet_add.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
.content .mainarea table tbody tr.diffcode td.diffchanged pre {
|
||||
border:1px solid #f0f0bc;
|
||||
background-color:#ffffcc;
|
||||
background-image:url(images/bullet_yellow.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.content .mainarea pre.prettyprint {
|
||||
/* anything that make prettyprint area different from other pres? */
|
||||
background-color: #FFFFFF;
|
||||
@ -336,8 +301,19 @@ pre.prettyprint .nocode a:hover {
|
||||
}
|
||||
}
|
||||
|
||||
.content .infostrip {
|
||||
font-size: 0.9em;
|
||||
background: #E5ECF9 none repeat scroll 0 0;
|
||||
margin: 0.3em 0em 0em 0em;
|
||||
padding: 0.3em 0.3em 0.3em 0.3em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.content .infostrip a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.content .sidebar {
|
||||
/* sidebar to show extra information holding one or more infoboxes */
|
||||
font-size: 0.9em;
|
||||
float: right;
|
||||
width: 20em;
|
||||
@ -398,10 +374,6 @@ pre.prettyprint .nocode a:hover {
|
||||
padding: 0.2em 0 0.2em 1em;
|
||||
}
|
||||
|
||||
|
||||
.content .sidebar a:hover {
|
||||
}
|
||||
|
||||
.content .footer {
|
||||
padding: 0.3em 0em 0.3em 0em;
|
||||
font-size: .9em;
|
||||
|
@ -1,5 +1,110 @@
|
||||
/* specific IDs */
|
||||
/*
|
||||
* This file contains specific IDs for furthur customization.
|
||||
*/
|
||||
|
||||
#project_list_mainarea {
|
||||
/*-----------------------------------------------
|
||||
* project source folder view
|
||||
*-----------------------------------------------*/
|
||||
#project_source_folder_mainarea_result {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#project_source_folder_mainarea_result_table tr {
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------
|
||||
* project source folder view
|
||||
*-----------------------------------------------*/
|
||||
#project_file_home_mainarea_result {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#project_file_home_mainarea_result_table tr {
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------
|
||||
* project source history view
|
||||
*-----------------------------------------------*/
|
||||
#project_source_history_mainarea_result {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#project_source_history_mainarea_result_table tr {
|
||||
vertical-align: top;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#project_source_history_mainarea_result_table_path_list {
|
||||
/* the list in the 'paths' column */
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------
|
||||
* project source diff view
|
||||
*-----------------------------------------------*/
|
||||
#project_source_diff_mainarea_result {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#project_source_diff_mainarea_result_table {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#project_source_diff_mainarea_result_table tr.diff td pre {
|
||||
background-color: inherit;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#project_source_diff_mainarea_result_table tr.diff td.diff {
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#project_source_diff_mainarea_result_table tr.diff td.diffrow {
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#project_source_diff_mainarea_result_table tr.diff td.diffadded {
|
||||
border:1px solid #cdf0cd;
|
||||
background-color:#ddffdd;
|
||||
background-image:url(images/bullet_add.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#project_source_diff_mainarea_result_table tr.diff td.diffdeleted {
|
||||
border:1px solid #e8d4bc;
|
||||
background-color:#f8e4cc;
|
||||
background-image:url(images/bullet_delete.png);
|
||||
background-position:2px 50%;
|
||||
background-repeat:no-repeat;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#project_source_diff_mainarea_result_table tr.diff td.diffchanged {
|
||||
border:1px solid #f0f0bc;
|
||||
background-color:#ffffcc;
|
||||
background-image:url(images/bullet_yellow.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
90
codepot/src/css/websvn.css
Normal file
90
codepot/src/css/websvn.css
Normal file
@ -0,0 +1,90 @@
|
||||
|
||||
/*-----------------------------------------------
|
||||
* websvn source folder view
|
||||
*-----------------------------------------------*/
|
||||
#websvn_folder_mainarea_result {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#websvn_folder_mainarea_result_table {
|
||||
border: 0;
|
||||
border-collapse: collapse;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#websvn_folder_mainarea_result_table tr {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#websvn_folder_mainarea_result_table tr td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
padding-left: 0.2em;
|
||||
padding-right: 0.2em;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------
|
||||
* websvn source diff view
|
||||
*-----------------------------------------------*/
|
||||
#websvn_diff_mainarea_result {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#websvn_diff_mainarea_result_table {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#websvn_diff_mainarea_result_table tr.diff pre {
|
||||
background-color: inherit;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#websvn_diff_mainarea_result_table tr.diff td.diff {
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#websvn_diff_mainarea_result_table tr.diff td.diffrow {
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#websvn_diff_mainarea_result_table tr.diff td.diffadded {
|
||||
border:1px solid #cdf0cd;
|
||||
background-color:#ddffdd;
|
||||
background-image:url(images/bullet_add.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#websvn_diff_mainarea_result_table tr.diff td.diffdeleted {
|
||||
border:1px solid #e8d4bc;
|
||||
background-color:#f8e4cc;
|
||||
background-image:url(images/bullet_delete.png);
|
||||
background-position:2px 50%;
|
||||
background-repeat:no-repeat;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#websvn_diff_mainarea_result_table tr.diff td.diffchanged {
|
||||
border:1px solid #f0f0bc;
|
||||
background-color:#ffffcc;
|
||||
background-image:url(images/bullet_yellow.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:2px 50%;
|
||||
padding: 0;
|
||||
padding-left:22px;
|
||||
margin: 0;
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ class SVNRepository {
|
||||
@exec($cmd);
|
||||
|
||||
// Get the file as a string (memory hogging, but we have no other options)
|
||||
$content = highlight_file($filename, true);
|
||||
$content = '<PRE>' . highlight_file($filename, true) . '</PRE>';
|
||||
|
||||
// Destroy the previous version, and replace it with the highlighted version
|
||||
$f = fopen($filename, "w");
|
||||
@ -664,7 +664,9 @@ class SVNRepository {
|
||||
@exec($cmd);
|
||||
$tmpStr = file_get_contents($tmp);
|
||||
$tmpStr = str_replace(array("\r\n"), array("\n"), $tmpStr);
|
||||
print '<PRE>';
|
||||
highlight_string($tmpStr);
|
||||
print '</PRE>';
|
||||
@unlink($tmp);
|
||||
} else if ($l !== null && $config->useGeshi) {
|
||||
$tmp = tempnam("temp", "wsvn");
|
||||
|
@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mainarea">
|
||||
<div class="mainarea" id="websvn_diff_mainarea">
|
||||
|
||||
[websvn-test:noaccess]
|
||||
[lang:NOACCESS]
|
||||
@ -49,26 +49,26 @@
|
||||
[websvn:fileviewloglink]
|
||||
</div> <!-- menu -->
|
||||
|
||||
<div id="result">
|
||||
<div id="websvn_diff_mainarea_result">
|
||||
|
||||
[websvn-test:noprev]
|
||||
[lang:NOPREVREV]
|
||||
[websvn-else]
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<table id="websvn_diff_mainarea_result_table">
|
||||
<tr class="heading">
|
||||
<th>[lang:REV] [websvn:rev2]</th>
|
||||
<th>[lang:REV] [websvn:rev1]</th>
|
||||
</tr>
|
||||
|
||||
[websvn-startlisting]
|
||||
[websvn-test:rev1lineno]
|
||||
<tr class="diffcode">
|
||||
<td class="row1"><strong>[lang:LINE] [websvn:rev1lineno]...</strong></td>
|
||||
<td class="row1"><strong>[lang:LINE] [websvn:rev2lineno]...</strong></td>
|
||||
<tr class="diff">
|
||||
<td class="diffrow"><strong>[lang:LINE] [websvn:rev1lineno]...</strong></td>
|
||||
<td class="diffrow"><strong>[lang:LINE] [websvn:rev2lineno]...</strong></td>
|
||||
</tr>
|
||||
[websvn-else]
|
||||
<tr class="diffcode">
|
||||
<tr class="diff">
|
||||
<td class="[websvn:rev1diffclass]"><pre>[websvn:rev1line]</pre></td>
|
||||
<td class="[websvn:rev2diffclass]"><pre>[websvn:rev2line]</pre></td>
|
||||
</tr>
|
||||
|
@ -62,7 +62,7 @@
|
||||
[websvn-endtest]
|
||||
</div> <!-- menu -->
|
||||
|
||||
<div id="body">
|
||||
<div id="websvn_folder_mainarea_result">
|
||||
|
||||
[websvn-defineicons]
|
||||
dir=<img src="[websvn:locwebsvnhttp]/templates/calm/images/folder.png" alt="[FOLDER]" class="icon" />
|
||||
@ -92,9 +92,9 @@ e-node=<img src="[websvn:locwebsvnhttp]/templates/calm/images/e-node.png" alt="[
|
||||
[websvn-enddefineicons]
|
||||
|
||||
[websvn:compare_form]
|
||||
<table>
|
||||
<table id="websvn_folder_mainarea_result_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr class='heading'>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th>[lang:PATH]</th>
|
||||
|
@ -41,9 +41,7 @@
|
||||
[websvn:fileviewloglink]
|
||||
</div>
|
||||
|
||||
<div class="codebox">
|
||||
[websvn-getlisting]
|
||||
</div>
|
||||
[websvn-getlisting]
|
||||
|
||||
[websvn-endtest]
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
<link rel="shortcut icon" type="image/x-icon" href="[websvn:locwebsvnhttp]/templates/calm/images/favicon.ico" />
|
||||
|
||||
<link type="text/css" href="[websvn:loccodepothttp]/css/common.css" rel="stylesheet" />
|
||||
<link type="text/css" href="[websvn:loccodepothttp]/css/websvn.css" rel="stylesheet" />
|
||||
|
||||
[websvn-test:rssurl]
|
||||
<link rel='alternate' type='application/rss+xml' title='WebSVN RSS' href='[websvn:rssurl]' />
|
||||
|
Loading…
Reference in New Issue
Block a user