Commit 1861ee3f authored by EL HASSANE GARGEM's avatar EL HASSANE GARGEM
Browse files

onboarding on models tab

parent f06b241c
......@@ -287,6 +287,7 @@ class ModelsList(LoginRequiredMixin, ListView):
if self.document:
context['document'] = self.document
context['object'] = self.document # legacy
context['onboarding'] = self.request.user.onboarding # legacy
return context
......
function exitonboarding() {
$.ajax({type: 'PUT', url:'/api/users/onboarding/',
contentType: "application/json; charset=utf-8",
data:JSON.stringify({
onboarding : "False",
})
}).done($.proxy(function(data){
}, this)).fail(function(data) {
alert(data);
});
}
var models_intro = introJs();
models_intro.setOptions('doneLabel', 'Next page');
models_intro.setOptions({steps: [
{
element: '#models-table',
intro: 'Here you manage Transcription and Segmentation models related to this document.',
position: 'bottom'
}
]});
......@@ -622,6 +622,7 @@
const DOCUMENT_ID = '{{document.id}}';
var PART_ID = {{part.id}}; // can be changed with next & previous pages
const onboarding = "{{ onboarding }}";
var models_url = "{% url 'document-models' document_pk=document.pk %}";
</script>
<script type="text/javascript">
......
......@@ -73,6 +73,9 @@
{% block scripts %}
{{ block.super }}
<script src="{% static 'vendor/introjs/intro.js' %}"></script>
<script src="{% static 'js/onboarding/models.js' %}"></script>
<script src="{% static 'js/onboarding/exit.js' %}"></script>
<script type="text/javascript">
'use strict';
$(document).ready(function() {
......@@ -83,4 +86,19 @@ $(document).ready(function() {
});
</script>
<script src="{% static 'js/models.js' %}"></script>
<script type="text/javascript">
const onboarding = "{{ onboarding }}";
if (onboarding == "True") {
models_intro.start();
models_intro.onexit(function () {
exitonboarding();
});
models_intro.oncomplete(function () {
exitonboarding();
});
}
</script>
{% endblock %}
Supports Markdown
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