forked from tshi0912/baguajie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
203 additions
and
42 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...ajie-web/src/main/java/net/baguajie/web/mvc/controllers/GetSignInStatusBarController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package net.baguajie.web.mvc.controllers; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpSession; | ||
|
||
import net.baguajie.constants.ApplicationConstants; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.SessionAttributes; | ||
|
||
@Controller | ||
@SessionAttributes(ApplicationConstants.SESSION_SIGNIN_USER) | ||
public class GetSignInStatusBarController { | ||
|
||
@RequestMapping(value="/signin/navbar", method=RequestMethod.GET) | ||
public String thumb(Model model, HttpServletRequest request, | ||
HttpSession session){ | ||
return "comp/sign.in.status"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
baguajie-web/src/main/webapp/WEB-INF/views/comp/sign.in.status.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | ||
<c:if test="${not empty signInUser}"> | ||
<ul class="nav pull-right"> | ||
<li class="dropdown"><a class="dropdown-toggle" | ||
data-toggle="dropdown" href="#"> 关于 <b class="caret"></b> | ||
</a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="#">关于八卦街</a></li> | ||
<li><a href="#">八卦工具</a></li> | ||
<li><a href="#">开发动态</a></li> | ||
<li class="divider"></li> | ||
<li><a href="#">帮助</a></li> | ||
<li><a href="#">反馈</a></li> | ||
</ul></li> | ||
<li class="divider-vertical"></li> | ||
<li id="nav-profile"><a | ||
href="<c:url value="/profiles/${signInUser.id}" />">我的门面</a></li> | ||
<li id="nav-dashboard"><a href="<c:url value="/dashboard" />">我的八卦圈</a></li> | ||
<li class="dropdown"><a class="dropdown-toggle" | ||
data-toggle="dropdown" href="#"> 消息 <b class="caret"></b> | ||
</a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="#">查看评论</a></li> | ||
<li><a href="#">查看@我</a></li> | ||
<li><a href="#">查看私信</a></li> | ||
<li><a href="#">查看通知</a></li> | ||
</ul></li> | ||
<li class="dropdown"><a class="dropdown-toggle" | ||
data-toggle="dropdown" href="#"> 账号 <b class="caret"></b> | ||
</a> | ||
<ul class="dropdown-menu"> | ||
<li><a href="<c:url value="/setting" />">账号设置</a></li> | ||
<li class="divider"></li> | ||
<li><a href="<c:url value="/signout" />">退出登录</a></li> | ||
</ul></li> | ||
</ul> | ||
</c:if> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
baguajie-web/src/main/webapp/WEB-INF/views/modal/sign.in.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | ||
<div id="sign-in-modal" class="modal hide fade" | ||
style="width: 450px;"> | ||
<form id="signInForm" class="mb-0 fs-14 lh-16 sign-in" action="<c:url value="/signin" />" method="post"> | ||
<div class="modal-header"> | ||
<a class="close" data-dismiss="modal">×</a> | ||
<h3>登录八卦街</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="row-fluid mt-10"> | ||
<input id="signInName" class="validate[required,custom[email]] input-large" name="signInName" type="text" | ||
data-prompt-position="centerRight:0,-4" placeholder="八卦街注册邮箱" autocomplete="off" /></div> | ||
<div class="row-fluid mt-10"> | ||
<input id="signInPassword" class="validate[required] input-large" name="signInPassword" type="password" | ||
data-prompt-position="centerRight:0,-4" placeholder="输入密码" autocomplete="off" /></div> | ||
<div class="row-fluid mt-10"> | ||
<a href="<c:url value="/signup" />">还没有八卦街账号?立即注册!</a> | ||
<a href="#" class="f-r">忘记密码?</a> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<input type="submit" class="btn btn-primary btn-large" value="登录"></input> | ||
</div> | ||
</form> | ||
</div> | ||
<script type="text/javascript"> | ||
$(function() { | ||
$('#signInForm').validationEngine({ | ||
prettySelect: true, | ||
useSuffix: '_target', | ||
promptPosition: 'centerRight', | ||
autoPositionUpdate: true, | ||
ajaxFormValidation: true, | ||
ajaxFormValidationMethod: 'post', | ||
ajaxFormValidationURL: '<c:url value="/signin/validate" />', | ||
onBeforeAjaxFormValidation: function(form, options){ | ||
form.find('.modal-footer input[type="submit"]').button('loading'); | ||
}, | ||
onAjaxFormComplete: function(status, form, errors, options){ | ||
form.find('.modal-footer input[type="submit"]').button('reset') | ||
if(status == true){ | ||
$('#sign-in-modal').modal('hide'); | ||
$.get('<c:url value="/signin/navbar" />', function(data){ | ||
var statefulNav = $.trim(data); | ||
if(statefulNav){ | ||
$('.navbar .nav.pull-right').replaceWith(statefulNav); | ||
} | ||
}) | ||
} | ||
} | ||
}); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters