From 94a3dea3f7c50f439f81e01f98b376aea4d61a46 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 22 Jul 2022 13:35:54 +0800 Subject: [PATCH] * Optimize pages. --- module/gitea/view/binduser.html.php | 2 +- module/gitea/view/create.html.php | 3 +-- module/gitea/view/edit.html.php | 3 +-- module/gitlab/view/binduser.html.php | 2 +- module/gitlab/view/browsebranch.html.php | 2 +- module/gitlab/view/browsegroup.html.php | 2 +- module/gitlab/view/browseproject.html.php | 10 +++++----- module/gitlab/view/browseuser.html.php | 10 +++++----- module/gitlab/view/create.html.php | 3 +-- module/gitlab/view/creategroup.html.php | 3 +-- module/gitlab/view/createproject.html.php | 3 +-- module/gitlab/view/createuser.html.php | 3 +-- module/gitlab/view/edit.html.php | 3 +-- module/gitlab/view/editgroup.html.php | 3 +-- module/gitlab/view/editproject.html.php | 3 +-- module/gitlab/view/edituser.html.php | 3 +-- module/gitlab/view/managetagpriv.html.php | 2 +- module/jenkins/view/create.html.php | 3 +-- module/jenkins/view/edit.html.php | 3 +-- module/job/view/create.html.php | 3 +-- module/job/view/edit.html.php | 3 +-- module/mr/css/view.css | 1 + module/mr/view/diff.html.php | 8 ++++---- module/repo/control.php | 1 - module/repo/css/browse.css | 1 + module/repo/css/common.css | 1 + module/repo/css/diff.css | 4 +++- module/repo/js/browse.js | 4 ++-- module/repo/view/ajaxgetdropmenu.html.php | 1 - module/repo/view/ajaxsidecommits.html.php | 2 +- module/repo/view/create.html.php | 3 +-- module/repo/view/diff.html.php | 10 +++++----- module/repo/view/edit.html.php | 3 +-- module/sonarqube/view/create.html.php | 3 +-- module/sonarqube/view/edit.html.php | 3 +-- 35 files changed, 51 insertions(+), 66 deletions(-) diff --git a/module/gitea/view/binduser.html.php b/module/gitea/view/binduser.html.php index 554c875fd8..7a4a9f3897 100644 --- a/module/gitea/view/binduser.html.php +++ b/module/gitea/view/binduser.html.php @@ -72,7 +72,7 @@ - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitea/view/create.html.php b/module/gitea/view/create.html.php index bab219de0a..5b2200f66e 100644 --- a/module/gitea/view/create.html.php +++ b/module/gitea/view/create.html.php @@ -33,8 +33,7 @@ - - + diff --git a/module/gitea/view/edit.html.php b/module/gitea/view/edit.html.php index 439206e9bf..048c824a80 100644 --- a/module/gitea/view/edit.html.php +++ b/module/gitea/view/edit.html.php @@ -33,8 +33,7 @@ token) ? $gitea->token : '', "class='form-control'");?> - - + diff --git a/module/gitlab/view/binduser.html.php b/module/gitlab/view/binduser.html.php index 836fe3856e..714b43a683 100644 --- a/module/gitlab/view/binduser.html.php +++ b/module/gitlab/view/binduser.html.php @@ -72,7 +72,7 @@ - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/browsebranch.html.php b/module/gitlab/view/browsebranch.html.php index bd29860a2b..6aae1486a9 100644 --- a/module/gitlab/view/browsebranch.html.php +++ b/module/gitlab/view/browsebranch.html.php @@ -37,7 +37,7 @@ recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - gitlab->branch->name);?> + gitlab->branch->name);?> gitlab->branch->lastCommitter;?> gitlab->branch->lastCommittedDate);?> diff --git a/module/gitlab/view/browsegroup.html.php b/module/gitlab/view/browsegroup.html.php index fb4315ff18..0e66006d8b 100644 --- a/module/gitlab/view/browsegroup.html.php +++ b/module/gitlab/view/browsegroup.html.php @@ -49,7 +49,7 @@ $gitlabGroup): ?> - id;?> + id;?> name))); ?> $gitlabGroup->avatar_url, 'account' => $groupName), 20); ?> diff --git a/module/gitlab/view/browseproject.html.php b/module/gitlab/view/browseproject.html.php index 486412f9d7..522a666510 100644 --- a/module/gitlab/view/browseproject.html.php +++ b/module/gitlab/view/browseproject.html.php @@ -42,23 +42,23 @@ gitlab->id);?> - gitlab->project->name);?> - - gitlab->lastUpdate;?> + gitlab->project->name);?> + + gitlab->lastUpdate;?> actions;?> $gitlabProject): ?> - id;?> + id;?> name_with_namespace;?> star_count;?> forks_count;?> last_activity_at, 0, 10);?> - + id", '', 'list', 'branch-lock', '', '', false, '', $this->lang->gitlab->browseBranchPriv, 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); echo common::buildIconButton('gitlab', 'manageTagPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag-lock', '', '', false, '', $this->lang->gitlab->browseTagPriv, 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); diff --git a/module/gitlab/view/browseuser.html.php b/module/gitlab/view/browseuser.html.php index 66da47013d..499696782b 100644 --- a/module/gitlab/view/browseuser.html.php +++ b/module/gitlab/view/browseuser.html.php @@ -38,17 +38,17 @@ gitlab->user->id);?> - gitlab->user->name);?> - - gitlab->user->createOn;?> - gitlab->user->lastActivity;?> + gitlab->user->name);?> + + gitlab->user->createOn;?> + gitlab->user->lastActivity;?> actions;?> $gitlabUser): ?> - id;?> + id;?> avatar, "height=40");?> realname;?> diff --git a/module/gitlab/view/create.html.php b/module/gitlab/view/create.html.php index 224aaaded3..1a00c2222f 100644 --- a/module/gitlab/view/create.html.php +++ b/module/gitlab/view/create.html.php @@ -34,8 +34,7 @@ gitlab->placeholder->token}'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/creategroup.html.php b/module/gitlab/view/creategroup.html.php index e8f913c8fa..877c533160 100644 --- a/module/gitlab/view/creategroup.html.php +++ b/module/gitlab/view/creategroup.html.php @@ -69,8 +69,7 @@ gitlab->group->subgroupCreationLevelList, 'maintainer', "class='form-control'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/createproject.html.php b/module/gitlab/view/createproject.html.php index 99450d6e31..3f1ab9f9cb 100644 --- a/module/gitlab/view/createproject.html.php +++ b/module/gitlab/view/createproject.html.php @@ -52,8 +52,7 @@ gitlab->project->visibilityList, 'private', "", 'block'));?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/createuser.html.php b/module/gitlab/view/createuser.html.php index 5adf9ff875..04aca3bba9 100644 --- a/module/gitlab/view/createuser.html.php +++ b/module/gitlab/view/createuser.html.php @@ -81,8 +81,7 @@ - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/edit.html.php b/module/gitlab/view/edit.html.php index 689ce8243a..6739d9a982 100644 --- a/module/gitlab/view/edit.html.php +++ b/module/gitlab/view/edit.html.php @@ -33,8 +33,7 @@ token) ? $gitlab->token : '', "class='form-control' placeholder='{$lang->gitlab->placeholder->token}'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/editgroup.html.php b/module/gitlab/view/editgroup.html.php index 10a602bb2e..b33d9ea25d 100644 --- a/module/gitlab/view/editgroup.html.php +++ b/module/gitlab/view/editgroup.html.php @@ -72,8 +72,7 @@ gitlab->group->subgroupCreationLevelList, $group->subgroup_creation_level, "class='form-control'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/editproject.html.php b/module/gitlab/view/editproject.html.php index 24e97a639c..376197c168 100644 --- a/module/gitlab/view/editproject.html.php +++ b/module/gitlab/view/editproject.html.php @@ -40,8 +40,7 @@ gitlab->project->visibilityList, $project->visibility, "", 'block'));?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/edituser.html.php b/module/gitlab/view/edituser.html.php index d5ef0b6863..9ff06611dc 100644 --- a/module/gitlab/view/edituser.html.php +++ b/module/gitlab/view/edituser.html.php @@ -81,8 +81,7 @@ - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/managetagpriv.html.php b/module/gitlab/view/managetagpriv.html.php index bca3de59b6..58a3c63c96 100644 --- a/module/gitlab/view/managetagpriv.html.php +++ b/module/gitlab/view/managetagpriv.html.php @@ -47,7 +47,7 @@ - + save, 'onclick="savePriv()" id="saveBtn"', 'btn btn-wide btn-primary'); diff --git a/module/jenkins/view/create.html.php b/module/jenkins/view/create.html.php index 34c988c862..4d52cb332b 100644 --- a/module/jenkins/view/create.html.php +++ b/module/jenkins/view/create.html.php @@ -44,8 +44,7 @@ jenkins->tips;?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/jenkins/view/edit.html.php b/module/jenkins/view/edit.html.php index 303ff9d57f..9eed8ff5d9 100644 --- a/module/jenkins/view/edit.html.php +++ b/module/jenkins/view/edit.html.php @@ -44,8 +44,7 @@ jenkins->tips;?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/job/view/create.html.php b/module/job/view/create.html.php index af31444465..fddeb4505b 100644 --- a/module/job/view/create.html.php +++ b/module/job/view/create.html.php @@ -139,8 +139,7 @@ - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index 4809a12cfb..6fd81f22cb 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -187,8 +187,7 @@ - - + repo}"), $lang->goback, '', 'class="btn btn-wide"');?> repo, 'Git'));?> diff --git a/module/mr/css/view.css b/module/mr/css/view.css index 4e42eafa41..3e38664325 100644 --- a/module/mr/css/view.css +++ b/module/mr/css/view.css @@ -10,3 +10,4 @@ box-shadow: 0 1px 1px rgba(0,0,0,.05),0 2px 6px 0 rgba(0,0,0,.045) } .side-col{padding-top:5px;} +.detail-content .btn-active-text {padding-top: 5px;} diff --git a/module/mr/view/diff.html.php b/module/mr/view/diff.html.php index 2684cc66ba..57716856e0 100644 --- a/module/mr/view/diff.html.php +++ b/module/mr/view/diff.html.php @@ -93,8 +93,8 @@ lines as $line):?> - type != 'new') echo $line->oldlc?> - type != 'old') echo $line->newlc?> + type != 'new') echo $line->oldlc?> + type != 'old') echo $line->newlc?> type == 'old' ? preg_replace('/^\-/', '–', $line->line) : ($line->type == 'new' ? $line->line : ' ' . $line->line); ?> @@ -121,12 +121,12 @@ if(!isset($content->new[$newlc])) continue; } ?> - + type?> type == 'custom') echo "line-old"?> code'>old[$oldlc])) $content->old[$oldlc] = ''; if(!empty($oldlc)) echo $line->type != 'all' ? preg_replace('/^\-/', '–', $content->old[$oldlc]) : ' ' . $content->old[$oldlc]; ?> - + type?> type == 'custom') echo "line-new"?> code'>new[$newlc])) $content->new[$newlc] = ''; if(!empty($newlc)) echo $line->type != 'all' ? $content->new[$newlc] : ' ' . $content->new[$newlc]; diff --git a/module/repo/control.php b/module/repo/control.php index 46b6837bd1..84bd9ba78a 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -80,7 +80,6 @@ class repo extends control { $repoID = $this->repo->saveState(0, $objectID); if($this->viewType !== 'json') $this->commonAction($repoID, $objectID); - if(common::hasPriv('repo', 'create')) $this->lang->TRActions = html::a(helper::createLink('repo', 'create'), " " . $this->lang->repo->create, '', "class='btn btn-primary'"); $repoList = $this->repo->getList(0, '', $orderBy); $sonarRepoList = $this->loadModel('job')->getSonarqubeByRepo(array_keys($repoList)); diff --git a/module/repo/css/browse.css b/module/repo/css/browse.css index 9ecc8cca58..fd9c9002de 100644 --- a/module/repo/css/browse.css +++ b/module/repo/css/browse.css @@ -31,3 +31,4 @@ .popover-content {padding: 0;} .download-popover .table {margin-bottom: 0;} .download-popover .table td {padding-right: 0;} +.download-popover .popover-title {padding: 8px;} diff --git a/module/repo/css/common.css b/module/repo/css/common.css index 141b05002f..307392df8f 100644 --- a/module/repo/css/common.css +++ b/module/repo/css/common.css @@ -190,3 +190,4 @@ h3 {font-size: 16px;} .header-btn .btn > .text {text-overflow: unset !important;} #repoPageSize {right: 90px;} +.dropdown-menu li > a.selected {color: #3123ae !important; background: #f2eafc !important; line-height: 20px; border-radius: 5px;} diff --git a/module/repo/css/diff.css b/module/repo/css/diff.css index c35af3a9d7..42127daf7d 100644 --- a/module/repo/css/diff.css +++ b/module/repo/css/diff.css @@ -9,7 +9,7 @@ table.diff {margin-bottom: 0px;} .diff .line-new, .diff .line-new {background: #CFC;} .diff .line-old, .diff .line-old {background: #FCC;} .diff .line-all, .diff .line-all {background: #FFF;} -.diff .w-num {width: 25px; border-right: 1px solid #E4E4E4; color: #999; border-left: 1px solid #E4E4E4; color: #999; font-weight: normal;} +.diff .w-num {width: 25px; border-right: 1px solid #E4E4E4; color: #999; border-left: 1px solid #E4E4E4; color: #999; font-weight: normal; line-height: 2.5;} .repoCode .diff tr .comment-btn .icon-wrapper {left: -23px;} .repoCode .diff tr.over td.line-all, .repoCode .diff tr.over td.line-all {background: #f8eec7;} @@ -22,3 +22,5 @@ table.diff {margin-bottom: 0px;} .btn-download {border-right: none;} .body-modal .repo-diff {display: none;} .body-modal #mainMenu {padding-bottom: 40px;} + +.repoCode td.code {white-space: inherit;} diff --git a/module/repo/js/browse.js b/module/repo/js/browse.js index 0dcfbce1f0..e3c7de1962 100644 --- a/module/repo/js/browse.js +++ b/module/repo/js/browse.js @@ -36,7 +36,7 @@ function getCloneHtml(cloneLang, url) { var content = ''; content += ""; - content += "" + cloneLang + ""; + content += "" + cloneLang + ""; content += ""; content += ""; content += ""; @@ -53,7 +53,7 @@ $(function() content: getDownload(), html: true, placement: 'bottom', - template: '

