--- a/server/pom.xml Fri Apr 05 19:33:39 2013 +0200
+++ b/server/pom.xml Mon Apr 08 01:20:47 2013 +0200
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.iri_research.renkan</groupId>
<artifactId>renkan</artifactId>
- <version>0.6.1</version>
+ <version>0.6.2</version>
<packaging>war</packaging>
<properties>
@@ -17,6 +17,7 @@
<jetty-version>8.1.10.v20130312</jetty-version>
<junit-version>4.10</junit-version>
<thymeleaf-version>2.0.16</thymeleaf-version>
+ <thymeleaf-springsecurity-version>2.0.0</thymeleaf-springsecurity-version>
<cometd-version>2.5.1</cometd-version>
<jackson-version>2.1.4</jackson-version>
<joda-version>2.1</joda-version>
@@ -308,6 +309,11 @@
<version>${thymeleaf-version}</version>
</dependency>
<dependency>
+ <groupId>org.thymeleaf.extras</groupId>
+ <artifactId>thymeleaf-extras-springsecurity3</artifactId>
+ <version>${thymeleaf-springsecurity-version}</version>
+ </dependency>
+ <dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.16</version>
@@ -368,6 +374,16 @@
<version>${spring-security-version}</version>
</dependency>
<dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-acl</artifactId>
+ <version>${spring-security-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-taglibs</artifactId>
+ <version>${spring-security-version}</version>
+ </dependency>
+ <dependency>
<groupId>de.undercouch</groupId>
<artifactId>bson4jackson</artifactId>
<version>2.1.1</version>
--- a/server/src/main/java/org/iri_research/renkan/Constants.java Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/java/org/iri_research/renkan/Constants.java Mon Apr 08 01:20:47 2013 +0200
@@ -20,7 +20,7 @@
{
add("0");
add("6");
- add("1");
+ add("2");
add("final");
add("0");
}
--- a/server/src/main/java/org/iri_research/renkan/controller/AdminController.java Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/java/org/iri_research/renkan/controller/AdminController.java Mon Apr 08 01:20:47 2013 +0200
@@ -42,7 +42,6 @@
private final Logger logger = LoggerFactory.getLogger(AdminController.class);
-
@Autowired
private SpacesRepository spacesRepository;
@Autowired
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/java/org/iri_research/renkan/controller/AuthController.java Mon Apr 08 01:20:47 2013 +0200
@@ -0,0 +1,30 @@
+package org.iri_research.renkan.controller;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Controller
+@RequestMapping("/auth")
+public class AuthController {
+
+ @SuppressWarnings("unused")
+ private final Logger logger = LoggerFactory.getLogger(AuthController.class);
+
+ @RequestMapping(value="/login", method = RequestMethod.GET, produces={"text/html;charset=UTF-8"})
+ public String login() {
+ return "auth/login";
+ }
+
+ @RequestMapping(value="/loginfailed", method = RequestMethod.GET, produces={"text/html;charset=UTF-8"})
+ public String loginFailed(Model model) {
+
+ model.addAttribute("login_error", true);
+ return "auth/login";
+ }
+
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/java/org/iri_research/renkan/utils/RenkanLogger.java Mon Apr 08 01:20:47 2013 +0200
@@ -0,0 +1,15 @@
+package org.iri_research.renkan.utils;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Retention(RUNTIME)
+@Target(FIELD)
+@Documented
+public @interface RenkanLogger {
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/java/org/iri_research/renkan/utils/RenkanLoggerInjector.java Mon Apr 08 01:20:47 2013 +0200
@@ -0,0 +1,39 @@
+package org.iri_research.renkan.utils;
+
+import java.lang.reflect.Field;
+
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ReflectionUtils;
+
+import static org.springframework.util.ReflectionUtils.FieldCallback;
+
+@Component
+public class RenkanLoggerInjector implements BeanPostProcessor {
+
+ @Override
+ public Object postProcessBeforeInitialization(final Object bean,
+ String beanName) throws BeansException {
+ ReflectionUtils.doWithFields(bean.getClass(), new FieldCallback() {
+ public void doWith(Field field) throws IllegalArgumentException,
+ IllegalAccessException {
+ // make the field accessible if defined private
+ ReflectionUtils.makeAccessible(field);
+ if (field.getAnnotation(RenkanLogger.class) != null) {
+ org.slf4j.Logger logger = LoggerFactory.getLogger(bean
+ .getClass());
+ field.set(bean, logger);
+ }
+ }
+ });
+ return bean;
+ }
+
+ @Override
+ public Object postProcessAfterInitialization(Object bean, String beanName)
+ throws BeansException {
+ return bean;
+ }
+}
\ No newline at end of file
--- a/server/src/main/webapp/WEB-INF/applicationContext.xml Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/applicationContext.xml Mon Apr 08 01:20:47 2013 +0200
@@ -54,6 +54,7 @@
<!-- Loads MongoDB configuraton -->
<import resource="mongo-config.xml"/>
+ <import resource="spring-security.xml"/>
<bean id="springConfigurer"
class="org.iri_research.renkan.coweb.SpringConfigurer"
@@ -81,5 +82,16 @@
</bean>
</mvc:argument-resolvers>
</mvc:annotation-driven-->
+ <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
+ <property name="basenames">
+ <list>
+ <value>WEB-INF/i18n/messages</value>
+ <value>classpath:org/springframework/security/messages</value>
+ </list>
+ </property>
+ <property name="defaultEncoding" value="UTF-8"/>
+ <property name="fallbackToSystemLocale" value="true" />
+ </bean>
+
</beans>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/webapp/WEB-INF/i18n/messages.properties Mon Apr 08 01:20:47 2013 +0200
@@ -0,0 +1,82 @@
+
+date.format = yyyy/MM/dd HH:mm
+question.yes = yes
+question.no = no
+
+renkanIndex.renkan_exp = Create a Renkan
+renkanIndex.project_list = Renkan list
+renkanIndex.project_name = Name
+renkanIndex.project_creation = Creation
+renkanIndex.project_updated = Updated
+renkanIndex.project_edit = Edit
+renkanIndex.project_copy = Copy
+renkanIndex.project_delete = Delete
+renkanIndex.project_render = View
+renkanIndex.project_edit_link = Edit renkan
+renkanIndex.project_copy_link = Copy renkan
+renkanIndex.project_delete_link = Delete renkan
+renkanIndex.project_render_link = View renkan
+renkanIndex.project_delete_confirm = Delete renkan "<%= title %>" ?
+renkanIndex.project_filter = Filter title
+
+renkanIndex.space_exp = Create a space
+renkanIndex.renkan_spaces = Renkan Spaces
+renkanIndex.renkan_space = Renkan Space
+renkanIndex.space_list = Space list
+renkanIndex.space_name = Name
+renkanIndex.space_title = Title
+renkanIndex.space_creation = Creation date
+renkanIndex.space_open = Open
+renkanIndex.space_open_link = Open space
+renkanIndex.space_proj_count = Renkan count
+
+
+renkanIndex.js.empty_name_error = Please enter a title
+
+renkanAdmin.renkan_admin = Renkan administration
+renkanAdmin.site_admin = Site administration
+
+renkanAdmin.object = Object
+renkanAdmin.object_list = {0} list
+
+renkanAdmin.space_objects_name = Spaces
+renkanAdmin.space_object_name = Spaces
+
+renkanAdmin.space_add = Add space
+renkanAdmin.space_edit = Edit space
+renkanAdmin.space_delete = Delete space
+renkanIndex.space_url = Url
+renkanAdmin.space_confirm_delete = Do you want to delete the space entitled "{0}" ?
+
+renkanAdmin.object_name = Name
+renkanAdmin.object_edit = Edit
+renkanAdmin.object_delete = Delete
+renkanAdmin.object_edit_link = Edit
+renkanAdmin.object_delete_link = Del.
+
+renkanAdmin.form.title = Title
+renkanAdmin.form.uri = URI
+renkanAdmin.form.description = Description
+renkanAdmin.form.color = Color
+renkanAdmin.form.space.bin_config = Bin config
+renkanAdmin.form.space.submit = Ok
+renkanAdmin.form.space.cancel = Cancel
+renkanAdmin.form.space.format = Format
+renkanAdmin.form.space.compact = Compact
+
+renkan.error.title.empty = Title must not be empty or null
+renkan.error.bin_config.json = bin config field must contain a valid json
+
+renkanAuth.log_in = Log in
+renkanAuth.username_label = Username:
+renkanAuth.password_label = Password:
+renkanAuth.renkan_login = Renkan Authentication
+renkanAdmin.site_login = Site Authentication
+renkanAuth.login_error_message = Your login attempt was not successful, try again.
+renkanAuth.login_error_cause = Cause:
+
+renkanHeader.login = login
+renkanHeader.logout = logout
+renkanHeader.admin = admin
+renkanHeader.home = home
+
--- a/server/src/main/webapp/WEB-INF/i18n/messages_en.properties Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/i18n/messages_en.properties Mon Apr 08 01:20:47 2013 +0200
@@ -66,3 +66,16 @@
renkan.error.title.empty = Title must not be empty or null
renkan.error.bin_config.json = bin config field must contain a valid json
+
+renkanAuth.log_in = Log in
+renkanAuth.username_label = Username:
+renkanAuth.password_label = Password:
+renkanAuth.renkan_login = Renkan Authentication
+renkanAdmin.site_login = Site Authentication
+renkanAuth.login_error_message = Your login attempt was not successful, try again.
+renkanAuth.login_error_cause = Cause:
+
+renkanHeader.login = login
+renkanHeader.logout = logout
+renkanHeader.admin = admin
+renkanHeader.home = home
--- a/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties Mon Apr 08 01:20:47 2013 +0200
@@ -33,6 +33,7 @@
renkanIndex.js.empty_name_error = Veuillez entrer un titre
+
renkanAdmin.renkan_admin = Administration Renkan
renkanAdmin.site_admin = Administration site
@@ -63,4 +64,17 @@
renkanAdmin.form.space.compact = Compacter
renkan.error.title.empty = Le champ titre ne doit pas être vide
-renkan.error.bin_config.json = le champ bin config doit contenir un json valide
\ No newline at end of file
+renkan.error.bin_config.json = le champ bin config doit contenir un json valide
+
+renkanAuth.log_in = Connection
+renkanAuth.username = Identifiant :
+renkanAuth.password = Mot de passe :
+renkanAuth.renkan_login = Renkan Authentification
+renkanAdmin.site_login = Site Authentification
+renkanAuth.login_error_message = Votre tentative de connexion a échoué, veuillez recommencer.
+renkanAuth.login_error_cause = Raison :
+
+renkanHeader.login = connexion
+renkanHeader.logout = déconnexion
+renkanHeader.admin = administration
+renkanHeader.home = accueil
--- a/server/src/main/webapp/WEB-INF/spring-security.xml Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/spring-security.xml Mon Apr 08 01:20:47 2013 +0200
@@ -29,10 +29,11 @@
<property name="IgnoreResourceNotFound" value="true"/>
</bean>
- <security:http>
- <security:intercept-url pattern="/admin" access="ROLE_ADMIN" />
- <security:intercept-url pattern="/admin/*" access="ROLE_ADMIN" />
- <security:http-basic />
+ <security:http auto-config="true" use-expressions="true">
+ <security:intercept-url pattern="/admin" access="hasRole('ROLE_ADMIN')" />
+ <security:intercept-url pattern="/admin/*" access="hasRole('ROLE_ADMIN')" />
+ <security:form-login login-page="/auth/login" authentication-failure-url="/auth/loginfailed" password-parameter="password" username-parameter="username" />
+ <security:logout />
</security:http>
<security:authentication-manager>
--- a/server/src/main/webapp/WEB-INF/spring-servlet.xml Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/spring-servlet.xml Mon Apr 08 01:20:47 2013 +0200
@@ -53,6 +53,11 @@
<bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
+ <property name="additionalDialects">
+ <set>
+ <bean class="org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect"/>
+ </set>
+ </property>
</bean>
<bean class="org.thymeleaf.spring3.view.ThymeleafViewResolver">
@@ -63,10 +68,5 @@
<property name="redirectHttp10Compatible" value="false" />
</bean>
- <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
- <property name="basenames" value="WEB-INF/i18n/messages"/>
- <property name="defaultEncoding" value="UTF-8"/>
- <property name="fallbackToSystemLocale" value="true" />
- </bean>
</beans>
\ No newline at end of file
--- a/server/src/main/webapp/WEB-INF/templates/admin/adminIndex.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/admin/adminIndex.html Mon Apr 08 01:20:47 2013 +0200
@@ -16,8 +16,10 @@
</head>
<body>
<div id="container">
- <div id="wrapper">
- <h1 th:text="#{renkanAdmin.renkan_admin}">Renkan administration</h1>
+ <div id="wrapper" th:with="headerTitle=#{renkanAdmin.renkan_admin}">
+ <header id="header" th:include="fragment/pageFragment :: headerFragment">
+ <h1 th:text="#{renkanAdmin.renkan_admin}">Renkan administration</h1>
+ </header>
<h2 th:text="#{renkanAdmin.site_admin}">Site administration</h2>
<table id="object_list">
<thead>
--- a/server/src/main/webapp/WEB-INF/templates/admin/spaceDeleteConfirm.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/admin/spaceDeleteConfirm.html Mon Apr 08 01:20:47 2013 +0200
@@ -17,7 +17,10 @@
<body>
<div id="container">
<div id="wrapper">
- <h1><a href="renkanIndex.html" th:href="@{/admin}" th:text="#{renkanAdmin.renkan_admin}" id="home-link">Renkan administration</a></h1>
+ <header id="header">
+ <h1><a href="renkanIndex.html" th:href="@{/admin}" th:text="#{renkanAdmin.renkan_admin}" id="home-link">Renkan administration</a></h1>
+ <div id="headerNav" th:include="fragment/pageFragment :: headerNavFragment"></div>
+ </header>
<h2><a href="spacesList.html" th:href="@{/admin/spaces}" th:text="#{renkanAdmin.object_list(#{renkanAdmin.space_objects_name})}">Spaces List</a> / <span th:text="#{renkanAdmin.space_delete}">Delete space</span></h2>
<div id="space-delete-container">
<div id="space-delete-question" th:text="#{renkanAdmin.space_confirm_delete(${spaceObj.title})}">Do you want to delete space with title</div>
--- a/server/src/main/webapp/WEB-INF/templates/admin/spaceEdit.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/admin/spaceEdit.html Mon Apr 08 01:20:47 2013 +0200
@@ -21,9 +21,12 @@
<body>
<div id="container">
<div id="wrapper">
- <h1><a href="renkanIndex.html" th:href="@{/admin}" th:text="#{renkanAdmin.renkan_admin}" id="home-link">Renkan administration</a></h1>
+ <header id="header">
+ <h1><a href="renkanIndex.html" th:href="@{/admin}" th:text="#{renkanAdmin.renkan_admin}" id="home-link">Renkan administration</a></h1>
+ <div id="headerNav" th:include="fragment/pageFragment :: headerNavFragment"></div>
+ </header>
<h2><a href="spacesList.html" th:href="@{/admin/spaces}" th:text="#{renkanAdmin.object_list(#{renkanAdmin.space_objects_name})}">Spaces List</a> / <span th:text="#{renkanAdmin.space_edit}">Edit space</span></h2>
- <div th:include="fragment/spaceForm::spaceFormFragment" id="space-form-container">
+ <div th:include="fragment/spaceForm::spaceFormFragment" id="inner-container">
</div>
</div>
<footer id="footer" th:substituteby="fragment/pageFragment::footerFragment">
--- a/server/src/main/webapp/WEB-INF/templates/admin/spacesList.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/admin/spacesList.html Mon Apr 08 01:20:47 2013 +0200
@@ -17,7 +17,10 @@
<body>
<div id="container">
<div id="wrapper">
- <h1><a href="renkanIndex.html" th:href="@{/admin}" th:text="#{renkanAdmin.renkan_admin}" id="home-link">Renkan administration</a></h1>
+ <header id="header">
+ <h1><a href="renkanIndex.html" th:href="@{/admin}" th:text="#{renkanAdmin.renkan_admin}" id="home-link">Renkan administration</a></h1>
+ <div id="headerNav" th:include="fragment/pageFragment :: headerNavFragment"></div>
+ </header>
<h2 th:text="#{renkanAdmin.object_list(#{renkanAdmin.space_objects_name})}">List of objects</h2>
<div th:include="fragment/paginationFragment :: paginationFragment" class="pagination-container">
<div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/webapp/WEB-INF/templates/auth/login.html Mon Apr 08 01:20:47 2013 +0200
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
+ <head>
+ <title>Renkan Auth Login</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta charset="utf-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
+
+ <link rel="shortcut icon" href="../../../static/img/favicon.ico" th:href="@{/static/img/favicon.ico}" />
+
+ <link href="../../../static/css/style.css" rel="stylesheet" th:href="@{/static/css/style.css}"/>
+ <link href="../../../static/css/index.css" rel="stylesheet" th:href="@{/static/css/index.css}"/>
+
+ <script th:remove="all" type="text/javascript" src="../../../static/lib/jquery.min.js"></script>
+ <script th:remove="all" type="text/javascript" src="../../../static/js/thymol.js"></script>
+ </head>
+ <body>
+ <div id="container">
+ <div id="wrapper">
+ <header id="header">
+ <h1><a href="../renkanIndex.html" id="home-link" th:href="@{/}" th:text="#{renkanAuth.renkan_login}">Renkan login</a></h1>
+ <div id="header-clear"></div>
+ </header>
+ <h2 th:text="#{renkanAdmin.site_login}">Site login</h2>
+ <div id="inner-container">
+ <div id="login-errors" th:if="${login_error}">
+ <div th:text="#{renkanAuth.login_error_message}">Your login attempt was not successful, try again.</div>
+ <div th:if="${session} and ${session.containsKey('SPRING_SECURITY_LAST_EXCEPTION')}"><span th:text="#{renkanAuth.login_error_cause}">Cause: </span> <span th:text="${session['SPRING_SECURITY_LAST_EXCEPTION'].message}">Cause of login error</span></div>
+ </div>
+ <form action="#" th:action="@{/j_spring_security_check}" method="post" id="login-form">
+ <fieldset id="login-fieldset" class="form-fields">
+ <div>
+ <label for="username" th:text="#{renkanAuth.username_label}">username:</label>
+ <input type="text" id="username" name="username"/>
+ </div>
+ <div>
+ <label for="password" th:text="#{renkanAuth.password_label}">password:</label>
+ <input type="password" name="password" id="password"/>
+ </div>
+ <input type="submit" value="log in" th:value="#{renkanAuth.log_in}"/>
+ </fieldset>
+ </form>
+ </div>
+ </div>
+ <footer id="footer" th:substituteby="fragment/pageFragment::footerFragment">
+ <div id="version">© <span class="version-date">2013</span> <a href="http://www.iri.centrepompidou.fr" target="_blanck">IRI</a> - Version <span class="version-version">0.0</span></div>
+ </footer>
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- a/server/src/main/webapp/WEB-INF/templates/fragment/pageFragment.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/fragment/pageFragment.html Mon Apr 08 01:20:47 2013 +0200
@@ -1,11 +1,25 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:th="http://www.thymeleaf.org">
+ xmlns:th="http://www.thymeleaf.org"
+ xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="utf-8" />
<title>pagination fragment</title>
</head>
<body>
+ <header id="header" th:fragment="headerFragment" >
+ <h1 th:utext="${headerTitle}">Renkan</h1>
+ <div id="header-nav" th:fragment="headerNavFragment">
+ <div sec:authorize="isAnonymous()" class="header-nav"><a href="auth/login.html" th:href="@{/auth/login}" th:text="#{renkanHeader.login}">login</a></div>
+ <div sec:authorize="isAuthenticated()" class="header-nav">
+ <img src="../../../static/img/user.png" th:src="@{/static/img/user.png}" id="header-nav-user-avatar"/><span sec:authentication="name">username</span> |
+ <a sec:authorize="hasRole('ROLE_USER')" href="" th:href="@{/}" th:text="#{renkanHeader.home}">home</a> |
+ <a sec:authorize="hasRole('ROLE_ADMIN')" href="admin/adminIndex.html" th:href="@{/admin}" th:text="#{renkanHeader.admin}">admin</a> |
+ <a href="renkanIndex.html" th:href="@{/j_spring_security_logout}" th:text="#{renkanHeader.logout}">logout</a>
+ </div>
+ <div id="header-clear"></div>
+ </div>
+ </header>
<footer id="footer" th:fragment="footerFragment" >
<div id="version">© <span th:text="${#dates.year(#dates.createNow())}" class="version-date">2013</span> <a href="http://www.iri.centrepompidou.fr" target="_blank">IRI</a> - Version <span th:text="${T(org.iri_research.renkan.Constants).version}" class="version-version">0.0a</span></div>
</footer>
--- a/server/src/main/webapp/WEB-INF/templates/fragment/spaceForm.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/fragment/spaceForm.html Mon Apr 08 01:20:47 2013 +0200
@@ -1,10 +1,9 @@
<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:th="http://www.thymeleaf.org">
-<head>
-<meta charset="utf-8"/>
-<title>Space form</title>
-</head>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
+ <head>
+ <meta charset="utf-8"/>
+ <title>Space form</title>
+ </head>
<body>
<div id="spaceForm" th:fragment="spaceFormFragment" >
<script type="text/javascript" th:inline="javascript">
--- a/server/src/main/webapp/WEB-INF/templates/projectIndex.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/projectIndex.html Mon Apr 08 01:20:47 2013 +0200
@@ -1,4 +1,4 @@
-<!doctype html>
+<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
<head>
<title>Renkan</title>
@@ -22,7 +22,10 @@
<body>
<div id="container">
<div id="wrapper">
- <h1><a href="renkanIndex.html" th:href="@{'/'}" id="home-link" th:text="#{renkanIndex.renkan_space}">Renkan Space</a>: <span th:text="${space.title}">Titre</span></h1>
+ <header id="header">
+ <h1><a href="renkanIndex.html" th:href="@{'/'}" id="home-link" th:text="#{renkanIndex.renkan_space}">Renkan Space</a>: <span th:text="${space.title}">Titre</span></h1>
+ <div id="headerNav" th:include="fragment/pageFragment :: headerNavFragment"></div>
+ </header>
<div id="inner">
<div id="label" class="translate" th:text="#{renkanIndex.renkan_exp}">Create a Renkan</div>
<form action="#" onsubmit="go2Title();return false;">
--- a/server/src/main/webapp/WEB-INF/templates/renkanIndex.html Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/renkanIndex.html Mon Apr 08 01:20:47 2013 +0200
@@ -1,4 +1,4 @@
-<!doctype html>
+<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
<head>
<title>Renkan</title>
@@ -21,8 +21,10 @@
</head>
<body>
<div id="container">
- <div id="wrapper">
- <h1 th:text="#{renkanIndex.renkan_spaces}">Renkan Spaces</h1>
+ <div id="wrapper" th:with="headerTitle=#{renkanIndex.renkan_spaces}">
+ <header id="header" th:include="fragment/pageFragment :: headerFragment">
+ <h1 th:text="#{renkanIndex.renkan_spaces}">Renkan Spaces</h1>
+ </header>
<div id="inner">
<div id="label" class="translate" th:text="#{renkanIndex.space_exp}">Create a Space</div>
<form action="#" onsubmit="go2Title();return false;">
--- a/server/src/main/webapp/WEB-INF/web.xml Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/web.xml Mon Apr 08 01:20:47 2013 +0200
@@ -13,7 +13,7 @@
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
- <param-value>/WEB-INF/applicationContext.xml, /WEB-INF/spring-security.xml</param-value>
+ <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<servlet>
<servlet-name>cometd</servlet-name>
--- a/server/src/main/webapp/static/css/index.css Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/main/webapp/static/css/index.css Mon Apr 08 01:20:47 2013 +0200
@@ -13,7 +13,7 @@
margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; background: #F6F6F6; color: #333333;
}
h1 {
- margin-bottom: 5px; padding: 15px; border-bottom: 2px solid #ffffff; background: #333333; color: #ffffff;
+ margin-bottom: 5px; padding: 15px; background: #333333; color: #ffffff;
font-weight: bold; font-size: 30px;
}
h2 {
@@ -77,6 +77,42 @@
padding-bottom: 1em; /* bottom padding for footer */
}
+header#header {
+ border-bottom: 2px solid #ffffff; background: #333333; color: #ffffff;
+ font-weight: bold; font-size: 30px;
+}
+
+header h1 {
+ float:left;
+}
+
+header #header-clear {
+ clear: both;
+}
+
+header .header-nav {
+ background: #333333; color: #ffffff;
+ float: right;
+ font-weight: normal; font-size: 15px;
+ margin-bottom: 5px; padding: 15px;
+ text-align: right;
+}
+
+
+header .header-nav a, header .header-nav a:ACTIVE, header .header-nav a:LINK, header .header-nav a:VISITED {
+ color: #ffffff;
+ text-decoration: none;
+}
+
+header .header-nav a:HOVER {
+ color: #ffffff;
+ text-decoration: underline;
+}
+
+#header-nav-user-avatar {
+ margin: 0 5px 2px 0;
+}
+
footer#footer {
position:absolute;
bottom:0;
@@ -238,10 +274,6 @@
}
-#space-form-container {
- margin: 12px 0px 0px 15px;
-}
-
.form-fields div {
margin-bottom: 12px;
}
@@ -333,3 +365,20 @@
.proj-sort-asc-col {
background: url("../img/sort_arrows.png") 0 -33px;
}
+
+#inner-container {
+ margin: 12px 0px 0px 15px;
+}
+
+#login-errors {
+ color: #ff0000;
+ border: 1px solid #ff0000;
+ padding: 8px;
+ margin: 16px 16px 32px;
+ width: inherit;
+ float: left;
+}
+
+#login-form {
+ clear: both;
+}
Binary file server/src/main/webapp/static/img/user.png has changed
--- a/server/src/test/resources/org/iri_research/renkan/test/controller/controller-context.xml Fri Apr 05 19:33:39 2013 +0200
+++ b/server/src/test/resources/org/iri_research/renkan/test/controller/controller-context.xml Mon Apr 08 01:20:47 2013 +0200
@@ -24,5 +24,16 @@
For example @Controller and @Service. Make sure to set the correct base-package-->
<context:component-scan base-package="org.iri_research.renkan.rest" />
<context:component-scan base-package="org.iri_research.renkan.coweb" />
+
+ <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
+ <property name="basenames">
+ <list>
+ <value>WEB-INF/i18n/messages</value>
+ <value>classpath:org/springframework/security/messages</value>
+ </list>
+ </property>
+ <property name="defaultEncoding" value="UTF-8"/>
+ <property name="fallbackToSystemLocale" value="true" />
+ </bean>
</beans>
\ No newline at end of file