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
b4b05d55
Commit
b4b05d55
authored
Jan 08, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] ReadDocs button transition OK
parent
b86a3941
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
17 deletions
+33
-17
views.py
gargantext_web/views.py
+1
-1
corpus.html
templates/corpus.html
+32
-16
No files found.
gargantext_web/views.py
View file @
b4b05d55
...
@@ -439,7 +439,7 @@ def subcorpus(request, project_id, corpus_id, start , end ):
...
@@ -439,7 +439,7 @@ def subcorpus(request, project_id, corpus_id, start , end ):
filtered_docs
.
append
(
doc
)
filtered_docs
.
append
(
doc
)
# ordering from most recent to the older.
# ordering from most recent to the older.
ordered
=
sorted
(
filtered_docs
,
key
=
lambda
x
:
x
.
date
,
reverse
=
True
)
ordered
=
sorted
(
filtered_docs
,
key
=
lambda
x
:
x
.
date
)
# pages of 10 elements. Like a sir.
# pages of 10 elements. Like a sir.
paginator
=
Paginator
(
ordered
,
10
)
paginator
=
Paginator
(
ordered
,
10
)
...
...
templates/corpus.html
View file @
b4b05d55
...
@@ -14,6 +14,15 @@
...
@@ -14,6 +14,15 @@
<script
type=
"text/javascript"
src=
"{% static "
js
/
charts
/
crossfilter
.
js
"%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
js
/
charts
/
crossfilter
.
js
"%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
js
/
charts
/
dc
.
js
"%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
js
/
charts
/
dc
.
js
"%}"
></script>
<style>
.no-transition
{
-webkit-transition
:
height
0.1s
;
-moz-transition
:
height
0.1s
;
-ms-transition
:
height
0.1s
;
-o-transition
:
height
0.1s
;
transition
:
height
0.1s
;
}
</style>
{% endblock %}
{% endblock %}
...
@@ -33,7 +42,7 @@
...
@@ -33,7 +42,7 @@
</p>
</p>
{% endif %}
{% endif %}
<!-- <a class="btn btn-primary btn-lg" role="button" href="/admin/documents/corpus/{{ corpus.pk }}/">Add file</a> --
!
>
<!-- <a class="btn btn-primary btn-lg" role="button" href="/admin/documents/corpus/{{ corpus.pk }}/">Add file</a> -->
<a
class=
"btn btn-primary btn-lg"
role=
"button"
href=
"/project/{{project.pk}}/corpus/{{ corpus.pk }}/corpus.csv"
>
Save as
</a>
<a
class=
"btn btn-primary btn-lg"
role=
"button"
href=
"/project/{{project.pk}}/corpus/{{ corpus.pk }}/corpus.csv"
>
Save as
</a>
<a
class=
"btn btn-primary btn-lg"
role=
"button"
href=
"/project/{{project.pk}}/corpus/{{ corpus.pk }}/delete"
>
Delete
</a></p>
<a
class=
"btn btn-primary btn-lg"
role=
"button"
href=
"/project/{{project.pk}}/corpus/{{ corpus.pk }}/delete"
>
Delete
</a></p>
...
@@ -79,7 +88,7 @@
...
@@ -79,7 +88,7 @@
</a>
</a>
</h4>
</h4>
</div>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel">
<div
id=
"collapseOne"
class=
"panel-collapse collapse
no-transition
"
role=
"tabpanel"
>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<p
align=
"right"
>
<p
align=
"right"
>
...
@@ -144,6 +153,7 @@
...
@@ -144,6 +153,7 @@
var
datesbuffer
=
false
;
var
datesbuffer
=
false
;
var
latest
,
oldest
;
function
pr
(
msg
)
{
function
pr
(
msg
)
{
console
.
log
(
msg
)
console
.
log
(
msg
)
...
@@ -165,14 +175,29 @@ function updateDocuments(pagenumber,pagenav) {
...
@@ -165,14 +175,29 @@ function updateDocuments(pagenumber,pagenav) {
pagenav
=
(
pagenav
)?
pagenav
:
true
;
pagenav
=
(
pagenav
)?
pagenav
:
true
;
pagenumber
=
(
pagenumber
)?
pagenumber
:
1
;
pagenumber
=
(
pagenumber
)?
pagenumber
:
1
;
pr
(
"in here pagenav:"
+
pagenav
+
" - pagenumber:"
+
pagenumber
)
pr
(
"in here pagenav:"
+
pagenav
+
" - pagenumber:"
+
pagenumber
)
pr
(
$
(
"#collapseOne"
).
height
()
)
pr
(
"offset left: "
+
$
(
"#collapseOne"
).
offset
().
left
)
// if "Read Documents" collapsible is close, then... show some me pubs!
// if "Read Documents" collapsible is close, then... show some me pubs!
if
(
pagenav
||
$
(
"#collapseOne"
).
height
()
<
5
0
)
{
if
(
pagenav
||
$
(
"#collapseOne"
).
offset
().
left
==
0
)
{
// Here u ask for the server some paginated results (pubs)
// Here u ask for the server some paginated results (pubs)
// if u havent select a timerange from the blue chart, then show me all pubs
// if u havent select a timerange from the blue chart, then show me all pubs
if
(
!
datesbuffer
)
{
if
(
!
datesbuffer
)
{
console
.
log
(
"nothing cause dont wanna"
)
var
dataini
=
oldest
.
join
(
""
)
var
datafin
=
latest
.
join
(
""
)
//http://localhost:8000/project/37525/corpus/37526/timerange/20040117/20040125?page=1
var
base
=
window
.
location
.
href
;
var
theurl
=
base
+
"timerange/"
+
dataini
+
"/"
+
datafin
+
"?page="
+
pagenumber
;
pr
(
"theurl: "
+
theurl
)
$
.
ajax
({
url
:
theurl
,
success
:
function
(
data
)
{
// console.log(data)
$
(
'#subcorpusdiv'
).
html
(
data
);
}
});
}
}
// there's some timerange selected in the blue chart, so show me the pubs of that period
// there's some timerange selected in the blue chart, so show me the pubs of that period
else
{
else
{
...
@@ -196,10 +221,6 @@ function updateDocuments(pagenumber,pagenav) {
...
@@ -196,10 +221,6 @@ function updateDocuments(pagenumber,pagenav) {
}
}
//else: "Read Documents" collapsible is open!, so do nothing
//else: "Read Documents" collapsible is open!, so do nothing
}
}
...
@@ -233,13 +254,8 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
...
@@ -233,13 +254,8 @@ d3.csv("/chart/corpus/{{ corpus.id }}/data.csv", function (data) {
var
orderDates
=
Object
.
keys
(
justdates
).
reverse
();
var
orderDates
=
Object
.
keys
(
justdates
).
reverse
();
var
latest
=
orderDates
[
0
].
split
(
"/"
)
latest
=
orderDates
[
0
].
split
(
"/"
)
var
oldest
=
orderDates
[
orderDates
.
length
-
1
].
split
(
"/"
)
oldest
=
orderDates
[
orderDates
.
length
-
1
].
split
(
"/"
)
pr
(
"latest:"
)
pr
(
latest
)
pr
(
"oldest:"
)
pr
(
oldest
)
var
t0_year
=
oldest
[
0
]
var
t0_year
=
oldest
[
0
]
var
t0_month
=
oldest
[
1
]
var
t0_month
=
oldest
[
1
]
...
...
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