Skip to content

Commit

Permalink
base files commited, started work on login page. Blocked by messages/…
Browse files Browse the repository at this point in the history
…errors suckish hook see #215
  • Loading branch information
vankeisb committed Apr 13, 2014
1 parent 42d3b86 commit e7e13ae
Show file tree
Hide file tree
Showing 38 changed files with 1,462 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package woko.facets.builtin.bootstrap3.all;

import net.sourceforge.jfacets.IFacetDescriptorManager;
import woko.facets.builtin.all.LayoutAll;
import woko.persistence.ObjectStore;
import woko.users.UserManager;
import woko.users.UsernameResolutionStrategy;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
* <code>layout</code> facet for the bootstrap3 skin.
*/
public class LayoutBootstrap3<
OsType extends ObjectStore,
UmType extends UserManager,
UnsType extends UsernameResolutionStrategy,
FdmType extends IFacetDescriptorManager> extends LayoutAll<OsType,UmType,UnsType,FdmType> {

private static final String JS_JQUERY = "/js/jQuery-V1.9.1/jquery.min.js";
private static final String JS_BOOTSTRAP = "/bootstrap-3.1.1-dist/js/bootstrap.min.js";
private static final String JS_BOOTSTRAP_DATEPICKER = "/js/bootstrap3-datepicker/bootstrap-datepicker.min.js";
private static final String JS_WOKO_BASE = "/woko/js/woko.base.js";
private static final String JS_WOKO_JQUERY = "/woko/js/woko.jquery.js";
private static final String JS_WOKO_RPC = "/woko/js/woko.rpc.js";

private static final String CSS_BOOTSTRAP = "/bootstrap-3.1.1-dist/css/bootstrap.min.css";
private static final String CSS_WOKO = "/css/woko.css";

private static final List<String> CSS_INCLUDES = Collections.unmodifiableList(
Arrays.asList(CSS_BOOTSTRAP, CSS_WOKO)
);

private static final List<String> JS_INCLUDES = Collections.unmodifiableList(
Arrays.asList(JS_JQUERY, JS_BOOTSTRAP, JS_BOOTSTRAP_DATEPICKER, JS_WOKO_BASE, JS_WOKO_JQUERY, JS_WOKO_RPC)
);

@Override
public List<String> getJsIncludes() {
return JS_INCLUDES;
}

@Override
public List<String> getCssIncludes() {
return CSS_INCLUDES;
}

}
20 changes: 20 additions & 0 deletions webresources/bootstrap3/src/main/resources/stripes.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
########################
## Stripes Messages ##
########################
# Resource strings used by the stripes:errors tag when there are no nested tags
stripes.errors.header=<div class="container"><div class="alert alert-error"><button type="button" class="close" data-dismiss="alert">&times;</button><ul class="list-unstyled">
stripes.errors.beforeError=<li>
stripes.errors.afterError=</li>
stripes.errors.footer=</ul></div></div>


stripes.fieldErrors.header=
stripes.fieldErrors.beforeError=<span class="help-inline">
stripes.fieldErrors.afterError=</span>
stripes.fieldErrors.footer=

# Resource strings used by the stripes:messages tag
stripes.messages.header=<div class="container"><div class="alert alert-success"><button type="button" class="close" data-dismiss="alert">&times;</button><ul class="list-unstyled">
stripes.messages.beforeMessage=<li>
stripes.messages.afterMessage=</li>
stripes.messages.footer=</ul></div></div>
20 changes: 20 additions & 0 deletions webresources/bootstrap3/src/main/resources/stripes_en.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
########################
## Stripes Messages ##
########################
# Resource strings used by the stripes:errors tag when there are no nested tags
stripes.errors.header=<div class="alert alert-error fade in"><button type="button" class="close" data-dismiss="alert">&times;</button><ul class="unstyled">
stripes.errors.beforeError=<li>
stripes.errors.afterError=</li>
stripes.errors.footer=</ul></div>


stripes.fieldErrors.header=
stripes.fieldErrors.beforeError=<span class="help-inline">
stripes.fieldErrors.afterError=</span>
stripes.fieldErrors.footer=

