Files
Phraseanet/www/scripts/apps/admin/tasks-manager/views/scheduler.js
Florian BLOUET ebaf36f2d2 PHRAS-845 - fix close button
PHRAS-846 - fix admin log view
PHRAS-843 - fix action icons
added white skin
misc fix on skin color handling
replace image icons by fonts icons
2015-12-02 17:35:42 +01:00

64 lines
2.0 KiB
JavaScript

/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
define([
"jquery",
"underscore",
"backbone"
], function ($, _, Backbone) {
var SchedulerView = Backbone.View.extend({
initialize: function () {
this.template = _.template($('#scheduler_template').html());
// render only parts of the model
this.model.on('change:configuration', this.renderConfiguration, this);
this.model.on('change:actual', this.renderActual, this);
this.model.on('change:process-id', this.renderPid, this);
this.model.on('change:name', this.renderName, this);
},
events: {
"click a": "clickAction"
},
tagName: "tr",
render: function () {
this.$el.empty();
this.$el.html(this.template({'scheduler':this.model.toJSON()}));
$('.dropdown-toggle').dropdown();
return this;
},
renderConfiguration: function () {
$(".confScheduler", this.$el).html(this.model.get("configuration"));
return this;
},
renderActual: function () {
$(".actualScheduler", this.$el).html(this.model.get("actual"));
return this;
},
renderPid: function () {
$(".pidScheduler", this.$el).html(this.model.get("process-id"));
return this;
},
renderName: function () {
$(".nameScheduler", this.$el).html(this.model.get("name"));
return this;
},
clickAction: function(e) {
e.preventDefault();
var link = $(e.target);
var url = link.attr('href');
if(url && url.indexOf('#') !== 0) {
// This is defined in admin/index.html.twig
// window.loadRightAjax(url, link.attr("method") || "GET");
}
}
});
return SchedulerView;
});