diff --git a/module/repo/control.php b/module/repo/control.php index 7d4b2512aa..3646d7d05e 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -46,7 +46,8 @@ class repo extends control public function commonAction($repoID = 0, $objectID = 0) { $tab = $this->app->tab; - $this->repos = $this->repo->getRepoPairs($tab, $objectID); + $this->repos = $this->repo->getRepoPairs($tab, $objectID); + $this->reposGroup = $this->repo->getReposGroup($tab, $objectID); if($tab == 'project') { @@ -477,20 +478,21 @@ class repo extends control /* Synchronous commit only in root path. */ if(strpos($repo->SCM, 'Git') !== false and empty($path) and $infos and empty($revisions)) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID&objectID=$objectID&branch=" . base64_encode($this->cookie->repoBranch))); - $this->view->title = $this->lang->repo->common; - $this->view->repo = $repo; - $this->view->repos = $this->repos; - $this->view->revisions = $revisions; - $this->view->revision = $revision; - $this->view->infos = $infos; - $this->view->repoID = $repoID; - $this->view->branches = $branches; - $this->view->branchID = $branchID; - $this->view->objectID = $objectID; - $this->view->pager = $pager; - $this->view->path = urldecode($path); - $this->view->logType = $logType; - $this->view->cacheTime = date('m-d H:i', filemtime($cacheFile)); + $this->view->title = $this->lang->repo->common; + $this->view->repo = $repo; + $this->view->reposGroup = $this->reposGroup; + $this->view->repos = $this->repos; + $this->view->revisions = $revisions; + $this->view->revision = $revision; + $this->view->infos = $infos; + $this->view->repoID = $repoID; + $this->view->branches = $branches; + $this->view->branchID = $branchID; + $this->view->objectID = $objectID; + $this->view->pager = $pager; + $this->view->path = urldecode($path); + $this->view->logType = $logType; + $this->view->cacheTime = date('m-d H:i', filemtime($cacheFile)); $this->display(); } diff --git a/module/repo/css/browse.css b/module/repo/css/browse.css index 5a718bb0b5..983a9c5a40 100644 --- a/module/repo/css/browse.css +++ b/module/repo/css/browse.css @@ -4,6 +4,15 @@ .main-row {width: 99%;} .btn-toolbar > .last-sync-time {display: inline-block; float: left; margin-right: 10px;} .dropdown-menu > li.selected > a:after {content: '';} +.pull-left li > a.selected {color: #e9f2fb; background-color: #16a8f8;} +.pull-left li > a {line-height: 20px; border-radius: 5px;} +.tree li.has-list.open:before {border-left: 0px;} +#mainMenu > div.btn-toolbar.pull-left > div.btn-group.open {line-height: 20px;} +#dropMenuRepo > div.table-row > div > div > ul > li {padding: 0} +#dropMenuRepo > div.table-row > div > div > ul > li > div {padding-left: 20px;} +#dropMenuRepo > div.table-row > div > div > ul > li > ul {padding-left: 10px;} +#repoList .hide-in-search .hidden {display: block !important; visibility: inherit !important;} +#repoList > ul > li > ul > li > a:hover {color: white; background-color: #0c64eb; text-decoration: none;} .c-name {min-width: 150px;} .c-checkbox {width: 40px;} diff --git a/module/repo/model.php b/module/repo/model.php index 082559ea2b..179e76ae96 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -397,6 +397,44 @@ class repoModel extends model return $repoPairs; } + /** + * Get repos group by repo type. + * + * @param string type + * @param int $projectID + * @access public + * @return array + */ + public function getReposGroup($type, $projectID = 0) + { + $repoPairs = $this->getRepoPairs($type, $projectID); + + $repos = array(); + $repos['gitlab'] = array(); + $repos['svn'] = array(); + $repos['git'] = array(); + + foreach($repoPairs as $id => $repo) + { + if(strpos($repo, '[gitlab]') !== false) + { + $repo = str_replace('[gitlab]', '', $repo); + $repos['gitlab'][$id] = $repo; + } + if(strpos($repo, '[svn]') !== false) + { + $repo = str_replace('[svn]', '', $repo); + $repos['svn'][$id] = $repo; + } + if(strpos($repo, '[git]') !== false) + { + $repo = str_replace('[git]', '', $repo); + $repos['git'][$id] = $repo; + } + } + return $repos; + } + /** * Get repo by id. * diff --git a/module/repo/view/browse.html.php b/module/repo/view/browse.html.php index cfbd61f832..ada4afb32b 100644 --- a/module/repo/view/browse.html.php +++ b/module/repo/view/browse.html.php @@ -11,17 +11,42 @@