diff --git a/app/Resources/assets/js/style.js b/app/Resources/assets/js/style.js index ad3bc6d..900bb01 100644 --- a/app/Resources/assets/js/style.js +++ b/app/Resources/assets/js/style.js @@ -20,9 +20,16 @@ $(document).ready(function(){ .rating("disable") ; - $('.tabular.menu .item').tab(); + $('.tabular.menu .item').tab({ + onVisible: function() { + $('.image img').visibility('refresh'); + } + }); $('.tabular.submenu .item').tab({ + onVisible: function() { + $('.image img').visibility('refresh'); + } }); diff --git a/app/Resources/assets/style/main.scss b/app/Resources/assets/style/main.scss index b26b9b5..5027b8d 100644 --- a/app/Resources/assets/style/main.scss +++ b/app/Resources/assets/style/main.scss @@ -84,6 +84,29 @@ background: url("/resources/images/spinner.svg") no-repeat center; background-color: lightgrey; } + + .found-count { + margin: 0 !important; + } + + .truncate { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .ui.search > .results .result { + .title { + font-weight: normal; + } + + em { + font-weight: 700; + } + + padding: 0.5em 1em !important; + } } @each $i in 5 10 15 20 25 30 40 50 60 { diff --git a/app/Resources/assets/style/part.scss b/app/Resources/assets/style/part.scss index ed01546..67ac759 100644 --- a/app/Resources/assets/style/part.scss +++ b/app/Resources/assets/style/part.scss @@ -6,9 +6,27 @@ font-size: 12px !important; margin: 0; } + .description { font-size: 11px; margin: 0 !important; } + + .truncate-multiline { + height: 30px; + line-height: 13px; + display: block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + } } -} \ No newline at end of file +} + +.parts { + margin: 0 -0.3em !important; + + .part { + padding: 0.3em !important; + } +} diff --git a/app/Resources/assets/style/set.scss b/app/Resources/assets/style/set.scss index e7b67f1..d442f8c 100644 --- a/app/Resources/assets/style/set.scss +++ b/app/Resources/assets/style/set.scss @@ -1,5 +1,12 @@ +.sets { + margin: 0 -0.3em !important; + + .set { + padding: 0.3em !important; + } +} + .set { - padding: 10px !important; .content .header { font-size: 14px !important; margin-bottom: 3px; diff --git a/app/Resources/relations/alias_model.yml b/app/Resources/relations/alias_model.yml index cf872b9..fa8b818 100644 --- a/app/Resources/relations/alias_model.yml +++ b/app/Resources/relations/alias_model.yml @@ -379,4 +379,6 @@ u9209c01: u9209 4694c03: 4694c01 2772c02: 2772c01 -2772c03: 2772c01 \ No newline at end of file +2772c03: 2772c01 + +81294: 3351a \ No newline at end of file diff --git a/app/Resources/translations/messages.en.yml b/app/Resources/translations/messages.en.yml index d337586..95d7f68 100644 --- a/app/Resources/translations/messages.en.yml +++ b/app/Resources/translations/messages.en.yml @@ -47,6 +47,14 @@ set: model: filter.title: Filter + id: Model number + category: Category + author: Author + set.count: + license: License + keywords: Keywords + aliases: Aliases + download: Download model form: search: Search category: Category @@ -55,6 +63,7 @@ model: page: model.index: Browse models set.index: Browse sets + search: "Search: \"%query%\"" filter: model: diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index 460c69a..c3ef64f 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -35,7 +35,7 @@ {% endfor %} -
+
{% for label, flashes in app.session.flashbag.all %} {% for flash in flashes %} {{ elements.flash(label,flash) }} @@ -71,7 +71,8 @@ }, minCharacters : 3, fields: { - title: 'title', + title: 'name', + description: 'id', url: 'url' } }); diff --git a/app/Resources/views/html.html.twig b/app/Resources/views/html.html.twig index 101b711..7165d09 100644 --- a/app/Resources/views/html.html.twig +++ b/app/Resources/views/html.html.twig @@ -2,6 +2,7 @@ + {% block title %}PrintABrick{% endblock %} {% block stylesheets %} diff --git a/app/Resources/views/macros/blocks.html.twig b/app/Resources/views/macros/blocks.html.twig index b716429..6f46e27 100644 --- a/app/Resources/views/macros/blocks.html.twig +++ b/app/Resources/views/macros/blocks.html.twig @@ -27,7 +27,10 @@ {% import _self as blocks %} {{ blocks.partImage(model.id, 'part_min', color) }}
-

