From a0c0f3ff0cc9d1e3b02d100bcd50ee5ced53733c Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 2 Mar 2020 11:06:36 +0100 Subject: [PATCH 1/3] Sort result files --- app/templates/jobs/job.html.j2 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/templates/jobs/job.html.j2 b/app/templates/jobs/job.html.j2 index c4db01b4..d5495967 100644 --- a/app/templates/jobs/job.html.j2 +++ b/app/templates/jobs/job.html.j2 @@ -177,6 +177,7 @@ for (let operation of patch) { /* "/jobId/valueName" -> ["jobId", "valueName"] */ + console.log(operation.value); pathArray = operation.path.split("/").slice(1); if (pathArray[0] != this.jobId) {continue;} switch(operation.op) { @@ -215,9 +216,19 @@ setResults(results) { let resultsElement; - + results.sort(function (a, b) { + var filenameA = a.filename.toUpperCase(); + var filenameB = b.filename.toUpperCase(); + if (filenameA < filenameB) { + return -1; + } + if (filenameA > filenameB) { + return 1; + } + return 0; + }); resultsElement = document.getElementById("results"); - + console.log(results); for (let result of results) { resultsElement.insertAdjacentHTML( "beforeend", From f8524be488c05a0de154d22498750d2a8e52af64 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 2 Mar 2020 11:07:25 +0100 Subject: [PATCH 2/3] Sort result files without log message --- app/templates/jobs/job.html.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/app/templates/jobs/job.html.j2 b/app/templates/jobs/job.html.j2 index d5495967..70a8e935 100644 --- a/app/templates/jobs/job.html.j2 +++ b/app/templates/jobs/job.html.j2 @@ -228,7 +228,6 @@ return 0; }); resultsElement = document.getElementById("results"); - console.log(results); for (let result of results) { resultsElement.insertAdjacentHTML( "beforeend", From 4a8696cf16dab3bd006050d61a1d5fdbc7ad356a Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 2 Mar 2020 11:18:34 +0100 Subject: [PATCH 3/3] Fix typo --- app/corpora/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/corpora/forms.py b/app/corpora/forms.py index b11d5ef6..27844d18 100644 --- a/app/corpora/forms.py +++ b/app/corpora/forms.py @@ -11,7 +11,7 @@ class AddCorpusFileForm(FlaskForm): chapter = StringField('Chapter', validators=[Length(0, 255)]) editor = StringField('Editor', validators=[Length(0, 255)]) file = FileField('File', validators=[DataRequired()]) - institution = StringField('institution', validators=[Length(0, 255)]) + institution = StringField('Institution', validators=[Length(0, 255)]) journal = StringField('Journal', validators=[Length(0, 255)]) pages = StringField('Pages', validators=[Length(0, 255)]) publisher = StringField('Publisher', validators=[Length(0, 255)])