Commit 15128b92 authored by delanoe's avatar delanoe

Merge branch 'romain-refactoring' into refactoring

parents 7a3a35ab 54e5e456
...@@ -475,10 +475,12 @@ class ListFamily(APIView): ...@@ -475,10 +475,12 @@ class ListFamily(APIView):
hidden_ngrams_query = _query_grouped_ngrams(groups_id, details=True, hidden_ngrams_query = _query_grouped_ngrams(groups_id, details=True,
scoring_metric_id= scores_id) scoring_metric_id= scores_id)
# infos for stoplist terms, absent from mainlist
stop_ngrams_query = _query_list(other_list_ids['stoplist'], details=True,
scoring_metric_id=scores_id)
# and for the other lists (stop and map) # and for the other lists (stop and map)
# no details needed here, just the member ids # no details needed here, just the member ids
# - maplist ngrams will already be in ngraminfos b/c of mainlist
# - stoplist ngrams will not be shown in detail
for li in other_list_ids: for li in other_list_ids:
li_elts = _query_list(other_list_ids[li], details=False li_elts = _query_list(other_list_ids[li], details=False
).all() ).all()
...@@ -497,7 +499,7 @@ class ListFamily(APIView): ...@@ -497,7 +499,7 @@ class ListFamily(APIView):
# TODO add maplist membership # TODO add maplist membership
ngrams_which_need_detailed_info = mainlist_query.all() ngrams_which_need_detailed_info = mainlist_query.all()
else: else:
ngrams_which_need_detailed_info = mainlist_query.all() + hidden_ngrams_query.all() ngrams_which_need_detailed_info = mainlist_query.all() + hidden_ngrams_query.all() + stop_ngrams_query.all()
# the output form of details is: # the output form of details is:
# ngraminfo[id] => [term, weight] # ngraminfo[id] => [term, weight]
......
...@@ -69,18 +69,10 @@ function Push2Buffer( NewVal ) { ...@@ -69,18 +69,10 @@ function Push2Buffer( NewVal ) {
} }
function Final_UpdateTable( action ) { function Final_UpdateTable( action ) {
// (1) Identifying if the button is collapsed:
var isCollapsed=false;
var accordiontext = $("#collapseOne").attr("class")
if(accordiontext.indexOf("collapse in")>-1)
isCollapsed=true;
var UpdateTable = false var UpdateTable = false
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) { if (action=="changerange") {
UpdateTable = true; UpdateTable = true;
$("#corpusdisplayer").html("View by titles") }
} else $("#corpusdisplayer").html("View by titles")
pr("update table??: "+UpdateTable) pr("update table??: "+UpdateTable)
...@@ -98,7 +90,7 @@ function Final_UpdateTable( action ) { ...@@ -98,7 +90,7 @@ function Final_UpdateTable( action ) {
// console.log("dataini, datafin") // console.log("dataini, datafin")
// console.log(dataini, datafin) // console.log(dataini, datafin)
$.each(AjaxRecords, function(i, node) { $.each(AjaxRecords, function(i, node) {
if (node.date >= dataini && node.date >= dataini) { if (node.date >= dataini && node.date <= datafin) {
// pr( AjaxRecords[i].date+" : "+AjaxRecords[i].id ) // pr( AjaxRecords[i].date+" : "+AjaxRecords[i].id )
TimeRange.push(node); TimeRange.push(node);
} }
...@@ -128,8 +120,8 @@ function Final_UpdateTable( action ) { ...@@ -128,8 +120,8 @@ function Final_UpdateTable( action ) {
// STEP 01: // STEP 01:
// remember url elements // remember url elements
var id_from_url = function(name) { var id_from_url = function(nodename) {
var regex = new RegExp(name + '/(\\d+)'); var regex = new RegExp(nodename + '/(\\d+)');
var result = regex.exec(location.href); var result = regex.exec(location.href);
return result ? result[1] : null; return result ? result[1] : null;
}; };
...@@ -164,17 +156,19 @@ function getRecords() { ...@@ -164,17 +156,19 @@ function getRecords() {
function transformContent2(rec_id) { function transformContent2(rec_id) {
// pr("\t\ttransformContent2: "+rec_id) // pr("\t\ttransformContent2: "+rec_id)
var elem = AjaxRecords[rec_id]; var elem = AjaxRecords[rec_id];
// pr("\t"+elem.title) // pr("\t"+elem.rawtitle)
var result = {} var result = {}
if (elem["del"]) { if (elem["del"]) {
result["id"] = elem["id"] result["id"] = elem["id"]
result["date"] = '<strike>'+elem["date"]+'</strike>' result["date"] = '<strike>'+elem["date"]+'</strike>'
result["name"] = '<strike>'+elem["name"]+'</strike>' result["docurl"] = '<strike>'+elem["docurl"]+'</strike>'
result["rawtitle"] = elem["rawtitle"]
result["del"] = '<input id='+rec_id+' onclick="overRide(this)" type="checkbox" checked/>' result["del"] = '<input id='+rec_id+' onclick="overRide(this)" type="checkbox" checked/>'
} else { } else {
result["id"] = elem["id"] result["id"] = elem["id"]
result["date"] = elem["date"] result["date"] = elem["date"]
result["name"] = elem["name"] result["docurl"] = elem["docurl"]
result["rawtitle"] = elem["rawtitle"]
result["del"] = '<input id='+rec_id+' onclick="overRide(this)" type="checkbox"/>' result["del"] = '<input id='+rec_id+' onclick="overRide(this)" type="checkbox"/>'
} }
return result; return result;
...@@ -272,11 +266,11 @@ function Main_test(Data) { ...@@ -272,11 +266,11 @@ function Main_test(Data) {
div_table += '<table id="my-ajax-table" class="table table-bordered">'+"\n" div_table += '<table id="my-ajax-table" class="table table-bordered">'+"\n"
div_table += "\t"+'<thead>'+"\n" div_table += "\t"+'<thead>'+"\n"
div_table += "\t"+"\t"+'<th width="100px;" data-dynatable-column="date">'+"\n" div_table += "\t"+"\t"+'<th width="100px;" data-dynatable-column="date">'+"\n"
div_table += "\t"+"\t"+'<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> Date</th>'+"\n" div_table += "\t"+"\t"+'<span class="glyphicon glyphicon-calendar"></span> Date</th>'+"\n"
div_table += "\t"+"\t"+'<th data-dynatable-column="name">'+"\n" div_table += "\t"+"\t"+'<th data-dynatable-column="docurl">'+"\n"
div_table += "\t"+"\t"+'<span class="glyphicon glyphicon-text-size" aria-hidden="true"></span> Title</th>'+"\n" div_table += "\t"+"\t"+'<span class="glyphicon glyphicon-text-size"></span> Title</th>'+"\n"
div_table += "\t"+"\t"+'<th data-dynatable-column="del" data-dynatable-no-sort="true">'+"\n" div_table += "\t"+"\t"+'<th data-dynatable-column="del" data-dynatable-no-sort="true">'+"\n"
div_table += "\t"+"\t"+'<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>'+"\n" div_table += "\t"+"\t"+'<span class="glyphicon glyphicon-trash"></span>'+"\n"
div_table += "\t"+"\t"+'</th>'+"\n" div_table += "\t"+"\t"+'</th>'+"\n"
div_table += "\t"+'</thead>'+"\n" div_table += "\t"+'</thead>'+"\n"
div_table += "\t"+'<tbody>'+"\n" div_table += "\t"+'<tbody>'+"\n"
...@@ -290,7 +284,7 @@ function Main_test(Data) { ...@@ -290,7 +284,7 @@ function Main_test(Data) {
var date = Data[i]["date"]; var date = Data[i]["date"];
if ( ! justdates[date] ) justdates[date] = 0; if ( ! justdates[date] ) justdates[date] = 0;
justdates[date]++; justdates[date]++;
// console.log(Data[i]["date"]+" : originalRecords["+arr_id+"] <- "+orig_id+" | "+Data[i]["name"]) // console.log(Data[i]["date"]+" : originalRecords["+arr_id+"] <- "+orig_id+" | "+Data[i]["docurl"])
} }
var t0 = get_node_date(AjaxRecords[0]); var t0 = get_node_date(AjaxRecords[0]);
...@@ -420,6 +414,8 @@ function Main_test(Data) { ...@@ -420,6 +414,8 @@ function Main_test(Data) {
var chartfilt = chart.filter() var chartfilt = chart.filter()
// tricky part: identifying when the moveChart changes. // tricky part: identifying when the moveChart changes.
if(chartfilt) { if(chartfilt) {
console.log("chart.filter()")
console.log(chart.filter())
Push2Buffer ( chart.filter() ) Push2Buffer ( chart.filter() )
} else { } else {
if(TheBuffer) { if(TheBuffer) {
...@@ -435,13 +431,17 @@ function Main_test(Data) { ...@@ -435,13 +431,17 @@ function Main_test(Data) {
MyTable = [] MyTable = []
MyTable = $('#my-ajax-table').dynatable({ MyTable = $('#my-ajax-table').dynatable({
dataset: { dataset: {
records: Data records: Data,
sorts : {"date": 1},
sortTypes: {
docurl: 'rawtitleSort'
}
}, },
features: { features: {
pushState: false, pushState: false,
// prevent default title search which can't do title vs abstract // prevent default title search which can't do title vs abstract
search: false, search: false,
// sort: false //i need to fix the sorting function... the current one just sucks sort: true
}, },
inputs: { inputs: {
// our own search which differentiates title vs abstract queries // our own search which differentiates title vs abstract queries
...@@ -454,7 +454,7 @@ function Main_test(Data) { ...@@ -454,7 +454,7 @@ function Main_test(Data) {
}); });
MyTable.data('dynatable').paginationPage.set(1); MyTable.data('dynatable').paginationPage.set(1);
MyTable.data('dynatable').process(); // MyTable.data('dynatable').process();
if ( $(".imadiv").length>0 ) return 1; if ( $(".imadiv").length>0 ) return 1;
$('<br><br><div class="imadiv"></div>').insertAfter(".dynatable-per-page") $('<br><br><div class="imadiv"></div>').insertAfter(".dynatable-per-page")
...@@ -471,7 +471,7 @@ function Main_test(Data) { ...@@ -471,7 +471,7 @@ function Main_test(Data) {
// NB searchString == $("#doubleSearch").val() // NB searchString == $("#doubleSearch").val()
// by default we always decide to search in the title // by default we always decide to search in the title
matchInTexts = [record.title] matchInTexts = [record.rawtitle]
// if box is checked we'll also search in the abstracts // if box is checked we'll also search in the abstracts
if (doAbstractsSearch) { if (doAbstractsSearch) {
...@@ -493,20 +493,25 @@ function Main_test(Data) { ...@@ -493,20 +493,25 @@ function Main_test(Data) {
} }
return contains; return contains;
} }
MyTable.data('dynatable').process(); // MyTable.data('dynatable').process();
// also append another bound filter for duplicates // also append another bound filter for duplicates
MyTable.data('dynatable').queries MyTable.data('dynatable').queries
.functions['dupFilter'] = function(record,selected) { .functions['dupFilter'] = function(record,selected) {
return (selected == 'filter_all')||(countByTitles[record.title] > 1) return (selected == 'filter_all')||(countByTitles[record.rawtitle] > 1)
} }
// and set this filter's initial status to 'filter_all' // and set this filter's initial status to 'filter_all'
MyTable.data('dynatable').settings.dataset.queries['dupFilter'] = 'filter_all' MyTable.data('dynatable').settings.dataset.queries['dupFilter'] = 'filter_all'
MyTable.data('dynatable').process();
MyTable.data('dynatable').process MyTable.data('dynatable').sorts.functions["rawtitleSort"] = function testSort (rec1,rec2) {
// sorts on rawtitle instead of derived docurl
// and sorts with locale-aware order
return rec1.rawtitle.localeCompare(rec2.rawtitle)
}
MyTable.data('dynatable').process();
// re-apply search function on click // re-apply search function on click
$('#searchAB').click( function() { $('#searchAB').click( function() {
...@@ -523,7 +528,28 @@ function Main_test(Data) { ...@@ -523,7 +528,28 @@ function Main_test(Data) {
return "OK" return "OK"
} }
$("#corpusdisplayer").hide() var dupFlag = false ;
$("#div-table").on("dynatable:queries:added", function(e, qname, qval) {
if (!dupFlag && qname == 'dupFilter' && qval == "filter_dupl") {
MyTable.data('dynatable').queries.remove('dupFilter')
// to avoid recursion when we'll call this filter again in 4 lines
dupFlag = true ;
// sort alphabetically **before** duplicates filter
MyTable.data('dynatable').sorts.clear();
MyTable.data('dynatable').sorts.add('rawtitle', -1) // -1 <==> DESC (ASC doesn't work well ?)
MyTable.data('dynatable').queries.add('dupFilter', 'filter_dupl')
MyTable.data('dynatable').process();
}
});
$("#div-table").on("dynatable:queries:removed", function(e, qname) {
if (qname == 'dupFilter') {
dupFlag = false ;
}
});
// 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({
...@@ -536,15 +562,17 @@ $.ajax({ ...@@ -536,15 +562,17 @@ $.ajax({
var orig_id = parseInt(record.id); var orig_id = parseInt(record.id);
var arr_id = parseInt(i) var arr_id = parseInt(i)
RecDict[orig_id] = arr_id; RecDict[orig_id] = arr_id;
record.title = record.name; record.rawtitle = record.name;
record.name = '<a target="_blank" href="/projects/' + project_id + '/corpora/'+ corpus_id + '/documents/' + record.id + '">' + record.name + '</a>';
// trick to have a clickable title in docurl slot, but could be done in transformContent2
record.docurl = '<a target="_blank" href="/projects/' + project_id + '/corpora/'+ corpus_id + '/documents/' + record.id + '">' + record.name + '</a>';
record.date = get_node_date(record); record.date = get_node_date(record);
record.del = false; record.del = false;
}); });
// initialize CountByTitle census // initialize CountByTitle census
for (var i in data.records) { for (var i in data.records) {
ourTitle = data.records[i]['title'] ; ourTitle = data.records[i]['rawtitle'] ;
if (countByTitles.hasOwnProperty(ourTitle)) { if (countByTitles.hasOwnProperty(ourTitle)) {
countByTitles[ourTitle] ++ ; countByTitles[ourTitle] ++ ;
} }
...@@ -556,9 +584,7 @@ $.ajax({ ...@@ -556,9 +584,7 @@ $.ajax({
var result = Main_test(data.records) var result = Main_test(data.records)
$("#corpusdisplayer").show()
$("#content_loader").remove() $("#content_loader").remove()
$("#corpusdisplayer").click()
console.log( result ) console.log( result )
}, },
......
...@@ -100,27 +100,15 @@ function Push2Buffer( NewVal ) { ...@@ -100,27 +100,15 @@ function Push2Buffer( NewVal ) {
} }
function Final_UpdateTable( action ) { function Final_UpdateTable( action ) {
// (1) Identifying if the button is collapsed:
var isCollapsed=false;
var tableClass = $("#journal_table").attr("class")
//\bcollapse\b
if(tableClass.indexOf(" collapse ")>-1) {
isCollapsed=true;
}
var UpdateTable = false var UpdateTable = false
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) { if (action=="changerange") {
UpdateTable = true; UpdateTable = true;
$("#corpusdisplayer").html("Close Folder") }
} else $("#corpusdisplayer").html("View by journals")
pr("update table??: "+UpdateTable) pr("update table??: "+UpdateTable)
if ( ! UpdateTable ) return false; //stop whatever you wanted to do. if ( ! UpdateTable ) return false; //stop whatever you wanted to do.
var TimeRange = AjaxRecords; var TimeRange = AjaxRecords;
var dataini = (TheBuffer[0])?TheBuffer[0]:oldest; var dataini = (TheBuffer[0])?TheBuffer[0]:oldest;
...@@ -502,8 +490,6 @@ function Main_test( data , initial) { ...@@ -502,8 +490,6 @@ function Main_test( data , initial) {
$("#corpusdisplayer").hide()
console.log(window.location.href) console.log(window.location.href)
// match corpus_id in the url // match corpus_id in the url
...@@ -525,13 +511,8 @@ if (rematch) { ...@@ -525,13 +511,8 @@ if (rematch) {
var result = Main_test( data.by.journal , "FirstScore" ) var result = Main_test( data.by.journal , "FirstScore" )
console.log( result ) console.log( result )
$("#corpusdisplayer").show()
$("#content_loader").remove() $("#content_loader").remove()
$("#corpusdisplayer").click()
} }
}); });
} }
else {
}
...@@ -27,8 +27,10 @@ ...@@ -27,8 +27,10 @@
* Romain Loth * Romain Loth
* - minor 2016 modifications + doc * - minor 2016 modifications + doc
* - unify table ids with ngram ids * - unify table ids with ngram ids
* - new api routes + prefetch maplist terms
* - simplify UpdateTable
* *
* @version 1.0 beta * @version 1.1
* *
* @requires jquery.dynatable * @requires jquery.dynatable
* @requires d3 * @requires d3
...@@ -304,27 +306,14 @@ function Final_UpdateTable( action ) { ...@@ -304,27 +306,14 @@ function Final_UpdateTable( action ) {
// console.log("AjaxRecords") // console.log("AjaxRecords")
// console.log(AjaxRecords) // console.log(AjaxRecords)
// (1) Identifying if the button is collapsed:
var isCollapsed=false;
var tableClass = $("#terms_table").attr("class")
//\bcollapse\b
if(tableClass.indexOf(" collapse ")>-1) {
isCollapsed=true;
}
var UpdateTable = false var UpdateTable = false
if ( (action == "click" && !isCollapsed) || (action=="changerange" && isCollapsed) ) { if (action=="changerange") {
UpdateTable = true; UpdateTable = true;
$("#corpusdisplayer").html("Close Term List") }
} else $("#corpusdisplayer").html("View by terms")
pr("update table??: "+UpdateTable) pr("update table??: "+UpdateTable)
if ( ! UpdateTable ) return false; //stop whatever you wanted to do. if ( ! UpdateTable ) return false; //stop whatever you wanted to do.
var TimeRange = AjaxRecords; var TimeRange = AjaxRecords;
var dataini = (TheBuffer[0])?TheBuffer[0]:oldest; var dataini = (TheBuffer[0])?TheBuffer[0]:oldest;
...@@ -1433,19 +1422,19 @@ function GROUPCRUD( groupnode_id , post_data , callback) { ...@@ -1433,19 +1422,19 @@ function GROUPCRUD( groupnode_id , post_data , callback) {
* 3. Creates the scores distribution chart over table * 3. Creates the scores distribution chart over table
* 4. Set up Search div * 4. Set up Search div
* *
* @param data: a response from the api/node/CID/ngrams/list/ routes * @param ngdata: a response from the api/node/CID/ngrams/list/ routes
* @param initial: initial score type "occs" or "tfidf" * @param initial: initial score type "occs" or "tfidf"
* @param search_filter: eg 'filter_all' (see SearchFilters.MODE) * @param search_filter: eg 'filter_all' (see SearchFilters.MODE)
*/ */
function MainTableAndCharts( data , initial , search_filter) { function MainTableAndCharts( ngdata , initial , search_filter) {
// debug // debug
// alert("refresh main") // alert("refresh main")
console.log("") console.log("")
console.log(" = = = = MainTableAndCharts: = = = = ") console.log(" = = = = MainTableAndCharts: = = = = ")
console.log("data:") console.log("ngdata:")
console.log(data) console.log(ngdata)
console.log("initial:") // console.log("initial:") //
console.log(initial) console.log(initial)
console.log("search_filter:") // eg 'filter_all' console.log("search_filter:") // eg 'filter_all'
...@@ -1453,13 +1442,13 @@ function MainTableAndCharts( data , initial , search_filter) { ...@@ -1453,13 +1442,13 @@ function MainTableAndCharts( data , initial , search_filter) {
console.log(" = = = = / MainTableAndCharts: = = = = ") console.log(" = = = = / MainTableAndCharts: = = = = ")
console.log("") console.log("")
// Expected infos in "data.ngrams" should have the form: // Expected infos in "ngdata.ngrams" should have the form:
// { "1": { id: "1", name: "réalité", score: 36 }, // { "1": { id: "1", name: "réalité", score: 36 },
// "9": { id: "9", name: "pdg", score: 116 }, // "9": { id: "9", name: "pdg", score: 116 },
// "10": { id:"10", name: "infrastructure", score: 12 } etc. } // "10": { id:"10", name: "infrastructure", score: 12 } etc. }
// (see filling of rec_info below) // (see filling of rec_info below)
// console.log(data.ngrams) // console.log(ngdata.ngrams)
var DistributionDict = {} var DistributionDict = {}
for(var i in DistributionDict) for(var i in DistributionDict)
...@@ -1541,8 +1530,8 @@ function MainTableAndCharts( data , initial , search_filter) { ...@@ -1541,8 +1530,8 @@ function MainTableAndCharts( data , initial , search_filter) {
$('#mapAll').data("columnSelection", 'SOME') $('#mapAll').data("columnSelection", 'SOME')
var div_stats = "<p>"; var div_stats = "<p>";
for(var i in data.scores) { for(var i in ngdata.scores) {
var value = (!isNaN(Number(data.scores[i])))? Number(data.scores[i]).toFixed(1) : data.scores[i]; var value = (!isNaN(Number(ngdata.scores[i])))? Number(ngdata.scores[i]).toFixed(1) : ngdata.scores[i];
div_stats += i+": "+value+" | " div_stats += i+": "+value+" | "
} }
div_stats += "</p>" div_stats += "</p>"
...@@ -1550,11 +1539,11 @@ function MainTableAndCharts( data , initial , search_filter) { ...@@ -1550,11 +1539,11 @@ function MainTableAndCharts( data , initial , search_filter) {
AjaxRecords = {} AjaxRecords = {}
for(var id in data.ngrams) { for(var id in ngdata.ngrams) {
// console.log(i) // console.log(i)
// console.log(data.ngrams[i]) // console.log(ngdata.ngrams[i])
var le_ngram = data.ngrams[id] ; var le_ngram = ngdata.ngrams[id] ;
// INIT records // INIT records
// one record <=> one line in the table + ngram states // one record <=> one line in the table + ngram states
...@@ -1893,13 +1882,6 @@ var NGrams = { ...@@ -1893,13 +1882,6 @@ var NGrams = {
"scores" : {} "scores" : {}
} }
$("#corpusdisplayer").hide()
// if( $("#share_button").length==0 ) {
// $("#ImportList").remove()
// }
// NEW AJAX x 2 // NEW AJAX x 2
...@@ -2029,13 +2011,20 @@ function AfterAjax() { ...@@ -2029,13 +2011,20 @@ function AfterAjax() {
// ----------------------------------------- MAPLIST // ----------------------------------------- MAPLIST
if( Object.keys(NGrams["map"]).length>0 ) { if( Object.keys(NGrams["map"]).length>0 ) {
for(var ngram_id in NGrams["main"].ngrams) { for(var ngram_id in NGrams["main"].ngrams) {
myMiamNgram = NGrams["main"].ngrams[ngram_id] myNgram = NGrams["main"].ngrams[ngram_id]
if(NGrams["map"][ngram_id]) { if(NGrams["map"][ngram_id]) {
// keepstateId = 1 // keepstateId = 1
keepstateId = System[0]["statesD"]["keep"] keepstateId = System[0]["statesD"]["keep"]
// initialize state of maplist items // initialize state of maplist items
myMiamNgram["state"] = keepstateId ; myNgram["state"] = keepstateId ;
}
else if (NGrams["stop"][ngram_id]) {
// delstateId = 2
delstateId = System[0]["statesD"]["delete"]
// initialize state of stoplist items
myNgram["state"] = delstateId ;
} }
} }
} }
...@@ -2071,10 +2060,7 @@ function AfterAjax() { ...@@ -2071,10 +2060,7 @@ function AfterAjax() {
// //
// }); // });
$("#corpusdisplayer").show()
$("#content_loader").remove() $("#content_loader").remove()
$("#corpusdisplayer").click()
$(".nav-tabs a").click(function(e){ $(".nav-tabs a").click(function(e){
e.preventDefault(); e.preventDefault();
......
/* styles for menu.html template (navbar etc) */ /* styles for menu.html template (navbar etc) */
#dafixedtop .navbar-text { #dafixedtop .navbar-text, #graphsfixedtop .navbar-text {
margin: 0 ; margin: 0 ;
padding-top: 15px; padding-top: 15px;
padding-bottom: 15px; padding-bottom: 15px;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<link rel="stylesheet" href="{% static "js/libs/css2/custom.css" %}" media="screen"> <link rel="stylesheet" href="{% static "js/libs/css2/custom.css" %}" media="screen">
<link rel="stylesheet" href="{% static "js/libs/css2/sidebar.css" %}" media="screen"> <link rel="stylesheet" href="{% static "js/libs/css2/sidebar.css" %}" media="screen">
<link rel="stylesheet" type="text/css" href="{% static "js/gargantext/menu.css"%}"/>
<style> <style>
#leftcolumn { #leftcolumn {
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
<body> <body>
<div class="navbar navbar-inverse" role="navigation"> <div id="graphsfixedtop" class="navbar navbar-inverse" role="navigation">
<div class="container"> <div class="container">
<div class="navbar-inner"> <div class="navbar-inner">
<button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
...@@ -84,20 +85,27 @@ ...@@ -84,20 +85,27 @@
<ul class="nav pull-right"> <ul class="nav pull-right">
<li class="dropdown"> <li class="dropdown">
<a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown" title="That is your login"><i class="icon-user"></i> <a href="#" role="button" class="dropdown-toggle navbar-text" data-toggle="dropdown" title="That is your username">
<span class="glyphicon glyphicon-user" aria-hidden="true" style="color:white"></span> <i class="icon-user"></i>
{{ user.username | truncatechars:15}} <span class="glyphicon glyphicon-user" aria-hidden="true" style="color:white"></span>
{{ user.username | truncatechars:15}}
<i class="caret"></i> <i class="caret"></i>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a tabindex="-1" href="http://www.iscpif.fr/tiki-index.php?page=gargantext_feedback" title="Send us a message (bug, thanks, congrats...)">Report Feedback</a></li> <li><a tabindex="-1" href="http://www.iscpif.fr/tiki-index.php?page=gargantext_feedback" title="Send us a message (bug, thanks, congrats...)">
<span class="glyphicon glyphicon-bullhorn" aria-hidden="true"></span>
Report Feedback</a></li>
<li class="divider"></li> <li class="divider"></li>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<li><a tabindex="-1" href="/auth/logout" title="Click here to logout especially on public devices">Logout</a></li> <li>
<a tabindex="-1" href="/auth/logout"
title="Click here to logout especially on public devices">
<span class="glyphicon glyphicon-log-out" aria-hidden="true"></span>
Logout
</a></li>
{% else %} {% else %}
<li><a tabindex="-1" href="/auth/">Login</a></li> <li><a tabindex="-1" href="/auth/login">Login</a></li>
{% endif %} {% endif %}
</ul> </ul>
</li> </li>
</ul> </ul>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<center> <center>
Select a frequency group in the chart with blue bars to zoom in Select a frequency group in the chart with blue bars 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>--!> <!--<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="btn btn-xs btn-default" href="javascript:volumeChart.filterAll();dc.redrawAll();">Reset</a></p>
<!-- <p style="font-size:70%"> <!-- <p style="font-size:70%">
<b>x</b>: amount of documents for the journal <b>x</b>: amount of documents for the journal
...@@ -51,36 +51,29 @@ ...@@ -51,36 +51,29 @@
<div class="container"> <div class="container">
<div class="jumbotron"> <div class="jumbotron">
<div class="row"> <div class="panel panel-default">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-heading"> <h4 class="panel-title">
<h4 class="panel-title"> Publications by source
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> </h4>
<!-- Final_UpdateTable redraws the dynatable if necessary --> </div>
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg">Journals
</p>
</a> <div class="panel-body">
</h4> <div id="div-table">
</div> <!-- (table id="my-ajax-table") dynamically set by Journals_dyna_chart_and_table -->
</div>
<div id="journal_table" class="panel-collapse collapse in no-transition" role="tabpanel"> </div>
<div class="panel-body">
<div id="div-table">
<!-- (table id="my-ajax-table") dynamically set by Journals_dyna_chart_and_table --> </div> <!-- /div panel -->
</div>
</div> </div> <!-- /jumbotron -->
</div> <!-- /div panel-collapse -->
</div>
</div> <!-- /div panel -->
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron -->
<!--
</div> Alignment
</div> (these divs are closed by the menu)
/container -->
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<center> <center>
Select a score/frequency range in the chart with blue bars to zoom in Select a score/frequency range in the chart with blue bars 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>--!> <!--<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="btn btn-xs btn-default" href="javascript:volumeChart.filterAll();dc.redrawAll();">Reset</a></p>
<div class="clearfix"></div> <div class="clearfix"></div>
</center> </center>
...@@ -49,16 +49,11 @@ ...@@ -49,16 +49,11 @@
<input type="hidden" id="scores_id" value=""></input> <input type="hidden" id="scores_id" value=""></input>
<div class="jumbotron"> <div class="jumbotron">
<div class="row">
<div class="panel panel-default"> <div class="panel panel-default">
<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"> Extracted terms
<!-- Final_UpdateTable redraws the dynatable if necessary -->
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg">
Close term list
</p>
<!-- <button title='run test function' onclick="doATest()"> <!-- <button title='run test function' onclick="doATest()">
TEST TEST
</button> --> </button> -->
...@@ -72,37 +67,34 @@ ...@@ -72,37 +67,34 @@
<option value='0'>Candidates only</option> <option value='0'>Candidates only</option>
<!-- <option value='1' selected="selected">Map terms only</option> --> <!-- <option value='1' selected="selected">Map terms only</option> -->
<option value='1'>Map terms only</option> <option value='1'>Map terms only</option>
<option value='2'>New stopwords only</option> <option value='2'>Stopwords only</option>
</select> </select>
</div> </div>
</h4> </h4>
</div> </div>
<div id="terms_table" class="panel-collapse collapse in no-transition" role="tabpanel"> <div id="terms_table" class="panel-body">
<div class="panel-body"> <div id="div-table">
<div id="div-table"> <!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table -->
<!-- (table id="my-ajax-table") dynamically set by Ngrams_dyna_chart_and_table --> </div>
</div>
<!-- under the table --> <!-- under the table -->
<p align="right"> <p align="right">
<button id="Save_All" class="btn btn-primary">Save changes permanently</button> <button id="Save_All" class="btn btn-primary">Save changes permanently</button>
</p> </p>
</div> </div>
</div> <!-- /div panel-collapse -->
</div> <!-- /div panel --> </div> <!-- /div panel -->
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron --> </div> <!-- /jumbotron -->
<!-- Divs closed by the menu <!--
</div> Alignment
<button id="ImportList" onclick="GetUserPortfolio();" class="btn btn-warning"> <button id="ImportList" onclick="GetUserPortfolio();" class="btn btn-warning">
Import a Corpus-List Import a Corpus-List
</button> </button>
</div> container -->
--!> </div>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<center> <center>
Select a time range in the chart with blue bars to zoom in Select a time range in the chart with blue bars 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>--!> <!--<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="btn btn-xs btn-default" href="javascript:volumeChart.filterAll();dc.redrawAll();">Reset</a></p>
<div class="clearfix"></div> <div class="clearfix"></div>
...@@ -51,50 +51,42 @@ ...@@ -51,50 +51,42 @@
<div class="container"> <div class="container">
<div class="jumbotron"> <div class="jumbotron">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <div class="panel panel-default">
<div class="panel panel-body"> <div class="panel-heading">
<div class="panel-heading"> <h4 class="panel-title">
<h4 class="panel-title"> Publications by title
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> </h4>
<p id="corpusdisplayer" onclick='Final_UpdateTable("click")' class="btn btn-primary btn-lg" style="width:200px; margin:0 auto; display:block;">Titles</h2></p> <!-- search box with custom function in Docs_dyna_chart_and_tables.js -->
</a> <div class="pull-left" style="margin-top:1.85em; font-size: 16px;">
</h4> <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
Search:
<!-- search box with custom function in Docs_dyna_chart_and_tables.js --> <input type="search" id="doubleSearch"/>
<div class="pull-left" style="margin-top:1.85em; font-size: 16px;"> <span style="font-size:70%;">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span> <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
Search: <!-- Used by the #doubleSearch associated function -->
<input type="search" id="doubleSearch"/> <input title="Search in Titles" id="searchTI" name="searchTI" type="checkbox" checked onclick="return false">TI&nbsp;
<span style="font-size:70%;"> <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span> <input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">AB
<!-- Used by the #doubleSearch associated function --> </span>&nbsp;&nbsp;
<input title="Search in Titles" id="searchTI" name="searchTI" type="checkbox" checked onclick="return false">TI&nbsp; <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span> <select id="dupFilter" name="dupFilter">
<input title="Search in Abstracts" id="searchAB" name="searchAB" type="checkbox">AB <option value="filter_all">All</option>
</span>&nbsp;&nbsp; <option value="filter_dupl">Duplicates by Title</option>
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span> </select>
<select id="dupFilter" name="dupFilter">
<option value="filter_all">All</option>
<option value="filter_dupl">Duplicates by Title</option>
</select>
</div>
</div>
<div id="collapseOne" class="panel-collapse collapse no-transition" role="tabpanel">
<div class="panel-body">
<div id="div-table"></div>
<p align="right">
<button id="move2trash" class="btn btn-primary btn-lg" >
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Trash It!
</button>
</p>
</div>
</div>
</div> </div>
</div> </div>
<div class="panel-body">
<div id="div-table"></div>
<p align="right">
<button id="move2trash" class="btn btn-primary btn-lg" >
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Trash It!
</button>
</p>
</div>
</div> </div>
</div>
</div>
<!-- here goes import script js/bootstrap/bootstrap-multiselect.js, mais ca marche pas--> <!-- here goes import script js/bootstrap/bootstrap-multiselect.js, mais ca marche pas-->
<script type="text/javascript" src="{% static "js/jquery/dynatable/jquery.dynatable.js" %}"></script> <script type="text/javascript" src="{% static "js/jquery/dynatable/jquery.dynatable.js" %}"></script>
......
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