Browse Source
Merge pull request #487 from CatalystCode/guideline-per-document
Enhancement/Document-level annotation guideline
pull/1177/head
Hiroki Nakayama
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
20 additions and
2 deletions
-
app/server/static/components/annotation.pug
-
app/server/static/components/annotationMixin.js
|
|
@ -106,7 +106,7 @@ div.columns(v-cloak="") |
|
|
|
) |
|
|
|
section.modal-card-body.modal-card-body-footer |
|
|
|
vue-json-pretty( |
|
|
|
v-bind:data="documentMetadata" |
|
|
|
v-bind:data="displayDocumentMetadata" |
|
|
|
v-bind:show-double-quotes="false" |
|
|
|
v-bind:show-line="false" |
|
|
|
) |
|
|
|
|
|
@ -336,7 +336,13 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
compiledMarkdown() { |
|
|
|
return marked(this.guideline, { |
|
|
|
const documentMetadata = this.documentMetadata; |
|
|
|
|
|
|
|
const guideline = documentMetadata && documentMetadata.guideline |
|
|
|
? documentMetadata.guideline |
|
|
|
: this.guideline; |
|
|
|
|
|
|
|
return marked(guideline, { |
|
|
|
sanitize: true, |
|
|
|
}); |
|
|
|
}, |
|
|
@ -354,6 +360,18 @@ export default { |
|
|
|
: 'Click to approve annotations'; |
|
|
|
}, |
|
|
|
|
|
|
|
displayDocumentMetadata() { |
|
|
|
let documentMetadata = this.documentMetadata; |
|
|
|
if (documentMetadata == null) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
documentMetadata = { ...documentMetadata }; |
|
|
|
delete documentMetadata.guideline; |
|
|
|
delete documentMetadata.documentSourceUrl; |
|
|
|
return documentMetadata; |
|
|
|
}, |
|
|
|
|
|
|
|
documentMetadata() { |
|
|
|
return this.documentMetadataFor(this.pageNumber); |
|
|
|
}, |
|
|
|