[from now] 2013/04/19 08:28:54

diff --git a/grails-app/conf/ApplicationResources.groovy b/grails-app/conf/ApplicationResources.groovy
index f710da4..71a8121 100644
--- a/grails-app/conf/ApplicationResources.groovy
+++ b/grails-app/conf/ApplicationResources.groovy
@@ -8,5 +8,7 @@ modules = {
         resource url: 'cs/services/user_context.coffee'

         resource url: 'cs/controllers/login.coffee'
+
+        resource url: 'cs/router.coffee'
     }
 }
\ No newline at end of file
diff --git a/grails-app/conf/UrlMappings.groovy b/grails-app/conf/UrlMappings.groovy
index 713febc..8d66a2a 100644
--- a/grails-app/conf/UrlMappings.groovy
+++ b/grails-app/conf/UrlMappings.groovy
@@ -7,7 +7,9 @@ class UrlMappings {
             }
         }

-        "/"(view: "/index")
-        "500"(view: '/error')
+        "/signup" view: "/signup"
+        "/"       view: "/index"
+
+        "500"     view: "/error"
     }
 }
diff --git a/grails-app/views/index.gsp b/grails-app/views/index.gsp
index 85f3793..79e4254 100644
--- a/grails-app/views/index.gsp
+++ b/grails-app/views/index.gsp
@@ -9,6 +9,9 @@

 <g:render template="/login"/>

+<a href="#/signup">singup</a>
+<div ng-view></div>
+
 </body>
 <r:layoutResources/>
 </html>
\ No newline at end of file
diff --git a/grails-app/views/signup.gsp b/grails-app/views/signup.gsp
new file mode 100644
index 0000000..9ec6f7c
--- /dev/null
+++ b/grails-app/views/signup.gsp
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <r:require modules="sayaka"/>
+    <r:layoutResources/>
+</head>
+
+<body ng-app="sayaka" data-base-url="${createLink(uri: '/')}">
+
+xxxx
+</body>
+<r:layoutResources/>
+</html>
\ No newline at end of file
diff --git a/web-app/cs/router.coffee b/web-app/cs/router.coffee
new file mode 100644
index 0000000..dfc1e21
--- /dev/null
+++ b/web-app/cs/router.coffee
@@ -0,0 +1,7 @@
+app = angular.module "sayaka"
+
+app.config ['$routeProvider', ($routeProvider, Url) ->
+  $routeProvider.when('/signup', {templateUrl: '/sayaka/signup'})
+]
+#  $routeProvider.when('/signup', {templateUrl: Url.createUrl.create('/sayaka/signup')})
+#  $routeProvider.when('/phones', {templateUrl: 'partials/phone-list.html',   controller: PhoneListCtrl})
diff --git a/web-app/cs/sayaka.coffee b/web-app/cs/sayaka.coffee
index da976c8..2a2e5f4 100644
--- a/web-app/cs/sayaka.coffee
+++ b/web-app/cs/sayaka.coffee
@@ -1 +1,2 @@
 app = angular.module "sayaka", []
+
[from now] 2013/04/21 17:55:45

diff --git a/grails-app/conf/ApplicationResources.groovy b/grails-app/conf/ApplicationResources.groovy
index 71a8121..5db000d 100644
--- a/grails-app/conf/ApplicationResources.groovy
+++ b/grails-app/conf/ApplicationResources.groovy
@@ -8,6 +8,7 @@ modules = {
         resource url: 'cs/services/user_context.coffee'

         resource url: 'cs/controllers/login.coffee'
+        resource url: 'cs/controllers/signup.coffee'

         resource url: 'cs/router.coffee'
     }
diff --git a/grails-app/conf/UrlMappings.groovy b/grails-app/conf/UrlMappings.groovy
index 8d66a2a..5d6972e 100644
--- a/grails-app/conf/UrlMappings.groovy
+++ b/grails-app/conf/UrlMappings.groovy
@@ -7,9 +7,12 @@ class UrlMappings {
             }
         }

-        "/signup" view: "/signup"
-        "/"       view: "/index"
+        "/signup"(controller: "signup") {
+            action = [GET: "form", POST: "signup"]
+        }
+
+        "/" view: "/index"

