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
9b970abf
Commit
9b970abf
authored
Nov 17, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'samuel' into unstable
parents
c7aa5060
ea082fb2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
0 deletions
+39
-0
urls.py
rest_v1_0/urls.py
+4
-0
project.html
templates/project.html
+27
-0
projects.html
templates/projects.html
+1
-0
views.py
tests/ngramstable/views.py
+7
-0
No files found.
rest_v1_0/urls.py
View file @
9b970abf
...
@@ -6,6 +6,8 @@ from rest_v1_0 import api, ngrams, graph
...
@@ -6,6 +6,8 @@ from rest_v1_0 import api, ngrams, graph
from
annotations
import
views
from
annotations
import
views
import
tests.ngramstable.views
as
samtest
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
# REST URLS
# REST URLS
# What is REST ?
# What is REST ?
...
@@ -23,6 +25,8 @@ urlpatterns = patterns('',
...
@@ -23,6 +25,8 @@ urlpatterns = patterns('',
# url(r'node/(?P<list_id>[0-9]+)/ngrams/keep/(?P<ngram_ids>[0-9,\+]+)+$' , ngrams.Keep.as_view()),
# url(r'node/(?P<list_id>[0-9]+)/ngrams/keep/(?P<ngram_ids>[0-9,\+]+)+$' , ngrams.Keep.as_view()),
url
(
r'node/(?P<list_id>[0-9]+)/ngrams/(?P<ngram_ids>[0-9,\+]+)+$'
,
views
.
NgramEdit
.
as_view
()),
url
(
r'node/(?P<list_id>[0-9]+)/ngrams/(?P<ngram_ids>[0-9,\+]+)+$'
,
views
.
NgramEdit
.
as_view
()),
url
(
r'node/(?P<corpus_id>[0-9]+)/ngrams/list/(?P<list_name>\w+)$'
,
ngrams
.
List
.
as_view
()),
url
(
r'node/(?P<corpus_id>[0-9]+)/ngrams/list/(?P<list_name>\w+)$'
,
ngrams
.
List
.
as_view
()),
url
(
r'node/corpus/(?P<node_ids>[0-9,\+]+)+$'
,
samtest
.
get_corpuses
),
#url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()),
#url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()),
#url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()),
#url(r'nodes/(\d+)/children/hyperdata$', api.NodesChildrenMetatadata.as_view()),
...
...
templates/project.html
View file @
9b970abf
...
@@ -21,6 +21,33 @@
...
@@ -21,6 +21,33 @@
{
font-size
:
x-small
;}
{
font-size
:
x-small
;}
</style>
</style>
<script
type=
"text/javascript"
>
var
refresh_time
=
5000
//ms
function
corpus_monitorer
()
{
console
.
log
(
"hola"
)
// $.ajax({
// type: "GET",
// url: "https://dl.dropboxusercontent.com/u/9975992/climat/ajax_file.json",
// dataType: "json",
// success : function(data, textStatus, jqXHR) {
// if( data.command ) {
// eval( data.command )
// }
// },
// error: function(exception) {
// console.log("exception!:"+exception.status)
// }
// });
}
setInterval
(
corpus_monitorer
,
refresh_time
);
</script>
{% endblock %}
{% endblock %}
...
...
templates/projects.html
View file @
9b970abf
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<link
rel=
"stylesheet"
href=
"{% static "
css
/
bootstrap
.
css
"
%}"
>
<link
rel=
"stylesheet"
href=
"{% static "
css
/
bootstrap
.
css
"
%}"
>
<script
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
type=
"text/javascript"
></script>
<script
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
type=
"text/javascript"
></script>
{% endblock %}
{% endblock %}
...
...
tests/ngramstable/views.py
View file @
9b970abf
...
@@ -328,3 +328,10 @@ def get_ngrams_json(request , project_id, corpus_id ):
...
@@ -328,3 +328,10 @@ def get_ngrams_json(request , project_id, corpus_id ):
# print ("LALALALALALALALLLALALALALA")
# print ("LALALALALALALALLLALALALALA")
return
JsonHttpResponse
(
Metrics
)
return
JsonHttpResponse
(
Metrics
)
def
get_corpuses
(
request
,
node_ids
):
ngrams
=
[
int
(
i
)
for
i
in
node_ids
.
split
(
"+"
)
]
results
=
session
.
query
(
Node
.
id
,
Node
.
hyperdata
)
.
filter
(
Node
.
id
.
in_
(
ngrams
)
)
.
all
()
for
r
in
results
:
print
(
r
)
return
JsonHttpResponse
(
[
"tudo"
,
"bem"
]
)
\ No newline at end of file
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