<!-- Modal notes -->
<div class="modal fade bd-example-modal-lg {{ type }}" id="view-notes" tabindex="-1" role="dialog" aria-labelledby="view-notes" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="modal-title-wrap">
<h5 class="modal-title">{{ "pro_page.notes" | trans }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<i class="fal fa-times"></i>
</button>
</div>
{% set averageNotes = getAverageNotes(course.owner)%}
{% set average = averageNotes.total %}
{% if average != 0 %}
<div class="row total-average">
<div class="col-12">
<p class="average-note">{{ average }}</p>
{% for i in 1..5 %}
{% if average >= i %}
<i class="fas fa-star"></i>
{% else %}
{% if average > (i - 1) %}
<i class="fas fa-star-half-alt"></i>
{% else %}
<i class="far fa-star"></i>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="row organization-education">
<div class="global-note-col">
<span class="text">{{ "pro_page.organization" | trans }}:</span>
<div class="start-notes">
{% if averageNotes.organization != 0 %}
{% for i in 1..5 %}
{% if averageNotes.organization >= i %}
<i class="fas fa-star"></i>
{% else %}
{% if averageNotes.organization > (i - 1) %}
<i class="fas fa-star-half-alt"></i>
{% else %}
<i class="far fa-star"></i>
{% endif %}
{% endif %}
{% endfor %}
{% else %}
{% for i in 1..5 %}
{% if i <= 4 %}
<i class="fas fa-star grey-star"></i>
{% else %}
<i class="far fa-star grey-star"></i>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
<div class="global-note-col">
<span class="text">{{ "pro_page.education" | trans }}:</span>
<div class="start-notes">
{% if averageNotes.education != 0 %}
{% for i in 1..5 %}
{% if averageNotes.education >= i %}
<i class="fas fa-star"></i>
{% else %}
{% if averageNotes.education > (i - 1) %}
<i class="fas fa-star-half-alt"></i>
{% else %}
<i class="far fa-star"></i>
{% endif %}
{% endif %}
{% endfor %}
{% else %}
{% for i in 1..5 %}
{% if i <= 4 %}
<i class="fas fa-star grey-star"></i>
{% else %}
<i class="far fa-star grey-star"></i>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
</div>
<div class="notes">
{% for note in getNotes(course.owner) %}
<div class="row note">
<div class="col-md-3 pl-0">
<p class="trainee">{{ note.booking ? note.booking.trainee.firstname : note.trainee.firstname }}</p>
<p class="date">{{ note.createdAt | date('d/m/Y') }}</p>
<div class="total">
{% for i in 1..5 %}
{% if note.getTotalNote >= i %}
<i class="fas fa-star"></i>
{% else %}
{% if note.getTotalNote > (i - 1) %}
<i class="fas fa-star-half-alt"></i>
{% else %}
<i class="far fa-star"></i>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="col-md-9 note-details px-0">
<a href="{{ path('view_course', { 'token':note.course.token }) }}" target="_blank" class="course">{{ note.course.getTranslatedContent(app.request.locale).name | raw }}</a>
<p class="comment">{{ note.comment }}</p>
<div class="row organization-education-note">
<div class="col-6">
{{ "pro_page.organization" | trans }}
{% if note.organization != null %}
{% for i in 1..5 %}
{% if note.organization >= i %}
<i class="fas fa-star"></i>
{% else %}
{% if note.organization > (i - 1) %}
<i class="fas fa-star-half-alt"></i>
{% else %}
<i class="far fa-star"></i>
{% endif %}
{% endif %}
{% endfor %}
{% else %}
{% for i in 1..5 %}
{% if i <= 4 %}
<i class="fas fa-star grey-star"></i>
{% else %}
<i class="far fa-star grey-star"></i>
{% endif %}
{% endfor %}
{% endif %}
</div>
<div class="col-6">
{{ "pro_page.education" | trans }}
{% if note.education != null %}
{% for i in 1..5 %}
{% if note.education >= i %}
<i class="fas fa-star"></i>
{% else %}
{% if note.education > (i - 1) %}
<i class="fas fa-star-half-alt"></i>
{% else %}
<i class="far fa-star"></i>
{% endif %}
{% endif %}
{% endfor %}
{% else %}
{% for i in 1..5 %}
{% if i <= 4 %}
<i class="fas fa-star grey-star"></i>
{% else %}
<i class="far fa-star grey-star"></i>
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="note-box">
<p class="empty-note">{{ "pro_page.no_note" | trans }}</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!-- Modal social media -->
<div class="modal fade" id="share-socials" tabindex="-1" role="dialog" aria-labelledby="share-socials" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<h5 class="modal-title">{{ "page_course_detail.share_course" | trans }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<i class="fal fa-times"></i>
</button>
<div class="row" id="social-networks">
<div class="col-3">
<a href="https://www.facebook.com/sharer/sharer.php?u={{ url('view_course', {'token': course.token}) }}" target="_blank">
<div class="card">
<div id="icon">
<i class="fab fa-facebook-f"></i>
</div>
</div>
</a>
</div>
<div class="col-3">
<a href="https://twitter.com/intent/tweet?text={{ url('view_course', {'token': course.token}) }}" target="_blank">
<div class="card">
<div id="icon">
<i class="fab fa-x-twitter"></i>
</div>
</div>
</a>
</div>
<div class="col-3">
<a href="https://www.linkedin.com/shareArticle?mini=true&url={{ url('view_course', {'token': course.token}) }}&title={{ course.getTranslatedContent(app.request.locale).name }}" target="_blank">
<div class="card">
<div id="icon">
<i class="fab fa-linkedin-in"></i>
</div>
</div>
</a>
</div>
<div class="col-3">
<a href="https://api.whatsapp.com/send?&text={{ url('view_course', {'token': course.token}) }}" target="_blank">
<div class="card">
<div id="icon">
<i class="fab fa-whatsapp"></i>
</div>
</div>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
{% if course.videos | length > 0 %}
<!-- Modal watch video -->
<div class="modal fade bd-example-modal-lg" id="watch-video" tabindex="-1" role="dialog" aria-labelledby="video" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<h5 class="modal-title">{{ 'pro_page.watch_video' | trans }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<i class="fal fa-times"></i>
</button>
{% if course.videos | first.type == 'youtube' or course.videos | first.type == 'vimeo' %}
{% if course.videos | first.type == 'youtube' %}
{% set src = 'https://www.youtube.com/embed/' ~ course.videos | first.videoId %}
{% else %}
{% set src = 'https://player.vimeo.com/video/' ~ course.videos | first.videoId %}
{% endif %}
<div class="video-responsive">
<iframe width="560" height="315" id="watched-video" frameborder="0" allowfullscreen src="{{ src }}"></iframe>
</div>
{% else %}
<video controls width="100%">
<source src="{{ asset('/images/video/' ~ course.videos | first.path) }}" type="video/mp4">
</video>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}