* Modify edit mr page.

This commit is contained in:
caoyanyi
2022-08-11 16:49:11 +08:00
parent e45d44ccaa
commit b0ad47a7e9
4 changed files with 6 additions and 10 deletions
+1 -1
View File
@@ -559,7 +559,7 @@ class gogsModel extends model
$newBranches = array();
foreach($branches as $branch)
{
$branch->name = $branch->branch_name;
$branch->name = $branch->Name;
if(empty($keyword) || stristr($branch->name, $keyword)) $newBranches[] = $branch;
}
+3 -6
View File
@@ -177,13 +177,10 @@ class mr extends control
$branchList = $this->loadModel($scm)->getBranches($MR->hostID, $MR->targetProject);
$MR->canDeleteBranch = true;
if($scm != 'gogs')
$branchPrivs = $this->loadModel($scm)->apiGetBranchPrivs($MR->hostID, $MR->sourceProject);
foreach($branchPrivs as $priv)
{
$branchPrivs = $this->loadModel($scm)->apiGetBranchPrivs($MR->hostID, $MR->sourceProject);
foreach($branchPrivs as $priv)
{
if($MR->canDeleteBranch and $priv->name == $MR->sourceBranch) $MR->canDeleteBranch = false;
}
if($MR->canDeleteBranch and $priv->name == $MR->sourceBranch) $MR->canDeleteBranch = false;
}
$targetBranchList = array();
+1 -1
View File
@@ -1244,7 +1244,7 @@ class mrModel extends model
}
else
{
$url = sprintf($this->loadModel('gitea')->getApiRoot($hostID), "/repos/$projectID/pulls/$MRID/commits");
$url = sprintf($this->loadModel($host->type)->getApiRoot($hostID), "/repos/$projectID/pulls/$MRID/commits");
}
return json_decode(commonModel::http($url));
}
+1 -2
View File
@@ -80,8 +80,7 @@
<th><?php echo $lang->mr->removeSourceBranch;?></th>
<td colspan='1'>
<div class="checkbox-primary" title="<?php echo $lang->mr->notDelbranch;?>">
<?php $checked = $MR->canDeleteBranch and $MR->removeSourceBranch== '1' ? 'checked' : '' ?>
<input type="checkbox" <?php echo $checked;?> <?php if(!$MR->canDeleteBranch) echo 'disabled';?> name="removeSourceBranch" value="1" id="removeSourceBranch">
<input type="checkbox" <?php echo ($MR->canDeleteBranch and $MR->removeSourceBranch == '1') ? 'checked' : '';?> <?php if(!$MR->canDeleteBranch) echo 'disabled';?> name="removeSourceBranch" value="1" id="removeSourceBranch">
<label for="removeSourceBranch"></label>
</div>
</td>