* Finish the view of creating MR(staging).
This commit is contained in:
+20
-11
@@ -2,10 +2,10 @@ $(function()
|
||||
{
|
||||
$('#gitlabID').change(function()
|
||||
{
|
||||
host = $('#gitlabID').val();
|
||||
host = $('#gitlabID').val();
|
||||
if(host == '') return false;
|
||||
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host);
|
||||
|
||||
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host);
|
||||
$.get(url, function(response)
|
||||
{
|
||||
$('#sourceProject').html('').append(response);
|
||||
@@ -13,18 +13,27 @@ $(function()
|
||||
});
|
||||
});
|
||||
|
||||
$('#sourceProject').change(function()
|
||||
$('#sourceProject,#targetProject').change(function()
|
||||
{
|
||||
$option = $(this).find('option:selected');
|
||||
$('#name').val($option.data('name'));
|
||||
project = $('#sourceProject').val();
|
||||
url = createLink('gitlab', 'ajaxgetprojectbranches', "gitlabID=" + host + "&projectID=" + project);
|
||||
$.get(url, function(response)
|
||||
sourceProject = $(this).val();
|
||||
var branchSelect = $(this).parents('td').find('select[name*=Branch]');
|
||||
branchUrl = createLink('gitlab', 'ajaxgetprojectbranches', "gitlabID=" + host + "&projectID=" + sourceProject);
|
||||
$.get(branchUrl, function(response)
|
||||
{
|
||||
$('#sourceBranch').html('').append(response);
|
||||
$('#sourceBranch').chosen().trigger("chosen:updated");;
|
||||
branchSelect.html('').append(response);
|
||||
branchSelect.chosen().trigger("chosen:updated");;
|
||||
});
|
||||
|
||||
$('#targetProject').chosen().trigger("chosen:updated");;
|
||||
});
|
||||
|
||||
$('#sourceProject').change(function()
|
||||
{
|
||||
sourceProject = $(this).val();
|
||||
projectUrl = createLink('mr', 'ajaxGetMRTragetProjects', "gitlabID=" + host + "&projectID=" + sourceProject);
|
||||
$.get(projectUrl, function(response)
|
||||
{
|
||||
$('#targetProject').html('').append(response);
|
||||
$('#targetProject').chosen().trigger("chosen:updated");;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang->mr->reviewer = '评审人';
|
||||
$lang->mr->link = 'GitLab链接';
|
||||
$lang->mr->canMerge = '是否可合并';
|
||||
|
||||
$lang->mr->description = '描述';
|
||||
$lang->mr->confirmDelete = '确认删除该merge request吗?';
|
||||
$lang->mr->sourceProject = '源项目';
|
||||
$lang->mr->sourceBranch = '源分支';
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<form id='mrForm' method='post' class='form-ajax'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->repo->gitlabHost;?></th>
|
||||
<td class='required'><?php echo html::select('gitlabID', $gitlabHosts, '', "class='form-control' placeholder='{$lang->repo->placeholder->gitlabHost}'");?>
|
||||
<th><?php echo $lang->gitlab->common;?></th>
|
||||
<td class='required'><?php echo html::select('gitlabID', $gitlabHosts, '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->mr->sourceProject;?></th>
|
||||
@@ -38,10 +38,26 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->mr->name;?></th>
|
||||
<td class='required'><?php echo html::input('title', '', "class='form-control'"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->mr->description; ?></th>
|
||||
<td colspan='1'><?php echo html::textarea('description', '', "rows='3' class='form-control'"); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->mr->assignee;?></th>
|
||||
<td><?php echo html::select('assignee', $users, '', "class='form-control chosen'")?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->mr->reviewer;?></th>
|
||||
<td><?php echo html::select('reviewer', $users, '', "class='form-control chosen'")?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td colspan='2' class='text-center form-actions'>
|
||||
<?php echo html::submitButton($lang->mr->cmpAndContinue); ?>
|
||||
<?php echo html::submitButton(); ?>
|
||||
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"');?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user