Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
3b427459
Commit
3b427459
authored
Sep 24, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] annotation view is showing document text even if the workflow is not finished
parent
59035813
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
22 deletions
+35
-22
document.js
annotations/static/annotations/document.js
+28
-19
main.html
annotations/templates/annotations/main.html
+4
-2
views.py
annotations/views.py
+3
-1
No files found.
annotations/static/annotations/document.js
View file @
3b427459
...
@@ -23,6 +23,11 @@
...
@@ -23,6 +23,11 @@
$rootScope
.
docId
=
data
.
id
;
$rootScope
.
docId
=
data
.
id
;
$rootScope
.
full_text
=
data
.
full_text
;
$rootScope
.
full_text
=
data
.
full_text
;
$rootScope
.
abstract_text
=
data
.
abstract_text
;
$rootScope
.
abstract_text
=
data
.
abstract_text
;
$rootScope
.
workflow_finished
=
data
.
corpus_status
[
'complete'
]
;
console
.
log
(
"workflow status"
,
$rootScope
.
workflow_finished
)
if
(
$scope
.
workflow_finished
)
{
console
.
log
(
"annotations.document.DocController.getannotations"
)
console
.
log
(
"annotations.document.DocController.getannotations"
)
// GET the annotationss
// GET the annotationss
NgramListHttpService
.
get
(
NgramListHttpService
.
get
(
...
@@ -42,6 +47,10 @@
...
@@ -42,6 +47,10 @@
console
.
error
(
"unable to get the list of ngrams"
);
console
.
error
(
"unable to get the list of ngrams"
);
}
}
);
);
}
else
{
$scope
.
dataLoading
=
false
;
}
});
});
...
...
annotations/templates/annotations/main.html
View file @
3b427459
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<div
id=
"annotationsApp"
ng-cloak
>
<div
id=
"annotationsApp"
ng-cloak
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<div
class=
"row-fluid main-panel"
ng-controller=
"NGramHighlightController"
>
<div
class=
"row-fluid main-panel"
ng-controller=
"NGramHighlightController"
>
<div
class=
"col-md-4 col-xs-4 tabbable words-panel"
>
<div
ng-if=
"workflow_finished"
class=
"col-md-4 col-xs-4 tabbable words-panel"
>
<div
class=
"list-selector"
>
<div
class=
"list-selector"
>
<h5>
Select highlighted list(s)
<h5>
Select highlighted list(s)
<select
class=
"selectpicker"
multiple
ng-change=
"activeListsChange()"
ng-model=
"lists"
ng-controller=
"ActiveListsController"
>
<select
class=
"selectpicker"
multiple
ng-change=
"activeListsChange()"
ng-model=
"lists"
ng-controller=
"ActiveListsController"
>
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
</div>
</div>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<ul
class=
"list-group clearfix"
>
<ul
class=
"list-group clearfix"
>
<li
class=
"list-group-item small"
><span
class=
"badge"
>
journal
</span>
{[{journal}]}
</li>
<li
class=
"list-group-item small"
><span
class=
"badge"
>
source
</span>
{[{journal}]}
</li>
<li
class=
"list-group-item small"
><span
class=
"badge"
>
authors
</span>
{[{authors}]}
</li>
<li
class=
"list-group-item small"
><span
class=
"badge"
>
authors
</span>
{[{authors}]}
</li>
<li
class=
"list-group-item small"
><span
class=
"badge"
>
date
</span>
{[{publication_date}]}
</li>
<li
class=
"list-group-item small"
><span
class=
"badge"
>
date
</span>
{[{publication_date}]}
</li>
</ul>
</ul>
...
@@ -108,12 +108,14 @@
...
@@ -108,12 +108,14 @@
<span
class=
"badge"
>
abstract
</span>
<span
class=
"badge"
>
abstract
</span>
</div>
</div>
<p
id=
"abstract-text"
class=
"text-container"
>
<p
id=
"abstract-text"
class=
"text-container"
>
{[{abstract_text}]}
<div
ng-if=
"abstract_text == null"
class=
"alert alert-info small"
role=
"alert"
>
Empty abstract text
</div>
<div
ng-if=
"abstract_text == null"
class=
"alert alert-info small"
role=
"alert"
>
Empty abstract text
</div>
</p>
</p>
<div
ng-if=
"full_text != null"
>
<div
ng-if=
"full_text != null"
>
<span
class=
"badge"
>
full article
</span>
<span
class=
"badge"
>
full article
</span>
</div>
</div>
<p
id=
"full-text"
class=
"text-container"
>
<p
id=
"full-text"
class=
"text-container"
>
{[{full_text}]}
<div
ng-if=
"full_text == null"
class=
"alert alert-info small"
role=
"alert"
>
Empty full text
</div>
<div
ng-if=
"full_text == null"
class=
"alert alert-info small"
role=
"alert"
>
Empty full text
</div>
</p>
</p>
</div>
</div>
...
...
annotations/views.py
View file @
3b427459
...
@@ -172,8 +172,9 @@ class Document(APIView):
...
@@ -172,8 +172,9 @@ class Document(APIView):
def
get
(
self
,
request
,
doc_id
):
def
get
(
self
,
request
,
doc_id
):
"""Document by ID"""
"""Document by ID"""
# implicit global session
node
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
doc_id
)
.
first
()
node
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
doc_id
)
.
first
()
corpus
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
node
.
parent_id
)
.
first
()
corpus_workflow_status
=
corpus
.
hyperdata
[
'statuses'
][
0
]
if
node
is
None
:
if
node
is
None
:
raise
APIException
(
'This node does not exist'
,
404
)
raise
APIException
(
'This node does not exist'
,
404
)
...
@@ -185,6 +186,7 @@ class Document(APIView):
...
@@ -185,6 +186,7 @@ class Document(APIView):
pub_date
=
node
.
hyperdata
.
get
(
'publication_date'
)
pub_date
=
node
.
hyperdata
.
get
(
'publication_date'
)
data
=
{
data
=
{
'corpus_status'
:
corpus_workflow_status
,
'title'
:
node
.
hyperdata
.
get
(
'title'
),
'title'
:
node
.
hyperdata
.
get
(
'title'
),
'authors'
:
node
.
hyperdata
.
get
(
'authors'
),
'authors'
:
node
.
hyperdata
.
get
(
'authors'
),
'journal'
:
node
.
hyperdata
.
get
(
'journal'
),
'journal'
:
node
.
hyperdata
.
get
(
'journal'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment