* Add gitlab project,edit gitlab project page
This commit is contained in:
@@ -806,7 +806,11 @@ class gitlab extends control
|
||||
$namespaces = array();
|
||||
foreach($namespacesList as $namespace)
|
||||
{
|
||||
if($namespace->kind == 'user' and $namespace->path == $user->username) $namespaces[$namespace->id] = $namespace->path;
|
||||
if($namespace->kind == 'user' and $namespace->path == $user->username)
|
||||
{
|
||||
$namespaces[$namespace->id] = $namespace->path;
|
||||
$this->view->defaultSpace = $namespace->id;
|
||||
}
|
||||
if($namespace->kind == 'group') $namespaces[$namespace->id] = $namespace->path;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
function onNameChange(event)
|
||||
{
|
||||
$("#path").val($(event.target).val().toLowerCase());
|
||||
}
|
||||
|
||||
function onAclChange(event)
|
||||
{
|
||||
const visibility = $(event.target).val();
|
||||
|
||||
if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
|
||||
if(visibility != 'public') $('#publicTip').remove();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
function onAclChange(event)
|
||||
{
|
||||
const visibility = $(event.target).val();
|
||||
|
||||
if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
|
||||
if(visibility != 'public') $('#publicTip').remove();
|
||||
}
|
||||
|
||||
$(function()
|
||||
{
|
||||
if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
|
||||
});
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The createproject view file of gitlab module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
$publicTip = "<span id='publicTip' class='text-danger'>" . $lang->gitlab->project->publicTip . '</span>';
|
||||
jsVar('publicTip', $publicTip);
|
||||
|
||||
$urlOptions = array();
|
||||
if(count($namespaces) < 2)
|
||||
{
|
||||
$urlOptions[] = input
|
||||
(
|
||||
set::name('url'),
|
||||
set::value($gitlab->url . '/' . $user->username . '/'),
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$urlOptions[] = $gitlab->url;
|
||||
$urlOptions[] = picker
|
||||
(
|
||||
set::name('namespace_id'),
|
||||
set::value(!empty($defaultSpace) ? $defaultSpace : ''),
|
||||
set::items($namespaces),
|
||||
set::required(true)
|
||||
);
|
||||
}
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::title($lang->gitlab->project->create),
|
||||
formGroup
|
||||
(
|
||||
set::name('name'),
|
||||
set::label($lang->gitlab->project->name),
|
||||
set::placeholder($lang->gitlab->project->name),
|
||||
set::required(true),
|
||||
set::width('2/3'),
|
||||
on::input('onNameChange')
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->project->url),
|
||||
set::width('2/3'),
|
||||
inputGroup
|
||||
(
|
||||
$urlOptions
|
||||
),
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->project->path),
|
||||
set::name('path'),
|
||||
set::placeholder($lang->gitlab->placeholder->projectPath),
|
||||
set::required(true),
|
||||
set::width('2/3'),
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->project->description),
|
||||
set::name('description'),
|
||||
set::control('textarea'),
|
||||
set::width('2/3')
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->project->visibility),
|
||||
set::control('radioList'),
|
||||
set::items($lang->gitlab->project->visibilityList),
|
||||
set::value('private'),
|
||||
set::name('visibility'),
|
||||
on::change('onAclChange')
|
||||
)
|
||||
);
|
||||
|
||||
render();
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The editroject view file of gitlab module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
$publicTip = "<span id='publicTip' class='text-danger'>" . $lang->gitlab->project->publicTip . '</span>';
|
||||
jsVar('publicTip', $publicTip);
|
||||
jsVar('visibility', $project->visibility);
|
||||
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::title($lang->gitlab->project->edit),
|
||||
formGroup
|
||||
(
|
||||
set::name('id'),
|
||||
set::label($lang->gitlab->project->id),
|
||||
set::readonly(true),
|
||||
set::value($project->id),
|
||||
set::width('2/3')
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::name('name'),
|
||||
set::label($lang->gitlab->project->name),
|
||||
set::placeholder($lang->gitlab->project->name),
|
||||
set::required(true),
|
||||
set::value($project->name),
|
||||
set::width('2/3'),
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->project->description),
|
||||
set::name('description'),
|
||||
set::control('textarea'),
|
||||
set::value($project->description),
|
||||
set::width('2/3')
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->project->visibility),
|
||||
set::control('radioList'),
|
||||
set::items($lang->gitlab->project->visibilityList),
|
||||
set::value($project->visibility),
|
||||
set::name('visibility'),
|
||||
on::change('onAclChange')
|
||||
)
|
||||
);
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user