-        "500"     view: "/error"
+        "500" view: "/error"
     }
 }
diff --git a/grails-app/controllers/SignupController.groovy b/grails-app/controllers/SignupController.groovy
new file mode 100644
index 0000000..d156492
--- /dev/null
+++ b/grails-app/controllers/SignupController.groovy
@@ -0,0 +1,10 @@
+class SignupController {
+
+    def form() {
+        render view: 'signup'
+    }
+
+    def signup() {
+        render text: "ok!"
+    }
+}
diff --git a/grails-app/views/signup.gsp b/grails-app/views/signup.gsp
deleted file mode 100644
index 9ec6f7c..0000000
--- a/grails-app/views/signup.gsp
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <r:require modules="sayaka"/>
-    <r:layoutResources/>
-</head>
-
-<body ng-app="sayaka" data-base-url="${createLink(uri: '/')}">
-
-xxxx
-</body>
-<r:layoutResources/>
-</html>
\ No newline at end of file
diff --git a/grails-app/views/signup/signup.gsp b/grails-app/views/signup/signup.gsp
new file mode 100644
index 0000000..5c6e579
--- /dev/null
+++ b/grails-app/views/signup/signup.gsp
@@ -0,0 +1,8 @@
+<div ng-controller='SignupCtrl'>
+<form method='post' ng-submit='signup()'>
+    <p>username: <g:textField name="username" ng-model="user.username"/></p>
+    <p>password: <g:passwordField name="password" ng-model="user.password"/></p>
+    <g:submitButton name="signup" value="xxx"/>
+    {{user|json}}
+</form>
+</div>
diff --git a/src/groovy/sayaka/spring/security/SayakaDigestPasswordEncoder.groovy b/src/groovy/sayaka/spring/security/SayakaDigestPasswordEncoder.groovy
index 32597b7..64858c0 100644
--- a/src/groovy/sayaka/spring/security/SayakaDigestPasswordEncoder.groovy
+++ b/src/groovy/sayaka/spring/security/SayakaDigestPasswordEncoder.groovy
@@ -4,7 +4,7 @@ import org.springframework.security.authentication.encoding.MessageDigestPasswor

 class SayakaDigestPasswordEncoder extends MessageDigestPasswordEncoder {
     SayakaDigestPasswordEncoder() {
-        super("SHA-512")
-        iterations = 100
+        super("SHA-256")
+        iterations = 1000
     }
 }
diff --git a/web-app/cs/controllers/signup.coffee b/web-app/cs/controllers/signup.coffee
new file mode 100644
index 0000000..5735e51
--- /dev/null
+++ b/web-app/cs/controllers/signup.coffee
@@ -0,0 +1,7 @@
+app = angular.module "sayaka"
+
+app.controller "SignupCtrl", ($scope, $http, Url) ->
+
+  $scope.signup = ->
+    $http.post(Url.create("signup"), $scope.user) .success ->
+      alert('success')
diff --git a/web-app/cs/router.coffee b/web-app/cs/router.coffee
index dfc1e21..9e352f2 100644
--- a/web-app/cs/router.coffee
+++ b/web-app/cs/router.coffee
@@ -1,7 +1,5 @@
 app = angular.module "sayaka"

-app.config ['$routeProvider', ($routeProvider, Url) ->
+app.config ['$routeProvider', ($routeProvider) ->
   $routeProvider.when('/signup', {templateUrl: '/sayaka/signup'})
 ]
-#  $routeProvider.when('/signup', {templateUrl: Url.createUrl.create('/sayaka/signup')})
-#  $routeProvider.when('/phones', {templateUrl: 'partials/phone-list.html',   controller: PhoneListCtrl})
diff --git a/web-app/cs/services/url.coffee b/web-app/cs/services/url.coffee
index 2c2adcd..8703ed4 100644
--- a/web-app/cs/services/url.coffee
+++ b/web-app/cs/services/url.coffee
@@ -3,4 +3,4 @@ app = angular.module "sayaka"
 app.factory "Url", ->
   baseUrl = angular.element('body').data('base-url')
   create: (path) ->
-    baseUrl + path
\ No newline at end of file
+    baseUrl + path