diff --git a/codepot/src/codepot/controllers/file.php b/codepot/src/codepot/controllers/file.php index fa53121d..aff5b85c 100644 --- a/codepot/src/codepot/controllers/file.php +++ b/codepot/src/codepot/controllers/file.php @@ -38,7 +38,9 @@ class File extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -78,7 +80,9 @@ class File extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -123,7 +127,9 @@ class File extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -178,7 +184,9 @@ class File extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?'] && @@ -369,7 +377,9 @@ class File extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?'] && diff --git a/codepot/src/codepot/controllers/project.php b/codepot/src/codepot/controllers/project.php index 465f6601..b40a11fc 100644 --- a/codepot/src/codepot/controllers/project.php +++ b/codepot/src/codepot/controllers/project.php @@ -39,7 +39,9 @@ class Project extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -173,7 +175,9 @@ class Project extends Controller else if ($project === NULL) { $data['login'] = $login; - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?'] && @@ -265,7 +269,9 @@ class Project extends Controller else if ($project === NULL) { $data['login'] = $login; - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?'] && diff --git a/codepot/src/codepot/controllers/site.php b/codepot/src/codepot/controllers/site.php index c5700d6d..01597f64 100644 --- a/codepot/src/codepot/controllers/site.php +++ b/codepot/src/codepot/controllers/site.php @@ -132,7 +132,7 @@ class Site extends Controller else if ($site === NULL) { $data['login'] = $login; - $data['message'] = "NO SUCH PROJECT - $siteid"; + $data['message'] = "NO SUCH SITE - $siteid"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?']) @@ -224,7 +224,7 @@ class Site extends Controller else if ($site === NULL) { $data['login'] = $login; - $data['message'] = "NO SUCH PROJECT - $siteid"; + $data['message'] = "NO SUCH SITE - $siteid"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?']) diff --git a/codepot/src/codepot/controllers/source.php b/codepot/src/codepot/controllers/source.php index 386095ca..9f124495 100644 --- a/codepot/src/codepot/controllers/source.php +++ b/codepot/src/codepot/controllers/source.php @@ -48,7 +48,9 @@ class Source extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -120,7 +122,9 @@ class Source extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -179,7 +183,9 @@ class Source extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -228,7 +234,9 @@ class Source extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -276,7 +284,9 @@ class Source extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else diff --git a/codepot/src/codepot/controllers/wiki.php b/codepot/src/codepot/controllers/wiki.php index 5672fe50..f90d2783 100644 --- a/codepot/src/codepot/controllers/wiki.php +++ b/codepot/src/codepot/controllers/wiki.php @@ -40,7 +40,9 @@ class Wiki extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else @@ -80,21 +82,36 @@ class Wiki extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else { if ($name == '__PROJECT_HOME__') { - redirect ('project/home/' . $projectid); + redirect ("project/home/{$projectid}"); } else if ($name == '__WIKI_HOME__') { - redirect ('wiki/home/' . $projectid . '/' . $name); + redirect ("wiki/home/{$projectid}"); } else { + $ex = explode (':', $name); + if (count($ex) == 2) + { + if ($ex[0] == '__PROJECT_HOME__') + { + redirect ("project/home/{$ex[1]}"); + } + else if ($ex[0] == '__WIKI_HOME__') + { + redirect ("wiki/home/{$ex[1]}"); + } + } + $wiki = $this->wikis->get ($login['id'], $project, $name); if ($wiki === FALSE) { @@ -103,7 +120,7 @@ class Wiki extends Controller } else if ($wiki === NULL) { - redirect ('wiki/create/'. $projectid . '/' . + redirect ("wiki/create/{$projectid}/" . $this->converter->AsciiToHex($name)); } else @@ -137,7 +154,9 @@ class Wiki extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?'] && @@ -263,7 +282,9 @@ class Wiki extends Controller } else if ($project === NULL) { - $data['message'] = "NO SUCH PROJECT - $projectid"; + $data['message'] = + $this->lang->line('MSG_NO_SUCH_PROJECT') . + " - {$projectid}"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$login['sysadmin?'] && diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index a8423a7d..99125380 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -54,9 +54,16 @@ $lang['Username'] = 'Username'; $lang['Wiki'] = 'Wiki'; $lang['Wikis'] = 'Wikis'; + +$lang['MSG_LOG_COMMIT_BY'] = 'committed by %s'; +$lang['MSG_LOG_CREATE_BY'] = 'created by %s'; +$lang['MSG_LOG_DELETE_BY'] = 'deleted by %s'; +$lang['MSG_LOG_UPDATE_BY'] = 'updated by %s'; + $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_SOURCE_CODE_AVAIL'] = 'No source code available'; +$lang['MSG_NO_SUCH_PROJECT'] = 'No such project'; $lang['MSG_NO_WIKIS_AVAIL'] = 'No wiki pages available'; $lang['MSG_SURE_TO_DELETE_THIS'] = "I'm sure to delete this"; ?> diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index 88f9e39f..6e8020e9 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -54,9 +54,15 @@ $lang['Username'] = 'Nama pemakai'; $lang['Wiki'] = 'Wiki'; $lang['Wikis'] = 'Wiki'; +$lang['MSG_LOG_COMMIT_BY'] = 'committed by %s'; +$lang['MSG_LOG_CREATE_BY'] = 'created by %s'; +$lang['MSG_LOG_DELETE_BY'] = 'deleted by %s'; +$lang['MSG_LOG_UPDATE_BY'] = 'updated by %s'; + $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_SOURCE_CODE_AVAIL'] = 'Tidak ada kode sumber tersedia'; +$lang['MSG_NO_SUCH_PROJECT'] = 'No such project'; $lang['MSG_NO_WIKIS_AVAIL'] = 'Tidak ada halaman wiki tersedia'; $lang['MSG_SURE_TO_DELETE_THIS'] = "Saya yakin untuk menghapus"; ?> diff --git a/codepot/src/codepot/language/korean/common_lang.php b/codepot/src/codepot/language/korean/common_lang.php index 2dcc7cb6..07aa7f46 100644 --- a/codepot/src/codepot/language/korean/common_lang.php +++ b/codepot/src/codepot/language/korean/common_lang.php @@ -54,9 +54,15 @@ $lang['Username'] = '사용자명'; $lang['Wiki'] = '위키'; $lang['Wikis'] = '위키'; +$lang['MSG_LOG_COMMIT_BY'] = '%s에 의해 커밋되었습니다'; +$lang['MSG_LOG_CREATE_BY'] = '%s에 의해 생성되었습니다'; +$lang['MSG_LOG_DELETE_BY'] = '%s에 의해 삭제되었습니다'; +$lang['MSG_LOG_UPDATE_BY'] = '%s에 의해 갱신되었습니다'; + $lang['MSG_NO_DIFF'] = '차이점이 없습니다'; $lang['MSG_NO_FILES_AVAIL'] = '사용가능한 파일이 없습니다'; -$lang['MSG_NO_SOURCE_AVAIL'] = '사용가능한 소스가 없습니다'; +$lang['MSG_NO_SOURCE_CODE_AVAIL'] = '사용가능한 소스코드가 없습니다'; +$lang['MSG_NO_SUCH_PROJECT'] = '프로젝트가 없습니다'; $lang['MSG_NO_WIKIS_AVAIL'] = '사용가능한 위키페이지가 없습니다'; $lang['MSG_SURE_TO_DELETE_THIS'] = '반드시 이것을 삭제하고 싶어요'; ?> diff --git a/codepot/src/codepot/models/filemodel.php b/codepot/src/codepot/models/filemodel.php index 7a79e43b..f9864a18 100644 --- a/codepot/src/codepot/models/filemodel.php +++ b/codepot/src/codepot/models/filemodel.php @@ -47,8 +47,16 @@ class FileModel extends Model $this->db->set ('createdby', $userid); $this->db->set ('updatedon', date('Y-m-d H:i:s')); $this->db->set ('updatedby', $userid); - $this->db->insert ('file'); + + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'file'); + $this->db->set ('action', 'create'); + $this->db->set ('projectid', $file->projectid); + $this->db->set ('userid', $userid); + $this->db->set ('message', $file->name); + $this->db->insert ('log'); + $this->db->trans_complete (); return $this->db->trans_status(); } @@ -63,8 +71,16 @@ class FileModel extends Model $this->db->set ('description', $file->description); $this->db->set ('updatedon', date('Y-m-d H:i:s')); $this->db->set ('updatedby', $userid); - $this->db->update ('file'); + + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'file'); + $this->db->set ('action', 'update'); + $this->db->set ('projectid', $file->projectid); + $this->db->set ('userid', $userid); + $this->db->set ('message', $file->name); + $this->db->insert ('log'); + $this->db->trans_complete (); return $this->db->trans_status(); } @@ -94,6 +110,14 @@ class FileModel extends Model $this->db->where ('projectid', $file->projectid); $this->db->where ('name', $file->name); $this->db->delete ('file'); + + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'file'); + $this->db->set ('action', 'delete'); + $this->db->set ('projectid', $file->projectid); + $this->db->set ('userid', $userid); + $this->db->set ('message', $file->name); + $this->db->insert ('log'); if ($this->db->trans_status() === FALSE) { diff --git a/codepot/src/codepot/models/logmodel.php b/codepot/src/codepot/models/logmodel.php index 3f4e9021..0bd67532 100644 --- a/codepot/src/codepot/models/logmodel.php +++ b/codepot/src/codepot/models/logmodel.php @@ -41,7 +41,6 @@ class LogModel extends Model $commits = array (); foreach ($result as $row) { - list($type,$repo,$rev) = split('[,]', $row->message); /* $row->project must be equal to $repo */ $commits[$count]['createdon'] = $row->createdon; @@ -50,27 +49,36 @@ class LogModel extends Model $commits[$count]['projectid'] = $row->projectid; $commits[$count]['userid'] = $row->userid; - $tmp['type'] = $type; - $tmp['repo'] = $repo; - $tmp['rev'] = $rev; - - $log = @svn_log ( - 'file:///'.CODEPOT_SVNREPO_DIR."/{$repo}", - $rev, $rev, 1,SVN_DISCOVER_CHANGED_PATHS); - if ($log === FALSE || count($log) < 1) + if ($row->type == 'code') { - $tmp['time'] = ''; - $tmp['author'] = ''; - $tmp['message'] = ''; + list($type,$repo,$rev) = split('[,]', $row->message); + $tmp['type'] = $type; + $tmp['repo'] = $repo; + $tmp['rev'] = $rev; + + $log = @svn_log ( + 'file:///'.CODEPOT_SVNREPO_DIR."/{$repo}", + $rev, $rev, 1,SVN_DISCOVER_CHANGED_PATHS); + if ($log === FALSE || count($log) < 1) + { + $tmp['time'] = ''; + $tmp['author'] = ''; + $tmp['message'] = ''; + } + else + { + $tmp['time'] = $log[0]['date']; + $tmp['author'] = $log[0]['author']; + $tmp['message'] = $log[0]['msg']; + } + + $commits[$count]['message'] = $tmp; } else { - $tmp['time'] = $log[0]['date']; - $tmp['author'] = $log[0]['author']; - $tmp['message'] = $log[0]['msg']; + $commits[$count]['message'] = $row->message; } - - $commits[$count][$row->type.'-'.$row->action] = $tmp; + $count++; } diff --git a/codepot/src/codepot/models/projectmodel.php b/codepot/src/codepot/models/projectmodel.php index de550adc..e22ab9c6 100644 --- a/codepot/src/codepot/models/projectmodel.php +++ b/codepot/src/codepot/models/projectmodel.php @@ -78,6 +78,14 @@ class ProjectModel extends Model $this->db->insert ('project_membership'); } + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'project'); + $this->db->set ('action', 'create'); + $this->db->set ('projectid', $project->id); + $this->db->set ('userid', $userid); + $this->db->set ('message', $project->name); + $this->db->insert ('log'); + if ($priority <= 0 || $this->db->trans_status() === FALSE) { $this->db->trans_rollback (); @@ -140,6 +148,14 @@ class ProjectModel extends Model $this->db->insert ('project_membership'); } + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'project'); + $this->db->set ('action', 'update'); + $this->db->set ('projectid', $project->id); + $this->db->set ('userid', $userid); + $this->db->set ('message', $project->name); + $this->db->insert ('log'); + if ($priority <= 0 || $this->db->trans_status() === FALSE) { $this->db->trans_rollback (); @@ -160,6 +176,14 @@ class ProjectModel extends Model $this->db->where ('id', $project->id); $this->db->delete ('project'); + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'project'); + $this->db->set ('action', 'delete'); + $this->db->set ('projectid', $project->id); + $this->db->set ('userid', $userid); + $this->db->set ('message', $project->name); + $this->db->insert ('log'); + if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback (); diff --git a/codepot/src/codepot/models/wikimodel.php b/codepot/src/codepot/models/wikimodel.php index 40354352..50787959 100644 --- a/codepot/src/codepot/models/wikimodel.php +++ b/codepot/src/codepot/models/wikimodel.php @@ -45,6 +45,15 @@ class WikiModel extends Model $this->db->set ('createdby', $userid); $this->db->set ('updatedby', $userid); $this->db->insert ('wiki'); + + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'wiki'); + $this->db->set ('action', 'create'); + $this->db->set ('projectid', $wiki->projectid); + $this->db->set ('userid', $userid); + $this->db->set ('message', $wiki->name); + $this->db->insert ('log'); + $this->db->trans_complete (); return $this->db->trans_status(); } @@ -59,6 +68,15 @@ class WikiModel extends Model $this->db->set ('updatedon', date('Y-m-d H:i:s')); $this->db->set ('updatedby', $userid); $this->db->update ('wiki'); + + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'wiki'); + $this->db->set ('action', 'update'); + $this->db->set ('projectid', $wiki->projectid); + $this->db->set ('userid', $userid); + $this->db->set ('message', $wiki->name); + $this->db->insert ('log'); + $this->db->trans_complete (); return $this->db->trans_status(); } @@ -70,6 +88,15 @@ class WikiModel extends Model $this->db->where ('projectid', $wiki->projectid); $this->db->where ('name', $wiki->name); $this->db->delete ('wiki'); + + $this->db->set ('createdon', date('Y-m-d H:i:s')); + $this->db->set ('type', 'wiki'); + $this->db->set ('action', 'delete'); + $this->db->set ('projectid', $wiki->projectid); + $this->db->set ('userid', $userid); + $this->db->set ('message', $wiki->name); + + $this->db->insert ('log'); $this->db->trans_complete (); return $this->db->trans_status(); } diff --git a/codepot/src/codepot/views/project_home.php b/codepot/src/codepot/views/project_home.php index d0dfb8c5..ef8d5c3b 100644 --- a/codepot/src/codepot/views/project_home.php +++ b/codepot/src/codepot/views/project_home.php @@ -91,32 +91,80 @@ $this->load->view ( $xdot = $this->converter->AsciiToHex ('.'); foreach ($log_entries as $log) { - if ($log['type'] == 'code' && $log['action'] == 'commit') + if ($log['type'] == 'code') { - $x = $log['code-commit']; + $x = $log['message']; print ''; print ''; - print substr($x['time'], 0, 10); + print substr($x['time'], 5, 5); print ''; - print ''; print anchor ( "/source/revision/{$x['repo']}/{$xdot}/{$x['rev']}", - $x['rev']); - print ''; - print ''; - print htmlspecialchars ($x['author']); + "r{$x['rev']}"); print ''; + print ''; print ''; - print ''; + + print ''; + print ''; + print ''; + $fmt = $this->lang->line ( + 'MSG_LOG_'.strtoupper($log['action']).'_BY'); + print htmlspecialchars (sprintf($fmt, $x['author'])); + print ''; + + print '
';
 			$sm = strtok (trim ($x['message']), "\r\n");
 			print htmlspecialchars ($sm);
+			print '
'; print ''; print ''; } + else + { + print ''; + print ''; + print date ('m-d', strtotime($log['createdon'])); + print ''; + + print ''; + $uri = ''; + if ($log['type'] == 'project') + { + $uri = "/project/home/{$log['projectid']}"; + } + else if ($log['type'] == 'wiki' || + $log['type'] == 'file') + { + $hex = $this->converter->AsciiToHex ($log['message']); + $uri = "/{$log['type']}/show/{$log['projectid']}/{$hex}"; + } + + $trimmed = preg_replace("/(.{20}).+/u", "$1…", $log['message']); + if ($uri != '') + print anchor ($uri, htmlspecialchars($trimmed)); + else + print htmlspecialchars($trimmed); + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + $fmt = $this->lang->line ( + 'MSG_LOG_'.strtoupper($log['action']).'_BY'); + print htmlspecialchars (sprintf($fmt, $log['userid'])); + print ''; + print ''; + + print ''; + } } ?> diff --git a/codepot/src/codepot/views/projectbar.php b/codepot/src/codepot/views/projectbar.php index e0422a34..61a5cdd4 100644 --- a/codepot/src/codepot/views/projectbar.php +++ b/codepot/src/codepot/views/projectbar.php @@ -5,8 +5,15 @@ function show_projectbar ($con, $site, $project, $pageid, $ctxmenuitems) { print "
"; - if (isset($project)) print $project->name; - else if (isset($site) && $site->name != '') print htmlspecialchars($site->name); + if (isset($project)) + { + if (strcasecmp ($project->name, $project->id) == 0) + print $project->name; + else + print "{$project->name} ({$project->id})"; + } + else if (isset($site) && $site->name != '') + print htmlspecialchars($site->name); else print htmlspecialchars(CODEPOT_DEFAULT_BANNER); print "
"; diff --git a/codepot/src/codepot/views/source_folder.php b/codepot/src/codepot/views/source_folder.php index b6f61d90..7e2b76ae 100644 --- a/codepot/src/codepot/views/source_folder.php +++ b/codepot/src/codepot/views/source_folder.php @@ -99,7 +99,7 @@ $this->load->view ( if (count($file['content']) <= 0) { - print $this->lang->line('MSG_NO_SOURCE_AVAIL'); + print $this->lang->line('MSG_NO_SOURCE_CODE_AVAIL'); } else { diff --git a/codepot/src/codepot/views/user_home.php b/codepot/src/codepot/views/user_home.php index 0af2c90b..6ba87697 100644 --- a/codepot/src/codepot/views/user_home.php +++ b/codepot/src/codepot/views/user_home.php @@ -88,13 +88,13 @@ foreach ($latest_projects as $project) $xdot = $this->converter->AsciiToHex ('.'); foreach ($log_entries as $log) { - if ($log['type'] == 'code' && $log['action'] == 'commit') + if ($log['type'] == 'code') { - $x = $log['code-commit']; + $x = $log['message']; print ''; print ''; - print substr($x['time'], 0, 10); + print substr($x['time'], 5, 5); print ''; print ''; print anchor ( @@ -104,20 +104,73 @@ foreach ($latest_projects as $project) print ''; print anchor ( "/source/revision/{$x['repo']}/{$xdot}/{$x['rev']}", - $x['rev']); - print ''; - print ''; - print htmlspecialchars ($x['author']); + "r{$x['rev']}"); print ''; + print ''; print ''; - print ''; + + print ''; + print ''; + print ''; + $fmt = $this->lang->line ( + 'MSG_LOG_'.strtoupper($log['action']).'_BY'); + print htmlspecialchars (sprintf($fmt, $x['author'])); + print ''; + + print '
';
 			$sm = strtok (trim ($x['message']), "\r\n");
 			print htmlspecialchars ($sm);
+			print '
'; print ''; print ''; } + else + { + print ''; + print ''; + print date ('m-d', strtotime($log['createdon'])); + print ''; + + print ''; + print anchor ("/project/home/{$log['projectid']}", $log['projectid']); + print ''; + + print ''; + $uri = ''; + if ($log['type'] == 'project') + { + $uri = "/project/home/{$log['projectid']}"; + } + else if ($log['type'] == 'wiki' || + $log['type'] == 'file') + { + $hex = $this->converter->AsciiToHex ($log['message']); + $uri = "/{$log['type']}/show/{$log['projectid']}/{$hex}"; + } + + $trimmed = preg_replace("/(.{15}).+/u", "$1…", $log['message']); + if ($uri != '') + print anchor ($uri, htmlspecialchars($trimmed)); + else + print htmlspecialchars($trimmed); + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + $fmt = $this->lang->line ( + 'MSG_LOG_'.strtoupper($log['action']).'_BY'); + print htmlspecialchars (sprintf($fmt, $log['userid'])); + print ''; + print ''; + + print ''; + } } ?> diff --git a/codepot/src/codepot/views/user_sitelog.php b/codepot/src/codepot/views/user_sitelog.php index a3f75ecb..fabf693d 100644 --- a/codepot/src/codepot/views/user_sitelog.php +++ b/codepot/src/codepot/views/user_sitelog.php @@ -56,12 +56,12 @@ $this->load->view ( foreach ($log_entries as $log) { - if ($log['type'] == 'code' && $log['action'] == 'commit') + if ($log['type'] == 'code') { - $code_commit = $log['code-commit']; + $code = $log['message']; - $date = substr($code_commit['time'], 0, 10); - $time = substr($code_commit['time'], 11, 5); + $date = substr($code['time'], 0, 10); + $time = substr($code['time'], 11, 5); } else { @@ -71,8 +71,8 @@ $this->load->view ( if ($curdate != $date) { - print " "; - print "$date"; + print " "; + print "$date"; $curdate = $date; $rowcount = 0; } @@ -82,34 +82,81 @@ $this->load->view ( print '' . $time . ''; print ''; - print anchor ( - "/project/home/{$log['projectid']}", - $log['projectid']); - print ''; - - print ''; - if ($log['type'] == 'code' && $log['action'] == 'commit') { - print ''; + print anchor ( + "/source/file/{$code['repo']}/{$xdot}/{$code['rev']}", + $log['projectid']); + } + else + { + print anchor ( + "/project/home/{$log['projectid']}", + $log['projectid']); + } + print ''; + + + if ($log['type'] == 'code') + { + print ''; print anchor ( - "/source/revision/{$log['projectid']}/{$xdot}/{$code_commit['rev']}", - "r{$code_commit['rev']}"); - print ' committed by '; - print htmlspecialchars ($code_commit['author']); + "/source/revision/{$log['projectid']}/{$xdot}/{$code['rev']}", + "r{$code['rev']}"); + print ''; + + print ''; + print ''; + $fmt = $this->lang->line ( + 'MSG_LOG_'.strtoupper($log['action']).'_BY'); + print htmlspecialchars (sprintf($fmt, $code['author'])); print ''; print '
';
-			print htmlspecialchars ($code_commit['message']);
+			print htmlspecialchars ($code['message']);
 			print '
'; } + else + { + print ''; + + $uri = ''; + if ($log['type'] == 'project') + { + $uri = "/project/home/{$log['projectid']}"; + } + else if ($log['type'] == 'wiki' || + $log['type'] == 'file') + { + $hex = $this->converter->AsciiToHex ($log['message']); + $uri = "/{$log['type']}/show/{$log['projectid']}/{$hex}"; + } + + $trimmed = preg_replace("/(.{10}).+/u", "$1…", $log['message']); + if ($uri != '') + { + print anchor ( + $uri, + htmlspecialchars ($trimmed), + 'title="'.htmlspecialchars ($log['message']).'"'); + } + else print htmlspecialchars ($trimmed); + print ''; + + print ''; + print ''; + $fmt = $this->lang->line ( + 'MSG_LOG_'.strtoupper($log['action']).'_BY'); + print htmlspecialchars (sprintf($fmt, $log['userid'])); + print ''; + } print ''; print ''; } ?> - + diff --git a/codepot/src/css/common.css b/codepot/src/css/common.css index 7b154b3b..c170639a 100644 --- a/codepot/src/css/common.css +++ b/codepot/src/css/common.css @@ -5,7 +5,7 @@ body { .content { - font-size: 90%; + font-size: 0.9em; font-family: sans-serif; } diff --git a/codepot/src/css/project.css b/codepot/src/css/project.css index 753b51c9..fb8d5324 100644 --- a/codepot/src/css/project.css +++ b/codepot/src/css/project.css @@ -6,7 +6,7 @@ * user home view *-----------------------------------------------*/ #user_home_mainarea_sidebar { - width: 25em; + width: 24em; } #user_home_mainarea_sidebar_log_table { @@ -24,9 +24,19 @@ #user_home_mainarea_sidebar_log_table tr.even { background-color: inherit; +} + +#user_home_mainarea_sidebar_log_table tr.even .description { font-style: italic; } +#user_home_mainarea_sidebar_log_table tr.even pre.message { + border: 0; + margin: 1px; + background-color: inherit; + white-space: pre-wrap; +} + /*----------------------------------------------- * user sidelog view *-----------------------------------------------*/ @@ -66,7 +76,7 @@ } #user_sitelog_mainarea_result_table td.details .description { - font-style: italic; + /*font-style: italic;*/ } #user_sitelog_mainarea_result_table td.details pre.message { @@ -100,10 +110,21 @@ #project_home_mainarea_sidebar_log_table tr.even { background-color: inherit; - //font-size: 0.9em; + /*font-size: 0.9em;*/ font-style: italic; } +#project_home_mainarea_sidebar_log_table tr.even .description { + /*font-style: italic;*/ +} + +#project_home_mainarea_sidebar_log_table tr.even pre.message { + border: 0; + margin: 1px; + background-color: inherit; + white-space: pre-wrap; +} + /*----------------------------------------------- * project file home view *-----------------------------------------------*/ @@ -376,3 +397,14 @@ margin: 0; } +/*----------------------------------------------- + * project source diff view + *-----------------------------------------------*/ +#project_wiki_show_textarea table th { + background-color: #bbccdd; +} + +#project_wiki_show_textarea table td { + vertical-align: top; + border-bottom: 1px dashed #bbccdd; +}