merge topbar template in menu templates files

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1304878 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-03-24 18:22:59 +00:00
parent 34e4af8ca4
commit 0319d5c176
4 changed files with 54 additions and 69 deletions

View File

@ -17,7 +17,6 @@
* under the License. * under the License.
*/ */
require(["text!js/archiva/templates/menu.html"+appendTemplateUrl(), require(["text!js/archiva/templates/menu.html"+appendTemplateUrl(),
"text!js/archiva/templates/topbar.html"+appendTemplateUrl(),
"text!js/archiva/templates/message.html"+appendTemplateUrl(), "text!js/archiva/templates/message.html"+appendTemplateUrl(),
"text!js/archiva/templates/modal.html"+appendTemplateUrl(), "text!js/archiva/templates/modal.html"+appendTemplateUrl(),
"text!js/archiva/templates/grids-generics.html"+appendTemplateUrl(), "text!js/archiva/templates/grids-generics.html"+appendTemplateUrl(),
@ -27,13 +26,12 @@ require(["text!js/archiva/templates/menu.html"+appendTemplateUrl(),
"text!js/archiva/templates/repository-groups.html"+appendTemplateUrl(), "text!js/archiva/templates/repository-groups.html"+appendTemplateUrl(),
"text!js/archiva/templates/search.html"+appendTemplateUrl(), "text!js/archiva/templates/search.html"+appendTemplateUrl(),
"text!js/archiva/templates/general-admin.html"+appendTemplateUrl()], "text!js/archiva/templates/general-admin.html"+appendTemplateUrl()],
function(menu,topbar,message,modal,grids_generics,repositories,network_proxies,proxies_connectors, function(menu,message,modal,grids_generics,repositories,network_proxies,proxies_connectors,
repository_groups,search,general_admin) { repository_groups,search,general_admin) {
var htmlFragment=$("#html-fragments"); var htmlFragment=$("#html-fragments");
// template loading // template loading
$.tmpl( menu ).appendTo(htmlFragment); htmlFragment.append(menu);
$.tmpl( topbar ).appendTo(htmlFragment);
htmlFragment.append(message); htmlFragment.append(message);
$.tmpl( modal ).appendTo(htmlFragment); $.tmpl( modal ).appendTo(htmlFragment);
htmlFragment.append(grids_generics); htmlFragment.append(grids_generics);

View File

@ -286,8 +286,8 @@ $(function() {
startArchivaApplication=function(){ startArchivaApplication=function(){
$.log("startArchivaApplication"); $.log("startArchivaApplication");
$('#topbar-menu-container').html($("#topbar-menu")); $('#topbar-menu-container').html($("#topbar_menu_tmpl" ).tmpl());//$("#topbar-menu"));
$('#sidebar-content').html($("#main-menu")); $('#sidebar-content').html( $("#main_menu_tmpl").tmpl());
hideElementWithKarma(); hideElementWithKarma();
checkSecurityLinks(); checkSecurityLinks();

View File

@ -16,6 +16,7 @@
~ specific language governing permissions and limitations ~ specific language governing permissions and limitations
~ under the License. ~ under the License.
--> -->
<script type="text/html" id="main_menu_tmpl">
<div id="main-menu"> <div id="main-menu">
<ul class="nav nav-list"> <ul class="nav nav-list">
@ -72,3 +73,52 @@
</ul> </ul>
</div> </div>
</script>
<script id="topbar_menu_tmpl" type="text/html">
<div id="topbar-menu">
<div class="navbar navbar-fixed-top">
<div style="max-height: 40px" class="navbar-inner">
<div class="container-fluid">
<div id="organisation-logo" class="pull-left"></div>
<div class="nav-collapse">
<ul class="nav pull-right">
<li id="create-admin-link" class="pull-right" style="display: none">
<a href="#" onclick="adminCreateBox();" id="create-admin-link-a">
<span class="label label-important">${$.i18n.prop('create.admin.page.link')}</span>
</a>
</li>
<li id="login-link" class="pull-right" style="display: none">
<a href="#" onclick="loginBox();" id="login-link-a">
<span class="label label-success force-upper-case">${$.i18n.prop('login')}</span>
</a>
</li>
<li id="change-password-link" class="pull-right" style="">
<a href="#" onclick="editUserDetailsBox();">${$.i18n.prop('edit.details')}</a>
</li>
<li id="logout-link" class="pull-right" style="display: none">
<a href="#" onclick="logout(true);" id="logout-link-a">
<span class="label label-important force-upper-case">${$.i18n.prop('logout')}</span>
</a>
</li>
<li id="register-link" class="pull-right" style="display: none">
<a href="#" onclick="registerBox();" id="register-link-a">
<span class="label label-info force-upper-case">${$.i18n.prop('register')}</span>
</a>
</li>
<li class="pull-right">
<div class="ui-widget">
<input type="text" class="ui-autocomplete-input" id="quick-search-autocomplete"
placeholder="${$.i18n.prop('menu.topbar.quicksearch')}" />
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</script>

View File

@ -1,63 +0,0 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<div id="topbar-menu">
<div class="navbar navbar-fixed-top">
<div style="max-height: 40px" class="navbar-inner">
<div class="container-fluid">
<div id="organisation-logo" class="pull-left"></div>
<div class="nav-collapse">
<ul class="nav pull-right">
<li id="create-admin-link" class="pull-right" style="display: none">
<a href="#" onclick="adminCreateBox();" id="create-admin-link-a">
<span class="label label-important">${$.i18n.prop('create.admin.page.link')}</span>
</a>
</li>
<li id="login-link" class="pull-right" style="display: none">
<a href="#" onclick="loginBox();" id="login-link-a">
<span class="label label-success force-upper-case">${$.i18n.prop('login')}</span>
</a>
</li>
<li id="change-password-link" class="pull-right" style="">
<a href="#" onclick="editUserDetailsBox();">${$.i18n.prop('edit.details')}</a>
</li>
<li id="logout-link" class="pull-right" style="display: none">
<a href="#" onclick="logout(true);" id="logout-link-a">
<span class="label label-important force-upper-case">${$.i18n.prop('logout')}</span>
</a>
</li>
<li id="register-link" class="pull-right" style="display: none">
<a href="#" onclick="registerBox();" id="register-link-a">
<span class="label label-info force-upper-case">${$.i18n.prop('register')}</span>
</a>
</li>
<li class="pull-right">
<div class="ui-widget">
<input type="text" class="ui-autocomplete-input" id="quick-search-autocomplete"
placeholder="${$.i18n.prop('menu.topbar.quicksearch')}" />
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>