Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
scripta
eScriptorium
Commits
4caa7235
Commit
4caa7235
authored
Sep 03, 2020
by
EL HASSANE GARGEM
Browse files
onboarding exit after all skiped
parent
0630b60f
Changes
10
Hide whitespace changes
Inline
Side-by-side
app/apps/core/static/js/edit/components/trans_modal.js
View file @
4caa7235
...
...
@@ -176,10 +176,12 @@ const TranscriptionModal = Vue.component('transcriptionmodal', {
this
.
intro
.
start
();
this
.
intro
.
onexit
(
function
()
{
userProfile
.
set
(
'
onboarding_trans
'
,
true
);
exitonboarding
();
});
this
.
intro
.
oncomplete
(
function
()
{
userProfile
.
set
(
'
onboarding_trans
'
,
true
);
exitonboarding
();
});
...
...
app/apps/core/static/js/edit/main.js
View file @
4caa7235
...
...
@@ -200,12 +200,14 @@ var partVM = new Vue({
this
.
intro
.
setOptions
({
steps
:
steps_edit
});
this
.
intro
.
start
();
this
.
intro
.
onexit
(
function
()
{
userProfile
.
set
(
'
onboarding_edit
'
,
true
);
exitonboarding
();
});
this
.
intro
.
oncomplete
(
function
()
{
window
.
location
.
href
=
models_url
;
userProfile
.
set
(
'
onboarding_edit
'
,
true
);
exitonboarding
();
window
.
location
.
href
=
models_url
;
});
},
resetZoom
()
{
...
...
app/apps/core/views.py
View file @
4caa7235
...
...
@@ -251,6 +251,7 @@ class EditPart(LoginRequiredMixin, DetailView):
# so we need context['object'] = document
context
[
'object'
]
=
self
.
object
.
document
context
[
'document'
]
=
self
.
object
.
document
context
[
'onboarding'
]
=
self
.
request
.
user
.
onboarding
context
[
'part'
]
=
self
.
object
return
context
...
...
@@ -288,6 +289,7 @@ class ModelsList(LoginRequiredMixin, ListView):
if
self
.
document
:
context
[
'document'
]
=
self
.
document
context
[
'object'
]
=
self
.
document
# legacy
context
[
'onboarding'
]
=
self
.
request
.
onboarding
return
context
...
...
app/escriptorium/static/js/onboarding.js
View file @
4caa7235
var
onboarding_document
=
userProfile
.
get
(
'
onboarding_document
'
);
var
onboarding_images
=
userProfile
.
get
(
'
onboarding_images
'
);
var
onboarding_edit
=
userProfile
.
get
(
'
onboarding_edit
'
);
var
onboarding_trans
=
userProfile
.
get
(
'
onboarding_trans
'
);
var
onboarding_models
=
userProfile
.
get
(
'
onboarding_models
'
);
//document_form
var
document_intro
=
introJs
();
document_intro
.
setOptions
({
...
...
@@ -127,7 +133,9 @@ steps_trans = [{
];
function
exitonboarding
()
{
$
.
ajax
({
if
(
onboarding_document
&&
onboarding_images
&&
onboarding_edit
&&
onboarding_trans
&&
onboarding_models
){
$
.
ajax
({
type
:
'
PUT
'
,
url
:
'
/api/users/onboarding/
'
,
contentType
:
"
application/json; charset=utf-8
"
,
...
...
@@ -139,4 +147,6 @@ function exitonboarding() {
alert
(
data
);
});
}
}
\ No newline at end of file
app/escriptorium/templates/base.html
View file @
4caa7235
...
...
@@ -113,6 +113,8 @@
<script
src=
"{% static 'js/messages.js' %}"
></script>
{% include 'includes/messages.html' %}
<script
src=
"{% static 'js/profile.js' %}"
></script>
<script
src=
"{% static 'vendor/introjs/intro.js' %}"
></script>
<script
src=
"{% static 'js/onboarding.js' %}"
></script>
{% endif %}
{% endblock scripts %}
</body>
...
...
app/escriptorium/templates/core/document_form.html
View file @
4caa7235
...
...
@@ -171,7 +171,7 @@
<script
src=
"{% static 'js/help.js' %}"
></script>
<script
type=
"text/javascript"
>
var
onboarding_document
=
userProfile
.
get
(
'
onboarding_document
'
);
const
onboarding
=
"
{{ onboarding }}
"
;
if
(
onboarding
==
"
True
"
&&
!
onboarding_document
)
{
...
...
app/escriptorium/templates/core/document_images.html
View file @
4caa7235
...
...
@@ -116,7 +116,6 @@
<script
type=
"text/javascript"
>
'
use strict
'
;
const
DOCUMENT_ID
=
{{
document
.
pk
}};
var
onboarding_images
=
userProfile
.
get
(
'
onboarding_images
'
);
const
onboarding
=
"
{{ onboarding }}
"
;
$
(
document
).
ready
(
function
()
{
// join the ws room
...
...
@@ -140,12 +139,14 @@ if (onboarding== "True" && !onboarding_images)
{
document_images_intro
.
start
();
document_images_intro
.
onexit
(
function
()
{
userProfile
.
set
(
'
onboarding_images
'
,
true
);
exitonboarding
();
});
document_images_intro
.
oncomplete
(
function
()
{
var
edit_url
=
"
{% url 'document-part-edit' pk=document.pk %}
"
;
userProfile
.
set
(
'
onboarding_images
'
,
true
);
exitonboarding
();
window
.
location
.
href
=
edit_url
;
});
...
...
app/escriptorium/templates/core/document_nav.html
View file @
4caa7235
...
...
@@ -25,6 +25,4 @@
{% block tab_content %}{% endblock %}
</div>
{% block modals %}{% endblock %}
<script
src=
"{% static 'vendor/introjs/intro.js' %}"
></script>
<script
src=
"{% static 'js/onboarding.js' %}"
></script>
{% endblock %}
app/escriptorium/templates/core/document_part_edit.html
View file @
4caa7235
...
...
@@ -622,8 +622,6 @@
const
DOCUMENT_ID
=
'
{{document.id}}
'
;
var
PART_ID
=
{{
part
.
id
}};
// can be changed with next & previous pages
const
onboarding
=
"
{{ onboarding }}
"
;
var
onboarding_edit
=
userProfile
.
get
(
'
onboarding_edit
'
);
var
onboarding_trans
=
userProfile
.
get
(
'
onboarding_trans
'
);
var
models_url
=
"
{% url 'document-models' document_pk=document.pk %}
"
;
</script>
...
...
app/escriptorium/templates/core/models_list.html
View file @
4caa7235
...
...
@@ -84,20 +84,19 @@ $(document).ready(function() {
</script>
<script
src=
"{% static 'js/models.js' %}"
></script>
<script
type=
"text/javascript"
>
const
onboarding_models
=
"
{{ onboarding_models }}
"
;
if
(
onboarding_models
==
"
True
"
)
{
const
onboarding
=
"
{{ onboarding }}
"
;
if
(
onboarding
==
"
True
"
&&
!
onboarding_models
)
{
models_intro
.
start
();
models_intro
.
onexit
(
function
()
{
exitonboarding
({
onboarding_models
:
"
False
"
,
});
userProfile
.
set
(
'
onboarding_models
'
,
true
);
exitonboarding
();
});
models_intro
.
oncomplete
(
function
()
{
exitonboarding
({
onboarding_models
:
"
False
"
,
});
userProfile
.
set
(
'
onboarding_models
'
,
true
);
exitonboarding
();
});
}
...
...
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