From 54be2a4b4eaf31663f299e37ed5b308a86372a51 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Fri, 26 Mar 2021 09:35:30 +0800 Subject: [PATCH] * Fix repo links. --- module/repo/control.php | 10 +++++++--- module/repo/view/blame.html.php | 4 ++-- module/repo/view/diff.html.php | 2 +- module/repo/view/maintain.html.php | 2 +- module/repo/view/revision.html.php | 2 +- module/repo/view/view.html.php | 4 ++-- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index 82a94bfe1c..f756e39ee7 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -293,6 +293,7 @@ class repo extends control $this->view->showBug = $showBug; $this->view->encoding = str_replace('-', '_', $encoding); $this->view->repoID = $repoID; + $this->view->branchID = $this->cookie->repoBranch; $this->view->objectID = $objectID; $this->view->repo = $repo; $this->view->revision = $revision; @@ -582,6 +583,7 @@ class repo extends control $this->view->type = $type; $this->view->changes = $changes; $this->view->repoID = $repoID; + $this->view->branchID = $this->cookie->repoBranch; $this->view->objectID = $objectID; $this->view->revision = $log[0]->revision; $this->view->parentDir = $parent; @@ -632,6 +634,7 @@ class repo extends control $this->view->title = $this->lang->repo->common; $this->view->repoID = $repoID; + $this->view->branchID = $this->cookie->repoBranch; $this->view->objectID = $objectID; $this->view->repo = $repo; $this->view->revision = $revision; @@ -662,9 +665,9 @@ class repo extends control $this->commonAction($repoID, $objectID); if($this->get->repoPath) $entry = $this->get->repoPath; - $file = $entry; - $repo = $this->repo->getRepoByID($repoID); - $entry = $this->repo->decodePath($entry); + $file = $entry; + $repo = $this->repo->getRepoByID($repoID); + $entry = $this->repo->decodePath($entry); $pathInfo = pathinfo($entry); $suffix = ''; @@ -736,6 +739,7 @@ class repo extends control $this->view->suffix = $suffix; $this->view->file = $file; $this->view->repoID = $repoID; + $this->view->branchID = $this->cookie->repoBranch; $this->view->objectID = $objectID; $this->view->repo = $repo; $this->view->encoding = str_replace('-', '_', $encoding); diff --git a/module/repo/view/blame.html.php b/module/repo/view/blame.html.php index fb2b0c2ac7..5ce5e3c616 100644 --- a/module/repo/view/blame.html.php +++ b/module/repo/view/blame.html.php @@ -31,14 +31,14 @@ css::import($jsRoot . 'misc/highlight/styles/github.css');
repo->createLink('browse', "repoID=$repoID&objectID=$objectID"), $repo->name); + echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID"), $repo->name); $paths= explode('/', $entry); $fileName = array_pop($paths); $postPath = ''; foreach($paths as $pathName) { $postPath .= $pathName . '/'; - echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/')); + echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/')); } echo '/' . ' ' . $fileName; echo " " . $revisionName . ''; diff --git a/module/repo/view/diff.html.php b/module/repo/view/diff.html.php index a3a4313291..3a1934949c 100644 --- a/module/repo/view/diff.html.php +++ b/module/repo/view/diff.html.php @@ -35,7 +35,7 @@ foreach($paths as $pathName) { $postPath .= $pathName . '/'; - echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/')); + echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/')); } echo '/' . ' ' . $fileName; if($repo->SCM == 'Git') diff --git a/module/repo/view/maintain.html.php b/module/repo/view/maintain.html.php index 90f05f4e4a..2cb0aced53 100644 --- a/module/repo/view/maintain.html.php +++ b/module/repo/view/maintain.html.php @@ -35,7 +35,7 @@ id; ?> repo->scmList, $repo->SCM); ?> - createLink('repo', 'browse', "repoID={$repo->id}&objectID=$objectID"), $repo->name);?> + createLink('repo', 'browse', "repoID={$repo->id}&branchID=&objectID=$objectID"), $repo->name);?> product)); diff --git a/module/repo/view/revision.html.php b/module/repo/view/revision.html.php index b21950f560..21d7855802 100644 --- a/module/repo/view/revision.html.php +++ b/module/repo/view/revision.html.php @@ -19,7 +19,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';