* Adjust menu when width is more.
This commit is contained in:
+24
-1
@@ -22,12 +22,35 @@ $(document).ready(function()
|
||||
|
||||
if(flow == 'onlyTest')
|
||||
{
|
||||
$('#modulemenu > .nav').append($('#featurebar').html());
|
||||
$('#modulemenu > .nav').append($('#featurebar > .submenu').html());
|
||||
toggleSearch();
|
||||
|
||||
$(".export").modalTrigger({width:650, type:'iframe'});
|
||||
|
||||
$('#modulemenu > .nav > li').removeClass('active');
|
||||
$('#modulemenu > .nav > li[data-id=' + browseType + ']').addClass('active');
|
||||
|
||||
var navWidth = $('#modulemenu > .nav').width();
|
||||
var leftWidth = 0;
|
||||
var rightWidth = 0;
|
||||
$('#modulemenu > .nav > li.right').each(function(){rightWidth += $(this).width();})
|
||||
|
||||
var maxWidth = navWidth - $('#modulemenu > .nav > #bysearchTab').width() - rightWidth - 80;
|
||||
|
||||
$('#modulemenu > .nav > li:not(.right)').each(function()
|
||||
{
|
||||
if(leftWidth > maxWidth)
|
||||
{
|
||||
if($(this).attr('id') != 'moreMenus' && $(this).attr('id') != 'bysearchTab')
|
||||
{
|
||||
$('#moreMenus').removeClass('hidden');
|
||||
$('#moreMenus > ul').append($(this)[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
leftWidth += $(this).width();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,31 +19,39 @@ js::set('bugBrowseType', ($browseType == 'bymodule' and $this->session->bugBrows
|
||||
js::set('flow', $this->config->global->flow);
|
||||
?>
|
||||
<?php if($this->config->global->flow == 'onlyTest'):?>
|
||||
<div id='featurebar' class='hidden'>
|
||||
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> <?php echo $lang->bug->byQuery;?></a></li>
|
||||
<li class='pull-right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('bug', 'create') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('bug', 'create') ? $this->createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID") : '#';
|
||||
echo html::a($link, "<i class='icon icon-plus'></i>" . $lang->bug->create, '', $misc);
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('bug', 'batchCreate') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('bug', 'batchCreate') ? $this->createLink('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->bug->batchCreate, '', $misc) . "</li>";
|
||||
?>
|
||||
<div id='featurebar'>
|
||||
<ul class='submenu hidden'>
|
||||
<li id='moreMenus' class='hidden'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown'>
|
||||
<?php echo $lang->more;?> <span class='caret'></span>
|
||||
</a>
|
||||
<ul class='dropdown-menu right'>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class='pull-right'>
|
||||
<?php common::printLink('bug', 'report', "productID=$productID&browseType=$browseType&branchID=$branch&moduleID=$moduleID", "<i class='icon-common-report icon-bar-chart'></i> " . $lang->bug->report->common); ?>
|
||||
</li>
|
||||
<li class='pull-right'>
|
||||
</li>
|
||||
<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> <?php echo $lang->bug->byQuery;?></a></li>
|
||||
<li class='right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('bug', 'create') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('bug', 'create') ? $this->createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID") : '#';
|
||||
echo html::a($link, "<i class='icon icon-plus'></i>" . $lang->bug->create, '', $misc);
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('bug', 'batchCreate') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('bug', 'batchCreate') ? $this->createLink('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->bug->batchCreate, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class='right'>
|
||||
<?php common::printLink('bug', 'report', "productID=$productID&browseType=$browseType&branchID=$branch&moduleID=$moduleID", "<i class='icon-common-report icon-bar-chart'></i> " . $lang->bug->report->common); ?>
|
||||
</li>
|
||||
<li class='right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown'>
|
||||
<i class='icon-download-alt'></i> <?php echo $lang->export ?>
|
||||
<span class='caret'></span>
|
||||
@@ -56,6 +64,7 @@ js::set('flow', $this->config->global->flow);
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php else:?>
|
||||
@@ -304,4 +313,10 @@ if($shortcut.size() > 0)
|
||||
$(function(){$('#modulemenu .nav li:last').after("<li class='right'><a style='font-size:12px' href='javascript:setHomepage(\"qa\", \"browse\")'><i class='icon icon-cog'></i> <?php echo $lang->homepage?></a></li>")});
|
||||
<?php endif;?>
|
||||
</script>
|
||||
<?php if($config->global->flow == 'onlyTest'):?>
|
||||
<style>
|
||||
.outer.with-side #featurebar {background: none; border: none; line-height: 0; margin: 0; min-height: 0; padding: 0; }
|
||||
#querybox #searchform{border-bottom: 1px solid #ddd; margin-bottom: 20px;}
|
||||
</style>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -47,7 +47,8 @@ $(document).ready(function()
|
||||
|
||||
if(flow == 'onlyTest')
|
||||
{
|
||||
$('#modulemenu > .nav').append($('#featurebar').html());
|
||||
$('#modulemenu > .nav').append($('#featurebar > .submenu').html());
|
||||
|
||||
toggleSearch();
|
||||
$('.export').modalTrigger({width:650, type:'iframe'});
|
||||
|
||||
|
||||
@@ -1,68 +1,74 @@
|
||||
<?php js::set('flow', $this->config->global->flow);?>
|
||||
<?php if(!isset($branch)) $branch = 0;?>
|
||||
<?php if($this->config->global->flow == 'onlyTest'):?>
|
||||
<div id='featurebar' class='hidden'>
|
||||
<?php
|
||||
$hasBrowsePriv = common::hasPriv('testcase', 'browse');
|
||||
$hasGroupPriv = common::hasPriv('testcase', 'groupcase');
|
||||
$hasZeroPriv = common::hasPriv('story', 'zerocase');
|
||||
?>
|
||||
<?php
|
||||
if($this->methodName == 'browse') echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";
|
||||
?>
|
||||
<li class='pull-right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<?php
|
||||
$initModule = isset($moduleID) ? (int)$moduleID : 0;
|
||||
$misc = common::hasPriv('testcase', 'create') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('testcase', 'create') ? $this->createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule") : '#';
|
||||
echo html::a($link, "<i class='icon-plus'></i>" . $lang->testcase->create, '', $misc);
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<style>
|
||||
.outer.with-side #featurebar {background: none; border: none; line-height: 0; margin: 0; min-height: 0; padding: 0; }
|
||||
#querybox #searchform{border-bottom: 1px solid #ddd; margin-bottom: 20px;}
|
||||
</style>
|
||||
<div id='featurebar'>
|
||||
<ul class='submenu hidden'>
|
||||
<?php
|
||||
$hasBrowsePriv = common::hasPriv('testcase', 'browse');
|
||||
$hasGroupPriv = common::hasPriv('testcase', 'groupcase');
|
||||
$hasZeroPriv = common::hasPriv('story', 'zerocase');
|
||||
?>
|
||||
<?php
|
||||
if($this->methodName == 'browse') echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";
|
||||
?>
|
||||
<li class='pull-right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<?php
|
||||
$initModule = isset($moduleID) ? (int)$moduleID : 0;
|
||||
$misc = common::hasPriv('testcase', 'create') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('testcase', 'create') ? $this->createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule") : '#';
|
||||
echo html::a($link, "<i class='icon-plus'></i>" . $lang->testcase->create, '', $misc);
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'batchCreate') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'batchCreate') ? $this->createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class='pull-right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon-upload-alt'></i> <?php echo $lang->import ?><span class='caret'></span></a>
|
||||
<ul class='dropdown-menu' id='importActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'batchCreate') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'batchCreate') ? $this->createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
|
||||
$misc = common::hasPriv('testcase', 'import') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'import') ? $this->createLink('testcase', 'import', "productID=$productID&branch=$branch") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->importFile, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'importFromLib') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'importFromLib') ? $this->createLink('testcase', 'importFromLib', "productID=$productID&branch=$branch") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->importFromLib, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</li>
|
||||
|
||||
<li class='pull-right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon-upload-alt'></i> <?php echo $lang->import ?><span class='caret'></span></a>
|
||||
<ul class='dropdown-menu' id='importActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'import') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'import') ? $this->createLink('testcase', 'import', "productID=$productID&branch=$branch") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->importFile, '', $misc) . "</li>";
|
||||
<li class='pull-right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown'>
|
||||
<i class='icon-download-alt'></i> <?php echo $lang->export ?>
|
||||
<span class='caret'></span>
|
||||
</a>
|
||||
<ul class='dropdown-menu' id='exportActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->export, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'importFromLib') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'importFromLib') ? $this->createLink('testcase', 'importFromLib', "productID=$productID&branch=$branch") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->importFromLib, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class='pull-right'>
|
||||
<a class='dropdown-toggle' data-toggle='dropdown'>
|
||||
<i class='icon-download-alt'></i> <?php echo $lang->export ?>
|
||||
<span class='caret'></span>
|
||||
</a>
|
||||
<ul class='dropdown-menu' id='exportActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->export, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->exportTemplet, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
$misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->exportTemplet, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<?php else:?>
|
||||
|
||||
@@ -20,42 +20,48 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
|
||||
js::set('flow', $this->config->global->flow);
|
||||
?>
|
||||
<?php if($this->config->global->flow == 'onlyTest'):?>
|
||||
<div id='featurebar' class='hidden'>
|
||||
<?php echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";?>
|
||||
<style>
|
||||
.outer.with-side #featurebar {background: none; border: none; line-height: 0; margin: 0; min-height: 0; padding: 0; }
|
||||
#querybox #searchform{border-bottom: 1px solid #ddd; margin-bottom: 20px;}
|
||||
</style>
|
||||
<div id='featurebar'>
|
||||
<ul class='submenu hidden'>
|
||||
<?php echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";?>
|
||||
|
||||
<li class='right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<li class='right'>
|
||||
<div class='btn-group' id='createActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testsuite', 'createCase') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('testsuite', 'createCase') ? $this->createLink('testsuite', 'createCase', "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0)) : '#';
|
||||
echo html::a($link, "<i class='icon-plus'></i>" . $lang->testcase->create, '', $misc);
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testsuite', 'batchCreateCase') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testsuite', 'batchCreateCase') ? $this->createLink('testsuite', 'batchCreateCase', "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0)) : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class='right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testsuite', 'createCase') ? "class='btn btn-primary'" : "class='btn btn-primary disabled'";
|
||||
$link = common::hasPriv('testsuite', 'createCase') ? $this->createLink('testsuite', 'createCase', "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0)) : '#';
|
||||
echo html::a($link, "<i class='icon-plus'></i>" . $lang->testcase->create, '', $misc);
|
||||
$link = common::hasPriv('testsuite', 'import') ? $this->createLink('testsuite', 'import', "libID=$libID") : '#';
|
||||
if(common::hasPriv('testsuite', 'import')) echo html::a($link, "<i class='icon-upload-alt'></i> " . $lang->testcase->importFile, '', "class='export'");
|
||||
?>
|
||||
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu pull-right'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testsuite', 'batchCreateCase') ? '' : "class=disabled";
|
||||
$link = common::hasPriv('testsuite', 'batchCreateCase') ? $this->createLink('testsuite', 'batchCreateCase', "libID=$libID&moduleID=" . (isset($moduleID) ? $moduleID : 0)) : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->batchCreate, '', $misc) . "</li>";
|
||||
</li>
|
||||
|
||||
<li class='right'>
|
||||
<?php
|
||||
$link = common::hasPriv('testsuite', 'exportTemplet') ? $this->createLink('testsuite', 'exportTemplet', "libID=$libID") : '#';
|
||||
if(common::hasPriv('testsuite', 'exportTemplet')) echo html::a($link, "<i class='icon-download-alt'></i> " . $lang->testsuite->exportTemplet, '', "class='export'");
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class='right'>
|
||||
<?php
|
||||
$link = common::hasPriv('testsuite', 'import') ? $this->createLink('testsuite', 'import', "libID=$libID") : '#';
|
||||
if(common::hasPriv('testsuite', 'import')) echo html::a($link, "<i class='icon-upload-alt'></i> " . $lang->testcase->importFile, '', "class='export'");
|
||||
?>
|
||||
</li>
|
||||
|
||||
<li class='right'>
|
||||
<?php
|
||||
$link = common::hasPriv('testsuite', 'exportTemplet') ? $this->createLink('testsuite', 'exportTemplet', "libID=$libID") : '#';
|
||||
if(common::hasPriv('testsuite', 'exportTemplet')) echo html::a($link, "<i class='icon-download-alt'></i> " . $lang->testsuite->exportTemplet, '', "class='export'");
|
||||
?>
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
@@ -258,7 +264,7 @@ $('#module' + moduleID).addClass('active');
|
||||
$('#<?php echo $this->session->libBrowseType?>Tab').addClass('active');
|
||||
if(flow == 'onlyTest')
|
||||
{
|
||||
$('#modulemenu > .nav > li.right').before($('#featurebar').html());
|
||||
$('#modulemenu > .nav > li.right').before($('#featurebar .submenu').html());
|
||||
toggleSearch();
|
||||
|
||||
$('#modulemenu > .nav > li').removeClass('active');
|
||||
|
||||
Reference in New Issue
Block a user