Add a popup menu in the main menu which allows to quickly jump between projects.
* refactor out the common menu code from several base*.html classes into main-menu.html and put the raw links into a unordered list (which makes it easier to create dynamic menus as we cannot insert block items into inline items in strict mode) * query the list of available projects on every request and set them for every template in Middleware.php * make the popup menu pretty
This commit is contained in:
parent
c3ff90c4f8
commit
7e10524f92
@ -112,6 +112,7 @@ function IDF_Middleware_ContextPreProcessor($request)
|
|||||||
$c = array_merge($c, $request->rights);
|
$c = array_merge($c, $request->rights);
|
||||||
}
|
}
|
||||||
$c['usherConfigured'] = Pluf::f("mtn_usher_conf", null) !== null;
|
$c['usherConfigured'] = Pluf::f("mtn_usher_conf", null) !== null;
|
||||||
|
$c['allProjects'] = IDF_Views::getProjects($request->user);
|
||||||
return $c;
|
return $c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,16 +29,13 @@
|
|||||||
<![endif]-->
|
<![endif]-->
|
||||||
{block extraheader}{/block}
|
{block extraheader}{/block}
|
||||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
|
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
|
||||||
|
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="{block docid}doc3{/block}">
|
<div id="{block docid}doc3{/block}">
|
||||||
<div id="hd">
|
<div id="hd">
|
||||||
{if $project}<h1 class="project-title">{$project}</h1>{/if}
|
{if $project}<h1 class="project-title">{$project}</h1>{/if}
|
||||||
<p class="top"><a href="#title" accesskey="2"></a>
|
{include 'idf/main-menu.html'}
|
||||||
{if !$user.isAnonymous()}{aurl 'url', 'idf_dashboard'}{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans} <a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a>{else}<a href="{url 'IDF_Views::login'}">{trans 'Sign in or create your account'}</a>{/if}
|
|
||||||
{if $project} | <a href="{url 'IDF_Views::index'}">{trans 'Project List'}</a>{/if}
|
|
||||||
| <a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a>
|
|
||||||
</p>
|
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<div id="main-tabs">
|
<div id="main-tabs">
|
||||||
{if $project}
|
{if $project}
|
||||||
@ -54,35 +51,34 @@
|
|||||||
{block subtabs}{if $user.isAnonymous()} | {aurl 'url', 'IDF_Views::login'}{blocktrans}<a href="{$url}">Sign in or create your account</a> to create issues or add comments{/blocktrans}{/if}{/block}
|
{block subtabs}{if $user.isAnonymous()} | {aurl 'url', 'IDF_Views::login'}{blocktrans}<a href="{$url}">Sign in or create your account</a> to create issues or add comments{/blocktrans}{/if}{/block}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1 class="title" id="title">{block titleicon}{/block}{block title}{$page_title}{/block}</h1>
|
<h1 class="title" id="title">{block titleicon}{/block}{block title}{$page_title}{/block}</h1>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="bd">
|
<div id="bd">
|
||||||
<div id="yui-main">
|
<div id="yui-main">
|
||||||
<div class="yui-b">
|
<div class="yui-b">
|
||||||
<div class="yui-g">
|
<div class="yui-g">
|
||||||
{if $user and $user.id}{getmsgs $user}{/if}
|
{if $user and $user.id}{getmsgs $user}{/if}
|
||||||
<div class="content">{block body}{/block}</div>
|
<div class="content">{block body}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="ft">{block foot}{/block}</div>
|
<div id="ft">{block foot}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
|
||||||
{include 'idf/js-hotkeys.html'}
|
{include 'idf/js-hotkeys.html'}
|
||||||
{block javascript}{/block}
|
{block javascript}{/block}
|
||||||
{if $project}
|
{if $project}
|
||||||
<script type="text/javascript" charset="utf-8">{literal}
|
<script type="text/javascript" charset="utf-8">{literal}
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var frag = location.hash;
|
var frag = location.hash;
|
||||||
if ($('#preview').length) {
|
if ($('#preview').length) {
|
||||||
location.hash = '#preview';
|
location.hash = '#preview';
|
||||||
}
|
}
|
||||||
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
|
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
|
||||||
$(frag).addClass("issue-comment-focus");
|
$(frag).addClass("issue-comment-focus");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//]]>{/literal}
|
//]]>{/literal}
|
||||||
</script>{/if}
|
</script>{/if}
|
||||||
|
@ -29,31 +29,27 @@
|
|||||||
<![endif]-->
|
<![endif]-->
|
||||||
{block extraheader}{/block}
|
{block extraheader}{/block}
|
||||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
|
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
|
||||||
|
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
||||||
<div id="hd">
|
<div id="hd">
|
||||||
<p class="top"><a href="#title" accesskey="2"></a>
|
{include 'idf/main-menu.html'}
|
||||||
{if !$user.isAnonymous()}{aurl 'url', 'idf_dashboard'}{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans} <a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a>{else}<a href="{url 'IDF_Views::login'}">{trans 'Sign in or create your account'}</a>{/if}
|
<h1 id="title" class="title">{block title}{$page_title}{/block}</h1>
|
||||||
| <a href="{url 'IDF_Views::index'}">{trans 'Project List'}</a> {if $isAdmin}| <a href="{url 'IDF_Views_Admin::projects'}">{trans 'Forge Management'}</a>{/if}
|
|
||||||
| <a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a>
|
|
||||||
</p>
|
|
||||||
<h1 id="title" class="title">{block title}{$page_title}{/block}</h1>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="bd">
|
<div id="bd">
|
||||||
<div id="yui-main">
|
<div id="yui-main">
|
||||||
<div class="yui-b">
|
<div class="yui-b">
|
||||||
<div class="yui-g">
|
<div class="yui-g">
|
||||||
{if $user and $user.id}{getmsgs $user}{/if}
|
{if $user and $user.id}{getmsgs $user}{/if}
|
||||||
<div class="content">{block body}{/block}</div>
|
<div class="content">{block body}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="yui-b context">{block context}{/block}</div>
|
<div class="yui-b context">{block context}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="ft">{block foot}{/block}</div>
|
<div id="ft">{block foot}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
|
||||||
{include 'idf/js-hotkeys.html'}
|
{include 'idf/js-hotkeys.html'}
|
||||||
{block javascript}{/block}
|
{block javascript}{/block}
|
||||||
</body>
|
</body>
|
||||||
|
@ -29,17 +29,13 @@
|
|||||||
<![endif]-->
|
<![endif]-->
|
||||||
{block extraheader}{/block}
|
{block extraheader}{/block}
|
||||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
|
<title>{block pagetitle}{$page_title|strip_tags}{/block}{if $project} - {$project.shortdesc}{/if}</title>
|
||||||
|
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
||||||
<div id="hd">
|
<div id="hd">
|
||||||
{if $project}<h1 class="project-title">{$project}</h1>{/if}
|
{if $project}<h1 class="project-title">{$project}</h1>{/if}
|
||||||
<p class="top"><a href="#title" accesskey="2"></a>
|
{include 'idf/main-menu.html'}
|
||||||
{if !$user.isAnonymous()}{aurl 'url', 'idf_dashboard'}{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans} <a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a>{else}<a href="{url 'IDF_Views::login'}">{trans 'Sign in or create your account'}</a>{/if}
|
|
||||||
{if $project} | <a href="{url 'IDF_Views::index'}">{trans 'Project List'}</a>{/if}
|
|
||||||
{if $isAdmin}| <a href="{url 'IDF_Views_Admin::projects'}">{trans 'Forge Management'}</a>{/if}
|
|
||||||
| <a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a>
|
|
||||||
</p>
|
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<div id="main-tabs">
|
<div id="main-tabs">
|
||||||
{if $project}
|
{if $project}
|
||||||
@ -55,36 +51,35 @@
|
|||||||
{block subtabs}{if $user.isAnonymous()} | {aurl 'url', 'IDF_Views::login'}{blocktrans}<a href="{$url}">Sign in or create your account</a> to create issues or add comments{/blocktrans}{/if}{/block}
|
{block subtabs}{if $user.isAnonymous()} | {aurl 'url', 'IDF_Views::login'}{blocktrans}<a href="{$url}">Sign in or create your account</a> to create issues or add comments{/blocktrans}{/if}{/block}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1 class="title" id="title">{block titleicon}{/block}{block title}{$page_title}{/block}</h1>
|
<h1 class="title" id="title">{block titleicon}{/block}{block title}{$page_title}{/block}</h1>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="bd">
|
<div id="bd">
|
||||||
<div id="yui-main">
|
<div id="yui-main">
|
||||||
<div class="yui-b">
|
<div class="yui-b">
|
||||||
<div class="yui-g">
|
<div class="yui-g">
|
||||||
{if $user and $user.id}{getmsgs $user}{/if}
|
{if $user and $user.id}{getmsgs $user}{/if}
|
||||||
<div class="content">{block body}{/block}</div>
|
<div class="content">{block body}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="yui-b context">{block context}{/block}</div>
|
<div class="yui-b context">{block context}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="ft">{block foot}{/block}</div>
|
<div id="ft">{block foot}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
|
||||||
{include 'idf/js-hotkeys.html'}
|
{include 'idf/js-hotkeys.html'}
|
||||||
{block javascript}{/block}
|
{block javascript}{/block}
|
||||||
{if $project}
|
{if $project}
|
||||||
<script type="text/javascript" charset="utf-8">{literal}
|
<script type="text/javascript" charset="utf-8">{literal}
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var frag = location.hash;
|
var frag = location.hash;
|
||||||
if ($('#preview').length) {
|
if ($('#preview').length) {
|
||||||
location.hash = '#preview';
|
location.hash = '#preview';
|
||||||
}
|
}
|
||||||
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
|
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
|
||||||
$(frag).addClass("issue-comment-focus");
|
$(frag).addClass("issue-comment-focus");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//]]>{/literal}
|
//]]>{/literal}
|
||||||
</script>{/if}
|
</script>{/if}
|
||||||
|
@ -29,16 +29,12 @@
|
|||||||
<![endif]-->
|
<![endif]-->
|
||||||
{block extraheader}{/block}
|
{block extraheader}{/block}
|
||||||
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
|
<title>{block pagetitle}{$page_title|strip_tags}{/block}</title>
|
||||||
|
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
<div id="{block docid}doc3{/block}" class="{block docclass}yui-t3{/block}">
|
||||||
<div id="hd">
|
<div id="hd">
|
||||||
<p class="top"><a href="#title" accesskey="2"></a>
|
{include 'idf/main-menu.html'}
|
||||||
{aurl 'url', 'IDF_Views_User::dashboard'}{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans} <a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a>
|
|
||||||
| <a href="{url 'IDF_Views::index'}">{trans 'Project List'}</a>
|
|
||||||
| <a href="{url 'IDF_Views_Admin::projects'}">{trans 'Forge Management'}</a>
|
|
||||||
| <a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a>
|
|
||||||
</p>
|
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<div id="main-tabs">
|
<div id="main-tabs">
|
||||||
<a href="{url 'IDF_Views_Admin::projects'}"{block tabprojects}{/block}>{trans 'Projects'}</a>
|
<a href="{url 'IDF_Views_Admin::projects'}"{block tabprojects}{/block}>{trans 'Projects'}</a>
|
||||||
@ -64,7 +60,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="ft">{block foot}{/block}</div>
|
<div id="ft">{block foot}{/block}</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="{media '/idf/js/jquery-1.2.6.min.js'}"></script>
|
|
||||||
{include 'idf/js-hotkeys.html'}
|
{include 'idf/js-hotkeys.html'}
|
||||||
{block javascript}{/block}
|
{block javascript}{/block}
|
||||||
</body>
|
</body>
|
||||||
|
31
src/IDF/templates/idf/main-menu.html
Normal file
31
src/IDF/templates/idf/main-menu.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<a href="#title" accesskey="2"></a>
|
||||||
|
<ul id="main-menu">
|
||||||
|
{if !$user.isAnonymous()}
|
||||||
|
{aurl 'url', 'idf_dashboard'}
|
||||||
|
<li>{blocktrans}Welcome, <strong><a class="userw" href="{$url}">{$user}</a></strong>.{/blocktrans}
|
||||||
|
<a href="{url 'IDF_Views::logout'}">{trans 'Sign Out'}</a></li>{else}<li>
|
||||||
|
<a href="{url 'IDF_Views::login'}">{trans 'Sign in or create your account'}</a></li>
|
||||||
|
{/if}<li id="project-list"><a href="{url 'IDF_Views::index'}">{trans 'Project List'} ▾</a>
|
||||||
|
{if $allProjects.count() != 0}
|
||||||
|
<ul>{foreach $allProjects as $p}
|
||||||
|
<li>{if $p.private}<img style="vertical-align: text-bottom;" src="{media '/idf/img/lock.png'}" alt="{trans 'Private project'}" /> {/if}
|
||||||
|
<a href="{url 'IDF_Views_Project::home', array($p.shortname)}">{$p}</a></li>
|
||||||
|
{/foreach}</ul>
|
||||||
|
{/if}</li>{if $isAdmin}<li><a href="{url 'IDF_Views_Admin::projects'}">{trans 'Forge Management'}</a></li>{/if}<li>
|
||||||
|
<a href="{url 'IDF_Views::faq'}" title="{trans 'Help and accessibility features'}">{trans 'Help'}</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{if $allProjects.count() != 0}
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
{literal}
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#project-list').bind('mouseenter', function(ev) {
|
||||||
|
$(this).find('ul').show();
|
||||||
|
}).bind('mouseleave', function(ev) {
|
||||||
|
$(this).find('ul').hide();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
{/if}
|
||||||
|
|
@ -716,3 +716,84 @@ div.deprecated-page {
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* main menu
|
||||||
|
*/
|
||||||
|
#main-menu {
|
||||||
|
padding: 0;
|
||||||
|
margin: 5px 0 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main-menu > li {
|
||||||
|
list-style-type: none;
|
||||||
|
margin-left: 5px;
|
||||||
|
padding-left: 5px;
|
||||||
|
border-left: 1px solid black;
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main-menu > li:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* project list popup
|
||||||
|
*/
|
||||||
|
#project-list {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-list > a {
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
margin-top: -3px;
|
||||||
|
padding-top: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-list + li {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-list ul {
|
||||||
|
display: none;
|
||||||
|
background: #A5E26A;
|
||||||
|
border-top: 0;
|
||||||
|
position: absolute;
|
||||||
|
padding: 5px 5px 5px 20px;
|
||||||
|
margin: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
top: 1.1em;
|
||||||
|
-moz-border-radius: 0 3px 3px 3px;
|
||||||
|
border-radius: 0 3px 3px 3px;
|
||||||
|
-moz-box-shadow: 0 10px 20px #333;
|
||||||
|
-webkit-box-shadow: 0 10px 20px #333;
|
||||||
|
box-shadow: 0 10px 20px #333;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-list ul li {
|
||||||
|
padding: 5px;
|
||||||
|
padding-left: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 0.95em;
|
||||||
|
list-style-type: square;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-list ul li a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-list:hover > a {
|
||||||
|
background: #A5E26A;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#project-list:hover a {
|
||||||
|
color: #2E3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user