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
ca3b8bd8
Commit
ca3b8bd8
authored
Oct 26, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Activated help
parent
3a8bb2dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
forms.py
gargantext/views/pages/forms.py
+0
-1
terms.py
gargantext/views/pages/terms.py
+15
-2
help.js
static/lib/gargantext/help.js
+5
-14
No files found.
gargantext/views/pages/forms.py
View file @
ca3b8bd8
...
...
@@ -81,4 +81,3 @@ class AuthenticationForm(forms.Form):
def
get_user
(
self
):
return
self
.
user_cache
gargantext/views/pages/terms.py
View file @
ca3b8bd8
...
...
@@ -5,6 +5,18 @@ from gargantext.models import Node
from
gargantext.constants
import
get_resource
from
datetime
import
datetime
def
get_node_user
(
user
):
#load user parameters
node_user
=
session
.
query
(
Node
)
.
filter
(
Node
.
user_id
==
user
.
id
,
Node
.
typename
==
"USER"
)
.
first
()
if
node_user
is
None
:
node_user
=
Node
(
typename
==
"USER"
,
user_id
=
user
.
id
,
name
=
user
.
name
)
#default language for now is 'fr'
node_user
[
"hyperdata"
][
"language"
]
=
"fr"
session
.
add
(
node_user
)
session
.
commit
()
return
node_user
@
requires_auth
def
ngramtable
(
request
,
project_id
,
corpus_id
):
'''
...
...
@@ -32,7 +44,7 @@ def ngramtable(request, project_id, corpus_id):
corpora_infos
=
corpora_infos_q
.
all
()
source_type
=
corpus
.
resources
()[
0
][
'type'
]
user_node
=
get_node_user
(
request
.
user
)
# rendered page : terms.html
return
render
(
template_name
=
'pages/corpora/terms.html'
,
...
...
@@ -48,6 +60,7 @@ def ngramtable(request, project_id, corpus_id):
# for the CSV import modal
'importroute'
:
"/api/ngramlists/import?onto_corpus=
%
i"
%
corpus
.
id
,
'corporainfos'
:
corpora_infos
'corporainfos'
:
corpora_infos
,
'user_parameters'
:
user_node
.
hyperdata
,
},
)
static/lib/gargantext/help.js
View file @
ca3b8bd8
...
...
@@ -145,31 +145,22 @@ help = {"#project":{
"placement"
:
"right"
,
"position"
:
"after"
,
}
}
//define lang
lang
=
$
(
"a#lang"
).
data
(
"lang"
)
//change lang
$
(
'li#new_lang'
).
on
(
'click'
,
function
(
e
)
{
alert
(
"click"
);
}
};
$
(
".help"
).
each
(
function
(
i
,
el
)
{
console
.
log
(
"This"
,
el
)
console
.
log
(
"This"
,
el
);
id
=
el
.
id
div_id
=
"#"
+
id
help_steps
=
Object
.
keys
(
help
)
//console.log(help_steps)
//console.log("div help:", div_id)
if
(
help_steps
.
includes
(
div_id
)
==
false
){
console
.
log
(
"Step
"
,
id
,
"
not described in help"
)
console
.
log
(
"Step
#"
,
id
,
"class='help'
not described in help"
)
return
}
btn
=
id
+
"-help"
info
=
help
[
div_id
]
lang
=
$
(
"a#lang"
).
data
(
"lang"
);
console
.
log
(
lang
)
console
.
log
(
info
[
lang
][
"content"
])
help_btn
=
'<span class="glyphicon glyphicon-question-sign" tab-index=0 data-toggle="popover" data-placement="'
+
info
[
lang
][
"placement"
]
+
'" title="'
+
info
[
lang
][
"title"
]
+
'" data-content="'
+
info
[
lang
][
"content"
]
+
'"></span>'
...
...
@@ -197,7 +188,7 @@ $( ".help" ).each(function(i, el) {
//$(help_btn).insertBefore(el);
}
})
})
;
$
(
document
).
on
(
'click'
,
function
(
e
)
{
$
(
'[data-toggle="popover"],[data-original-title]'
).
each
(
function
()
{
...
...
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