Merge branch 'cyy_optimize' into 'master'
* Adjust style and codes. See merge request easycorp/zentaopms!4073
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
.pull-left li > a {line-height: 20px; border-radius: 5px;}
|
||||
.tree li.has-list.open:before {border-left: 0px;}
|
||||
#mainMenu > div.btn-toolbar.pull-left > div.btn-group.open {line-height: 20px;}
|
||||
#dropMenuRepo > div.table-row > div > div > ul > li {padding: 0}
|
||||
#dropMenuRepo > div.table-row > div > div > ul > li > div {padding-left: 20px;}
|
||||
#dropMenuRepo > div.table-row > div > div > ul > li > ul {padding-left: 10px;}
|
||||
#repoList .hide-in-search .hidden {display: block !important; visibility: inherit !important;}
|
||||
|
||||
@@ -191,3 +191,14 @@ h3 {font-size: 16px;}
|
||||
.header-btn .btn > .text {text-overflow: unset !important;}
|
||||
|
||||
#repoPageSize {right: 90px;}
|
||||
|
||||
/* Style for repo select. */
|
||||
#repoList .tree li {padding: 0 0 0 15px;}
|
||||
#repoList .tree li > a {padding: 5px;}
|
||||
#repoList .hide-in-search .hidden {display: block !important; visibility: inherit !important;}
|
||||
#dropMenuRepo > div.table-row > div > div > ul > li > div {padding-left: 10px;}
|
||||
#repoList li > a.selected {color: #e9f2fb; background-color: #16a8f8; line-height: 20px; border-radius: 5px;}
|
||||
#repoList .tree li.has-list.open:before {border-left: 0px;}
|
||||
#repoList ul.tree-angles {margin-bottom: 0;}
|
||||
#repoList {margin: 0;}
|
||||
#repoList .tree > li {padding: 2px;}
|
||||
|
||||
+67
-6
@@ -410,26 +410,26 @@ class repoModel extends model
|
||||
$repoPairs = $this->getRepoPairs($type, $projectID);
|
||||
|
||||
$repos = array();
|
||||
$repos['gitlab'] = array();
|
||||
$repos['svn'] = array();
|
||||
$repos['git'] = array();
|
||||
$repos['Gitlab'] = array();
|
||||
$repos['SVN'] = array();
|
||||
$repos['Git'] = array();
|
||||
|
||||
foreach($repoPairs as $id => $repo)
|
||||
{
|
||||
if(strpos($repo, '[gitlab]') !== false)
|
||||
{
|
||||
$repo = str_replace('[gitlab]', '', $repo);
|
||||
$repos['gitlab'][$id] = $repo;
|
||||
$repos['Gitlab'][$id] = $repo;
|
||||
}
|
||||
if(strpos($repo, '[svn]') !== false)
|
||||
{
|
||||
$repo = str_replace('[svn]', '', $repo);
|
||||
$repos['svn'][$id] = $repo;
|
||||
$repos['SVN'][$id] = $repo;
|
||||
}
|
||||
if(strpos($repo, '[git]') !== false)
|
||||
{
|
||||
$repo = str_replace('[git]', '', $repo);
|
||||
$repos['git'][$id] = $repo;
|
||||
$repos['Git'][$id] = $repo;
|
||||
}
|
||||
}
|
||||
return $repos;
|
||||
@@ -2125,4 +2125,65 @@ class repoModel extends model
|
||||
foreach($executions as $execution) $pairs[$execution->id] = $execution->name;
|
||||
return $pairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get repos select menu.
|
||||
*
|
||||
* @param object $repo
|
||||
* @param int $objectID
|
||||
* @param string $link
|
||||
* @param string $scm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getReposMenu($repo, $objectID = 0, $link = '', $scm = '')
|
||||
{
|
||||
if(empty($link)) $link = helper::createLink('repo', 'browse', "repoID=%s&branchID=&objectID=$objectID");
|
||||
$html = "<button data-toggle='dropdown' type='button' class='btn btn-link btn-limit text-ellipsis' title='{$repo->name}'>";
|
||||
$html .= "<span class='text'>{$repo->name}</span>";
|
||||
$html .= "<span class='caret' style='margin-bottom: -1px'></span>";
|
||||
$html .= "</button>";
|
||||
$html .= "<div id='dropMenuRepo' class='dropdown-menu search-list' data-ride='searchList' data-url=''>";
|
||||
$html .= '<div class="input-control search-box has-icon-left has-icon-right">';
|
||||
$html .= '<input type="search" class="form-control search-input"/>';
|
||||
$html .= '<label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>';
|
||||
$html .= '<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>';
|
||||
$html .= '</div>';
|
||||
$html .= '<div class="table-row">';
|
||||
$html .= '<div class="table-col col-left">';
|
||||
$html .= '<div class="list-group" id="repoList">';
|
||||
$html .= "<ul class='tree tree-angles' data-ride='tree'>";
|
||||
|
||||
$tabName = $this->app->tab;
|
||||
$reposGroup = $this->getRepoGroup($tabName, $objectID);
|
||||
foreach($reposGroup as $groupName => $group)
|
||||
{
|
||||
if(empty($group)) continue;
|
||||
if($scm and strtolower($groupName) != strtolower($scm)) continue;
|
||||
|
||||
$html .= "<li data-idx='$groupName' data-id='$groupName' class='has-list open in'>";
|
||||
$html .= "<i class='list-toggle icon'></i>";
|
||||
$html .= "<div class='hide-in-search'>";
|
||||
$html .= "<a class='text-muted'>{$groupName} <span class='label label-outline'> {$this->lang->repo->type}</span></a>";
|
||||
$html .= "</div>";
|
||||
$html .= "<ul data-idx='$groupName'>";
|
||||
foreach($group as $id => $repoName)
|
||||
{
|
||||
$isSelected = $id == $repo->id ? 'selected' : '';
|
||||
$repoName = trim($repoName);
|
||||
|
||||
$html .= "<li data-idx='$repoName' data-id='$groupName-$repoName'>";
|
||||
$html .= "<a href='" . sprintf($link, $id) . "' id='$groupName-$repoName' class='$isSelected text-ellipsis' title='$repoName' data-key='$repoName' data-app='{$tabName}'>$repoName</a>";
|
||||
$html .= "</li>";
|
||||
}
|
||||
$html .= '</ul>';
|
||||
$html .= '</li>';
|
||||
}
|
||||
$html .= '</ul>';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,42 +11,8 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<div class='btn-group group'>
|
||||
<button data-toggle='dropdown' type='button' class='btn btn-link btn-limit repo-select text-ellipsis' title='<?php $repos[$repoID];?>'>
|
||||
<span class='text'><?php echo $repos[$repoID];?></span>
|
||||
<span class='caret' style='margin-bottom: -1px'></span>
|
||||
</button>
|
||||
<div id='dropMenuRepo' class='dropdown-menu search-list' data-ride='searchList' data-url=''>
|
||||
<div class="input-control search-box has-icon-left has-icon-right search-example">
|
||||
<input type="search" class="form-control search-input" id="searchSource"/>
|
||||
<label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
|
||||
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
|
||||
</div>
|
||||
<div class="table-row">
|
||||
<div class="table-col col-left">
|
||||
<div class="list-group" id="repoList">
|
||||
<ul class='tree tree-angles' data-ride='tree'>
|
||||
<?php foreach($repoGroup as $groupName => $group):?>
|
||||
<?php if(empty($group)) continue;?>
|
||||
<li data-idx='<?php echo $groupName;?>' data-id='<?php echo $groupName;?>' class='has-list open in' style='cursor: pointer;'><i class='list-toggle icon'></i>
|
||||
<div class='hide-in-search'><a class='text-muted'><?php echo $groupName;?></a><span class='label label-outline' style='margin-left:5px;'><?php echo $lang->repo->type;?></span></div>
|
||||
<ul data-idx='<?php echo $groupName;?>'>
|
||||
<?php
|
||||
foreach($group as $id => $repoName)
|
||||
{
|
||||
$isSelected = $id == $repoID ? 'selected' : '';
|
||||
$link = $this->createLink('repo', 'browse', "repoID=$id&branchID=&objectID=$objectID");
|
||||
echo "<li data-idx='$repoName' data-id='$groupName-$repoName'><a href='{$link}' id='$groupName-$repoName' class='$isSelected text-ellipsis' title='$repoName' data-key='$repoName' data-app='{$app->tab}'>$repoName</a></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='btn-group' id="swapper">
|
||||
<?php echo $this->repo->getReposMenu($repo, $objectID);?>
|
||||
</div>
|
||||
<?php if(!empty($branches)):?>
|
||||
<div class='btn-group'>
|
||||
|
||||
Reference in New Issue
Block a user