Skip to content

Commit

Permalink
将管理菜单改为三级菜单;增加cms站点切换页面;
Browse files Browse the repository at this point in the history
  • Loading branch information
think-gem committed Mar 7, 2013
1 parent 54ff371 commit e06b296
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 147 deletions.
158 changes: 98 additions & 60 deletions bin/refresh-db/init-data.xml

Large diffs are not rendered by default.

60 changes: 0 additions & 60 deletions bin/refresh-db/mysql/schema_data.sql

This file was deleted.

2 changes: 1 addition & 1 deletion bin/refresh-db/oracle/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ drop sequence SEQ_SYS_MENU;
create sequence SEQ_SYS_MENU
minvalue 1
maxvalue 999999999999999999999999999
start with 52
start with 60
increment by 1
cache 20;

Expand Down
Binary file removed bin/refresh-db/oracle/schema_data.dmp
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

<repository>
<id>repo.springsource.org</id>
<name>repo.springsource.org-releases</name>
<name>SpringSource Repository</name>
<url>http://repo.springsource.org/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ public String toString() {

sb.append("<li class=\"disabled\"><a href=\"javascript:\" style=\"border:0;padding-top:1px;_padding-top:7px;\">当前 ");
sb.append("<input type=\"text\" value=\""+pageNo+"\" style=\"width:30px;padding:0;margin:0 2px 3px 2px;text-align:center;\" ");
sb.append("onkeypress=\"if(window.event.keyCode==13) "+funcName+"(this.value,"+pageSize+");\"/> / ");
sb.append("onkeypress=\"if(window.event.keyCode==13) "+funcName+"(this.value,"+pageSize+");\" onclick=\"this.select();\"/> / ");
sb.append("<input type=\"text\" value=\""+pageSize+"\" style=\"width:30px;padding:0;margin:0 2px 3px 2px;text-align:center;\" ");
sb.append("onkeypress=\"if(window.event.keyCode==13) "+funcName+"("+pageNo+",this.value);\"/> 条,");
sb.append("onkeypress=\"if(window.event.keyCode==13) "+funcName+"("+pageNo+",this.value);\" onclick=\"this.select();\"/> 条,");
sb.append("共 " + count + " 条</a><li>\n");

