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
ca2e9b39
Commit
ca2e9b39
authored
Dec 08, 2015
by
Romain Loth
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/unstable' into romain
parents
ba026add
e1ab38b1
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
340 additions
and
183 deletions
+340
-183
corpus_views.py
gargantext_web/corpus_views.py
+19
-12
startCelery
startCelery
+2
-2
startUwsgi
startUwsgi
+3
-2
Docs_dyna_chart_and_table.js
static/js/Docs_dyna_chart_and_table.js
+7
-1
Journals_dyna_chart_and_table.js
static/js/Journals_dyna_chart_and_table.js
+9
-2
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+213
-140
documents.html
templates/corpus/documents.html
+3
-5
journals.html
templates/corpus/journals.html
+3
-4
terms.html
templates/corpus/terms.html
+68
-7
views.py
tests/ngramstable/views.py
+13
-8
No files found.
gargantext_web/corpus_views.py
View file @
ca2e9b39
...
...
@@ -73,11 +73,14 @@ def test_page(request , project_id , corpus_id):
corpus
=
cache
.
Node
[
int
(
corpus_id
)]
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
number
=
session
.
query
(
func
.
count
(
Node
.
id
))
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
type_doc_id
)
.
all
()[
0
][
0
]
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
@@ -115,11 +118,13 @@ def get_ngrams(request , project_id , corpus_id ):
list_id
=
listIds
(
user_id
=
request
.
user
.
id
,
corpus_id
=
int
(
corpus_id
),
typeList
=
list_type
)
lists
[
"
%
s"
%
list_id
[
0
][
0
]]
=
list_type
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
@@ -183,11 +188,13 @@ def get_journals(request , project_id , corpus_id ):
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
number
=
session
.
query
(
func
.
count
(
Node
.
id
))
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
type_doc_id
)
.
all
()[
0
][
0
]
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
startCelery
View file @
ca2e9b39
#!/bin/bash
FILE
=
$(
date
+%Y%m%d-%H:%M:%S.log
)
FILE
=
"/var/log/gargantext/celery/
$(
date
+%Y%m%d-%H:%M:%S
)
.log"
source
/srv/gargantext_env/bin/activate
touch
/var/log/gargantext/celery/
$FILE
&&
./manage.py celery worker
--loglevel
=
info
>>
$FILE
./manage.py celery worker
-f
$FILE
startUwsgi
View file @
ca2e9b39
#!/bin/bash
FILE
=
$(
date
+%Y%m%d-%H:%M:%S.log
)
touch
/var/log/gargantext/uwsgi/
$FILE
&&
uwsgi gargantext.ini
>>
$FILE
FILE
=
"/var/log/gargantext/uwsgi/
$(
date
+%Y%m%d-%H:%M:%S
)
.log"
#touch /var/log/gargantext/uwsgi/$FILE && sudo
uwsgi gargantext.ini
--logto
$FILE
static/js/Docs_dyna_chart_and_table.js
View file @
ca2e9b39
...
...
@@ -519,12 +519,13 @@ function SearchFilters( elem ) {
$
(
"#corpusdisplayer"
).
hide
()
// FIRST portion of code to be EXECUTED:
// (3) Get records and hyperdata for paginator
$
.
ajax
({
url
:
'/tests/paginator/corpus/'
+
url_mainIDs
[
"corpus"
],
success
:
function
(
data
){
$
(
"#content_loader"
).
remove
()
for
(
var
i
in
data
.
records
)
{
var
orig_id
=
parseInt
(
data
.
records
[
i
].
id
)
var
arr_id
=
parseInt
(
i
)
...
...
@@ -536,6 +537,11 @@ $.ajax({
AjaxRecords
=
data
.
records
;
// backup-ing in global variable!
var
result
=
Main_test
(
data
.
records
,
"filter_all"
)
$
(
"#corpusdisplayer"
).
show
()
$
(
"#content_loader"
).
remove
()
$
(
"#corpusdisplayer"
).
click
()
console
.
log
(
result
)
},
});
...
...
static/js/Journals_dyna_chart_and_table.js
View file @
ca2e9b39
...
...
@@ -495,6 +495,11 @@ function Main_test( data , initial) {
return
"OK"
}
$
(
"#corpusdisplayer"
).
hide
()
console
.
log
(
window
.
location
.
href
+
"/journals.json"
)
$
.
ajax
({
url
:
window
.
location
.
href
+
"/journals.json"
,
...
...
@@ -502,12 +507,14 @@ $.ajax({
console
.
log
(
data
)
$
(
"#content_loader"
).
remove
()
// // Initializing the Charts and Table
var
result
=
Main_test
(
data
,
"FirstScore"
)
console
.
log
(
result
)
$
(
"#corpusdisplayer"
).
show
()
$
(
"#content_loader"
).
remove
()
$
(
"#corpusdisplayer"
).
click
()
}
});
\ No newline at end of file
static/js/NGrams_dyna_chart_and_table.js
View file @
ca2e9b39
This diff is collapsed.
Click to expand it.
templates/corpus/documents.html
View file @
ca2e9b39
...
...
@@ -56,10 +56,9 @@ th a {
<center>
Blue bars: all, Green line for zooming : select a time range to zoom in
<p
align=
"center"
>
<a
class=
"btn btn-xs btn-default"
role=
"button"
href=
"/chart/corpus/{{ corpus.id }}/data.csv"
>
Save
</a></p>
<a
class=
"btn btn-xs btn-default"
role=
"button"
href=
"/chart/corpus/{{ corpus.id }}/data.csv"
>
Save
</a>
<a
class=
"btn btn-xs btn-default"
href=
"javascript:volumeChart.filterAll();dc.redrawAll();"
>
Reset
</a></p>
<a
class=
"reset"
href=
"javascript:volumeChart.filterAll();dc.redrawAll();"
style=
"display: none;"
>
reset
</a>
<div
class=
"clearfix"
></div>
</center>
</div>
...
...
@@ -91,8 +90,7 @@ th a {
<div
class=
"panel-heading"
>
<h4
class=
"panel-title"
>
<a
data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseOne"
>
<p
id=
"corpusdisplayer"
onclick=
'Final_UpdateTable("click")'
class=
"btn btn-primary btn-lg"
style=
"width:200px; margin:0 auto; display:block;"
>
Open Folder
</h2></p>
<p
id=
"corpusdisplayer"
onclick=
'Final_UpdateTable("click")'
class=
"btn btn-primary btn-lg"
style=
"width:200px; margin:0 auto; display:block;"
>
Open Folder
</h2></p>
</a>
</h4>
</div>
...
...
templates/corpus/journals.html
View file @
ca2e9b39
...
...
@@ -122,10 +122,9 @@ input[type=radio]:checked + label {
<strong>
Title
</strong>
(Blue bars: all, Green line: zoom)
Select a time range to zoom in
<p
align=
"center"
>
<a
class=
"btn btn-xs btn-default"
role=
"button"
href=
"/chart/corpus/{{ corpus.id }}/data.csv"
>
Save
</a></p>
<a
class=
"reset"
href=
"javascript:volumeChart.filterAll();dc.redrawAll();"
style=
"display: none;"
>
reset
</a>
<a
class=
"btn btn-xs btn-default"
role=
"button"
href=
"/chart/corpus/{{ corpus.id }}/data.csv"
>
Save
</a>
<a
class=
"btn btn-xs btn-default"
href=
"javascript:volumeChart.filterAll();dc.redrawAll();"
>
Reset
</a></p>
<div
class=
"clearfix"
></div>
</center>
</div>
...
...
templates/corpus/terms.html
View file @
ca2e9b39
...
...
@@ -137,10 +137,9 @@ input[type=radio]:checked + label {
<center>
Blue bars: all, Green line for zooming : select a time range to zoom in
<p
align=
"center"
>
<a
class=
"btn btn-xs btn-default"
role=
"button"
href=
"/chart/corpus/{{ corpus.id }}/data.csv"
>
Save
</a></p>
<a
class=
"btn btn-xs btn-default"
role=
"button"
href=
"/chart/corpus/{{ corpus.id }}/data.csv"
>
Save
</a>
<a
class=
"btn btn-xs btn-default"
href=
"javascript:volumeChart.filterAll();dc.redrawAll();"
>
Reset
</a></p>
<a
class=
"reset"
href=
"javascript:volumeChart.filterAll();dc.redrawAll();"
style=
"display: none;"
>
reset
</a>
<div
class=
"clearfix"
></div>
</center>
</div>
...
...
@@ -222,7 +221,7 @@ input[type=radio]:checked + label {
<label
class=
"control-label"
>
Which list do you want?
</label>
<label
class=
"radio"
>
<input
value=
"miam"
name=
"whichlist"
disabled
type=
"radio"
>
MiamList
<input
value=
"miam"
name=
"whichlist"
type=
"radio"
>
MiamList
</label>
<label
class=
"radio"
>
<input
value=
"stop"
name=
"whichlist"
checked
type=
"radio"
>
StopList
...
...
@@ -239,12 +238,74 @@ input[type=radio]:checked + label {
</div>
</div>
</div>
</div>
</div>
<div
id=
"pre_savechanges"
class=
"modal fade"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h3
class=
"modal-title"
>
Do you want to apply these to the whole Project as well?:
</h3>
</div>
<div
class=
"modal-body"
>
<div
id=
"stoplist_content"
>
</div>
<!--
<ul class="nav nav-tabs">
<li class="active"><a id="stoplist" href="#stoplist_content">Stop List</a></li>
<li><a id="maplist" href="#maplist_content">Map List</a></li>
<li><a id="grouplist" href="#grouplist_content">Group List</a></li>
</ul>
<div class="tab-content">
<div id="stoplist_content" class="tab-pane fade in active">
<ul>
<li>jiji01</li>
<li>jiji02</li>
<li>jiji03</li>
</ul>
</div>
<div id="maplist_content" class="tab-pane fade">
qowieuoqiwueowq
</div>
<div id="grouplist_content" class="tab-pane fade">
asdhasjkdhasjdh
</div>
</div>
-->
<div
class=
"modal-footer"
>
<button
onclick=
"SaveGlobalChanges(this.id)"
id=
"nope"
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
No
</button>
<button
onclick=
"SaveGlobalChanges(this.id)"
id=
"yep"
type=
"button"
class=
"btn btn-primary"
>
Yes
</button>
</div>
</div>
</div>
</div>
</div>
<div
id=
"filter_search"
style=
"visibility:hidden"
>
...
...
@@ -264,9 +325,9 @@ input[type=radio]:checked + label {
<option
id=
"filter_stop-list"
value=
"filter_stop-list"
>
Stop-List
</option>
<!-- </optgroup> -->
</select>
<!--
<button id="ImportList" onclick="GetUserPortfolio();
$('#corpuses').modal('show');
" class="btn btn-warning">Import a Corpus-List</button>
-->
<button
id=
"ImportList"
onclick=
"GetUserPortfolio();"
class=
"btn btn-warning"
>
Import a Corpus-List
</button>
</div>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
></script>
...
...
tests/ngramstable/views.py
View file @
ca2e9b39
...
...
@@ -77,11 +77,14 @@ def get_ngrams(request , project_id , corpus_id ):
myamlist_type_id
=
cache
.
NodeType
[
'MiamList'
]
.
id
miamlist
=
session
.
query
(
Node
)
.
filter
(
Node
.
user_id
==
request
.
user
.
id
,
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
myamlist_type_id
)
.
first
()
t
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
@@ -116,11 +119,13 @@ def get_journals(request , project_id , corpus_id ):
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
number
=
session
.
query
(
func
.
count
(
Node
.
id
))
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
type_doc_id
)
.
all
()[
0
][
0
]
the_query
=
""" SELECT hyperdata FROM node_node WHERE id=
%
d """
%
(
int
(
corpus_id
)
)
cursor
=
connection
.
cursor
()
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
cursor
.
execute
(
the_query
)
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
except
:
processing
=
"Error"
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
...
...
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