// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
wn.ui.form.Footer = Class.extend({
init: function(opts) {
var me = this;
$.extend(this, opts);
this.make();
this.make_assignments();
this.make_attachments();
this.make_tags();
this.make_comments();
// render-complete
$(this.frm.wrapper).on("render_complete", function() {
me.refresh();
})
},
make: function() {
var me = this;
$("
").css({"border-top":"1px solid #c7c7c7"}).appendTo(this.parent)
this.wrapper = $('')
.appendTo(this.parent);
this.wrapper.find(".btn-save").click(function() {
me.frm.save('Save', null, this);
})
this.help_area = this.wrapper.find(".help-area").get(0);
},
make_tags: function() {
this.frm.tags = new wn.ui.TagEditor({
parent: this.wrapper.find(".tag-area"),
frm: this.frm,
})
},
make_attachments: function() {
this.frm.attachments = new wn.ui.form.Attachments({
parent: this.wrapper.find(".form-attachments"),
frm: this.frm
});
},
make_assignments: function() {
this.frm.assign_to = new wn.ui.form.AssignTo({
parent: this.wrapper.find(".form-assignments"),
frm: this.frm
});
},
make_comments: function() {
this.frm.comments = new wn.ui.form.Comments({
parent: this.wrapper.find(".form-comments"),
frm: this.frm
})
},
refresh: function() {
if(this.frm.doc.__islocal) {
this.parent.addClass("hide");
} else {
this.parent.removeClass("hide");
this.frm.attachments.refresh();
this.frm.comments.refresh();
this.frm.assign_to.refresh();
this.frm.tags.refresh();
}
},
});
'+wn._("Comments")+'
\