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
Show 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):
...
@@ -73,11 +73,14 @@ def test_page(request , project_id , corpus_id):
corpus
=
cache
.
Node
[
int
(
corpus_id
)]
corpus
=
cache
.
Node
[
int
(
corpus_id
)]
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
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
]
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
:
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
cursor
.
execute
(
the_query
)
except
Exception
as
error
:
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
print
(
error
)
except
:
processing
=
0
processing
=
"Error"
html
=
t
.
render
(
Context
({
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
'debug'
:
settings
.
DEBUG
,
...
@@ -115,11 +118,13 @@ def get_ngrams(request , project_id , corpus_id ):
...
@@ -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
)
list_id
=
listIds
(
user_id
=
request
.
user
.
id
,
corpus_id
=
int
(
corpus_id
),
typeList
=
list_type
)
lists
[
"
%
s"
%
list_id
[
0
][
0
]]
=
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
:
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
cursor
.
execute
(
the_query
)
except
Exception
as
error
:
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
print
(
error
)
except
:
processing
=
0
processing
=
"Error"
html
=
t
.
render
(
Context
({
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
'debug'
:
settings
.
DEBUG
,
...
@@ -183,11 +188,13 @@ def get_journals(request , project_id , corpus_id ):
...
@@ -183,11 +188,13 @@ def get_journals(request , project_id , corpus_id ):
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
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
]
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
:
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
cursor
.
execute
(
the_query
)
except
Exception
as
error
:
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
print
(
error
)
except
:
processing
=
0
processing
=
"Error"
html
=
t
.
render
(
Context
({
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
'debug'
:
settings
.
DEBUG
,
...
...
startCelery
View file @
ca2e9b39
#!/bin/bash
#!/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
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
#!/bin/bash
FILE
=
$(
date
+%Y%m%d-%H:%M:%S.log
)
FILE
=
"/var/log/gargantext/uwsgi/
$(
date
+%Y%m%d-%H:%M:%S
)
.log"
touch
/var/log/gargantext/uwsgi/
$FILE
&&
uwsgi gargantext.ini
>>
$FILE
#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 ) {
...
@@ -519,12 +519,13 @@ function SearchFilters( elem ) {
$
(
"#corpusdisplayer"
).
hide
()
// FIRST portion of code to be EXECUTED:
// FIRST portion of code to be EXECUTED:
// (3) Get records and hyperdata for paginator
// (3) Get records and hyperdata for paginator
$
.
ajax
({
$
.
ajax
({
url
:
'/tests/paginator/corpus/'
+
url_mainIDs
[
"corpus"
],
url
:
'/tests/paginator/corpus/'
+
url_mainIDs
[
"corpus"
],
success
:
function
(
data
){
success
:
function
(
data
){
$
(
"#content_loader"
).
remove
()
for
(
var
i
in
data
.
records
)
{
for
(
var
i
in
data
.
records
)
{
var
orig_id
=
parseInt
(
data
.
records
[
i
].
id
)
var
orig_id
=
parseInt
(
data
.
records
[
i
].
id
)
var
arr_id
=
parseInt
(
i
)
var
arr_id
=
parseInt
(
i
)
...
@@ -536,6 +537,11 @@ $.ajax({
...
@@ -536,6 +537,11 @@ $.ajax({
AjaxRecords
=
data
.
records
;
// backup-ing in global variable!
AjaxRecords
=
data
.
records
;
// backup-ing in global variable!
var
result
=
Main_test
(
data
.
records
,
"filter_all"
)
var
result
=
Main_test
(
data
.
records
,
"filter_all"
)
$
(
"#corpusdisplayer"
).
show
()
$
(
"#content_loader"
).
remove
()
$
(
"#corpusdisplayer"
).
click
()
console
.
log
(
result
)
console
.
log
(
result
)
},
},
});
});
...
...
static/js/Journals_dyna_chart_and_table.js
View file @
ca2e9b39
...
@@ -495,6 +495,11 @@ function Main_test( data , initial) {
...
@@ -495,6 +495,11 @@ function Main_test( data , initial) {
return
"OK"
return
"OK"
}
}
$
(
"#corpusdisplayer"
).
hide
()
console
.
log
(
window
.
location
.
href
+
"/journals.json"
)
console
.
log
(
window
.
location
.
href
+
"/journals.json"
)
$
.
ajax
({
$
.
ajax
({
url
:
window
.
location
.
href
+
"/journals.json"
,
url
:
window
.
location
.
href
+
"/journals.json"
,
...
@@ -502,12 +507,14 @@ $.ajax({
...
@@ -502,12 +507,14 @@ $.ajax({
console
.
log
(
data
)
console
.
log
(
data
)
$
(
"#content_loader"
).
remove
()
// // Initializing the Charts and Table
// // Initializing the Charts and Table
var
result
=
Main_test
(
data
,
"FirstScore"
)
var
result
=
Main_test
(
data
,
"FirstScore"
)
console
.
log
(
result
)
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
function
pr
(
msg
)
{
function
pr
(
msg
)
{
console
.
log
(
msg
)
console
.
log
(
msg
)
}
}
...
@@ -20,8 +22,6 @@ function getCookie(name) {
...
@@ -20,8 +22,6 @@ function getCookie(name) {
}
}
var
latest
,
oldest
;
var
latest
,
oldest
;
var
TheBuffer
=
false
var
TheBuffer
=
false
...
@@ -113,7 +113,7 @@ function GetUserPortfolio() {
...
@@ -113,7 +113,7 @@ function GetUserPortfolio() {
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
html_
=
""
var
html_
=
""
html_
+=
'<div class="panel-group" id="accordion">'
+
"
\n
"
html_
+=
'<div class="panel-group" id="accordion
_
">'
+
"
\n
"
html_
+=
' <form id="corpuses_form" role="form">'
+
"
\n
"
html_
+=
' <form id="corpuses_form" role="form">'
+
"
\n
"
corpusesList
=
data
;
corpusesList
=
data
;
for
(
var
k1
in
data
)
{
for
(
var
k1
in
data
)
{
...
@@ -121,7 +121,7 @@ function GetUserPortfolio() {
...
@@ -121,7 +121,7 @@ function GetUserPortfolio() {
html_
+=
' <div class="panel panel-default">'
+
"
\n
"
html_
+=
' <div class="panel panel-default">'
+
"
\n
"
html_
+=
' <div class="panel-heading">'
+
"
\n
"
html_
+=
' <div class="panel-heading">'
+
"
\n
"
html_
+=
' <h4 class="panel-title">'
+
"
\n
"
html_
+=
' <h4 class="panel-title">'
+
"
\n
"
html_
+=
' <a data-toggle="collapse" data-parent="#accordion" href="#collapse_'
+
k1
+
'">'
+
v1
[
"proj_name"
]
+
'</a>'
+
"
\n
"
html_
+=
' <a data-toggle="collapse" data-parent="#accordion
_
" href="#collapse_'
+
k1
+
'">'
+
v1
[
"proj_name"
]
+
'</a>'
+
"
\n
"
html_
+=
' </h4>'
+
"
\n
"
html_
+=
' </h4>'
+
"
\n
"
html_
+=
' </div>'
+
"
\n
"
html_
+=
' </div>'
+
"
\n
"
html_
+=
' <div id="collapse_'
+
k1
+
'" class="panel-collapse collapse">'
+
"
\n
"
html_
+=
' <div id="collapse_'
+
k1
+
'" class="panel-collapse collapse">'
+
"
\n
"
...
@@ -157,6 +157,8 @@ function GetUserPortfolio() {
...
@@ -157,6 +157,8 @@ function GetUserPortfolio() {
});
});
$
(
'#corpuses'
).
modal
(
'show'
);
},
},
error
:
function
(){
error
:
function
(){
...
@@ -164,6 +166,7 @@ function GetUserPortfolio() {
...
@@ -164,6 +166,7 @@ function GetUserPortfolio() {
}
}
});
});
}
}
function
printCorpuses
()
{
function
printCorpuses
()
{
console
.
log
(
"!!!!!!!! in printCorpuses() !!!!!!!! "
)
console
.
log
(
"!!!!!!!! in printCorpuses() !!!!!!!! "
)
pr
(
corpusesList
)
pr
(
corpusesList
)
...
@@ -181,33 +184,53 @@ function printCorpuses() {
...
@@ -181,33 +184,53 @@ function printCorpuses() {
$
(
"#closecorpuses"
).
click
();
$
(
"#closecorpuses"
).
click
();
// EXTERNAL CORPUS TO COMPARE:
var
whichlist
=
$
(
'input[name=whichlist]:checked'
).
val
()
var
whichlist
=
$
(
'input[name=whichlist]:checked'
).
val
()
var
url
=
window
.
location
.
origin
+
"/api/node/"
+
selected_corpus
+
"/ngrams/list/"
+
whichlist
+
"?custom"
var
url
=
window
.
location
.
origin
+
"/api/node/"
+
selected_corpus
+
"/ngrams/list/"
+
whichlist
//
+"?custom"
console
.
log
(
url
)
console
.
log
(
url
)
GET_
(
url
,
function
(
results
)
{
GET_
(
url
,
function
(
results
)
{
if
(
Object
.
keys
(
results
).
length
>
0
)
{
if
(
Object
.
keys
(
results
).
length
>
0
)
{
var
sub_ngrams_data
=
{
var
sub_ngrams_data
=
{
"ngrams"
:[],
"ngrams"
:[],
"scores"
:
$
.
extend
({},
NGrams
[
"main"
].
scores
)
"scores"
:
$
.
extend
({},
NGrams
[
"main"
].
scores
)
}
}
for
(
var
i
in
NGrams
[
"main"
].
ngrams
)
{
if
(
whichlist
==
"stop"
)
{
if
(
results
[
NGrams
[
"main"
].
ngrams
[
i
].
id
]
)
{
for
(
var
r
in
results
)
{
var
a_ngram
=
NGrams
[
"main"
].
ngrams
[
i
]
var
a_ngram
=
results
[
r
]
a_ngram
[
"state"
]
=
System
[
0
][
"statesD"
][
"delete"
]
sub_ngrams_data
[
"ngrams"
].
push
(
a_ngram
)
sub_ngrams_data
[
"ngrams"
].
push
(
a_ngram
)
}
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_stop-list"
)
// if( results[ NGrams["main"].ngrams[i].id] && NGrams["main"].ngrams[i].name.split(" ").length==1 ) {
}
// if( NGrams["map"][ NGrams["main"].ngrams[i].id] ) {
// var a_ngram = NGrams["main"].ngrams[i]
if
(
whichlist
==
"miam"
)
{
// // a_ngram["state"] = System[0]["statesD"]["delete"]
for
(
var
i
in
NGrams
[
"main"
].
ngrams
)
{
// sub_ngrams_data["ngrams"].push( a_ngram )
var
local_ngram
=
NGrams
[
"main"
].
ngrams
[
i
]
// }
console
.
log
(
local_ngram
)
// }
}
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_all"
)
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_all"
)
}
// var sub_ngrams_data = {
// "ngrams":[],
// "scores": $.extend({}, NGrams["main"].scores)
// }
// if(whichlist=="stop") {
// for(var r in results) {
// var a_ngram = results[r]
// a_ngram["state"] = System[0]["statesD"]["delete"]
// sub_ngrams_data["ngrams"].push( a_ngram )
// }
// var result = Main_test(sub_ngrams_data , NGrams["main"].scores.initial , "filter_stop-list")
// }
// if(whichlist=="miam") {
// for(var i in NGrams["main"].ngrams) {
// var local_ngram = NGrams["main"].ngrams[i]
// console.log( local_ngram )
// }
// var result = Main_test(sub_ngrams_data , NGrams["main"].scores.initial , "filter_all")
// }
}
}
});
});
...
@@ -430,26 +453,6 @@ function clickngram_action ( elem ) {
...
@@ -430,26 +453,6 @@ function clickngram_action ( elem ) {
MyTable
.
data
(
'dynatable'
).
dom
.
update
();
MyTable
.
data
(
'dynatable'
).
dom
.
update
();
}
}
// function YOLO() {
// var sum__selected_elems = 0;
// for(var i in FlagsBuffer["group"])
// sum__selected_elems += Object.keys( FlagsBuffer["group"][i] ).length
// for(var i in FlagsBuffer)
// sum__selected_elems += Object.keys(FlagsBuffer[i]).length;
// console.log("")
// console.log("Current Buffer size: "+sum__selected_elems)
// console.log(FlagsBuffer)
// if ( sum__selected_elems>0 )
// $("#Clean_All, #Save_All").removeAttr("disabled", "disabled");
// else
// $("#Clean_All, #Save_All").attr( "disabled", "disabled" );
// }
// modified
// modified
function
transformContent
(
rec_id
)
{
function
transformContent
(
rec_id
)
{
var
elem
=
AjaxRecords
[
rec_id
];
var
elem
=
AjaxRecords
[
rec_id
];
...
@@ -535,27 +538,52 @@ function SelectAll( box ) {
...
@@ -535,27 +538,52 @@ function SelectAll( box ) {
MyTable
.
data
(
'dynatable'
).
dom
.
update
();
MyTable
.
data
(
'dynatable'
).
dom
.
update
();
}
}
function
SaveGlobalChanges
(
elem
)
{
console
.
log
(
"iterating over global stop words:"
)
$
(
'.globalstopwords'
).
each
(
function
(
i
,
obj
)
{
console
.
log
(
obj
)
});
console
.
log
(
" - - - - -"
)
console
.
log
(
elem
)
}
$
(
"#Clean_All"
).
click
(
function
(){
function
SaveGlobalChanges_Form
(
nodes2del
)
{
console
.
log
(
"In SaveGlobalChanges:"
)
for
(
var
id
in
AjaxRecords
)
console
.
log
(
nodes2del
)
AjaxRecords
[
id
][
"state"
]
=
0
;
//AjaxRecords[RecDict[1731]]
$
(
"#stoplist_content"
).
html
(
""
)
$
(
"#group_box"
).
remove
()
var
html_globalstop
=
""
GState
=
0
for
(
var
i
in
nodes2del
)
{
$
(
'<span/>'
,
{
MyTable
.
data
(
'dynatable'
).
dom
.
update
();
"class"
:
"globalstopwords"
,
"data-id"
:
AjaxRecords
[
RecDict
[
nodes2del
[
i
]]].
id
,
"data-stuff"
:
RecDict
[
nodes2del
[
i
]],
title
:
'Click to remove'
,
text
:
AjaxRecords
[
RecDict
[
nodes2del
[
i
]]].
name
,
css
:
{
"cursor"
:
"pointer"
,
"border"
:
"1px solid red"
,
"margin"
:
"3px"
,
"padding"
:
"3px"
,
}
})
.
click
(
function
()
{
$
(
this
).
remove
()
// if nothing in group div, then remove it
if
(
$
(
"#stoplist_content"
).
children
().
length
==
0
)
{
SaveLocalChanges
()
}
})
.
appendTo
(
'#stoplist_content'
)
for
(
var
i
in
FlagsBuffer
)
}
for
(
var
j
in
FlagsBuffer
[
i
])
$
(
"#pre_savechanges"
).
modal
(
"show"
)
delete
FlagsBuffer
[
i
][
j
];
}
// $("#Clean_All, #Save_All").attr( "disabled", "disabled" );
});
function
SaveLocalChanges
()
{
$
(
"#Save_All"
).
click
(
function
(){
console
.
clear
()
console
.
clear
()
console
.
log
(
"click in save all 01
"
)
console
.
log
(
"In SaveChanges()
"
)
var
sum__selected_elems
=
0
;
var
sum__selected_elems
=
0
;
FlagsBuffer
[
"delete"
]
=
{}
FlagsBuffer
[
"delete"
]
=
{}
...
@@ -565,20 +593,20 @@ $("#Save_All").click(function(){
...
@@ -565,20 +593,20 @@ $("#Save_All").click(function(){
for
(
var
id
in
AjaxRecords
)
{
for
(
var
id
in
AjaxRecords
)
{
if
(
NGrams
[
"map"
][
AjaxRecords
[
id
][
"id"
]
]
)
{
if
(
NGrams
[
"map"
][
AjaxRecords
[
id
][
"id"
]
]
)
{
if
(
AjaxRecords
[
id
][
"state"
]
==
0
||
AjaxRecords
[
id
][
"state"
]
==
2
)
{
if
(
AjaxRecords
[
id
][
"state"
]
==
System
[
0
][
"statesD"
][
"normal"
]
||
AjaxRecords
[
id
][
"state"
]
==
System
[
0
][
"statesD"
][
"delete"
]
)
{
FlagsBuffer
[
"outmap"
][
AjaxRecords
[
id
].
id
]
=
true
FlagsBuffer
[
"outmap"
][
AjaxRecords
[
id
].
id
]
=
true
if
(
AjaxRecords
[
id
][
"state"
]
==
2
)
{
if
(
AjaxRecords
[
id
][
"state"
]
==
System
[
0
][
"statesD"
][
"delete"
]
)
{
FlagsBuffer
[
"delete"
][
AjaxRecords
[
id
].
id
]
=
true
FlagsBuffer
[
"delete"
][
AjaxRecords
[
id
].
id
]
=
true
}
}
}
}
if
(
FlagsBuffer
[
"group"
][
AjaxRecords
[
id
].
id
]
&&
AjaxRecords
[
id
][
"state"
]
==
1
)
{
if
(
FlagsBuffer
[
"group"
][
AjaxRecords
[
id
].
id
]
&&
AjaxRecords
[
id
][
"state"
]
==
System
[
0
][
"statesD"
][
"keep"
]
)
{
FlagsBuffer
[
"inmap"
][
AjaxRecords
[
id
].
id
]
=
true
FlagsBuffer
[
"inmap"
][
AjaxRecords
[
id
].
id
]
=
true
}
}
}
else
{
}
else
{
if
(
AjaxRecords
[
id
][
"state"
]
==
1
)
{
if
(
AjaxRecords
[
id
][
"state"
]
==
System
[
0
][
"statesD"
][
"keep"
]
)
{
FlagsBuffer
[
"inmap"
][
AjaxRecords
[
id
].
id
]
=
true
FlagsBuffer
[
"inmap"
][
AjaxRecords
[
id
].
id
]
=
true
}
}
if
(
AjaxRecords
[
id
][
"state"
]
==
2
)
{
if
(
AjaxRecords
[
id
][
"state"
]
==
System
[
0
][
"statesD"
][
"delete"
]
)
{
FlagsBuffer
[
"delete"
][
AjaxRecords
[
id
].
id
]
=
true
FlagsBuffer
[
"delete"
][
AjaxRecords
[
id
].
id
]
=
true
}
}
}
}
...
@@ -630,6 +658,7 @@ $("#Save_All").click(function(){
...
@@ -630,6 +658,7 @@ $("#Save_All").click(function(){
var
list_id
=
$
(
"#list_id"
).
val
()
var
list_id
=
$
(
"#list_id"
).
val
()
var
corpus_id
=
getIDFromURL
(
"corpus"
)
// not used
var
corpus_id
=
getIDFromURL
(
"corpus"
)
// not used
$
(
"#stoplist_content"
).
html
()
// CRUD( list_id , "" , Object.keys(FlagsBuffer["inmap"]).map(Number) , [] , "PUT", function(result) {
// CRUD( list_id , "" , Object.keys(FlagsBuffer["inmap"]).map(Number) , [] , "PUT", function(result) {
// console.log( result )
// console.log( result )
...
@@ -645,9 +674,41 @@ $("#Save_All").click(function(){
...
@@ -645,9 +674,41 @@ $("#Save_All").click(function(){
});
});
});
});
});
});
}
$
(
"#Clean_All"
).
click
(
function
(){
for
(
var
id
in
AjaxRecords
)
AjaxRecords
[
id
][
"state"
]
=
0
;
$
(
"#group_box"
).
remove
()
GState
=
0
MyTable
.
data
(
'dynatable'
).
dom
.
update
();
for
(
var
i
in
FlagsBuffer
)
for
(
var
j
in
FlagsBuffer
[
i
])
delete
FlagsBuffer
[
i
][
j
];
// $("#Clean_All, #Save_All").attr( "disabled", "disabled" );
});
$
(
"#Save_All"
).
click
(
function
(){
SaveLocalChanges
()
// var Elems_2Del = {};
// for(var id in AjaxRecords) {
// if(AjaxRecords[id]["state"]==System[0]["statesD"]["delete"]) {
// Elems_2Del[AjaxRecords[id].id] = true
// }
// }
// if( Object.keys(Elems_2Del).length>0 ) {
// SaveGlobalChanges_Form( Object.keys(Elems_2Del).map(Number) )
// } else {
// // SaveLocalChanges() //At the end, reload!
// }
});
});
function
CRUD
(
parent_id
,
action
,
nodes
,
args
,
http_method
,
callback
)
{
function
CRUD
(
parent_id
,
action
,
nodes
,
args
,
http_method
,
callback
)
{
var
the_url
=
window
.
location
.
origin
+
"/api/node/"
+
parent_id
+
"/ngrams"
+
action
+
"/"
+
nodes
.
join
(
"+"
);
var
the_url
=
window
.
location
.
origin
+
"/api/node/"
+
parent_id
+
"/ngrams"
+
action
+
"/"
+
nodes
.
join
(
"+"
);
the_url
=
the_url
.
replace
(
/
\/
$/
,
""
);
//remove trailing slash
the_url
=
the_url
.
replace
(
/
\/
$/
,
""
);
//remove trailing slash
...
@@ -928,7 +989,6 @@ function Main_test( data , initial , search_filter) {
...
@@ -928,7 +989,6 @@ function Main_test( data , initial , search_filter) {
}
}
function
SearchFilters
(
elem
)
{
function
SearchFilters
(
elem
)
{
var
MODE
=
elem
.
value
;
var
MODE
=
elem
.
value
;
...
@@ -1143,4 +1203,17 @@ function AfterAjax() {
...
@@ -1143,4 +1203,17 @@ function AfterAjax() {
$
(
"#corpusdisplayer"
).
show
()
$
(
"#corpusdisplayer"
).
show
()
$
(
"#content_loader"
).
remove
()
$
(
"#content_loader"
).
remove
()
$
(
"#corpusdisplayer"
).
click
()
$
(
"#corpusdisplayer"
).
click
()
$
(
".nav-tabs a"
).
click
(
function
(
e
){
e
.
preventDefault
();
$
(
this
).
tab
(
'show'
);
});
$
(
'.nav-tabs a'
).
on
(
'shown.bs.tab'
,
function
(
event
){
var
x
=
$
(
event
.
target
).
text
();
// active tab
var
y
=
$
(
event
.
relatedTarget
).
text
();
// previous tab
$
(
".act span"
).
text
(
x
);
$
(
".prev span"
).
text
(
y
);
});
}
}
templates/corpus/documents.html
View file @
ca2e9b39
...
@@ -56,10 +56,9 @@ th a {
...
@@ -56,10 +56,9 @@ th a {
<center>
<center>
Blue bars: all, Green line for zooming : select a time range to zoom in
Blue bars: all, Green line for zooming : select a time range to zoom in
<p
align=
"center"
>
<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>
<div
class=
"clearfix"
></div>
</center>
</center>
</div>
</div>
...
@@ -91,8 +90,7 @@ th a {
...
@@ -91,8 +90,7 @@ th a {
<div
class=
"panel-heading"
>
<div
class=
"panel-heading"
>
<h4
class=
"panel-title"
>
<h4
class=
"panel-title"
>
<a
data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseOne"
>
<a
data-toggle=
"collapse"
data-parent=
"#accordion"
href=
"#collapseOne"
>
<p
id=
"corpusdisplayer"
onclick=
'Final_UpdateTable("click")'
<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>
class=
"btn btn-primary btn-lg"
style=
"width:200px; margin:0 auto; display:block;"
>
Open Folder
</h2></p>
</a>
</a>
</h4>
</h4>
</div>
</div>
...
...
templates/corpus/journals.html
View file @
ca2e9b39
...
@@ -122,10 +122,9 @@ input[type=radio]:checked + label {
...
@@ -122,10 +122,9 @@ input[type=radio]:checked + label {
<strong>
Title
</strong>
(Blue bars: all, Green line: zoom)
<strong>
Title
</strong>
(Blue bars: all, Green line: zoom)
Select a time range to zoom in
Select a time range to zoom in
<p
align=
"center"
>
<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>
<div
class=
"clearfix"
></div>
</center>
</center>
</div>
</div>
...
...
templates/corpus/terms.html
View file @
ca2e9b39
...
@@ -137,10 +137,9 @@ input[type=radio]:checked + label {
...
@@ -137,10 +137,9 @@ input[type=radio]:checked + label {
<center>
<center>
Blue bars: all, Green line for zooming : select a time range to zoom in
Blue bars: all, Green line for zooming : select a time range to zoom in
<p
align=
"center"
>
<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>
<div
class=
"clearfix"
></div>
</center>
</center>
</div>
</div>
...
@@ -222,7 +221,7 @@ input[type=radio]:checked + label {
...
@@ -222,7 +221,7 @@ input[type=radio]:checked + label {
<label
class=
"control-label"
>
<label
class=
"control-label"
>
Which list do you want?
</label>
Which list do you want?
</label>
<label
class=
"radio"
>
<label
class=
"radio"
>
<input
value=
"miam"
name=
"whichlist"
disabled
type=
"radio"
>
MiamList
<input
value=
"miam"
name=
"whichlist"
type=
"radio"
>
MiamList
</label>
</label>
<label
class=
"radio"
>
<label
class=
"radio"
>
<input
value=
"stop"
name=
"whichlist"
checked
type=
"radio"
>
StopList
<input
value=
"stop"
name=
"whichlist"
checked
type=
"radio"
>
StopList
...
@@ -239,7 +238,69 @@ input[type=radio]:checked + label {
...
@@ -239,7 +238,69 @@ input[type=radio]:checked + label {
</div>
</div>
</div>
</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>
</div>
...
@@ -264,9 +325,9 @@ input[type=radio]:checked + label {
...
@@ -264,9 +325,9 @@ input[type=radio]:checked + label {
<option
id=
"filter_stop-list"
value=
"filter_stop-list"
>
Stop-List
</option>
<option
id=
"filter_stop-list"
value=
"filter_stop-list"
>
Stop-List
</option>
<!-- </optgroup> -->
<!-- </optgroup> -->
</select>
</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>
</div>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
></script>
<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 ):
...
@@ -77,11 +77,14 @@ def get_ngrams(request , project_id , corpus_id ):
myamlist_type_id
=
cache
.
NodeType
[
'MiamList'
]
.
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
()
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
:
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
cursor
.
execute
(
the_query
)
except
Exception
as
error
:
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
print
(
error
)
except
:
processing
=
0
processing
=
"Error"
html
=
t
.
render
(
Context
({
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
'debug'
:
settings
.
DEBUG
,
...
@@ -116,11 +119,13 @@ def get_journals(request , project_id , corpus_id ):
...
@@ -116,11 +119,13 @@ def get_journals(request , project_id , corpus_id ):
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
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
]
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
:
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
cursor
.
execute
(
the_query
)
except
Exception
as
error
:
processing
=
cursor
.
fetchone
()[
0
][
"Processing"
]
print
(
error
)
except
:
processing
=
0
processing
=
"Error"
html
=
t
.
render
(
Context
({
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
'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