sb.insert(0,"<ul>\n").append("</ul>\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ public String delete(Long id, @RequestParam(required=false) Boolean isRe, Redire
* @param siteId
* @return
*/
@RequiresPermissions("cms:view")
@RequiresUser
@RequestMapping(value = "select")
public String select(Long id){
UserUtils.putCache("siteId", id);
return "redirect:"+BaseController.ADMIN_PATH;
public String select(Long id, boolean flag){
if (id!=null){
UserUtils.putCache("siteId", id);
}
if (flag){
return "redirect:"+BaseController.ADMIN_PATH;
}
return "modules/cms/siteSelect";
}
}
34 changes: 34 additions & 0 deletions src/main/webapp/WEB-INF/views/modules/cms/siteSelect.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>站点切换</title>
<script type="text/javascript">
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").submit();
return false;
}
</script>
</head>
<body>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/cms/site/select">站点切换</a></li>
</ul>
<table id="contentTable" class="table table-striped table-bordered ">
<thead><tr><th>名称</th><shiro:hasPermission name="cms:view"><th>操作</th></shiro:hasPermission></tr></thead>
<tbody>
<c:forEach items="${fnc:getSiteList()}" var="site">
<tr>
<td><a href="${ctx}/cms/site/select?id=${site.id}">${site.name}${fnc:getCurrentSiteId() eq site.id ? ' <font color="red">[当前站点]</font>' : ''}</a></td>
<shiro:hasPermission name="cms:view"><td>
<a href="${ctx}/cms/site/select?id=${site.id}">切换</a>
</td></shiro:hasPermission>
</tr>
</c:forEach>
</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>
7 changes: 4 additions & 3 deletions src/main/webapp/WEB-INF/views/modules/sys/menuTree.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@
$(this).parent().addClass("active");
$(this).children("i").addClass("icon-white");
});
$(".accordion-body a:first i").click();
});
</script>
</head>
<body>
<div class="accordion" id="menu"><c:set var="menuList" value="${fns:getMenuList()}"/><c:set var="firstMenu" value="true"/><c:forEach items="${menuList}" var="menu" varStatus="idxStatus"><c:if test="${menu.parent.id eq 1&&menu.isShow eq 1}">
<div class="accordion" id="menu"><c:set var="menuList" value="${fns:getMenuList()}"/><c:set var="firstMenu" value="true"/><c:forEach items="${menuList}" var="menu" varStatus="idxStatus"><c:if test="${menu.parent.id eq (not empty param.parentId?param.parentId:1)&&menu.isShow eq 1}">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#menu" href="#collapse${menu.id}"><i class="icon-chevron-${firstMenu?'down':'right'}"></i>&nbsp;&nbsp;${menu.name}</a>
</div>
<div id="collapse${menu.id}" class="accordion-body collapse ${firstMenu?'in':''}"><c:set var="firstMenu" value="false"/>
<div id="collapse${menu.id}" class="accordion-body collapse ${firstMenu?'in':''}">
<div class="accordion-inner">
<ul class="nav nav-list"><c:forEach items="${menuList}" var="menuChild"><c:if test="${menuChild.parent.id eq menu.id&&menuChild.isShow eq 1}">
<li><a href="${fn:indexOf(menuChild.href, '://') eq -1?ctx:''}${menuChild.href}" target="${not empty menuChild.target?menuChild.target:'mainFrame'}" ><i class="icon-${not empty menuChild.icon?menuChild.icon:'circle-arrow-right'}"></i>&nbsp;&nbsp;${menuChild.name}</a></li>
</c:if></c:forEach></ul>
<c:set var="firstMenu" value="false"/></c:if></c:forEach></ul>
</div>
</div>
</div>
Expand Down
31 changes: 20 additions & 11 deletions src/main/webapp/WEB-INF/views/modules/sys/sysIndex.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
<script src="${ctxStatic}/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-jbox/2.3/i18n/jquery.jBox-zh-CN.min.js" type="text/javascript"></script>
<style type="text/css">
.nav li{margin-top:8px;}
.nav li.title{margin-top:0;}
.nav li{margin-top:8px;}.nav li.title{margin-top:0;}.nav li.menu,.nav li.dropdown{margin:8px 3px 0 3px}
.nav li.menu a{padding:5px 6px;*padding:4px 5px 3px 5px;}.nav li.dropdown a{padding:5px 6px;*padding:1px 5px 3px 5px;}
.nav li a{font-size:14px;padding:6px 8px;*padding:3px 8px;}
</style>
<script type="text/javascript">
$(document).ready(function() {
$("#menu a.menu").click(function(){
$("#menu li.menu").removeClass("active");
$(this).parent().addClass("active");
});
});
</script>
</head>
<body>
<div id="main" class="container-fluid">
Expand All @@ -21,24 +29,24 @@
<shiro:user> | <a href="${ctx}/logout">退出</a></shiro:user> | <a href="${pageContext.request.contextPath}${fns:getFrontPath()}/index-${fnc:getCurrentSiteId()}.html" target="_blank">访问网站</a>
&nbsp;&nbsp;&nbsp;
</span>
<ul class="nav nav-pills nav-tabs2" style="margin:0;">
<ul class="nav nav-pills" style="margin:0;" id="menu">
<li class="title"><h1>JeeSite Admin <small></small></h1></li>
<li style="width:15px;">&nbsp;</li><%--
<li class="active"><a href="${ctx}">首页</a></li><li><a href="${ctx}">内容</a></li>
<li><a href="${ctx}">模块</a></li><li><a href="${ctx}">设置</a></li> --%>
<li style="width:15px;">&nbsp;</li>
<li style="width:18px;">&nbsp;</li>
<c:set var="firstMenu" value="true"/><c:forEach items="${fns:getMenuList()}" var="menu" varStatus="idxStatus"><c:if test="${menu.parent.id eq 1&&menu.isShow eq 1}">
<li class="menu ${firstMenu?' active':''}"><a class="menu" href="${ctx}/sys/menu/tree?parentId=${menu.id}" target="menuFrame" >${menu.name}</a></li>
<c:if test="${firstMenu}"><c:set var="firstMenuId" value="${menu.id}"/></c:if><c:set var="firstMenu" value="false"/></c:if></c:forEach>
<shiro:hasPermission name="cms:view"><li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">${fnc:getSite(fnc:getCurrentSiteId()).name}<b class="caret"></b></a>
<ul class="dropdown-menu">
<c:forEach items="${fnc:getSiteList()}" var="site"><li><a href="${ctx}/cms/site/select?id=${site.id}">${site.name}</a></li></c:forEach>
<c:forEach items="${fnc:getSiteList()}" var="site"><li><a href="${ctx}/cms/site/select?id=${site.id}&flag=1">${site.name}</a></li></c:forEach>
</ul>
</li></shiro:hasPermission>
</ul>
</div>
</div>
<div id="content" class="row-fluid">
<div id="left">
<iframe id="menuFrame" name="menuFrame" src="${ctx}/sys/menu/tree" style="overflow:visible;"
<iframe id="menuFrame" name="menuFrame" src="${ctx}/sys/menu/tree?parentId=${firstMenuId}" style="overflow:visible;"
scrolling="yes" frameborder="no" width="100%" height="650"></iframe>
</div>
<div id="openClose" class="close">&nbsp;</div>
Expand All @@ -57,13 +65,14 @@
function wSize(){
var strs=getWindowSize().toString().split(",");
if(strs[0]<550){
$("#main").css("height",550+"px");
$("#main").css("height",550);
$("#openClose").height(strs[0]);
}else{
$("#menuFrame, #mainFrame, #openClose").height(strs[0]-$("#header").height() - $("#footer").height() - 80);
$("#openClose").height($("#openClose").height()-6);
}
if(strs[1]<980){
$("#main").css("width",970+"px");
$("#main").css("width",970);
$("html").css("overflow-x","auto");
}else{
$("#main").css("width","auto");
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/WEB-INF/views/modules/sys/sysLogin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
$(document).ready(function() {
$("#loginForm").validate();
});
// 如果在框架中,则跳转刷新上级页面
if(self.frameElement.tagName=="IFRAME"){
parent.location.reload();
}
</script>
</head>
<body>
Expand Down
10 changes: 5 additions & 5 deletions src/main/webapp/static/bootstrap/2.0.4/css/ie6.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ body {background:#ffffff;background-image:none;padding:0;margin:0}
.navbar .nav li a {float:none;line-height:19px;padding:10px 10px 11px}
.navbar .nav li a:hover {background-color:transparent;color:#ffffff;text-decoration:none;}

.navbar .nav .active a,
.navbar .nav .active a:hover {color:#ffffff;text-decoration:none;background-color:#333333;}
.navbar .nav .open .dropdown-toggle,
.navbar .nav .active a, .nav-pills .active a, .nav-pills .active a:hover,
.navbar .nav .active a:hover {color:#ffffff;text-decoration:none;background-color:#0088cc;}
.navbar .nav .open .dropdown-toggle,
.navbar .nav .active .dropdown-toggle,
.navbar .nav .open.active .dropdown-toggle{background-color:transparent;}
.navbar .nav .active .dropdown-toggle:hover {background-color:transparent;color:#ffffff}

.dropdown .dropdown-toggle {margin-bottom:1px;position:relative;top:2px;left:0px}
.dropdown .dropdown-toggle:hover{background-color:#eeeeee;}
.dropdown .dropdown-toggle {margin-bottom:1px;position:relative;top:2px;left:0px;}
.nav-pills a:hover,.dropdown .dropdown-toggle:hover{background-color:#eeeeee;}
.nav .open .dropdown-toggle, .nav .open .dropdown-toggle:hover{color:#ffffff}
.nav .open,.nav .open .dropdown-toggle,.nav .open .dropdown-toggle:hover{background-color:#999999;}

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/static/bootstrap/2.0.4/css/ie6.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e06b296

Please sign in to comment.