* Optimize diff page.

This commit is contained in:
caoyanyi
2022-08-16 15:07:14 +08:00
parent 6a4299917d
commit ef7bcf26eb
+8 -3
View File
@@ -46,8 +46,7 @@ class repo extends control
public function commonAction($repoID = 0, $objectID = 0)
{
$tab = $this->app->tab;
$this->repos = $this->repo->getRepoPairs($tab, $objectID);
$this->repoGroup = $this->repo->getRepoGroup($tab, $objectID);
$this->repos = $this->repo->getRepoPairs($tab, $objectID);
if($tab == 'project')
{
@@ -492,7 +491,7 @@ class repo extends control
$this->view->repo = $repo;
$this->view->repos = $this->repos;
$this->view->revisions = $revisions;
$this->view->repoGroup = $this->repoGroup;
$this->view->repoGroup = $this->repo->getRepoGroup($this->app->tab, $objectID);
$this->view->revision = $revision;
$this->view->infos = $infos;
$this->view->repoID = $repoID;
@@ -743,6 +742,12 @@ class repo extends control
$repo = $this->repo->getRepoByID($repoID);
$entry = $this->repo->decodePath($entry);
if($repo->SCM == 'Git' and !is_dir($repo->path))
{
$error = sprintf($this->lang->repo->error->notFound, $repo->name, $repo->path);
return print(js::error($error) . js::locate($this->repo->createLink('maintain')));
}
$pathInfo = pathinfo($entry);
$suffix = '';
if(isset($pathInfo["extension"])) $suffix = strtolower($pathInfo["extension"]);