From e1fee1a4c337488d87267977d584c2f3c56abd34 Mon Sep 17 00:00:00 2001 From: "Parth Gajjar (Open ERP)" Date: Thu, 27 Mar 2014 16:46:12 +0530 Subject: [PATCH] [IMP] improved dialog bzr revid: pga@tinyerp.com-20140327111612-g0cukmzw4kripewq --- .../website_gengo/static/src/js/website_gengo.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/website_gengo/static/src/js/website_gengo.js b/addons/website_gengo/static/src/js/website_gengo.js index ea226ab2083..08cfe026500 100644 --- a/addons/website_gengo/static/src/js/website_gengo.js +++ b/addons/website_gengo/static/src/js/website_gengo.js @@ -118,6 +118,20 @@ 'hidden.bs.modal': 'destroy', }), template: 'website.GengoTranslatorStatisticDialog', + init:function(res){ + var self = this; + this.inprogess = 0; + this.new_words = 0; + this.done = res.done; + $('.oe_translatable_todo').each(function () { + self.new_words += $(this).text().trim().replace(/ +/g," ").split(" ").length; + }); + $('.oe_translatable_inprogress').each(function () { + self.inprogess += $(this).text().trim().replace(/ +/g," ").split(" ").length; + }); + this.total = this.done + this.inprogess; + return this._super.apply(this, arguments); + }, start: function (res) { this.$el.modal(this.res); },