1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-17 04:40:08 -07:00

Update Part detail template

This commit is contained in:
David Hübner 2017-04-28 16:19:03 +02:00
parent 517f859d26
commit aed76f492e
3 changed files with 109 additions and 59 deletions

View File

@ -6,7 +6,9 @@
{% block content %}
<table class="ui celled small padded table">
<h4 class="ui horizontal divider header">Solid</h4>
<table class="ui celled small padded table">
<thead>
<tr>
<th></th>
@ -17,7 +19,7 @@
</tr>
</thead>
<tbody>
{% for color in colors %}
{% for color in colors if not color.transparent%}
<tr>
<td style="background-color: #{{ color.rgb }}"></td>
<td>{{ color.id }}</td>
@ -27,6 +29,31 @@
</tr>
{% endfor %}
</tbody>
</table>
</table>
<h4 class="ui horizontal divider header">Transparent</h4>
<table class="ui celled small padded table">
<thead>
<tr>
<th></th>
<th>ID</th>
<th>Name</th>
<th>RGB</th>
<th>Material</th>
</tr>
</thead>
<tbody>
{% for color in colors if color.transparent%}
<tr>
<td style="background-color: #{{ color.rgb }}"></td>
<td>{{ color.id }}</td>
<td>{{ color.name }}</td>
<td>#{{ color.rgb }}</td>
<td>{{ color.transparent ? 'Transparent' : 'Solid' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -1,7 +1,5 @@
{% extends 'base.html.twig' %}
{% import 'macros/elements.html.twig' as elements %}
{% block title %}{{ 'page.model.index' | trans }}{% endblock %}
{% block header %}{{ 'page.model.index' | trans }}{% endblock %}
@ -30,9 +28,7 @@
<div class="column">
<div class="ui bordered fluid image">
<a href="{{ url('model_detail', {'number': model.number})}}">
<div class="image load">
<img src="{{ asset('resources/images/unknown_image.png') }}" data-src="{{ asset('/images/-1/'~model.number~'.png') | imagine_filter('model_min') }}" class="transition visible">
</div>
{{ blocks.modelImageMin(model,-1) }}
<div class="ui bottom attached label {% if model.parts|length == 0 %}black{% endif %}">{{ model.number }}</div>
</a>
</div>

View File

@ -2,28 +2,57 @@
{% import 'macros/elements.html.twig' as elements %}
{% block header %}#{{ part.number }} - {{ part.name }}{% endblock %}
{% block content %}
<dl>
<dt>number:</dt><dd>{{ part.number }}</dd>
<dt>name:</dt><dd>{{ part.name }}</dd>
<dt>category:</dt><dd>{{ part.category ? part.category.name }}</dd>
</dl>
{% if apiPart is not null %}
<a href="{{ apiPart.url }}">Rebrickable</a>
<img class="image ui middle" src="{{ apiPart.imgUrl }}" style="max-height: 90%; max-width: 100%">
{% endif %}
{% if part.model %}
<a href="{{ url('model_detail', {'number': part.model.number})}}">
<div class="image load">
<img src="{{ asset('resources/images/unknown_image.png') }}" data-src="{{ asset('/images/-1/'~part.model.number~'.png') | imagine_filter('model_min') }}" class="transition visible">
<div class="ui grid">
<div class="column ten wide">
<div id="model-viewer" class="model-container">
<img src="{{ apiPart.imgUrl }}">
</div>
<div class="ui bottom attached label">{{ part.model.number }}</div>
</a>
</div>
<div class="column six wide">
<div class="item-info ui">
<table class="ui very basic table">
<tr>
<td>{{ 'part.number' | trans }}</td><td>{{ part.number}}</td>
</tr>
<tr>
<td>{{ 'part.name' | trans }}</td><td>{{ part.name}}</td>
</tr>
<tr>
<td>{{ 'part.category' | trans }}</td><td>{{ part.category.name }}</td>
</tr>
<tr>
<td>{{ 'part.model' | trans }}</td>
<td>
{% if part.model %}
<a href="{{ url('model_detail', {'number': part.model.number})}}">{{ part.model.number }}</a>
{% endif %}
</td>
</tr>
{% if apiPart %}
<tr>
<td>{{ 'part.alternates' | trans }}</td>
<td>
{% for alternate in apiPart.alternates %}
<a href="{{ url('reb_part_detail', {'number': alternate})}}">{{ alternate }}</a>
{% endfor %}
</td>
</tr>
<tr>
<td>{{ 'part.molds' | trans }}</td>
<td>
{% for mold in apiPart.molds %}
<a href="{{ url('reb_part_detail', {'number': mold})}}">{{ mold }}</a>
{% endfor %}
</td>
</tr>
{% endif %}
</table>
</div>
</div>
</div>
<h4 class="ui horizontal divider header">
<i class="puzzle icon"></i> Sets
@ -35,15 +64,13 @@
<div class="ui fluid bordered image">
<a href="{{ url('set_detail', {number:set.number}) }}">
<div class="image load">
<img class="ui bordered" src="{{ asset('resources/images/unknown_image.png') }}" data-src="{{ set.number|setImage|imagine_filter('rebrickable_set_min') }}">
<img class="ui bordered" src="{{ asset('resources/images/unknown_image.png') }}" data-src="{{ set.number|setImage|imagine_filter('rebrickable_min') }}">
</div>
<div class="ui bottom attached label">{{ set.number }}<br></div>
</a>
</div>
</div>
{% endfor %}
<div>
{{ dump(apiPart) }}
</div>
{% endblock %}