Commit 4caa7235 authored by EL HASSANE GARGEM's avatar EL HASSANE GARGEM
Browse files

onboarding exit after all skiped

parent 0630b60f
......@@ -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();
});
......
......@@ -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() {
......
......@@ -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
......
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
......@@ -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>
......
......@@ -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)
{
......
......@@ -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;
});
......
......@@ -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 %}
......@@ -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>
......
......@@ -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();
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment