From 94cfb866d018b9fc1439eda5fb8544a75efae218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Dahlgren?= Date: Mon, 7 Apr 2014 01:46:06 +0200 Subject: [PATCH] Change type in settings --- public/js/app/forms/settings.js | 20 ++++++++++++-------- public/js/app/models/settings.js | 11 ++++++----- public/js/tpl/forms/settings.html | 24 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/public/js/app/forms/settings.js b/public/js/app/forms/settings.js index 1fb6ff7..6caa597 100644 --- a/public/js/app/forms/settings.js +++ b/public/js/app/forms/settings.js @@ -1,7 +1,7 @@ define(function (require) { - + "use strict"; - + var $ = require('jquery'), _ = require('underscore'), Backbone = require('backbone'), @@ -9,10 +9,10 @@ define(function (require) { FormView = require('marionette-formview'), Settings = require('app/models/settings'), tpl = require('text!tpl/forms/settings.html'); - + return FormView.extend({ template: _.template(tpl), - + fields: { path: { el: ".path", @@ -20,9 +20,13 @@ define(function (require) { validations: { email: "Please enter a valid path." } - } + }, + type: { + el: ".type", + required: "Please choose a valid type." + }, }, - + initialize: function () { var self = this; new Settings().fetch({success: function (model, response, options) { @@ -31,5 +35,5 @@ define(function (require) { }}); } }); - -}); \ No newline at end of file + +}); diff --git a/public/js/app/models/settings.js b/public/js/app/models/settings.js index 70267f7..936bbba 100644 --- a/public/js/app/models/settings.js +++ b/public/js/app/models/settings.js @@ -1,16 +1,17 @@ define(function (require) { - + "use strict"; - + var $ = require('jquery'), _ = require('underscore'), Backbone = require('backbone'); - + return Backbone.Model.extend({ defaults: { path: '', + type: 'windows', }, urlRoot : '/api/settings' }); - -}); \ No newline at end of file + +}); diff --git a/public/js/tpl/forms/settings.html b/public/js/tpl/forms/settings.html index e689e07..a0614d8 100644 --- a/public/js/tpl/forms/settings.html +++ b/public/js/tpl/forms/settings.html @@ -5,4 +5,28 @@ + +
+ +
+
+ +
+
+ +
+
+ +
+
+