From 84603d7449118455dfc173df4b57b41922c3e1b4 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 15 Jun 2018 15:41:33 +0900 Subject: [PATCH] Update annotation template --- doccano/app/server/static/annotation.1.js | 16 ++++++++++++++++ doccano/app/server/templates/annotation.1.html | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doccano/app/server/static/annotation.1.js b/doccano/app/server/static/annotation.1.js index 70d37fb0..93715d0b 100644 --- a/doccano/app/server/static/annotation.1.js +++ b/doccano/app/server/static/annotation.1.js @@ -143,6 +143,22 @@ var vm = new Vue({ computed: { done: function () { return this.total - this.remaining + }, + achievement: function () { + if (this.total == 0) { + return 0; + } else { + return (this.total - this.remaining) / this.total * 100 + } + }, + progressColor: function () { + if (this.achievement < 30) { + return 'is-danger' + } else if (this.achievement < 70) { + return 'is-warning' + } else { + return 'is-primary' + } } } }); \ No newline at end of file diff --git a/doccano/app/server/templates/annotation.1.html b/doccano/app/server/templates/annotation.1.html index 15756353..bfc8b29c 100644 --- a/doccano/app/server/templates/annotation.1.html +++ b/doccano/app/server/templates/annotation.1.html @@ -14,7 +14,7 @@