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
da790f94
Commit
da790f94
authored
Apr 08, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ngrams table groups: remove modify buttons if already active modifications
parent
bde5ec27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
ngramlists.py
gargantext/views/api/ngramlists.py
+1
-4
tables.css
static/css/gargantext/tables.css
+2
-2
NGrams_dyna_chart_and_table.js
static/js/gargantext/NGrams_dyna_chart_and_table.js
+15
-9
No files found.
gargantext/views/api/ngramlists.py
View file @
da790f94
...
@@ -148,6 +148,7 @@ class GroupChange(APIView):
...
@@ -148,6 +148,7 @@ class GroupChange(APIView):
=> removes couples where newly reconnected ngrams where involved
=> removes couples where newly reconnected ngrams where involved
=> adds new couples from GroupsBuffer of terms view
=> adds new couples from GroupsBuffer of terms view
TODO recalculate scores after new groups
TODO see use of util.lists.Translations
TODO see use of util.lists.Translations
TODO benchmark selective delete compared to entire list rewrite
TODO benchmark selective delete compared to entire list rewrite
"""
"""
...
@@ -155,10 +156,6 @@ class GroupChange(APIView):
...
@@ -155,10 +156,6 @@ class GroupChange(APIView):
all_nodes_involved
=
[]
all_nodes_involved
=
[]
links
=
[]
links
=
[]
print
([
i
for
i
in
request
.
POST
.
lists
()])
pass
for
(
mainform_key
,
subforms_ids
)
in
request
.
POST
.
lists
():
for
(
mainform_key
,
subforms_ids
)
in
request
.
POST
.
lists
():
mainform_id
=
mainform_key
[:
-
2
]
# remove brackets '543[]' -> '543'
mainform_id
=
mainform_key
[:
-
2
]
# remove brackets '543[]' -> '543'
all_nodes_involved
.
append
(
mainform_id
)
all_nodes_involved
.
append
(
mainform_id
)
...
...
static/css/gargantext/tables.css
View file @
da790f94
...
@@ -60,8 +60,8 @@ p.note > label {
...
@@ -60,8 +60,8 @@ p.note > label {
float
:
left
;
float
:
left
;
}
}
.
note.
greyed
{
.greyed
{
opacity
:
0.
2
;
opacity
:
0.
3
;
}
}
tr
:hover
{
tr
:hover
{
...
...
static/js/gargantext/NGrams_dyna_chart_and_table.js
View file @
da790f94
...
@@ -441,7 +441,7 @@ function toggleSeeGroup(plusicon, ngramId) {
...
@@ -441,7 +441,7 @@ function toggleSeeGroup(plusicon, ngramId) {
plusicon
.
classList
.
add
(
'glyphicon-triangle-right'
)
;
plusicon
.
classList
.
add
(
'glyphicon-triangle-right'
)
;
}
}
else
{
else
{
var
subNgramHtml
=
seeGroup
(
ngramId
)
;
var
subNgramHtml
=
seeGroup
(
ngramId
,
true
)
;
// we target the html in the mainform term's box
// we target the html in the mainform term's box
$
(
"#box-"
+
ngramId
).
append
(
subNgramHtml
)
;
$
(
"#box-"
+
ngramId
).
append
(
subNgramHtml
)
;
...
@@ -459,7 +459,7 @@ function toggleSeeGroup(plusicon, ngramId) {
...
@@ -459,7 +459,7 @@ function toggleSeeGroup(plusicon, ngramId) {
*
*
* @param ngramId (of the mainform)
* @param ngramId (of the mainform)
*/
*/
function
seeGroup
(
ngramId
)
{
function
seeGroup
(
ngramId
,
allowChangeFlag
)
{
// 1/7 create new element container
// 1/7 create new element container
var
subNgramHtml
=
$
(
'<p class="note">'
)
;
var
subNgramHtml
=
$
(
'<p class="note">'
)
;
subNgramHtml
.
attr
(
"id"
,
"subforms-"
+
ngramId
)
;
subNgramHtml
.
attr
(
"id"
,
"subforms-"
+
ngramId
)
;
...
@@ -494,12 +494,14 @@ function seeGroup ( ngramId ) {
...
@@ -494,12 +494,14 @@ function seeGroup ( ngramId ) {
subNgramHtml
.
append
(
htmlMiniTree
)
subNgramHtml
.
append
(
htmlMiniTree
)
// 6/7 add a "modify group" button
// 6/7 add a "modify group" button
var
changeGroupsButton
=
'<button style="float:right"'
;
if
(
allowChangeFlag
)
{
changeGroupsButton
+=
' title="add/remove contents of groups"'
;
var
changeGroupsButton
=
'<button style="float:right"'
;
changeGroupsButton
+=
' onclick="modifyGroup('
+
ngramId
+
')">'
;
changeGroupsButton
+=
' title="add/remove contents of groups"'
;
changeGroupsButton
+=
'modify group'
;
changeGroupsButton
+=
' onclick="modifyGroup('
+
ngramId
+
')">'
;
changeGroupsButton
+=
'</button>'
;
changeGroupsButton
+=
'modify group'
;
subNgramHtml
.
append
(
changeGroupsButton
)
;
changeGroupsButton
+=
'</button>'
;
subNgramHtml
.
append
(
changeGroupsButton
)
;
}
// 7/7 return html snippet (ready for rendering)
// 7/7 return html snippet (ready for rendering)
return
(
subNgramHtml
)
return
(
subNgramHtml
)
...
@@ -919,7 +921,11 @@ function transformContent(ngramId) {
...
@@ -919,7 +921,11 @@ function transformContent(ngramId) {
result
[
"name"
]
+=
'</span>
\
n'
result
[
"name"
]
+=
'</span>
\
n'
// if curently open we also add #subforms p with the sublist
// if curently open we also add #subforms p with the sublist
if
(
ngram_info
[
"id"
]
in
vizopenGroup
)
{
if
(
ngram_info
[
"id"
]
in
vizopenGroup
)
{
result
[
"name"
]
+=
seeGroup
(
ngram_info
[
"id"
])[
0
].
outerHTML
;
allowChange
=
(
GState
!=
1
)
result
[
"name"
]
+=
seeGroup
(
ngram_info
[
"id"
],
allowChange
)[
0
].
outerHTML
;
}
}
}
}
result
[
"name"
]
+=
'</div>
\
n'
result
[
"name"
]
+=
'</div>
\
n'
...
...
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