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
afc6583f
Commit
afc6583f
authored
Jan 13, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'romain-ngrams' into unstable-scopedSession
parents
71937a5b
971918f3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
436 additions
and
289 deletions
+436
-289
jquery.dynatable.css
static/css/jquery.dynatable.css
+1
-1
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+373
-182
terms.html
templates/corpus/terms.html
+26
-65
views.py
tests/ngramstable/views.py
+36
-41
No files found.
static/css/jquery.dynatable.css
View file @
afc6583f
...
...
@@ -69,4 +69,4 @@ th a:hover {
.dynatable-disabled-page
:hover
{
background
:
none
;
color
:
#999
;
}
\ No newline at end of file
}
static/js/NGrams_dyna_chart_and_table.js
View file @
afc6583f
This diff is collapsed.
Click to expand it.
templates/corpus/terms.html
View file @
afc6583f
...
...
@@ -25,13 +25,34 @@
-o-transition
:
height
0.1s
;
transition
:
height
0.1s
;
}
th
{
color
:
#fff
;
}
th
{
color
:
#fff
;
font-weight
:
normal
;
font-size
:
0.9em
;
vertical-align
:
top
;
}
/* specific selector to override equally specific bootstrap.css */
.table
>
thead
>
tr
>
th
{
vertical-align
:
top
;
}
th
a
{
color
:
#fff
;
font-weight
:
normal
;
font-style
:
italic
;
font-size
:
0.9em
;
}
th
p
.note
{
color
:
#ccc
;
font-size
:
0.6em
;
margin
:
1em
0
0
0
;
}
th
p
.note
>
input
{
float
:
left
;
margin
:
0
.2em
0
0
;
}
th
p
.note
>
label
{
float
:
left
;
}
tr
:hover
{
...
...
@@ -171,7 +192,7 @@ input[type=radio]:checked + label {
<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;"
>
Close Term List
</h2></p>
</a>
</h4>
</div>
...
...
@@ -194,7 +215,7 @@ input[type=radio]:checked + label {
</p> -->
<p
align=
"right"
>
<!-- <button id="Clean_All" class="btn btn-warning">Clean</button> -->
<button
id=
"Save_All"
class=
"btn btn-primary"
>
Save
</button>
<button
id=
"Save_All"
class=
"btn btn-primary"
>
Save
changes permanently
</button>
</p>
</div>
...
...
@@ -247,66 +268,6 @@ input[type=radio]:checked + label {
</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(false)"
id=
"nope"
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
No
</button>
<button
onclick=
"SaveGlobalChanges(true)"
id=
"yep"
type=
"button"
class=
"btn btn-primary"
>
Yes
</button>
</div>
</div>
</div>
</div>
</div>
<div
id=
"filter_search"
style=
"visibility:hidden"
>
<select
id=
"example-single-optgroups"
onchange=
"SearchFilters(this);"
>
...
...
tests/ngramstable/views.py
View file @
afc6583f
from
django.shortcuts
import
redirect
from
django.shortcuts
import
render
from
django.db
import
transaction
from
django.http
import
Http404
,
HttpResponse
,
HttpResponseRedirect
,
HttpResponseForbidden
#
from django.shortcuts import render
#
from django.db import transaction
#
from
django.http
import
Http404
,
HttpResponse
#
, HttpResponseRedirect, HttpResponseForbidden
from
django.template.loader
import
get_template
from
django.template
import
Context
...
...
@@ -13,49 +13,41 @@ from django.db import connection
# Node, NodeType, Node_Resource, Project, Corpus, \
# Ngram, Node_Ngram, NodeNgramNgram, NodeNodeNgram
from
node.admin
import
CorpusForm
,
ProjectForm
,
ResourceForm
,
CustomForm
from
django.contrib.auth.models
import
User
#
from node.admin import CorpusForm, ProjectForm, ResourceForm, CustomForm
#
#
from django.contrib.auth.models import User
#
import
datetime
from
itertools
import
*
from
dateutil.parser
import
parse
from
django.db
import
connection
from
django
import
forms
from
collections
import
defaultdict
from
parsing.FileParsers
import
*
import
os
#
from itertools import *
#
from dateutil.parser import parse
#
#
from django.db import connection
#
from django import forms
#
#
#
from collections import defaultdict
#
#
from parsing.FileParsers import *
#
import os
import
json
import
math
#
import math
# SOME FUNCTIONS
from
gargantext_web
import
settings
#
# from django.http import *
# from django.shortcuts import render_to_response,redirect
# from django.template import RequestContext
from
django.http
import
*
from
django.shortcuts
import
render_to_response
,
redirect
from
django.template
import
RequestContext
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth
import
authenticate
,
login
,
logout
# from gargantext_web.db import *
from
scrappers.scrap_pubmed.admin
import
Logger
from
gargantext_web.db
import
*
from
sqlalchemy
import
or_
,
func
from
gargantext_web
import
about
from
gargantext_web.db
import
session
,
cache
,
Node
,
NodeNgram
from
sqlalchemy
import
func
from
rest_v1_0.api
import
JsonHttpResponse
from
ngram.lists
import
listIds
,
listNgramIds
,
ngramList
,
doList
def
get_ngrams
(
request
,
project_id
,
corpus_id
):
if
not
request
.
user
.
is_authenticated
():
return
redirect
(
'/login/?next=
%
s'
%
request
.
path
)
...
...
@@ -167,9 +159,7 @@ def get_journals_json(request , project_id, corpus_id ):
JournalsDict
[
journal
]
+=
1
return
JsonHttpResponse
(
JournalsDict
)
from
gargantext_web.db
import
session
,
cache
,
Node
,
NodeNgram
from
sqlalchemy
import
or_
,
func
from
sqlalchemy.orm
import
aliased
def
get_corpuses
(
request
,
node_ids
):
...
...
@@ -202,6 +192,11 @@ def get_corpus_state( request , corpus_id ):
def
get_groups
(
request
):
"""
User groups for current user.id
route: /get_groups
"""
if
not
request
.
user
.
is_authenticated
():
return
JsonHttpResponse
(
{
"request"
:
"forbidden"
}
)
...
...
@@ -226,7 +221,7 @@ def get_groups( request ):
def
graph_share
(
request
,
generic
=
100
,
specific
=
100
):
if
request
.
method
==
'GET'
and
"token"
in
request
.
GET
:
import
json
#
import json
le_token
=
json
.
loads
(
request
.
GET
[
"token"
])[
0
]
import
base64
le_query
=
base64
.
b64decode
(
le_token
)
.
decode
(
"utf-8"
)
...
...
@@ -256,7 +251,7 @@ def graph_share(request, generic=100, specific=100):
def
node_link_share
(
request
):
data
=
{
"request"
:
"error"
}
if
request
.
method
==
'GET'
and
"token"
in
request
.
GET
:
import
json
#
import json
le_token
=
json
.
loads
(
request
.
GET
[
"token"
])[
0
]
import
base64
le_query
=
base64
.
b64decode
(
le_token
)
.
decode
(
"utf-8"
)
...
...
@@ -323,4 +318,4 @@ def share_resource(request , resource_id , group_id) :
connection
.
close
()
# [ / changing owner ]
return
JsonHttpResponse
(
results
)
\ No newline at end of file
return
JsonHttpResponse
(
results
)
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