* Adjust codes.

This commit is contained in:
caoyanyi
2022-07-21 17:01:39 +08:00
parent 0eba61ac66
commit aaeebc1abd
15 changed files with 47 additions and 38 deletions
+2
View File
@@ -8,7 +8,9 @@ $lang->gitea->edit = 'Edit Gitea';
$lang->gitea->view = 'View Gitea';
$lang->gitea->delete = 'Delete Gitea';
$lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?';
$lang->gitea->giteaAvatar = 'Avatar';
$lang->gitea->bindUser = 'Bind User';
$lang->gitea->giteaEmail = 'Email';
$lang->gitea->giteaAccount = 'Gitea Account';
$lang->gitea->zentaoAccount = 'Zentao Account';
$lang->gitea->bindingStatus = 'Binding Status';
+2
View File
@@ -8,7 +8,9 @@ $lang->gitea->edit = 'Edit Gitea';
$lang->gitea->view = 'View Gitea';
$lang->gitea->delete = 'Delete Gitea';
$lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?';
$lang->gitea->giteaAvatar = 'Avatar';
$lang->gitea->bindUser = 'Bind User';
$lang->gitea->giteaEmail = 'Email';
$lang->gitea->giteaAccount = 'Gitea Account';
$lang->gitea->zentaoAccount = 'Zentao Account';
$lang->gitea->bindingStatus = 'Binding Status';
+2
View File
@@ -8,7 +8,9 @@ $lang->gitea->edit = 'Edit Gitea';
$lang->gitea->view = 'View Gitea';
$lang->gitea->delete = 'Delete Gitea';
$lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?';
$lang->gitea->giteaAvatar = 'Avatar';
$lang->gitea->bindUser = 'Bind User';
$lang->gitea->giteaEmail = 'Email';
$lang->gitea->giteaAccount = 'Gitea Account';
$lang->gitea->zentaoAccount = 'Zentao Account';
$lang->gitea->bindingStatus = 'Binding Status';
+2
View File
@@ -8,7 +8,9 @@ $lang->gitea->edit = 'Edit Gitea';
$lang->gitea->view = 'View Gitea';
$lang->gitea->delete = 'Delete Gitea';
$lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?';
$lang->gitea->giteaAvatar = 'Avatar';
$lang->gitea->bindUser = 'Bind User';
$lang->gitea->giteaEmail = 'Email';
$lang->gitea->giteaAccount = 'Gitea Account';
$lang->gitea->zentaoAccount = 'Zentao Account';
$lang->gitea->bindingStatus = 'Binding Status';
+2
View File
@@ -9,7 +9,9 @@ $lang->gitea->view = '查看Gitea';
$lang->gitea->delete = '删除Gitea';
$lang->gitea->confirmDelete = '确认删除该Gitea吗?';
$lang->gitea->bindUser = '绑定用户';
$lang->gitea->giteaAvatar = '头像';
$lang->gitea->giteaAccount = 'Gitea用户';
$lang->gitea->giteaEmail = '邮箱';
$lang->gitea->zentaoAccount = '禅道用户';
$lang->gitea->bindingStatus = '绑定状态';
$lang->gitea->notBind = '未绑定';
+6 -4
View File
@@ -20,9 +20,11 @@
<table class="table table-borderless w-600px">
<thead>
<tr>
<th colspan='2'><?php echo $lang->gitea->giteaAccount;?></th>
<th><?php echo $lang->gitea->giteaAvatar;?></th>
<th><?php echo $lang->gitea->giteaAccount;?></th>
<th><?php echo $lang->gitea->giteaEmail;?></th>
<th class='w-150px'><?php echo $lang->gitea->zentaoAccount;?></th>
<th class='w-150px'><?php echo $lang->gitea->bindingStatus;?></th>
<th><?php echo $lang->gitea->bindingStatus;?></th>
</tr>
</thead>
<tbody>
@@ -35,8 +37,8 @@
<strong><?php echo $giteaUser->realname;?></strong>
<br>
<?php echo $giteaUser->account;?>
<?php if($giteaUser->email) echo " &lt;" . $giteaUser->email . "&gt;";?>
</td>
<td><?php echo $giteaUser->email;?></td>
<td><?php echo html::select("zentaoUsers[$giteaUser->account]", $userPairs, '', "class='form-control select chosen'" );?></td>
<td><?php echo $lang->gitea->notBind;?></td>
</tr>
@@ -50,8 +52,8 @@
<strong><?php echo $giteaUser->realname;?></strong>
<br>
<?php echo $giteaUser->account;?>
<?php if($giteaUser->email) echo " &lt;" . $giteaUser->email . "&gt;";?>
</td>
<td><?php echo $giteaUser->email;?></td>
<td><?php echo html::select("zentaoUsers[$giteaUser->account]", $userPairs, $giteaUser->zentaoAccount, "class='form-control select chosen'" );?></td>
<td>
<?php if(isset($bindedUsers[$giteaUser->zentaoAccount])):?>
-1
View File
@@ -11,7 +11,6 @@ table.diff {margin-bottom: 0px;}
.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;}
.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;}
.repoCode .diff tr.over td.line-new, .repoCode .diff tr.over td.line-new {background: #8eff8e;}
.repoCode .diff tr.over td.line-old, .repoCode .diff tr.over td.line-old {background: #f6b2b2;}
+1
View File
@@ -68,6 +68,7 @@ $(function()
$.get(repoUrl, function(response)
{
$('#repoID').html('').append(response);
$('#repoID').val(repo.id);
$('#repoID').chosen().trigger("chosen:updated");;
});
+1
View File
@@ -80,6 +80,7 @@ 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'), "<i class='icon icon-plus'></i> " . $this->lang->repo->create, '', "class='btn btn-primary'");
$repoList = $this->repo->getList(0, '', $orderBy);
$sonarRepoList = $this->loadModel('job')->getSonarqubeByRepo(array_keys($repoList));
+1
View File
@@ -1,3 +1,4 @@
.change ul {margin: 8px; margin-left: 1.5em;}
.change li {list-style: none;}
.panel-heading {border-bottom: 1px solid #ddd;}
.back-btn {margin-right: 5px !important;}
+1 -1
View File
@@ -2,7 +2,7 @@
.code .content {border: 1px solid #CCC; padding: 0;}
.repoCode pre {margin: 0; padding: 0; background: white; border: none;}
tr,th,td {border-bottom: none;}
.repoCode pre > table > tbody > tr > th {border: none; background-color: #ECECEC; width: 40px; text-align: right; vertical-align: top;}
.repoCode pre > table > tbody > tr > th {border-right: 1px solid #E4E4E4; width: 40px; text-align: right; vertical-align: top;}
.repoCode pre > table > tbody > tr > th, .repoCode pre > table > tbody > tr > td {padding: 1px 3px;}
.repoCode pre .commentContent {line-height: 1.4;}
.repoCode pre > table {border: 0px; width: 100%;}
+2 -2
View File
@@ -213,7 +213,7 @@ class repoModel extends model
->andWhere('client')->eq($data->client)
->andWhere('path')->eq($data->path)
->fetch();
if(!empty($repo)) dao::$errors['serviceProject'] = sprintf($this->lang->error->unique, $this->lang->repo->serviceProject, $repo->id);
if(!empty($repo)) dao::$errors['serviceProject'] = sprintf($this->lang->error->unique, $this->lang->repo->serviceProject, $repo->name);
if(dao::isError()) return false;
}
@@ -312,7 +312,7 @@ class repoModel extends model
->andWhere('path')->eq($data->path)
->andWhere('id')->ne($id)
->fetch();
if(!empty($repo)) dao::$errors['serviceProject'] = sprintf($this->lang->error->unique, $this->lang->repo->serviceProject, $repo->id);
if(!empty($repo)) dao::$errors['serviceProject'] = sprintf($this->lang->error->unique, $this->lang->repo->serviceProject, $repo->name);
if(dao::isError()) return false;
}
+7 -7
View File
@@ -98,7 +98,7 @@
<tr>
<th class='c-icon'></th>
<th class='c-name'><?php echo $lang->repo->name?></th>
<th class='text-center c-version'><?php echo $lang->repo->revisions?></th>
<th class='c-version'><?php echo $lang->repo->revisions?></th>
<th class='c-date'><?php echo $lang->repo->time?></th>
<th class='c-user'><?php echo $lang->repo->committer?></th>
<th><?php echo $lang->repo->comment?></th>
@@ -112,13 +112,13 @@
<span class="<?php echo $info->kind == 'dir' ? 'directory' : 'file';?> mini-icon"></span>
</td>
<td>
<?php
$infoPath = trim($path . '/' . $info->name, '/');
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($infoPath));
echo html::a($link, $info->name, '', "title='{$info->name}' data-app={$app->tab}");
?>
<?php
$infoPath = trim($path . '/' . $info->name, '/');
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($infoPath));
echo html::a($link, $info->name, '', "title='{$info->name}' data-app={$app->tab}");
?>
</td>
<td align='center'><?php echo $repo->SCM == 'Subversion' ? $info->revision : substr($info->revision, 0, 10);?></td>
<td><?php echo $repo->SCM == 'Subversion' ? $info->revision : substr($info->revision, 0, 10);?></td>
<td><?php echo substr($info->date, 0, 10)?></td>
<td><?php echo $info->account?></td>
<?php $comment = htmlSpecialString($info->comment, ENT_QUOTES);?>
+2 -7
View File
@@ -11,11 +11,6 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class='pull-right'>
<?php if(common::hasPriv('repo', 'create')) echo html::a(helper::createLink('repo', 'create'), "<i class='icon icon-plus'></i> " . $this->lang->repo->create, '', "class='btn btn-primary'");?>
</div>
</div>
<div id='mainContent'>
<form class='main-table' id='ajaxForm' method='post'>
<table id='repoList' class='table has-sort-head table-fixed'>
@@ -27,13 +22,13 @@
<th class='c-name text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->repo->name); ?></th>
<th class='c-product text-left'><?php common::printOrderLink('product', $orderBy, $vars, $lang->repo->product); ?></th>
<th class='text-left'><?php echo $lang->repo->path; ?></th>
<th class='c-actions-7'><?php echo $lang->actions; ?></th>
<th class='c-actions-3'><?php echo $lang->actions; ?></th>
</tr>
</thead>
<tbody>
<?php foreach($repoList as $repo):?>
<tr>
<td class='text-center'><?php echo $repo->id; ?></td>
<td class='text'><?php echo $repo->id; ?></td>
<td class='text'><?php echo zget($lang->repo->scmList, $repo->SCM); ?></td>
<td class='text' title='<?php echo $repo->name; ?>'><?php echo html::a($this->createLink('repo', 'browse', "repoID={$repo->id}&branchID=&objectID=$objectID"), $repo->name);?></td>
<?php
+16 -16
View File
@@ -21,7 +21,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<div class='btn-toolbar pull-left'>
<?php if(!isonlybody()):?>
<?php $browseLink = $app->session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=" . helper::safe64Encode(base64_encode($branchID)) . "&objectID=$objectID{$preDir}");?>
<?php echo html::a($browseLink, "<i class='icon icon-back'></i> " . $lang->goback, '', "class='btn btn-link'");?>
<?php echo html::a($browseLink, "<i class='icon icon-back'></i> " . $lang->goback, '', "class='btn btn-link back-btn'");?>
<div class="divider"></div>
<?php endif;?>
<div class="page-title">
@@ -42,8 +42,8 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<table class='table no-margin'>
<?php foreach($changes as $path => $change):?>
<tr>
<td><?php echo "<span class='label label-info label-badge'>" . $change['action'] . '</span> ' . $path?></td>
<td class='w-80px text-center'><?php echo zget($change, 'view', '') . zget($change, 'diff', '')?></td>
<td><?php echo "<span class='label label-info label-badge'>" . $change['action'] . '</span> ' . $path;?></td>
<td class='w-80px text-center'><?php echo zget($change, 'view', '') . zget($change, 'diff', '');?></td>
</tr>
<?php endforeach;?>
</table>
@@ -54,30 +54,30 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<div class='side-col col-4'>
<div class='cell'>
<div class='detail'>
<div class='detail-title'><?php echo $lang->repo->info?></div>
<div class='detail-title'><?php echo $lang->repo->info;?></div>
<div class='detail-content'>
<table class='table table-data'>
<tr>
<th class='w-80px'><?php echo $lang->repo->committer?></th>
<td><?php echo $log->committer?></td>
<th class='w-80px'><?php echo $lang->repo->committer;?></th>
<td><?php echo $log->committer;?></td>
</tr>
<tr>
<th><?php echo $lang->repo->revisionA?></th>
<td><?php echo $log->revision?></td>
<th><?php echo $lang->repo->revisionA;?></th>
<td><?php echo substr($log->revision, 0, 10);?></td>
</tr>
<?php if($repo->SCM != 'Subversion'):?>
<tr>
<th><?php echo $lang->repo->commit?></th>
<td><?php echo $log->commit?></td>
<th><?php echo $lang->repo->commit;?></th>
<td><?php echo $log->commit;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->repo->comment?></th>
<td><?php echo $log->comment?></td>
<th><?php echo $lang->repo->comment;?></th>
<td><?php echo $log->comment;?></td>
</tr>
<tr>
<th><?php echo $lang->repo->time?></th>
<td><?php echo $log->time?></td>
<th><?php echo $lang->repo->time;?></th>
<td><?php echo $log->time;?></td>
</tr>
</table>
</div>
@@ -87,8 +87,8 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
</div>
<div id="mainActions" class='main-actions'>
<nav class="container">
<?php if(!empty($preAndNext->pre)) echo html::a($this->repo->createLink('revision', "repoID=$repoID&objectID=$objectID&revision={$preAndNext->pre}" . $pathInfo . $typeInfo, 'html'), "<i class='icon-pre icon-chevron-left'></i>", '', "data-app='{$app->tab}' id='prevPage' class='btn btn-info' title='{$preAndNext->pre}'")?>
<?php if(!empty($preAndNext->next)) echo html::a($this->repo->createLink('revision', "repoID=$repoID&objectID=$objectID&revision={$preAndNext->next}" . $pathInfo . $typeInfo, 'html'), "<i class='icon-pre icon-chevron-right'></i>", '', "data-app='{$app->tab}' id='nextPage' class='btn btn-info' title='{$preAndNext->next}'")?>
<?php if(!empty($preAndNext->pre)) echo html::a($this->repo->createLink('revision', "repoID=$repoID&objectID=$objectID&revision={$preAndNext->pre}" . $pathInfo . $typeInfo, 'html'), "<i class='icon-pre icon-chevron-left'></i>", '', "data-app='{$app->tab}' id='prevPage' class='btn btn-info' title='{$preAndNext->pre}'");?>
<?php if(!empty($preAndNext->next)) echo html::a($this->repo->createLink('revision', "repoID=$repoID&objectID=$objectID&revision={$preAndNext->next}" . $pathInfo . $typeInfo, 'html'), "<i class='icon-pre icon-chevron-right'></i>", '', "data-app='{$app->tab}' id='nextPage' class='btn btn-info' title='{$preAndNext->next}'");?>
</nav>
</div>
<?php include '../../common/view/footer.html.php';?>