{{ model.id }}

+

{{ model.id }}

+
+ {{ model.name }} +
{% if quantity %}
{{ quantity }}x
{% endif %}
@@ -42,7 +45,10 @@ {% import _self as blocks %} {{ blocks.partImage(part.id,'part_min', color) }}
-

{{ part.id }}

+

{{ part.id }}

+
+ {{ part.name }} +
{% if quantity %}
{{ quantity }}x
{% endif %}
@@ -57,18 +63,13 @@ {% import _self as blocks %} {{ blocks.setImage(set.id,'set_min') }}
-

- {% if quantity %}
{{ quantity }}x
{% endif %} - {% if set.name|length > 17 %} - {{ set.name | slice(0,17) }} … - {% else %} - {{ set.name }} - {% endif %} +

+ {{ set.name }}

{{ set.id }}
- {{ set.theme.fullName | slice(0,27) }} … + {{ set.theme.fullName }}
diff --git a/app/Resources/views/model/detail.html.twig b/app/Resources/views/model/detail.html.twig index 805dca6..e744bd3 100644 --- a/app/Resources/views/model/detail.html.twig +++ b/app/Resources/views/model/detail.html.twig @@ -7,7 +7,7 @@ {% block header %}{{ model.name }}{% endblock %} {% block content %} -
+
{{ blocks.partImage(model.id,'part_large') }} @@ -17,7 +17,7 @@
- + @@ -39,18 +39,21 @@ {% if model.aliases|length %} {% endif %} diff --git a/app/Resources/views/model/index.html.twig b/app/Resources/views/model/index.html.twig index 593ba3d..07cc44f 100644 --- a/app/Resources/views/model/index.html.twig +++ b/app/Resources/views/model/index.html.twig @@ -12,24 +12,37 @@

{{ 'model.filter.title' | trans }}

