* Modify the repository drop-down menu.

This commit is contained in:
tianshujie98
2021-03-26 17:36:01 +08:00
parent e9f561b477
commit 2f9fabc20e
3 changed files with 24 additions and 24 deletions
-6
View File
@@ -213,8 +213,6 @@ $lang->scrum->menu->settings['subMenu']->whitelist = array('link' => "{$lang->
$lang->scrum->menu->settings['subMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|project=%s", 'subModule' => 'stakeholder');
$lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang->priv}|project|group|project=%s", 'alias' => 'group,manageview,managepriv');
$lang->scrum->menu->devops['subMenu'] = new stdclass();
/* Waterfall menu. */
$lang->waterfall->menu = new stdclass();
$lang->waterfall->menu->index = array('link' => "$lang->dashboard|project|index|project=%s");
@@ -300,8 +298,6 @@ $lang->execution->menu->view['subMenu'] = new stdclass();
$lang->execution->menu->view['subMenu']->groupTask = "$lang->groupView|execution|grouptask|executionID=%s";
$lang->execution->menu->view['subMenu']->tree = "$lang->treeView|execution|tree|executionID=%s";
$lang->execution->menu->devops['subMenu'] = new stdclass();
$lang->execution->menu->qa['subMenu'] = new stdclass();
$lang->execution->menu->qa['subMenu']->qa = array('link' => "$lang->dashboard|execution|qa|executionID=%s");
$lang->execution->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|execution|bug|executionID=%s", 'subModule' => 'bug');
@@ -370,8 +366,6 @@ $lang->devops->menuOrder[15] = 'jenkins';
$lang->devops->menuOrder[20] = 'maintain';
$lang->devops->menuOrder[25] = 'rules';
$lang->devops->menu->code['subMenu'] = new stdclass();
/* Doc menu.*/
$lang->doc->menu = new stdclass();
$lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|recent");
+5 -6
View File
@@ -61,8 +61,6 @@ class repo extends control
$this->repo->setMenu($this->repos, $repoID);
}
$this->lang->modulePageNav = $this->repo->select($this->repos, $repoID, $this->app->openApp, $objectID);
if(empty($this->repos) and $this->methodName != 'create') die(js::locate($this->repo->createLink('create', "objectID=$objectID")));
}
@@ -342,13 +340,12 @@ class repo extends control
$this->session->set('revisionList', $this->app->getURI(true));
session_write_close();
/* Use cookie to switch repo branch. */
setcookie('repoBranch', $branchID);
/* Get repo and synchronous commit. */
$repo = $this->repo->getRepoByID($repoID);
if(!$repo->synced) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID"));
$branches = $this->repo->getBranches($repo);
/* Decrypt path and get cacheFile. */
$path = $this->repo->decodePath($path);
$cacheFile = $this->repo->getCacheFile($repoID, $path, $revision);
@@ -426,11 +423,13 @@ class repo extends control
$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->branchID = $this->cookie->branchID;
$this->view->branches = $branches;
$this->view->branchID = $branchID ? $branchID : key($branches);
$this->view->objectID = $objectID;
$this->view->pager = $pager;
$this->view->path = urldecode($path);
+19 -12
View File
@@ -11,23 +11,30 @@
<?php include '../../common/view/header.html.php';?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<div class="page-title">
<strong>
<div class='btn-group'>
<a href='javascript:;' class='btn btn-link btn-limit text-ellipsis' data-toggle='dropdown' style="max-width: 120px;"><span class='text' title='<?php echo $repo->name;?>'><?php echo $repo->name;?></span> <span class='caret'></span></a>
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
<?php
echo html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID"), $repo->name, '', "data-app={$app->openApp}");
if(!empty($path))
foreach($repos as $id => $repoName)
{
$paths = explode('/', $path);
$postPath = '';
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&branchID=$branchID&objectID=$objectID&path=" . $this->repo->encodePath($postPath) . "&revision=$revision"), trim($pathName, '/'), '', '', "data-app={$app->openApp}");
}
echo "<li>" . html::a($this->createLink('repo', 'browse', "repoID=$id"), $repoName, '', "title='{$repoName}' class='text-ellipsis'") . "</li>";
}
?>
</strong>
</ul>
</div>
<?php if(!empty($branches)):?>
<div class='btn-group'>
<a href='javascript:;' class='btn btn-link btn-limit text-ellipsis' data-toggle='dropdown' style="max-width: 120px;"><span class='text' title='<?php echo $branches[$branchID];?>'><?php echo $branches[$branchID];?></span> <span class='caret'></span></a>
<ul class='dropdown-menu' style='max-height:240px; max-width: 300px; overflow-y:auto'>
<?php
foreach($branches as $id => $branchName)
{
echo "<li>" . html::a($this->createLink('repo', 'browse', "repoID=$repoID&branchID=$id"), $branchName, '', "title='{$branchName}' class='text-ellipsis'") . "</li>";
}
?>
</ul>
</div>
<?php endif;?>
</div>
<div class="btn-toolbar pull-right">
<span class='last-sync-time'><?php echo $lang->repo->notice->lastSyncTime . $cacheTime?></span>