Skip to content

Commit

Permalink
Resign akademie kurs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayvented committed Nov 23, 2023
1 parent 389b4ba commit 3070cc4
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 62 deletions.
2 changes: 1 addition & 1 deletion assets/controllers/appUi_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class extends Controller {
});
});
if (document.location.toString().match('#')) {
document.querySelector('[data-target="#' + document.location.toString().split('#')[1] + '"]').click();
document.querySelector('[data-target="#' + document.location.toString().split('#')[1] + '"]')?.click();
}
}

Expand Down
22 changes: 19 additions & 3 deletions assets/styles/tailmater.css
Original file line number Diff line number Diff line change
Expand Up @@ -957,19 +957,27 @@ input[type='text'], input[type='password'], input[type='email'], input[type='num
@apply w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50;
}

input[type='checkbox'] {
input[type='checkbox'], input[type='radio'] {
@apply w-5 h-5;
}

input[type='radio'] {
@apply rounded-full;
}

button:disabled {
@apply cursor-not-allowed;
}

.form-group textarea {
@apply -mb-2;
}

.form-check {
@apply flex;
@apply flex mb-2;
}

.form-check input[type='checkbox'] {
.form-check input[type='checkbox'], .form-check input[type='radio'] {
@apply mr-2;
}

Expand Down Expand Up @@ -1107,4 +1115,12 @@ trix-editor ul, .editor-output ul, ul.initial {

trix-editor ol, .editor-output ol, ol.initial {
list-style: decimal;
}

.alert {
@apply rounded-full block px-5 py-1;
}

.alert-warning {
@apply alert bg-amber-200 text-amber-800;
}
6 changes: 3 additions & 3 deletions templates/akademie/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
{% for b in buchungen %}
<tr>
<td>{{ b.id }}</td>
<th>
<td>
{% if b.zugewiesen > today %}
{% trans %}noAutomaticResubmission{% endtrans %}
{% else %}
{{ b.kurs.title }} (id: {{ b.kurs.id }})
{% endif %}
</th>
</td>
<td>{{ b.zugewiesen|date('d.m.Y') }}</td>
<td>{{ b.start|date('d.m.Y') }}</td>
<td>
Expand Down Expand Up @@ -58,7 +58,7 @@
{% trans from 'general' %}start{% endtrans %}
</a>
{% else %}
<a href="#">{% trans from 'general' %}finished{% endtrans %}</a>
{% trans from 'general' %}finished{% endtrans %}
{% endif %}
{% endif %}
</td>
Expand Down
72 changes: 30 additions & 42 deletions templates/akademie/kurs.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
{% endblock %}

{% block body %}
<div>
{% if kurs.type == 1 %}
<p class="alert-warning mb-2">{% trans %}video.vimeo{% endtrans %}</p>
{% endif %}
<div class="card card-outlined">
{% if kurs.type == 0 %}
{% if not buchung.abgeschlossen %}<p>{% trans %}video.uninterruptible{% endtrans %}</p>{% endif %}
<div>
Expand All @@ -17,50 +20,31 @@
</video>
</div>
{% elseif kurs.type == 1 %}
<p>{% trans %}video.vimeo{% endtrans %}</p>
<div>
<a>{% trans %}video.start{% endtrans %}</a>
<a>{% trans %}video.pause{% endtrans %}</a>
<div class="mb-5 flex">
<button class="btn startBtn flex mr-2"><span class="material-symbols-outlined">play_arrow</span>{#{% trans %}video.start{% endtrans %}#}</button>
<button class="btn pauseBtn flex" disabled><span class="material-symbols-outlined">pause</span>{#{% trans %}video.pause{% endtrans %}#}</button>
</div>
<div id="vimeoVideo"></div>

{% endif %}

{% if not buchung.abgeschlossen %}
<!-- Modal -->
<div id="finishModal" tabindex="-1" role="dialog" aria-labelledby="finishModal"
aria-hidden="true">
<div role="document">
<div>
<div>
<h5 id="finishModalLabel">{% trans %}lesson.finish{% endtrans %}</h5>
<button type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div>
<p>
{% trans %}lesson.disclaimer.finish{% endtrans %}
</p>
<p>
{% trans %}lesson.disclaimer.repeat{% endtrans %}
</p>

</div>
<div>
<button
disabled>{% trans from 'questionnaire' %}participation.start{% endtrans %}</button>
</div>
</div>
<p class="mt-5">{{ kurs.beschreibung|nl2br }}</p>
</div>
{% if not buchung.abgeschlossen %}
<div id="finishModal" class="modal">
<div data-close="#finishModal" class="modal-close"></div>
<div class="modal-inner">
<div class="modal-content">
<h3>{% trans %}lesson.finish{% endtrans %}</h3>
<p>{% trans %}lesson.disclaimer.finish{% endtrans %}</p>
<p>{% trans %}lesson.disclaimer.repeat{% endtrans %}</p>
</div>
<div class="modal-footer">
<button class="btn sendButton" disabled>{% trans from 'questionnaire' %}participation.start{% endtrans %}</button>
</div>
</div>
{% endif %}


<p>{{ kurs.beschreibung|nl2br }}</p>
</div>
</div>
<button data-type="dialogs" data-target="#finishModal" id="open-modal" class="hidden">open modal</button>
{% endif %}
{% endblock %}

{% block javascripts %}
{% if kurs.type == 0 and not buchung.abgeschlossen %}
<!-- Lokaler Storage -->
Expand All @@ -69,7 +53,7 @@
vid.onended = function () {
$('.sendButton').wrap('<a href="{{ path('participation_start',{'id':buchung.participations[0].id}) }}">');
$('.sendButton').prop('disabled', false);
$('#finishModal').modal('show', true);
$('#open-modal').trigger('click');
};
</script>
<!-- Vimeo SDK -->
Expand All @@ -78,6 +62,7 @@
<script>
var options = {
url: "{{ kurs.video }}",
loop: false,
{% if not buchung.abgeschlossen %}
controls: false,
title: false,
Expand All @@ -89,15 +74,18 @@
videoPlayer.on('ended', function () {
$('.sendButton').wrap('<a href="{{ path('participation_start',{'id':buchung.participations[0].id}) }}">');
$('.sendButton').prop('disabled', false);
$('#finishModal').modal('show', true);
$('#open-modal').trigger('click');
});
{% endif %}
$('.startBtn').click(function () {
videoPlayer.play();
$('.pauseBtn').removeClass('disabled');
$('.pauseBtn').prop('disabled', false);
$('.startBtn').prop('disabled', true);
});
$('.pauseBtn').click(function () {
videoPlayer.pause();
$('.pauseBtn').prop('disabled', true);
$('.startBtn').prop('disabled', false);
});
</script>
{% endif %}
Expand Down
24 changes: 11 additions & 13 deletions templates/questionnaire/participationQuestion/question.html.twig
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{% extends 'base.html.twig' %}

{% block title %}
{{ question.label }}
{% endblock %}

{% block body %}
<div>
<div>
{{ form_start(form) }}
<h5>{{ question.label }}</h5>
<div>
{{ form_row( attribute(form, question.id)) }}
</div>
<div>
{{ form_row(form.continue) }}
</div>
{{ form_end(form) }}
</div>
</div>
{{ form_start(form) }}
<fieldset>
{{ form_row( attribute(form, question.id)) }}
</fieldset>
{{ form_row(form.continue, {row_attr: {class: 'form-buttons'}}) }}
{{ form_end(form) }}
{% endblock %}

0 comments on commit 3070cc4

Please sign in to comment.