{#
#} - {{ form_start(form) }} + {{ form_start(form) }} - {{ form_rest(form) }} -
- -
- {{ form_end(form) }} + {{ form_rest(form) }} +
+ +
+ {{ form_end(form) }} {##}
-
- {% for model in models %} - {{ blocks.model(model) }} - {% else %} - {{ blocks.empty('empty.models') }} - {% endfor %} +
+ +
+
+
+ {% for model in models %} + {{ blocks.model(model) }} + {% else %} + {{ blocks.empty('empty.models') }} + {% endfor %} +
+
{{ knp_pagination_render(models) }}
diff --git a/app/Resources/views/search/index.html.twig b/app/Resources/views/search/index.html.twig index 28067a4..26b289c 100644 --- a/app/Resources/views/search/index.html.twig +++ b/app/Resources/views/search/index.html.twig @@ -2,28 +2,31 @@ {% import 'macros/blocks.html.twig' as blocks %} -{% block title %}{% endblock %} +{% block title %}{{ 'page.search' | trans({'%query%':query}) }}{% endblock %} -{% block header %}{% endblock %} +{% block header %}{{ 'page.search' | trans({'%query%':query}) }}{% endblock %} {% block content %} -

Sets

-
-
+ +
+

Sets

+
{% for set in sets %} {{ blocks.set(set) }} {% endfor %}
+ Show more
-

Models

-
-
+
+

Models

+
{% for model in models %} {{ blocks.model(model) }} {% endfor %}
+ Show more
{% endblock %} \ No newline at end of file diff --git a/app/Resources/views/set/detail.html.twig b/app/Resources/views/set/detail.html.twig index 4c0442b..17d8fc1 100644 --- a/app/Resources/views/set/detail.html.twig +++ b/app/Resources/views/set/detail.html.twig @@ -27,18 +27,20 @@
- + {% if brset %} - - - - + {% if brset.minifigs %} + + + + + {% endif %}
{{ 'model.number' | trans }}{{ 'model.id' | trans }}

{{ model.id }}

{{ 'model.keywords' | trans }} - {% for keyword in model.keywords %} - {{ keyword.name }} - {% endfor %} +
+ {% for keyword in model.keywords %} + {{ keyword.name }} + {% endfor %} +
{{ 'model.aliases' | trans }} - {% for alias in model.aliases | slice(0,10)%} + {% for alias in model.aliases | slice(0,20)%} {{ alias.id }}{% if not loop.last %},{% endif %} {% endfor %} + {% if model.aliases|length > 20 %}…{% endif %}
{{ 'set.theme' | trans }}{{ set.theme ? set.theme.name }}{{ set.theme ? set.theme.fullName }}
{{ 'set.parts' | trans }} - {{ set.partCount }} {{ brset ? '('~brset.pieces~')' }} + {{ set.partCount~' (Rebrickable)' }}{{ brset and brset.pieces ? ' / '~brset.pieces~' (Brickset)' }}
{{ 'set.minifigs' | trans }}{{ brset.minifigs }}
{{ 'set.minifigs' | trans }}{{ brset.minifigs }}
{{ 'set.rating' | trans }} @@ -109,9 +111,9 @@
-
-

{{ 'set.models.text' | trans({'%rebrickable%' : partCount, '%brickset%' : brset ? brset.pieces }) | nl2br }}

-
+ {#
#} + {#

{{ 'set.models.text' | trans({'%rebrickable%' : partCount, '%brickset%' : brset ? brset.pieces }) | nl2br }}

#} + {#
#}
- -
+
- -
-
-
- {% for set in sets %} - {{ blocks.set(set) }} - {% else %} - {{ blocks.empty('empty.sets') }} - {% endfor %} -
+
+
+ {% for set in sets %} + {{ blocks.set(set) }} + {% else %} + {{ blocks.empty('empty.sets') }} + {% endfor %}
-
+
{{ knp_pagination_render(sets) }}
diff --git a/app/Resources/views/set/tabs/colors.html.twig b/app/Resources/views/set/tabs/colors.html.twig index 55cf960..0e31dd7 100644 --- a/app/Resources/views/set/tabs/colors.html.twig +++ b/app/Resources/views/set/tabs/colors.html.twig @@ -9,24 +9,27 @@ {% endfor %} {% if colors|length > 0 %} - {% for color in colors %} -
- {{ color['color'].name }} ({{ color['quantity'] }}) -
-
- -
- {% for model in color['models'] %} - {{ blocks.model(model['model'],model['quantity'], color['color'].id) }} - {% endfor %} +
+

Models

+ {% for color in colors %} +
+
+ {{ color['color'].name }} ({{ color['quantity'] }}) +
+
+ {% for model in color['models'] %} + {{ blocks.model(model['model'],model['quantity'], color['color'].id) }} + {% endfor %} +
-
- {% endfor %} + {% endfor %} +
{% endif %} {% if missing|length > 0 %}
-
+

Missing

+
{% for part in missing %} {{ blocks.part(part['part'],part['quantity']) }} {% endfor %} diff --git a/app/Resources/views/set/tabs/models.html.twig b/app/Resources/views/set/tabs/models.html.twig index fe2782b..d241165 100644 --- a/app/Resources/views/set/tabs/models.html.twig +++ b/app/Resources/views/set/tabs/models.html.twig @@ -10,7 +10,8 @@ {% if models|length > 0 %}
-
+

Models

+
{% for model in models %} {{ blocks.model(model['model'],model['quantity']) }} {% endfor %} @@ -19,7 +20,8 @@ {% endif %} {% if missing|length > 0 %}
-
+

Missing

+
{% for part in missing %} {{ blocks.part(part['part'],part['quantity']) }} {% endfor %} diff --git a/app/Resources/views/set/tabs/sets.html.twig b/app/Resources/views/set/tabs/sets.html.twig index b84618a..5312a70 100644 --- a/app/Resources/views/set/tabs/sets.html.twig +++ b/app/Resources/views/set/tabs/sets.html.twig @@ -9,7 +9,7 @@ {% endfor %} {% if inventorySets %} -

Sets

+

Sets

{% for inventorySet in inventorySets %} diff --git a/app/config/config/liip_imagine.yml b/app/config/config/liip_imagine.yml index 50beb82..8229250 100644 --- a/app/config/config/liip_imagine.yml +++ b/app/config/config/liip_imagine.yml @@ -26,6 +26,7 @@ liip_imagine: cache: ~ default_image: "/resources/images/noimage_min.png" filters: + upscale: {min: [200, 200]} thumbnail: { size: [200, 200], mode: inset, allow_upscale: true } background: { size: [250, 250], position: center, color: '#FFFFFF' } part_large: diff --git a/composer.json b/composer.json index 65df0f5..ea0426d 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "psr-4": { "Tests\\": "tests/" } }, "require": { - "php": ">=7.0", + "php": "^7.0", "symfony/symfony": "3.2.*", "doctrine/orm": "^2.5", "doctrine/doctrine-bundle": "^1.6", diff --git a/composer.lock b/composer.lock index 3b5dfed..1ee9873 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "f3808dea37da4032a73d71e76ffca16c", + "content-hash": "292225406393a05e8d4b946ebe444df9", "packages": [ { "name": "composer/ca-bundle", @@ -4429,16 +4429,16 @@ }, { "name": "sebastian/environment", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "11e7710b7724d42c62249b0e9d3030240398949d" + "reference": "02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/11e7710b7724d42c62249b0e9d3030240398949d", - "reference": "11e7710b7724d42c62249b0e9d3030240398949d", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3", + "reference": "02b6b2c7aefe2cdb1185b8dbf8718b0bcedf3ab3", "shasum": "" }, "require": { @@ -4475,7 +4475,7 @@ "environment", "hhvm" ], - "time": "2017-04-21T14:40:32+00:00" + "time": "2017-05-18T10:10:00+00:00" }, { "name": "sebastian/exporter", @@ -5212,7 +5212,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0" + "php": "^7.0" }, "platform-dev": [] } diff --git a/src/AppBundle/Imagine/PartImageLoader.php b/src/AppBundle/Imagine/PartImageLoader.php index dab1553..2b7a126 100644 --- a/src/AppBundle/Imagine/PartImageLoader.php +++ b/src/AppBundle/Imagine/PartImageLoader.php @@ -38,7 +38,8 @@ class PartImageLoader extends BaseImageLoader // try to load image from rebrickable website try { if ($this->remoteFileExists($this->rebrickableContext.$path)) { - return file_get_contents($this->rebrickableContext.$path); + $context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n'))); + return file_get_contents($this->rebrickableContext.strtolower($path),false,$context); } } catch (\Exception $e) { throw new NotLoadableException(sprintf('Source image %s could not be loaded.', $path), $e->getCode(), $e); diff --git a/src/AppBundle/Imagine/SetImageLoader.php b/src/AppBundle/Imagine/SetImageLoader.php index b99e3a0..797fa5a 100644 --- a/src/AppBundle/Imagine/SetImageLoader.php +++ b/src/AppBundle/Imagine/SetImageLoader.php @@ -32,7 +32,8 @@ class SetImageLoader extends BaseImageLoader // try to load image from rebrickable website try { if ($this->remoteFileExists($this->rebrickableContext.strtolower($path))) { - return file_get_contents($this->rebrickableContext.strtolower($path)); + $context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n'))); + return file_get_contents($this->rebrickableContext.strtolower($path),false,$context); } } catch (\Exception $e) { throw new NotLoadableException(sprintf('Source image %s could not be loaded.', $path), $e->getCode(), $e); diff --git a/src/AppBundle/Service/Stl/StlConverterService.php b/src/AppBundle/Service/Stl/StlConverterService.php index 57f26df..8b6511f 100644 --- a/src/AppBundle/Service/Stl/StlConverterService.php +++ b/src/AppBundle/Service/Stl/StlConverterService.php @@ -3,7 +3,7 @@ namespace AppBundle\Service\Stl; use AppBundle\Exception\ConvertingFailedException; -use AppBundle\Exception\LDView\LDLibraryMissingException; +use AppBundle\Exception\Stl\LDLibraryMissingException; use League\Flysystem\File; use League\Flysystem\Filesystem; use Symfony\Component\Process\Exception\ProcessFailedException;