summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/account
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/account')
-rw-r--r--StoneIsland/www/js/lib/account/LoginView.js40
-rw-r--r--StoneIsland/www/js/lib/account/LogoutView.js13
-rw-r--r--StoneIsland/www/js/lib/account/OrdersView.js25
-rw-r--r--StoneIsland/www/js/lib/account/SignupView.js60
-rw-r--r--StoneIsland/www/js/lib/account/orders/OrderList.js17
-rw-r--r--StoneIsland/www/js/lib/account/orders/SingleOrder.js18
6 files changed, 59 insertions, 114 deletions
diff --git a/StoneIsland/www/js/lib/account/LoginView.js b/StoneIsland/www/js/lib/account/LoginView.js
deleted file mode 100644
index 8c875ae8..00000000
--- a/StoneIsland/www/js/lib/account/LoginView.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var LoginView = FormView.extend({
-
- el: "#login",
-
- action: sdk.account.login,
-
- events: {
- "click .newuser": "new_user",
- "submit form": "save",
- },
-
- initialize: function(){
- this.$form = this.$("form")
- this.$msg = this.$(".msg")
- this.scroller = new IScroll('#login', app.iscroll_options)
- },
-
- show: function(){
- app.footer.show("SUBMIT", "CANCEL")
- this.$form.get(0).reset()
- this.$msg.html("* Your personal and payment information will always remain private")
- document.body.className = "login"
- },
-
- new_user: function(){
- app.router.go("account/signup")
- },
-
- validate_presence: {
- "Email": "Please enter a valid email address.",
- "Password": "Please enter your password.",
- },
-
- success: function(data){
- },
-
- error: function(data){
- },
-
-})
diff --git a/StoneIsland/www/js/lib/account/LogoutView.js b/StoneIsland/www/js/lib/account/LogoutView.js
deleted file mode 100644
index 62c925eb..00000000
--- a/StoneIsland/www/js/lib/account/LogoutView.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var LogoutView = View.extend({
-
- el: "#logout",
-
- events: {
- },
-
- show: function(){
- document.body.className = "logout"
- app.footer.hide()
- },
-
-}) \ No newline at end of file
diff --git a/StoneIsland/www/js/lib/account/OrdersView.js b/StoneIsland/www/js/lib/account/OrdersView.js
index f269b7cf..66648b36 100644
--- a/StoneIsland/www/js/lib/account/OrdersView.js
+++ b/StoneIsland/www/js/lib/account/OrdersView.js
@@ -1,4 +1,27 @@
-var OrdersView = ScrollableView.extend({
+var OrdersView = View.extend({
+ el: "#orders",
+
+ events: {
+ "click .back": "back"
+ "click .details": "load_single"
+ },
+
+ initialize: function(){
+ this.single = new SingleOrder ()
+ this.list = new OrderList ()
+ },
+
+ show: function(){
+ document.body.className = "orders"
+ this.el.className = "list"
+ },
+
+ load_single: function(){
+ },
+
+ back: function(){
+ this.list.show()
+ },
})
diff --git a/StoneIsland/www/js/lib/account/SignupView.js b/StoneIsland/www/js/lib/account/SignupView.js
deleted file mode 100644
index 123b47a6..00000000
--- a/StoneIsland/www/js/lib/account/SignupView.js
+++ /dev/null
@@ -1,60 +0,0 @@
-var SignupView = FormView.extend({
-
- el: "#signup",
-
- action: sdk.account.login,
-
- events: {
- "submit form": "save",
- },
-
- initialize: function(){
- this.$form = this.$("form")
- this.$msg = this.$(".msg")
- this.scroller = new IScroll('#signup', app.iscroll_options)
- },
-
- show: function(){
- app.footer.show("SUBMIT", "CANCEL")
- this.$form.get(0).reset()
- this.$msg.html("* Your personal and payment information will always remain private")
- document.body.className = "signup"
- },
-
- validate_presence: {
- "Name": "Please enter your first name.",
- "Surname": "Please enter your last name.",
- "Email": "Please enter a valid email address.",
- "ConfirmEmail": "Please enter a valid email address.",
- "Password": "Please enter your password.",
- "Password2": "Please enter your password again.",
- "YooxLetter": "You must agree to data profiling.",
- "DataProfiling": "You must agree to data profiling.",
- },
-
- validate_fields: function(errors){
- if (data.Password !== data.Password2) { errors.push("Password2", "Passwords don't match.") }
- if (data.Email !== data.ConfirmEmail) { errors.push("ConfirmEmail", "Email addresses don't match.") }
- if (! data.YooxLetter) { data.YooxLetter = "false" }
- if (! data.DataProfiling) { data.DataProfiling = "false" }
- },
-
- success: function(data){
- auth.view_logged_in()
- },
-
- error: function(data){
- },
-
-/*
- var new_user_data = {
- "Email": "testit.account" + Math.floor(Math.random() * 10000000) + "@yoox.com",
- "Password": "TestPassword",
- "Gender": "M",
- "Name": "TestName",
- "Surname": "TestSurname",
- "DataProfiling": true,
- }
-*/
-
-}) \ No newline at end of file
diff --git a/StoneIsland/www/js/lib/account/orders/OrderList.js b/StoneIsland/www/js/lib/account/orders/OrderList.js
new file mode 100644
index 00000000..876f609e
--- /dev/null
+++ b/StoneIsland/www/js/lib/account/orders/OrderList.js
@@ -0,0 +1,17 @@
+var OrderList = ScrollableView.extend({
+
+ el: "#order_list",
+
+ template: $("#order_list .template"),
+
+ initialize: function(opt){
+ this.parent = opt.parent
+ this.scroller = new IScroll('#order_list', app.iscroll_options)
+ },
+
+ show: function(){
+ document.body.className = "orders"
+ app.orders.el.className = "list"
+ },
+
+})
diff --git a/StoneIsland/www/js/lib/account/orders/SingleOrder.js b/StoneIsland/www/js/lib/account/orders/SingleOrder.js
new file mode 100644
index 00000000..21416401
--- /dev/null
+++ b/StoneIsland/www/js/lib/account/orders/SingleOrder.js
@@ -0,0 +1,18 @@
+var SingleOrder = ScrollableView.extend({
+
+ el: "#single_order",
+
+ template: $("#single_order .template"),
+
+ initialize: function(opt){
+ this.parent = opt.parent
+ this.scroller = new IScroll('#single_order', app.iscroll_options)
+ },
+
+ show: function(id){
+ document.body.className = "orders"
+ app.orders.el.className = "single"
+ this.deferScrollToTop()
+ },
+
+})