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
c5f3fa91
Commit
c5f3fa91
authored
Jun 16, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] Journals-table View
parent
23c71efb
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
821 additions
and
2 deletions
+821
-2
urls.py
gargantext_web/urls.py
+2
-0
Docs_dyna_chart_and_table.js
static/js/Docs_dyna_chart_and_table.js
+0
-0
Journals_dyna_chart_and_table.js
static/js/Journals_dyna_chart_and_table.js
+507
-0
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+0
-0
corpus.html
templates/corpus.html
+1
-1
journals.html
templates/tests/journals.html
+257
-0
ngrams.html
templates/tests/ngrams.html
+1
-1
views.py
tests/ngramstable/views.py
+53
-0
No files found.
gargantext_web/urls.py
View file @
c5f3fa91
...
...
@@ -86,6 +86,8 @@ urlpatterns = patterns('',
url
(
r'^tests/move2trash/$'
,
views
.
move_to_trash_multiple
),
url
(
r'^project/(\d+)/corpus/(\d+)/ngrams/ngrams.json$'
,
samtest
.
test_ngrams
),
url
(
r'^project/(\d+)/corpus/(\d+)/ngrams$'
,
samtest
.
get_ngrams
),
url
(
r'^project/(\d+)/corpus/(\d+)/journals/journals.json$'
,
samtest
.
test_journals
),
url
(
r'^project/(\d+)/corpus/(\d+)/journals$'
,
samtest
.
get_journals
),
url
(
r'^corpus/(\d+)/document/(\d+)/testpage$'
,
samtest
.
test_test
)
)
...
...
static/js/dyna_chart_and_table.js
→
static/js/
Docs_
dyna_chart_and_table.js
View file @
c5f3fa91
File moved
static/js/Journals_dyna_chart_and_table.js
0 → 100644
View file @
c5f3fa91
This diff is collapsed.
Click to expand it.
static/js/
test
_dyna_chart_and_table.js
→
static/js/
NGrams
_dyna_chart_and_table.js
View file @
c5f3fa91
File moved
templates/corpus.html
View file @
c5f3fa91
...
...
@@ -201,7 +201,7 @@ th a {
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
dynatable
.
js
"
%}"
></script>
<!-- custom-lib for dynatable.js and dc.js -->
<script
type=
"text/javascript"
src=
"{% static "
js
/
dyna_chart_and_table
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
js
/
Docs_
dyna_chart_and_table
.
js
"
%}"
></script>
...
...
templates/tests/journals.html
0 → 100644
View file @
c5f3fa91
{% extends "menu.html" %}
{% block css %}
{% load staticfiles %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
bootstrap
.
css
"
%}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
morris
.
css
"
%}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
jquery
.
easy-pie-chart
.
css
"%}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
dc
.
css
"%}"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static "
css
/
jquery
.
dynatable
.
css
"%}"
/>
<script
type=
"text/javascript"
src=
"{% static "
js
/
charts
/
d3
.
js
"%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
js
/
charts
/
crossfilter
.
js
"%}"
></script>
<!-- <script type="text/javascript" src="http://localhost/i7/js_examples/DC_linear/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
;
}
th
{
color
:
#fff
;
}
th
a
{
color
:
#fff
;
font-weight
:
normal
;
font-style
:
italic
;
font-size
:
0.9em
;
}
/*tr:hover {
cursor: pointer;
color: #000;
font-weight: bold;
}*/
.to_delete
{
color
:
red
;
opacity
:
0.8
;
}
.to_group
{
color
:
blue
;
}
.to_keep
{
color
:
green
;
}
.dynatable-record-count
{
font-size
:
0.7em
;
}
.dynatable-pagination-links
{
font-size
:
0.7em
;
}
input
[
type
=
radio
]
{
display
:
none
;
}
input
[
type
=
radio
]
+
label
{
display
:
inline-block
;
margin
:
-2px
;
padding
:
4px
12px
;
margin-bottom
:
0
;
font-size
:
14px
;
line-height
:
20px
;
color
:
#333
;
text-align
:
center
;
text-shadow
:
0
1px
1px
rgba
(
255
,
255
,
255
,
0.75
);
vertical-align
:
middle
;
cursor
:
pointer
;
background-color
:
#f5f5f5
;
background-image
:
-moz-linear-gradient
(
top
,
#fff
,
#e6e6e6
);
background-image
:
-webkit-gradient
(
linear
,
0
0
,
0
100%
,
from
(
#fff
),
to
(
#e6e6e6
));
background-image
:
-webkit-linear-gradient
(
top
,
#fff
,
#e6e6e6
);
background-image
:
-o-linear-gradient
(
top
,
#fff
,
#e6e6e6
);
background-image
:
linear-gradient
(
to
bottom
,
#fff
,
#e6e6e6
);
background-repeat
:
repeat-x
;
border
:
1px
solid
#ccc
;
border-color
:
#e6e6e6
#e6e6e6
#bfbfbf
;
border-color
:
rgba
(
0
,
0
,
0
,
0.1
)
rgba
(
0
,
0
,
0
,
0.1
)
rgba
(
0
,
0
,
0
,
0.25
);
border-bottom-color
:
#b3b3b3
;
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#ffffffff'
,
endColorstr
=
'#ffe6e6e6'
,
GradientType
=
0
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
enabled
=
false
);
-webkit-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
}
input
[
type
=
radio
]
:checked
+
label
{
background-image
:
none
;
outline
:
0
;
-webkit-box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
background-color
:
#e0e0e0
;
}
</style>
{% endblock %}
{% block content %}
<div
class=
"container theme-showcase"
role=
"main"
>
<div
class=
"jumbotron"
>
{% if project %}
<h1>
{{ project.name }}, {{ corpus.name }}
</h1>
{% endif %}
{% if corpus %}
<p>
Created on {{ corpus.date }}
</p>
<div
id=
"stats"
></div>
{% endif %}
<!-- <a class="btn btn-primary btn-lg" role="button" href="/admin/documents/corpus/{{ corpus.id }}/">Add file</a> -->
<a
class=
"btn btn-primary btn-lg"
role=
"button"
href=
"/project/{{project.id}}/corpus/{{ corpus.id }}/corpus.csv"
>
Save as
</a>
<a
class=
"btn btn-primary btn-lg"
role=
"button"
href=
"/delete/{{ corpus.id }}"
>
Delete
</a></p>
{% if number == 0 %}
<a
class=
"btn btn-primary btn-lg"
role=
"button"
href=
"/admin/documents/corpus/{{ corpus.id }}/"
>
Add documents
</a></p>
{% endif %}
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<center>
<div
id=
"ScoresBox"
></div>
<br>
(Blue bars: all, Green line: zoom)
<a
class=
"reset"
href=
"javascript:volumeChart.filterAll();dc.redrawAll();"
style=
"display: none;"
>
reset
</a>
<div
class=
"clearfix"
></div>
</center>
<div
id=
"monthly-move-chart"
></div>
</div>
<div
class=
"row"
>
<div
id=
"monthly-volume-chart"
></div>
<p
class=
"muted pull-left"
style=
"margin-right: 15px;"
>
Select a time range to zoom in
</p>
</div>
</div>
<p
align=
"center"
>
<a
class=
"btn btn-xs btn-default"
role=
"button"
href=
"/chart/corpus/{{ corpus.id }}/data.csv"
>
Save
</a></p>
<div
class=
"container"
>
<div
class=
"jumbotron"
>
<div
class=
"panel-group"
id=
"accordion"
role=
"tablist"
aria-multiselectable=
"true"
>
<div
class=
"panel panel-body"
>
<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>
</a>
</h4>
</div>
<div
id=
"collapseOne"
class=
"panel-collapse collapse no-transition"
role=
"tabpanel"
>
<div
class=
"panel-body"
>
<div
id=
"div-table"
></div>
<!-- <p align="right">
<table id="my-ajax-table" class="table table-bordered">
<thead>
<th data-dynatable-column="name">Title</th>
<th id="score_column_id" data-dynatable-sorts="score" data-dynatable-column="score">Score</th>
<th data-dynatable-column="del" data-dynatable-no-sort="true">
<input type="checkbox" id="multiple_selection" onclick="SelectAll(this);" /> Select
</th>
</thead>
<tbody>
</tbody>
</table>
</p> -->
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"jumbotron"
>
<h3><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/chart"
>
Advanced charts
</a></h3>
<ol>
<li>
Count
</li>
<!-- read, compute -->
<li>
Filter
</li>
<!-- count, compute -->
<li>
Compare
</li>
<!-- select, cut -->
</ol>
<h4><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/"
>
Back to corpus
</a></h3>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"jumbotron"
>
<h3><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/matrix"
>
Matrix
</a></h3>
<ol>
<li>
Sort
</li>
<li>
Group
</li>
<li>
Cluster
</li>
</ol>
<h4><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/"
>
Back to corpus
</a></h3>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"jumbotron"
>
{% if processing > 0 %}
<h3>
<img
width=
"20px"
src=
"{% static "
js
/
libs
/
img2
/
loading-bar
.
gif
"
%}"
></img>
Graph (later)
</h3>
{% else %}
<h3><a
href=
"/project/{{project.id}}/corpus/{{ corpus.id }}/explorer"
>
Graph
</a></h3>
{% endif %}
<ol>
<li>
Visualize
</li>
<li>
Explore
</li>
<li>
Read
</li>
</ol>
<h4><a
href=
"/project/{{project.id}}/corpus/{{corpus.id}}/"
>
Back to corpus
</a></h3>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
charts
/
bootstrap
.
min
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
dynatable
.
js
"
%}"
></script>
<!-- custom-lib for dynatable.js and dc.js -->
<script
type=
"text/javascript"
src=
"{% static "
js
/
Journals_dyna_chart_and_table
.
js
"
%}"
></script>
{% endblock %}
templates/tests/ngrams.html
View file @
c5f3fa91
...
...
@@ -281,7 +281,7 @@ input[type=radio]:checked + label {
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
dynatable
.
js
"
%}"
></script>
<!-- custom-lib for dynatable.js and dc.js -->
<script
type=
"text/javascript"
src=
"{% static "
js
/
test
_dyna_chart_and_table
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% static "
js
/
NGrams
_dyna_chart_and_table
.
js
"
%}"
></script>
...
...
tests/ngramstable/views.py
View file @
c5f3fa91
...
...
@@ -162,6 +162,59 @@ def test_test(request , corpus_id , doc_id):
return
JsonHttpResponse
(
results
)
def
get_journals
(
request
,
project_id
,
corpus_id
):
if
not
request
.
user
.
is_authenticated
():
return
redirect
(
'/login/?next=
%
s'
%
request
.
path
)
try
:
offset
=
int
(
project_id
)
offset
=
int
(
corpus_id
)
except
ValueError
:
raise
Http404
()
t
=
get_template
(
'tests/journals.html'
)
user
=
cache
.
User
[
request
.
user
.
username
]
.
id
date
=
datetime
.
datetime
.
now
()
project
=
cache
.
Node
[
int
(
project_id
)]
corpus
=
cache
.
Node
[
int
(
corpus_id
)]
type_doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
number
=
session
.
query
(
func
.
count
(
Node
.
id
))
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
type_doc_id
)
.
all
()[
0
][
0
]
try
:
processing
=
corpus
.
hyperdata
[
'Processing'
]
except
Exception
as
error
:
print
(
error
)
processing
=
0
html
=
t
.
render
(
Context
({
'debug'
:
settings
.
DEBUG
,
'user'
:
user
,
'date'
:
date
,
'project'
:
project
,
'corpus'
:
corpus
,
'processing'
:
processing
,
'number'
:
number
,
}))
return
HttpResponse
(
html
)
def
test_journals
(
request
,
project_id
,
corpus_id
):
results
=
[
"hola"
,
"mundo"
]
JournalsDict
=
{}
user_id
=
request
.
user
.
id
document_type_id
=
cache
.
NodeType
[
'Document'
]
.
id
documents
=
session
.
query
(
Node
)
.
filter
(
Node
.
user_id
==
user_id
,
Node
.
parent_id
==
corpus_id
,
Node
.
type_id
==
document_type_id
)
.
all
()
for
doc
in
documents
:
if
"journal"
in
doc
.
hyperdata
:
journal
=
doc
.
hyperdata
[
"journal"
]
if
journal
not
in
JournalsDict
:
JournalsDict
[
journal
]
=
0
JournalsDict
[
journal
]
+=
1
return
JsonHttpResponse
(
JournalsDict
)
def
test_ngrams
(
request
,
project_id
,
corpus_id
):
results
=
[
"hola"
,
"mundo"
]
...
...
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