Commit 649b7a48 authored by Administrator's avatar Administrator

[BUG FIX] Annotations debug: still need to connect the api

	modifié :         annotations/views.py
	commented part that make bug the API (variables)

	modifié :         static/js/dyna_chart_and_table.js
	adapting the url for the demo

	modifié :         ../test-list-management.py
	Test with stop words
parent 847577ee
...@@ -46,7 +46,7 @@ class NgramList(APIView): ...@@ -46,7 +46,7 @@ class NgramList(APIView):
# ngrams of list_id of corpus_id: # ngrams of list_id of corpus_id:
doc_ngram_list = listNgramIds(corpus_id=corpus_id, doc_id=doc_id, user_id=request.user.id) doc_ngram_list = listNgramIds(corpus_id=corpus_id, doc_id=doc_id, user_id=request.user.id)
doc_ngram_list = [(1, 'miam', 2, 1931), (2, 'stop', 2, 1932), (3, 'Potassium channels', 4, 1931)] #doc_ngram_list = [(1, 'miam', 2, 1931), (2, 'stop', 2, 1932), (3, 'Potassium channels', 4, 1931)]
data = { '%s' % corpus_id : { data = { '%s' % corpus_id : {
'%s' % doc_id : [ '%s' % doc_id : [
......
...@@ -118,7 +118,11 @@ function Final_UpdateTable( action ) { ...@@ -118,7 +118,11 @@ function Final_UpdateTable( action ) {
// Get all the duplicates using the Django-Garg API // Get all the duplicates using the Django-Garg API
var current_docs = {} var current_docs = {}
var BIS_dict = {} var BIS_dict = {}
var corpusid = window.location.href.split("corpus")[1].replace(/\//g, '')//replace all the slashes
var path = window.location.pathname.match(/\/project\/(.*)\/corpus\/(.*)\//);
var projectid = path[1]
var corpusid = path[2]
var theurl = "/api/nodes/"+corpusid+"/children/duplicates?keys=title&limit=9999" var theurl = "/api/nodes/"+corpusid+"/children/duplicates?keys=title&limit=9999"
// $.ajax({ // $.ajax({
// url: theurl, // url: theurl,
...@@ -231,7 +235,7 @@ function ulWriter(rowIndex, record, columns, cellWriter) { ...@@ -231,7 +235,7 @@ function ulWriter(rowIndex, record, columns, cellWriter) {
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)
RecDict[orig_id] = arr_id; RecDict[orig_id] = arr_id;
data.records[i]["name"] = '<a target="_blank" href="/nodeinfo/'+orig_id+'">'+data.records[i]["name"]+'</a>' data.records[i]["name"] = '<a target="_blank" href="/project/'+projectid+'/corpus/'+ corpusid + '/document/'+orig_id+'">'+data.records[i]["name"]+'</a>'
data.records[i]["del"] = false data.records[i]["del"] = false
var date = data.records[i]["date"]; var date = data.records[i]["date"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment