2014-02-09 03:19:48 +00:00
|
|
|
define(function (require) {
|
2014-04-06 23:46:06 +00:00
|
|
|
|
2014-02-09 03:19:48 +00:00
|
|
|
"use strict";
|
2014-04-06 23:46:06 +00:00
|
|
|
|
2014-02-09 03:19:48 +00:00
|
|
|
var $ = require('jquery'),
|
|
|
|
_ = require('underscore'),
|
|
|
|
Backbone = require('backbone'),
|
|
|
|
Marionette = require('marionette'),
|
|
|
|
FormView = require('marionette-formview'),
|
|
|
|
Settings = require('app/models/settings'),
|
|
|
|
tpl = require('text!tpl/forms/settings.html');
|
2014-04-06 23:46:06 +00:00
|
|
|
|
2014-02-09 03:19:48 +00:00
|
|
|
return FormView.extend({
|
|
|
|
template: _.template(tpl),
|
2014-04-06 23:46:06 +00:00
|
|
|
|
2014-02-09 03:19:48 +00:00
|
|
|
fields: {
|
|
|
|
path: {
|
|
|
|
el: ".path",
|
|
|
|
required: "Please enter a valid path.",
|
|
|
|
validations: {
|
|
|
|
email: "Please enter a valid path."
|
|
|
|
}
|
2014-04-06 23:46:06 +00:00
|
|
|
},
|
|
|
|
type: {
|
|
|
|
el: ".type",
|
|
|
|
required: "Please choose a valid type."
|
|
|
|
},
|
2014-02-09 03:19:48 +00:00
|
|
|
},
|
2014-04-06 23:46:06 +00:00
|
|
|
|
2014-02-09 03:19:48 +00:00
|
|
|
initialize: function () {
|
|
|
|
var self = this;
|
2014-04-06 23:35:37 +00:00
|
|
|
new Settings().fetch({success: function (model, response, options) {
|
|
|
|
self.model = model;
|
|
|
|
self.runInitializers();
|
|
|
|
}});
|
2014-02-09 03:19:48 +00:00
|
|
|
}
|
|
|
|
});
|
2014-04-06 23:46:06 +00:00
|
|
|
|
|
|
|
});
|