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
0caaed78
Commit
0caaed78
authored
Jan 07, 2015
by
Mathieu Rodic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Document lists are now available at `/tests/mvc-listdocuments`
parent
9d3682eb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
390 additions
and
3 deletions
+390
-3
urls.py
gargantext_web/urls.py
+2
-0
views.py
gargantext_web/views.py
+11
-0
gargantext.angular.js
static/js/gargantext.angular.js
+17
-3
mvc-listdocuments.html
templates/tests/mvc-listdocuments.html
+360
-0
No files found.
gargantext_web/urls.py
View file @
0caaed78
...
...
@@ -29,6 +29,7 @@ urlpatterns = patterns('',
url
(
r'^project/(\d+)/corpus/(\d+)/$'
,
views
.
corpus
),
url
(
r'^project/(\d+)/corpus/(\d+)/delete/$'
,
views
.
delete_corpus
),
url
(
r'^project/(\d+)/corpus/(\d+)/corpus.csv$'
,
views
.
corpus_csv
),
url
(
r'^project/(\d+)/corpus/(tests_mvc_listdocuments+)/corpus.tests_mvc_listdocuments$'
,
views
.
corpus_csv
),
url
(
r'^project/(\d+)/corpus/(\d+)/timerange/(\d+)/(\d+)$'
,
views
.
subcorpus
),
...
...
@@ -57,6 +58,7 @@ urlpatterns = patterns('',
url
(
r'^ngrams$'
,
views
.
ngrams
),
url
(
r'^nodeinfo/(\d+)$'
,
views
.
nodeinfo
),
url
(
r'^tests/mvc$'
,
views
.
tests_mvc
),
url
(
r'^tests/mvc-listdocuments$'
,
views
.
tests_mvc_listdocuments
),
)
...
...
gargantext_web/views.py
View file @
0caaed78
...
...
@@ -717,6 +717,17 @@ def tests_mvc(request):
}))
return
HttpResponse
(
html
)
def
tests_mvc_listdocuments
(
request
):
'''Just a test page for Javascript MVC.'''
t
=
get_template
(
'tests/mvc-listdocuments.html'
)
user
=
request
.
user
date
=
datetime
.
datetime
.
now
()
html
=
t
.
render
(
Context
({
'user'
:
user
,
'date'
:
date
,
}))
return
HttpResponse
(
html
)
def
ngrams
(
request
):
'''The ngrams list.'''
t
=
get_template
(
'ngrams.html'
)
...
...
static/js/gargantext.angular.js
View file @
0caaed78
...
...
@@ -87,7 +87,7 @@ var groupings = {
// Define the application
var
gargantext
=
angular
.
module
(
'Gargantext'
,
[
'n3-charts.linechart'
,
'ngCookies'
])
var
gargantext
=
angular
.
module
(
'Gargantext'
,
[
'n3-charts.linechart'
,
'ngCookies'
])
;
// Customize the application's scope
...
...
@@ -168,7 +168,7 @@ gargantext.controller("QueryController", function($scope, $http) {
// change view to loading mode
$scope
.
loading
=
true
;
// query parameters: columns
var
retrieve
=
{
type
:
'fields'
,
list
:
[
'id'
,
'name'
]};
var
retrieve
=
{
type
:
'fields'
,
list
:
[
'id'
,
'name'
,
'metadata.publication_date'
]};
// query parameters: pagination
var
pagination
=
$scope
.
pagination
;
// query parameters: sort
...
...
@@ -200,13 +200,27 @@ gargantext.controller("QueryController", function($scope, $http) {
// send query to the server
$http
.
post
(
url
,
query
).
success
(
function
(
response
){
$scope
.
resultsCount
=
response
.
pagination
.
total
;
$scope
.
results
=
response
.
data
;
$scope
.
results
=
response
.
results
;
$scope
.
columns
=
response
.
retrieve
;
$scope
.
loading
=
false
;
}).
error
(
function
(
response
){
console
.
error
(
response
);
});
}
}
// change current page
$scope
.
decrement
=
function
()
{
if
(
$scope
.
pagination
.
offset
>
0
)
{
$scope
.
pagination
.
offset
--
;
}
$scope
.
postQuery
();
};
$scope
.
increment
=
function
()
{
if
(
$scope
.
pagination
.
offset
<
$scope
.
resultsCount
)
{
$scope
.
pagination
.
offset
+=
$scope
.
pagination
.
limit
;
}
$scope
.
postQuery
();
};
});
// Controller for datasets
...
...
templates/tests/mvc-listdocuments.html
0 → 100644
View file @
0caaed78
This diff is collapsed.
Click to expand it.
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