From e445a8ed13fc943b905c426e0c0ba7aaf765ef04 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 10 Jan 2016 05:11:37 +0000 Subject: [PATCH] fixed the code folder view to use the title-band class and show metadata differently from earlier revisions --- codepot/src/codepot/controllers/code.php | 6 +- .../src/codepot/models/subversionmodel.php | 6 + codepot/src/codepot/views/code_blame.php | 60 +- codepot/src/codepot/views/code_diff.php | 24 +- codepot/src/codepot/views/code_edit.php | 12 +- codepot/src/codepot/views/code_file.php | 68 +- codepot/src/codepot/views/code_folder.php | 582 +++++++++--------- codepot/src/codepot/views/code_history.php | 16 +- codepot/src/codepot/views/code_revision.php | 44 +- codepot/src/codepot/views/file_home.php | 2 +- codepot/src/codepot/views/file_show.php | 2 +- codepot/src/codepot/views/graph_main.php | 2 +- codepot/src/codepot/views/issue_home.php | 2 +- codepot/src/codepot/views/issue_show.php | 2 +- codepot/src/codepot/views/log.php | 4 +- codepot/src/codepot/views/wiki_home.php | 2 +- codepot/src/codepot/views/wiki_show.php | 2 +- codepot/src/css/code.css | 335 +++++----- codepot/src/css/common.css | 4 +- 19 files changed, 582 insertions(+), 593 deletions(-) diff --git a/codepot/src/codepot/controllers/code.php b/codepot/src/codepot/controllers/code.php index 7e30d50f..1e88a700 100644 --- a/codepot/src/codepot/controllers/code.php +++ b/codepot/src/codepot/controllers/code.php @@ -99,7 +99,6 @@ class Code extends Controller $file['head_tag'] = $this->subversion->getRevProp ($projectid, $file['head_rev'], CODEPOT_SVN_TAG_PROPERTY); if ($file['head_tag'] === FALSE) $file['head_tag'] = ''; - $data['project'] = $project; $data['headpath'] = $path; $data['file'] = $file; @@ -1071,7 +1070,6 @@ class Code extends Controller } else $h['tag'] = ''; - foreach ($h['paths'] as &$chg) { if ($chg['action'] == 'A' || $chg['action'] == 'M' || $chg['action'] == 'R') @@ -1085,7 +1083,7 @@ class Code extends Controller $props = array(); } else - { + { // get the first element in the associative array. foreach ($props as &$p) break; $props = $p; @@ -1101,7 +1099,7 @@ class Code extends Controller $prev_props = array(); } else - { + { // get the first element in the associative array. foreach ($prev_props as &$p) break; $prev_props = $p; diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 30fc2a15..55bfe5d1 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -27,6 +27,12 @@ class SubversionModel extends Model $canonical = $collapsed; } $canonical = preg_replace('|^/\.\./|','/',$canonical); + + if ($canonical != '/' && substr($canonical, -1) == '/') + { + // if the last character is / and it's not the only character, remove it + $canonical = substr ($canonical, 0, -1); + } return $canonical; } diff --git a/codepot/src/codepot/views/code_blame.php b/codepot/src/codepot/views/code_blame.php index 67832f51..46115a32 100644 --- a/codepot/src/codepot/views/code_blame.php +++ b/codepot/src/codepot/views/code_blame.php @@ -1,4 +1,6 @@ - + + + @@ -46,7 +48,7 @@ else