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
5ebf3ec3
Commit
5ebf3ec3
authored
Dec 19, 2014
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] data in nodeinfo view
parent
805cc912
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
0 deletions
+89
-0
urls.py
gargantext_web/urls.py
+1
-0
views.py
gargantext_web/views.py
+16
-0
add_corpus.html
templates/add_corpus.html
+11
-0
node-info.html
templates/node-info.html
+61
-0
No files found.
gargantext_web/urls.py
View file @
5ebf3ec3
...
...
@@ -48,6 +48,7 @@ urlpatterns = patterns('',
url
(
r'^graph-it$'
,
views
.
graph_it
),
url
(
r'^ngrams$'
,
views
.
ngrams
),
url
(
r'^nodeinfo/(\d+)$'
,
views
.
nodeinfo
),
url
(
r'^tests/mvc$'
,
views
.
tests_mvc
),
)
...
...
gargantext_web/views.py
View file @
5ebf3ec3
...
...
@@ -527,6 +527,22 @@ def ngrams(request):
}))
return
HttpResponse
(
html
)
def
nodeinfo
(
request
,
node_id
):
'''Structure of the popUp for topPapers div '''
t
=
get_template
(
'node-info.html'
)
ngrams_list
=
[
"hola"
,
"mundo"
]
user
=
request
.
user
date
=
datetime
.
datetime
.
now
()
html
=
t
.
render
(
Context
({
'user'
:
user
,
'date'
:
date
,
'node_id'
:
node_id
,
}))
return
HttpResponse
(
html
)
def
tfidf
(
request
,
corpus_id
,
ngram_id
):
"""
Takes IDs of corpus and ngram and returns list of relevent documents in json format
...
...
templates/add_corpus.html
View file @
5ebf3ec3
...
...
@@ -11,6 +11,10 @@
{% block content %}
<div
id=
"loading"
style=
"position:absolute; top:50%; left:40%; width:80px; display: none;"
>
<img
src=
"{% static "
img
/
ajax-loader
.
gif
"
%}"
alt=
""
/>
</div>
<div
class=
"container theme-showcase"
role=
"main"
>
<div
class=
"jumbotron"
>
...
...
@@ -25,4 +29,11 @@
</div>
</div>
<script>
function
showLoader
(){
$
(
'#loading'
).
setStyle
(
'display'
,
'block'
);
$
(
'submit_btn'
).
disabled
=
true
;
};
</script>
{% endblock %}
templates/node-info.html
0 → 100644
View file @
5ebf3ec3
{% block css %}
{% load staticfiles %}
<link
rel=
"stylesheet"
href=
"{% static "
css
/
bootstrap
.
css
"
%}"
>
<link
rel=
"stylesheet"
href=
"{% static "
css
/
bootstrap-theme
.
min
.
css
"
%}"
>
<link
rel=
"stylesheet"
href=
"{% static "
js
/
libs
/
jquery
/
jquery-ui
.
css
"
%}"
media=
"screen"
>
{% endblock %}
{% block content %}
{% if node_id %}
<div
id=
"nodeid"
style=
"visibility: hidden;"
>
{{node_id}}
</div>
<div
id=
"metadata"
></div>
{% endif %}
<script
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
type=
"text/javascript"
></script>
<script
src=
"{% static "
js
/
libs
/
jquery
/
jquery-ui
.
js
"
%}"
type=
"text/javascript"
></script>
<script
src=
"{% static "
js
/
libs
/
jquery
/
jquery
.
ba-dotimeout
.
min
.
js
"
%}"
type=
"text/javascript"
></script>
<!--<script src="{% static "js/libs/bootstrap/js/bootstrap.min.js" %}"></script>-->
<script
src=
"{% static "
js
/
libs
/
bootstrap
/
js
/
bootstrap-modal
.
js
"
%}"
type=
"text/javascript"
></script>
<script
src=
"{% static "
js
/
libs
/
bootstrap
/
js
/
bootstrap-hover-dropdown
.
min
.
js
"
%}"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
>
var
node_id
=
$
(
"#nodeid"
).
html
()
var
img
=
'<center><img src="'
+
window
.
location
.
origin
+
'/static/img/ajax-loader.gif" width="30%"></img></center>'
;
$
(
"#metadata"
).
html
(
img
);
$
.
ajax
({
type
:
'GET'
,
url
:
window
.
location
.
origin
+
'/api/nodes/'
+
node_id
,
//contentType: "application/json",
//dataType: 'json',
success
:
function
(
data
){
console
.
log
(
window
.
location
.
origin
+
'/api/nodes/'
+
node_id
)
jsondata
=
data
.
metadata
console
.
log
(
jsondata
)
var
output
=
""
if
(
jsondata
.
title
)
output
+=
"Title:<br>"
+
jsondata
.
title
+
"<br>"
;
if
(
jsondata
.
publication_date
)
output
+=
jsondata
.
publication_date
.
split
(
" "
)[
0
]
+
"<br><br>"
;
if
(
jsondata
.
authors
)
output
+=
"Authors:<br>"
+
jsondata
.
authors
+
"<br><br>"
;
if
(
jsondata
.
fields
)
output
+=
"Keywords:<br>"
+
jsondata
.
fields
+
"<br><br>"
;
if
(
jsondata
.
abstract
)
output
+=
"Abstract:<br>"
+
jsondata
.
abstract
+
"<br><br>"
;
$
(
"#metadata"
).
html
(
output
);
},
error
:
function
(){
console
.
log
(
'Page Not found: getTopPapers()'
);
}
});
</script>
{% endblock %}
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