From f7e55495bea8d7a5f923b635649f6a6f5b4bcbf3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 9 Dec 2021 06:04:33 +0000 Subject: [PATCH] * Optimize page style. --- module/gitlab/control.php | 2 ++ module/gitlab/css/browsebranchpriv.css | 2 ++ module/gitlab/model.php | 2 +- module/gitlab/view/browsebranchpriv.html.php | 7 +++++-- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 module/gitlab/css/browsebranchpriv.css diff --git a/module/gitlab/control.php b/module/gitlab/control.php index 3fed1904c8..e359263c64 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -727,6 +727,7 @@ class gitlab extends control { $keyword = fixer::input('post')->setDefault('keyword', '')->get('keyword'); $branches = $this->gitlab->apiGetBranchPrivs($gitlabID, $projectID, $keyword, $orderBy); + $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); /* Pager. */ $this->app->loadClass('pager', $static = true); @@ -740,6 +741,7 @@ class gitlab extends control $this->view->levelLang = $this->lang->gitlab->branch->branchCreationLevelList; $this->view->gitlabID = $gitlabID; $this->view->projectID = $projectID; + $this->view->project = $project; $this->view->orderBy = $orderBy; $this->view->branchList = empty($branchList) ? $branchList: $branchList[$pageID - 1]; $this->display(); diff --git a/module/gitlab/css/browsebranchpriv.css b/module/gitlab/css/browsebranchpriv.css new file mode 100644 index 0000000000..d86ca85e6a --- /dev/null +++ b/module/gitlab/css/browsebranchpriv.css @@ -0,0 +1,2 @@ +.text-c-counts > span {margin-left: 5px;} +#mainMenu .pull-left {margin-right: 15px;} diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 8ba4c6a5e6..5f061ba251 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -2311,7 +2311,7 @@ class gitlabModel extends model $newBranches = array(); foreach($branches as $branch) { - if(empty($keyword) || stristr($branch->name, $keyword)) $newBranches[$branch->$order[0]] = $branch; + if(empty($keyword) || stristr($branch->name, $keyword)) $newBranches[$branch->{$order[0]}] = $branch; } if($order[1] == 'asc') ksort($newBranches); diff --git a/module/gitlab/view/browsebranchpriv.html.php b/module/gitlab/view/browsebranchpriv.html.php index 4697480e78..e201121ecd 100644 --- a/module/gitlab/view/browsebranchpriv.html.php +++ b/module/gitlab/view/browsebranchpriv.html.php @@ -15,6 +15,9 @@
createLink('gitlab', 'browseProject', "gitlabID=$gitlabID"), " " . $lang->goback, '', "class='btn btn-secondary'");?>
+
+
name_with_namespace; ?>
+
@@ -51,8 +54,8 @@ $branch): ?> - merge_access_level = count($branch->merge_access_levels) > 1 ? 40 : $branch->merge_access_levels[0]->access_level; ?> - push_access_level = count($branch->push_access_levels) > 1 ? 40 : $branch->push_access_levels[0]->access_level; ?> + merge_access_level = $this->gitlab->checkAccessLevel($branch->merge_access_levels); ?> + push_access_level = $this->gitlab->checkAccessLevel($branch->push_access_levels); ?> name;?> merge_access_level];?>