Commit 34be2f9b authored by EL HASSANE GARGEM's avatar EL HASSANE GARGEM
Browse files

document intro and unuesed migrations

parent 7d392d04
......@@ -81,6 +81,7 @@ class CreateDocument(LoginRequiredMixin, SuccessMessageMixin, DocumentMixin, Cre
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['metadata_form'] = self.get_metadata_formset()
context['onboarding'] = self.request.user.onboarding
return context
def post(self, request, *args, **kwargs):
......@@ -114,6 +115,7 @@ class UpdateDocument(LoginRequiredMixin, SuccessMessageMixin, DocumentMixin, Upd
if 'metadata_form' not in kwargs:
context['metadata_form'] = self.get_metadata_formset(instance=self.object)
context['share_form'] = DocumentShareForm(instance=self.object, request=self.request)
context['onboarding'] = self.request.user.onboarding
return context
def post(self, request, *args, **kwargs):
......@@ -250,7 +252,6 @@ class EditPart(LoginRequiredMixin, DetailView):
context['object'] = self.object.document
context['document'] = self.object.document
context['part'] = self.object
context['onboarding'] = self.request.user.onboarding
return context
def dispatch(self, *args, **kwargs):
......@@ -287,7 +288,6 @@ class ModelsList(LoginRequiredMixin, ListView):
if self.document:
context['document'] = self.document
context['object'] = self.document # legacy
context['onboarding'] = self.request.user.onboarding
return context
......
# Generated by Django 2.1.4 on 2020-08-18 10:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0008_auto_20200520_1007'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='onboarding',
),
migrations.AddField(
model_name='user',
name='onboarding_edit',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='user',
name='onboarding_images',
field=models.BooleanField(default=False, verbose_name='first connection'),
),
migrations.AddField(
model_name='user',
name='onboarding_models',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='user',
name='onboarding_trans',
field=models.BooleanField(default=False),
),
]
# Generated by Django 2.1.4 on 2020-08-20 11:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20200818_1010'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='onboarding_edit',
),
migrations.RemoveField(
model_name='user',
name='onboarding_images',
),
migrations.RemoveField(
model_name='user',
name='onboarding_models',
),
migrations.RemoveField(
model_name='user',
name='onboarding_trans',
),
migrations.AddField(
model_name='user',
name='onboarding',
field=models.BooleanField(default=True, verbose_name='first connection'),
),
]
var document_intro = introJs();
document_intro.setOptions('doneLabel', 'Next page');
document_intro.setOptions({steps: [
{
element: ".container-fluid",
intro: 'Create your first document',
position: 'top'
},
]});
\ No newline at end of file
......@@ -169,4 +169,27 @@
{{ block.super }}
<script src="{% static 'js/document_form.js' %}"></script>
<script src="{% static 'js/help.js' %}"></script>
<script src="{% static 'vendor/introjs/intro.js' %}"></script>
<script src="{% static 'js/onboarding/document_form.js' %}"></script>
<script src="{% static 'js/onboarding/exit.js' %}"></script>
<script type="text/javascript">
var onboarding_document = userProfile.get('onboarding_document');
const onboarding = "{{ onboarding }}";
if (onboarding== "True" && !onboarding_document)
{
document_intro.start();
document_intro.onexit(function() {
exitonboarding();
});
document_intro.oncomplete(function() {
userProfile.set('onboarding_document',true);
});
}
</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