deblan.io-murph/templates/page/mesh/default.html.twig

76 lines
3.4 KiB
Twig
Raw Normal View History

2021-11-23 22:48:55 +01:00
{% extends "page/titled/default.html.twig" %}
2021-07-09 23:42:38 +02:00
{% block body %}
2021-07-10 11:22:11 +02:00
<div class="col-12">
<div class="body">
<div class="body-content">
{{- _page.content.value|murph_url|file_attributes|markdown('post') -}}
</div>
</div>
</div>
2021-07-09 23:42:38 +02:00
2022-10-01 11:17:37 +02:00
<div class="grid grid-flow-row-dens grid-cols-12 md:p-8 gap-5">
2022-09-25 18:06:39 +02:00
{% for mesh in pager %}
2022-09-25 20:43:24 +02:00
<div class="card shadow-md col-span-12 md:col-span-6 lg:col-span-4 m-3 bg-box">
2022-09-25 18:06:39 +02:00
<div class="card">
<figure>
<img src="{{ asset('build/images/px.png') }}" data-color="{{ generate_color_by_string(mesh.id) }}" data-src="{{- asset(mesh.preview)|imagine_filter('mesh_preview_filter') -}}" data-src-error="{{ asset('build/images/post-image-logo.png') }}" alt="{{ mesh.label }}">
2022-09-25 18:06:39 +02:00
</figure>
<div class="card-body">
<h2 class="card-title">{{ mesh.label }}</h2>
2021-07-10 11:22:11 +02:00
2022-09-25 18:06:39 +02:00
{{- mesh.description|murph_url|file_attributes|markdown('post') -}}
<div class="card-actions mt-5">
{% for key, item in mesh.files %}
<div class="dropdown dropdown-top">
<label tabindex="0" class="btn btn-xs">{{ item.name }}</label>
2022-09-25 18:06:39 +02:00
<ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-52">
<li>
2022-10-01 10:53:04 +02:00
<a class="mesh-viewer" data-modal href="{{ path('mesh_viewer', {stlMesh: mesh.id, key: key + 1}) }}">Voir en 3D</a>
2022-09-25 18:06:39 +02:00
</li>
<li>
<a target="_blank" href="{{ path('mesh_download', {stlMesh: mesh.id, key: key + 1}) }}">Télécharger</a>
</li>
</ul>
</div>
{% endfor %}
2021-07-10 11:22:11 +02:00
</div>
2021-07-09 23:42:38 +02:00
</div>
2022-09-25 18:06:39 +02:00
</div>
2021-07-09 23:42:38 +02:00
</div>
2022-09-25 18:06:39 +02:00
2022-10-01 10:53:04 +02:00
{# for key, item in mesh.files %}
2022-09-25 18:06:39 +02:00
<input type="checkbox" id="mesh-{{ mesh.id }}-{{ key }}" class="modal-toggle" />
<div class="modal modal-mesh">
2022-09-25 20:43:24 +02:00
<div class="modal-box max-w-full w-full m-10">
2022-09-25 18:06:39 +02:00
<iframe src="{{ path('mesh_viewer', {stlMesh: mesh.id, key: key + 1}) }}" frameborder="0"></iframe>
<div class="modal-action">
<label for="mesh-{{ mesh.id }}-{{ key }}" class="btn btn-sm">Fermer</label>
</div>
</div>
</div>
2022-10-01 10:53:04 +02:00
{% endfor #}
2022-09-25 18:06:39 +02:00
{% endfor %}
2021-07-09 23:42:38 +02:00
</div>
2022-09-25 18:06:39 +02:00
{#
2021-07-09 23:42:38 +02:00
{% if pager.getPaginationData.pageCount > 1 %}
<div class="col-12">
<div class="body">
<div class="pager align-right">
{% block pager %}
2021-11-22 10:49:09 +01:00
{{ include('module/_pager.html.twig', {
2021-07-09 23:42:38 +02:00
route: _node.routeName,
routeParams: {},
2022-09-06 13:52:12 +02:00
pages: pager.paginationData.pageCount,
2021-07-09 23:42:38 +02:00
currentPage: pager.paginationData.current
}) }}
{% endblock %}
</div>
</div>
</div>
{% endif %}
2022-09-25 18:06:39 +02:00
#}
2021-07-09 23:42:38 +02:00
{% endblock %}