diff --git a/codepot/src/codepot/controllers/source.php b/codepot/src/codepot/controllers/source.php index 46e759c1..5abaeadb 100644 --- a/codepot/src/codepot/controllers/source.php +++ b/codepot/src/codepot/controllers/source.php @@ -77,7 +77,7 @@ class Source extends Controller } } - function file ($projectid, $path, $rev = SVN_REVISION_HEAD) + function file ($projectid, $path = '', $rev = SVN_REVISION_HEAD) { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('SubversionModel', 'subversion'); @@ -88,6 +88,7 @@ class Source extends Controller $data['login'] = $login; $path = $this->converter->HexToAscii ($path); + if ($path == '.') $path = ''; /* treat a period specially */ $project = $this->projects->get ($projectid); if ($project === FALSE) @@ -163,6 +164,7 @@ class Source extends Controller $data['login'] = $login; $path = $this->converter->HexToAscii ($path); + if ($path == '.') $path = ''; /* treat a period specially */ $project = $this->projects->get ($projectid); if ($project === FALSE) @@ -248,13 +250,19 @@ class Source extends Controller //$data['folder'] = substr ($path, 0, strrpos($path, '/')); $data['folder'] = $path; $data['file'] = $file; + $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_HISTORY, $data); } } } - function revision ($projectid, $path, $rev) + function revision ($type, $projectid, $path, $rev = SVN_REVISION_HEAD) { $this->load->model ('ProjectModel', 'projects'); $this->load->model ('SubversionModel', 'subversion'); @@ -280,7 +288,7 @@ class Source extends Controller } else { - $file = $this->subversion->getRevisionHistory ($projectid, $path, $rev); + $file = $this->subversion->getRevHistory ($projectid, $path, $rev); if ($file === FALSE) { $data['message'] = 'Failed to get log content'; @@ -288,11 +296,18 @@ class Source extends Controller } else { + $data['type'] = $type; $data['project'] = $project; //$data['folder'] = substr ($path, 0, strrpos($path, '/')); $data['folder'] = $path; $data['file'] = $file; + $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_REVISION, $data); } } diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index bd3d1227..18a33c8e 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -31,6 +31,7 @@ $lang['Latest projects'] = 'Latest projects'; $lang['Other projects'] = 'Other projects'; $lang['Overview'] = 'Overview'; $lang['Password'] = 'Password'; +$lang['Path'] = 'Path'; $lang['Project'] = 'Project'; $lang['Projects'] = 'Projects'; $lang['Repository'] = 'Repository'; diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index 79bcb69d..0dcc4bcf 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -31,6 +31,7 @@ $lang['Latest projects'] = 'Proyek terakhir'; $lang['Other projects'] = 'Proyek lain'; $lang['Overview'] = 'Ringkasan'; $lang['Password'] = 'Kata sandi'; +$lang['Path'] = 'Path'; $lang['Project'] = 'Proyek'; $lang['Projects'] = 'Proyek'; $lang['Repository'] = 'Repository'; diff --git a/codepot/src/codepot/language/korean/common_lang.php b/codepot/src/codepot/language/korean/common_lang.php index 802e57a6..7f423f9f 100644 --- a/codepot/src/codepot/language/korean/common_lang.php +++ b/codepot/src/codepot/language/korean/common_lang.php @@ -8,7 +8,7 @@ $lang['Delete'] = '삭제'; $lang['Description'] = '설명'; $lang['Details'] = '상세내역'; $lang['Difference'] = '차이점'; -$lang['Directory'] = '파일목록'; +$lang['Directory'] = '디렉토리'; $lang['Download'] = '내려받기'; $lang['Edit'] = '수정'; $lang['Head revision'] = '최신리비전'; @@ -31,6 +31,7 @@ $lang['Latest projects'] = '최근 프로젝트'; $lang['Other projects'] = '다른 프로젝트'; $lang['Overview'] = '개요'; $lang['Password'] = '패스워드'; +$lang['Path'] = '경로'; $lang['Project'] = '프로젝트'; $lang['Projects'] = '프로젝트'; $lang['Repository'] = '저장소'; diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 9ee5cd5e..33c3ea25 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -10,7 +10,7 @@ class SubversionModel extends Model function getList ($projectid, $subdir = '', $rev = SVN_REVISION_HEAD, $recurse = FALSE) { $path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid; - if ($subdir != '') $path .= '/' . $subdir; + if ($subdir != '') $path .= "/{$subdir}"; $list = @svn_ls ($path, $rev, $recurse); if ($list === FALSE) return FALSE; @@ -26,6 +26,8 @@ class SubversionModel extends Model if ($info === FALSE) return FALSE; $last = substr(strrchr($path, '/'), 1); + if ($last === FALSE) $last = ''; + if (array_key_exists ($last, $info) === FALSE) return FALSE; $fileinfo = $info[$last]; @@ -44,6 +46,8 @@ class SubversionModel extends Model if ($info === FALSE) return FALSE; $last = substr(strrchr($path, '/'), 1); + if ($last === FALSE) $last = ''; + if (array_key_exists ($last, $info) === FALSE) return FALSE; $fileinfo = $info[$last]; @@ -59,6 +63,8 @@ class SubversionModel extends Model $path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file; $last = substr(strrchr($path, '/'), 1); + if ($last === FALSE) $last = ''; + $info['name'] = $last; $fileinfo = $info; @@ -69,11 +75,13 @@ class SubversionModel extends Model return $fileinfo; } - function getRevisionHistory ($projectid, $file, $rev) + function getRevHistory ($projectid, $file, $rev) { $path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file; $last = substr(strrchr($path, '/'), 1); + if ($last === FALSE) $last = ''; + $info['name'] = $last; $fileinfo = $info; @@ -334,6 +342,8 @@ class SubversionModel extends Model if ($info === FALSE) return FALSE; $last = substr(strrchr($path, '/'), 1); + if ($last === FALSE) $last = ''; + if (array_key_exists ($last, $info) === FALSE) return FALSE; $fileinfo = $info[$last]; diff --git a/codepot/src/codepot/views/source_blame.php b/codepot/src/codepot/views/source_blame.php index b9559784..98d5ed4a 100644 --- a/codepot/src/codepot/views/source_blame.php +++ b/codepot/src/codepot/views/source_blame.php @@ -134,9 +134,8 @@ for ($i = 0; $i < $len; $i++) $rev = $line['rev']; $rev_padded = str_pad ($rev, 6, ' ', STR_PAD_LEFT); - $par = $folder . '/' . $file['name']; - $par = $this->converter->AsciiTohex ($par); - $rev_padded = anchor ('/source/blame/' . $project->id . '/' . $par . '/' . $rev, $rev_padded); + $par = $this->converter->AsciiTohex ("{$folder}/{$file['name']}"); + $rev_padded = anchor ("/source/blame/{$project->id}/{$par}/{$rev}", $rev_padded); } else { @@ -154,9 +153,9 @@ for ($i = 0; $i < $len; $i++) $author_padded = str_pad (' ', 8, ' ', STR_PAD_RIGHT); } - print '' . $rev_padded . ' '; - print '' . $author_padded . ' '; - print '' . $lineno_padded . ' '; + print "{$rev_padded}"; + print "{$author_padded}"; + print "{$lineno_padded}"; print htmlspecialchars ($line['line']); print "\n"; } diff --git a/codepot/src/codepot/views/source_history.php b/codepot/src/codepot/views/source_history.php index da9aaa4a..08805a41 100644 --- a/codepot/src/codepot/views/source_history.php +++ b/codepot/src/codepot/views/source_history.php @@ -67,7 +67,7 @@ if ($type == 'folder') { $par = $this->converter->AsciiTohex ($folder); $xpar = "source/folder/{$project->id}/{$par}"; - print anchor ($xpar, $this->lang->line('Directory')); + print anchor ($xpar, $this->lang->line('Folder')); } else { @@ -107,10 +107,13 @@ else print ''; $hexfolder = $this->converter->AsciiToHex(($folder == '')? '.': $folder); + /* if ($type == 'folder') - print anchor ("/source/revision/{$project->id}/{$hexfolder}/{$h['rev']}", $h['rev']); + print anchor ("/source/revision/{$type}/{$project->id}/{$hexfolder}/{$h['rev']}", $h['rev']); else - print anchor ("/source/$type/{$project->id}/{$hexfolder}/{$h['rev']}", $h['rev']); + print anchor ("/source/{$type}/{$project->id}/{$hexfolder}/{$h['rev']}", $h['rev']); + */ + print $h['rev']; print ''; print ''; @@ -129,14 +132,20 @@ else print ''; if ($type == 'folder') { + print anchor ("/source/revision/{$type}/{$project->id}/{$hexfolder}/{$h['rev']}", + $this->lang->line('Details')); + print ' '; print anchor ("/source/folder/{$project->id}/{$hexfolder}/{$h['rev']}", - $this->lang->line('Directory')); + $this->lang->line('Folder')); } else { + print anchor ("/source/{$type}/{$project->id}/{$hexfolder}/{$h['rev']}", + $this->lang->line('Details')); + print ' '; print anchor ("/source/blame/{$project->id}/{$hexfolder}/{$h['rev']}", $this->lang->line('Blame')); - print ' | '; + print ' '; print anchor ("/source/diff/{$project->id}/{$hexfolder}/{$h['rev']}", $this->lang->line('Difference')); } diff --git a/codepot/src/codepot/views/source_revision.php b/codepot/src/codepot/views/source_revision.php index 75fcd7f2..6c7a574d 100644 --- a/codepot/src/codepot/views/source_revision.php +++ b/codepot/src/codepot/views/source_revision.php @@ -29,18 +29,13 @@ $this->load->view ( - - - - -
+
AsciiToHex ($par); print '/'; - $xpar = "source/revision/{$project->id}/{$hexpar}"; + $xpar = "source/revision/folder/{$project->id}/{$hexpar}"; if ($rev != '') $xpar .= "/{$rev}"; print anchor ($xpar, htmlspecialchars($exps[$i])); } } $hexfolder = $this->converter->AsciiToHex('.'); -print anchor ("/source/revision/{$project->id}/{$hexfolder}/{$revision}", htmlspecialchars($project->name)); +print anchor ("/source/revision/folder/{$project->id}/{$hexfolder}/{$revision}", htmlspecialchars($project->name)); if ($folder != '') print_path ($project, $folder, $revision, $this->converter); ?>
@@ -79,25 +75,65 @@ if ($folder != '') print_path ($project, $folder, $revision, $this->converter); +
+id}/${hexfolder}/{$prev_revision}", '<<')?> +lang->line('Revision')?>: +id}/${hexfolder}/{$next_revision}", '>>')?> | +lang->line('Author')?>: | +lang->line('Last updated on')?>: +
+ +
+'; + print ''; + print ''; + print ''; + print ''; + + $rowclasses = array ('even', 'odd'); + $rowcount = 0; foreach ($history['paths'] as $p) { - print '
  • '; - print '['; - print $p['action']; - print '] '; + $rowclass = $rowclasses[++$rowcount % 2]; + print "
  • "; + $hexpar = $this->converter->AsciiToHex ($p['path']); - print anchor ("source/file/{$project->id}/{$hexpar}/{$history['rev']}", htmlspecialchars($p['path'])); - print ''; + + print "'; + + print ''; + print ''; } - print ''; ?>
    ' . $this->lang->line('Path') . '
    "; + print htmlspecialchars($p['path']); + print ''; +/* + if ($type == 'folder') + { + print anchor ("source/folder/{$project->id}/{$hexpar}/{$history['rev']}", $this->lang->line('Folder')); + } + else + { +*/ + print anchor ("source/file/{$project->id}/{$hexpar}/{$history['rev']}", $this->lang->line('Details')); + print ' '; + print anchor ("source/blame/{$project->id}/{$hexpar}/{$history['rev']}", $this->lang->line('Blame')); + print ' '; + print anchor ("source/diff/{$project->id}/{$hexpar}/{$history['rev']}", $this->lang->line('Difference')); +/* + } +*/ + print '
    diff --git a/codepot/src/css/project.css b/codepot/src/css/project.css index b689d7bb..38af67d5 100644 --- a/codepot/src/css/project.css +++ b/codepot/src/css/project.css @@ -53,8 +53,36 @@ overflow: auto; } -#project_source_revision_mainarea_result ul li { - list-style: square; +#project_source_revision_mainarea_result_table td.M { + white-space: nowrap; + background-image:url(images/page_white_edit.png); + background-position:2px 50%; + background-repeat:no-repeat; + padding-left: 22px; +} + +#project_source_revision_mainarea_result_table td.D { + white-space: nowrap; + background-image:url(images/page_white_delete.png); + background-position:2px 50%; + background-repeat:no-repeat; + padding-left: 22px; +} + +#project_source_revision_mainarea_result_table td.A { + white-space: nowrap; + background-image:url(images/page_white_add.png); + background-position:2px 50%; + background-repeat:no-repeat; + padding-left: 22px; +} + +#project_source_revision_mainarea_result_table td.R { + white-space: nowrap; + background-image:url(images/page_white_add.png); + background-position:2px 50%; + background-repeat:no-repeat; + padding-left: 22px; } /*----------------------------------------------- diff --git a/codepot/src/websvn/languages/korean.php b/codepot/src/websvn/languages/korean.php index 823e75c1..f4667236 100644 --- a/codepot/src/websvn/languages/korean.php +++ b/codepot/src/websvn/languages/korean.php @@ -41,6 +41,8 @@ $lang["LINE"] = "행"; $lang["SHOWENTIREFILE"] = "모두 보기"; $lang["SHOWCOMPACT"] = "바뀐 부분만 보기"; +$lang["LISTING"] = "디렉토리열람"; +$lang["FILEDETAIL"] = "자세히 보기"; $lang["DIFFPREV"] = "이전 리비전과 비교"; $lang["BLAME"] = "수정한 사람 보기"; @@ -54,7 +56,7 @@ $lang["HIDECHANGED"] = "변경된 파일 숨기기"; $lang["NEWFILES"] = "새 파일"; $lang["CHANGEDFILES"] = "수정된 파일"; $lang["DELETEDFILES"] = "삭제된 파일"; -$lang["VIEWLOG"] = "로그 보기"; +$lang["VIEWLOG"] = "로그보기"; $lang["PATH"] = "경로"; $lang["AUTHOR"] = "작성자"; $lang["AGE"] = "기간";