# Resource strings used by the stripes:messages tag
stripes.messages.header=<div class="alert alert-success fade in"><button type="button" class="close" data-dismiss="alert">&times;</button><ul class="unstyled">
stripes.messages.beforeMessage=<li>
stripes.messages.afterMessage=</li>
stripes.messages.footer=</ul></div>
20 changes: 20 additions & 0 deletions webresources/bootstrap3/src/main/resources/stripes_fr.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
########################
## Stripes Messages ##
########################
# Resource strings used by the stripes:errors tag when there are no nested tags
stripes.errors.header=<div class="alert alert-error fade in"><button type="button" class="close" data-dismiss="alert">&times;</button><ul class="unstyled">
stripes.errors.beforeError=<li>
stripes.errors.afterError=</li>
stripes.errors.footer=</ul></div>


stripes.fieldErrors.header=
stripes.fieldErrors.beforeError=<span class="help-inline">
stripes.fieldErrors.afterError=</span>
stripes.fieldErrors.footer=

# Resource strings used by the stripes:messages tag
stripes.messages.header=<div class="alert alert-success fade in"><button type="button" class="close" data-dismiss="alert">&times;</button><ul class="unstyled">
stripes.messages.beforeMessage=<li>
stripes.messages.afterMessage=</li>
stripes.messages.footer=</ul></div>
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</script>

<% if (l.toString().equals("fr")) { %>
<script type="text/javascript" src="${cp}/js/bootstrap-datepicker/bootstrap-datepicker.fr.min.js?${cacheTokenParams}"></script>
<script type="text/javascript" src="${cp}/js/bootstrap3-datepicker/bootstrap-datepicker.fr.min.js?${cacheTokenParams}"></script>
<% } %>

<script type="text/javascript">
Expand All @@ -90,89 +90,65 @@
</head>

<body>
<div id="wrapper">

<%-- Header : the static navBar --%>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<%-- Display a button bar on tablet and phone --%>
<button class="btn btn-navbar collapsed" data-target=".nav-collapse" data-toggle="collapse" type="button">

<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

<%-- The app name --%>
<a href="${cp}/home" class="brand">${layout.appTitle}</a>

<%-- The navBar --%>
<div class="nav-collapse collapse">

<%-- First display the navBar facet --%>
<ul class="nav">
<w:includeFacet facetName="<%=WokoFacets.navBar%>" targetObject="${layout.facetContext.targetObject}"/>
</ul>


<%-- Display user/connexion info --%>
<p class="navbar-text pull-right">
<c:if test="${skipLoginLink==null}">
<c:choose>
<c:when test="${username != null}">
<strong>${username}</strong> -
<a href="${cp}/logout"><fmt:message bundle="${wokoBundle}" key="woko.layout.logout"/> </a>
</c:when>
<c:otherwise>
<fmt:message bundle="${wokoBundle}" key="woko.layout.notLogged"/>
<a href="${cp}/login"><fmt:message bundle="${wokoBundle}" key="woko.layout.login"/> </a>
</c:otherwise>
</c:choose>
</c:if>
</p>

<%-- Display the search input only for connected user --%>
<c:if test="${not empty username}">
<s:form action="/search" class="navbar-form pull-right" style="margin-right: 8px; height: 40px;">
<fmt:message bundle="${wokoBundle}" key="search" var="ph"/>
<s:text name="facet.query" class="search-query input-medium" placeholder="${ph}"/>
</s:form>
<a class="navbar-brand" href="${cp}/home">${layout.appTitle}</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<w:includeFacet facetName="<%=WokoFacets.navBar%>" targetObject="${layout.facetContext.targetObject}"/>
</ul>
<%-- Display user/connexion info --%>
<p class="navbar-text pull-right">
<c:if test="${skipLoginLink==null}">
<c:choose>
<c:when test="${username != null}">
<strong>${username}</strong> -
<a href="${cp}/logout"><fmt:message bundle="${wokoBundle}" key="woko.layout.logout"/> </a>
</c:when>
<c:otherwise>
<fmt:message bundle="${wokoBundle}" key="woko.layout.notLogged"/>
<a href="${cp}/login"><fmt:message bundle="${wokoBundle}" key="woko.layout.login"/> </a>
</c:otherwise>
</c:choose>
</c:if>

</div>
</p>

<%-- Display the search input only for connected user --%>
<c:if test="${not empty username}">
<s:form action="/search" class="navbar-form pull-right" style="margin-right: 8px; height: 40px;">
<fmt:message bundle="${wokoBundle}" key="search" var="ph"/>
<s:text name="facet.query" class="search-query input-medium" placeholder="${ph}"/>
</s:form>
</c:if>
</div>
</div>
</div>