li > ul > li > a:hover {color: white; background-color: #0c64eb; text-decoration: none;} #dropMenu .tree .has-list > ul > li {padding-top: 0;} -li > a.selected {color: #3123ae !important; background: #f2eafc !important; line-height: 20px; border-radius: 5px;} .search-list .list-group {padding: 7px 10px;} #swapper li>div.hide-in-search>a:focus, #swapper li>div.hide-in-search>a:hover {color: #838a9d; cursor: default;} #dropMenu .label-type {margin: 1px 10px;} diff --git a/module/repo/view/ajaxsidecommits.html.php b/module/repo/view/ajaxsidecommits.html.php index 74a1480b15..a78b02425a 100644 --- a/module/repo/view/ajaxsidecommits.html.php +++ b/module/repo/view/ajaxsidecommits.html.php @@ -20,7 +20,7 @@ if(isset($entry)) $pathInfo .= '&type=file'; SCM != 'Gitea'):?> - + repo->revisionA?> SCM != 'Subversion'):?> diff --git a/module/repo/view/create.html.php b/module/repo/view/create.html.php index ea5aa9a668..897b84c4f4 100644 --- a/module/repo/view/create.html.php +++ b/module/repo/view/create.html.php @@ -97,8 +97,7 @@ - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/repo/view/diff.html.php b/module/repo/view/diff.html.php index f867a31e32..5bff77e99f 100644 --- a/module/repo/view/diff.html.php +++ b/module/repo/view/diff.html.php @@ -101,8 +101,8 @@ lines as $line):?> - type != 'new') echo $line->oldlc?> - type != 'old') echo $line->newlc?> + type != 'new' and $line->oldlc) echo $line->oldlc?> + type != 'old' and $line->newlc) echo $line->newlc?> line = $repo->SCM == 'Subversion' ? htmlSpecialString($line->line) : $line->line; echo $line->type == 'old' ? preg_replace('/^\-/', '–', $line->line) : ($line->type == 'new' ? $line->line : ' ' . $line->line); @@ -125,18 +125,18 @@ } else { - $oldlc = $line->oldlc; + $oldlc = $line->oldlc > 0 ? $line->oldlc : ' '; $newlc = $line->newlc; if(!isset($content->new[$newlc])) continue; } ?> - + type?> type == 'custom') echo "line-old"?> code'>old[$oldlc])) $content->old[$oldlc] = ''; $content->old[$oldlc] = $repo->SCM == 'Subversion' ? htmlSpecialString($content->old[$oldlc]) : $content->old[$oldlc]; if(!empty($oldlc)) echo $line->type != 'all' ? preg_replace('/^\-/', '–', $content->old[$oldlc]) : ' ' . $content->old[$oldlc]; ?> - + type?> type == 'custom') echo "line-new"?> code'>new[$newlc])) $content->new[$newlc] = ''; $content->new[$newlc] = $repo->SCM == 'Subversion' ? htmlSpecialString($content->new[$newlc]) : $content->new[$newlc]; diff --git a/module/repo/view/edit.html.php b/module/repo/view/edit.html.php index 344d2535ba..db31220799 100644 --- a/module/repo/view/edit.html.php +++ b/module/repo/view/edit.html.php @@ -102,8 +102,7 @@ desc, "rows='3' class='form-control'"); ?> - - + goback, '', 'class="btn btn-wide"'); ?> diff --git a/module/sonarqube/view/create.html.php b/module/sonarqube/view/create.html.php index 5404fddea5..58668209bb 100644 --- a/module/sonarqube/view/create.html.php +++ b/module/sonarqube/view/create.html.php @@ -37,8 +37,7 @@ - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/sonarqube/view/edit.html.php b/module/sonarqube/view/edit.html.php index 6387b70dff..ecd2042561 100644 --- a/module/sonarqube/view/edit.html.php +++ b/module/sonarqube/view/edit.html.php @@ -37,8 +37,7 @@ password) ? $sonarqube->password : '', "class='form-control'");?> - - + goback, '', 'class="btn btn-wide"');?>