<%-- messages/errors --%>
<s:messages/>
<s:errors/>

<%-- Main content --%>
<div class="main-content">
<div class="container">
<div class="row-fluid">
<s:messages/>
</div>
<div class="row-fluid">
<s:errors/>
</div>
<s:layout-component name="body"/>
</div>
<div class="container">
<s:layout-component name="body"/>
</div>

<%-- Needed by the Sticky footer--%>
<div id="push"></div>

</div>

<footer>
<div class="container">
<div class="pull-right">
<div id="footer">
<div class="container">
Powered by
<a href="http://www.pojosontheweb.com">
<img src="${cp}/woko/woko-logo-small.png?${cacheTokenParams}" alt="logo" height="24px"/>
</a>
</div>
</div>
</footer>

</body>
</html>
Expand Down
36 changes: 17 additions & 19 deletions webresources/bootstrap3/src/main/webapp/WEB-INF/woko/jsp/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,24 @@
<s:layout-render name="${layout.layoutPath}" layout="${layout}" pageTitle="${pageTitle}" skipLoginLink="true">
<s:layout-component name="body">

<h1 class="page-header"><fmt:message bundle="${wokoBundle}" key="woko.login.title"/></h1>
<s:form beanclass="<%=WokoLogin.class%>" class="form-horizontal">
<h1 class="page-header">
<fmt:message bundle="${wokoBundle}" key="woko.login.title"/>
</h1>

<s:form beanclass="<%=WokoLogin.class%>" class="form-horizontal" role="form">
<s:hidden name="targetUrl"/>
<fieldset>
<div class="control-group">
<s:label for="user.username" class="control-label"/>
<div class="controls">
<s:text name="username" id="username"/>
</div>
</div>
<div class="control-group">
<s:label for="user.password" class="control-label"/>
<div class="controls">
<s:password name="password" id="password"/>
</div>
</div>
<div class="form-actions">
<s:submit class="btn btn-primary btn-large" name="login"/>
</div>
</fieldset>

<div class="form-group">
<s:label for="user.username" class="control-label"/>
<s:text name="username" id="username"/>
</div>

<div class="form-group">
<s:label for="user.password" class="control-label"/>
<s:password name="password" id="password"/>
</div>

<s:submit class="btn btn-primary btn-large" name="login"/>
</s:form>

</s:layout-component>
Expand Down
8 changes: 8 additions & 0 deletions webresources/bootstrap3/src/main/webapp/css/woko.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}

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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

35 changes: 16 additions & 19 deletions webresources/bootstrap3/src/main/webapp/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,22 @@
<s:layout-render name="${layout.layoutPath}" layout="${layout}" pageTitle="${pageTitle}" skipLoginLink="true">
<s:layout-component name="body">

<h1 class="page-header"><fmt:message bundle="${wokoBundle}" key="woko.login.title"/></h1>
<form method="POST" action="j_security_check" class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="username"><fmt:message bundle="${wokoBundle}" key="user.username"/></label>
<div class="controls">
<input type="text" name="j_username" id="username"/>
</div>
</div>
<div class="control-group">
<label class="control-label" for="password"><fmt:message bundle="${wokoBundle}" key="user.password"/></label>
<div class="controls">
<input type="password" name="j_password" id="password"/>
</div>
</div>
<div class="form-actions">
<button name="login" class="btn btn-primary btn-large" type="submit"><fmt:message bundle="${wokoBundle}" key="login"/></button>
</div>
</fieldset>
<h1 class="page-header">
<fmt:message bundle="${wokoBundle}" key="woko.login.title"/>
</h1>

<form method="POST" action="j_security_check" role="form">
<div class="form-group">
<label for="username"><fmt:message bundle="${wokoBundle}" key="user.username"/></label>
<input type="text" name="j_username" id="username" class="form-control"/>
</div>
<div class="form-group">
<label for="password"><fmt:message bundle="${wokoBundle}" key="user.password"/></label>
<input type="password" name="j_password" id="password" class="form-control"/>
</div>
<button name="login" type="submit" class="btn btn-primary">
<fmt:message bundle="${wokoBundle}" key="login"/>
</button>
</form>

</s:layout-component>
Expand Down
Loading

0 comments on commit e7e13ae

Please sign in to comment.