diff --git a/.gitignore b/.gitignore index 806985c..5beb2ea 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ /web/bundles/ .idea/ /node_modules/ +/bower_components/ /app/Resources/libs/semantic/dist /web/resources/ /var/media/ diff --git a/app/Resources/assets/images/.directory b/app/Resources/assets/images/.directory new file mode 100644 index 0000000..bc873d7 --- /dev/null +++ b/app/Resources/assets/images/.directory @@ -0,0 +1,4 @@ +[Dolphin] +PreviewsShown=true +Timestamp=2017,5,9,23,7,36 +Version=3 diff --git a/app/Resources/assets/images/noimage_large.png b/app/Resources/assets/images/noimage_large.png new file mode 100644 index 0000000..06c2dab Binary files /dev/null and b/app/Resources/assets/images/noimage_large.png differ diff --git a/app/Resources/assets/images/noimage_min.png b/app/Resources/assets/images/noimage_min.png new file mode 100644 index 0000000..8f7e6e8 Binary files /dev/null and b/app/Resources/assets/images/noimage_min.png differ diff --git a/app/Resources/assets/js/slider.js b/app/Resources/assets/js/slider.js new file mode 100644 index 0000000..3a389d6 --- /dev/null +++ b/app/Resources/assets/js/slider.js @@ -0,0 +1,24 @@ +$(document).ready(function() { + $('.number-range').each(function () { + var id = $(this).attr('id'); + var $slider = $(this).children('.slider'); + var $from = $(this).children('input[id*="from"]'); + var $to = $(this).children('input[id*="to"]'); + + $slider.slider({ + range: true, + min: parseInt($slider.attr('min')), + max: parseInt($slider.attr('max')), + step: $slider.attr('step'), + values: [$from.val(), $to.val()], + slide: function (event, ui) { + $from.val(ui.values[0]); + $to.val(ui.values[1]); + + $("#" + id + "_value").text(ui.values[0] + " - " + ui.values[1]); + } + }).slider("pips", {}); + + $("#" + id + "_value").text($slider.slider("values", 0) + ' - ' + $slider.slider("values", 1)) + }); +}); \ No newline at end of file diff --git a/app/Resources/assets/js/style.js b/app/Resources/assets/js/style.js index fbb1695..7a851e9 100644 --- a/app/Resources/assets/js/style.js +++ b/app/Resources/assets/js/style.js @@ -17,6 +17,9 @@ $(document).ready(function(){ $('.tabular.menu .item').tab(); + $('.tabular.submenu .item').tab({ + }); + $('.message .close') .on('click', function() { $(this) diff --git a/app/Resources/assets/style/colors.scss b/app/Resources/assets/style/colors.scss index 21506c8..e5b4db7 100644 --- a/app/Resources/assets/style/colors.scss +++ b/app/Resources/assets/style/colors.scss @@ -1,4 +1,4 @@ -$alpha: 0.7; +$alpha: 0.2; $colors: ( -1: #0033B2, @@ -139,7 +139,12 @@ $colors: ( ); @each $number, $color in $colors { - .color-#{$number} { + .border.color-#{$number} { border-bottom: 2px solid $color; } + + .text.color-#{$number} { + color: $color; + //background: color-contrast($color,#000,#FFF); + } } \ No newline at end of file diff --git a/app/Resources/assets/style/main.scss b/app/Resources/assets/style/main.scss index fbe6b95..33f9713 100644 --- a/app/Resources/assets/style/main.scss +++ b/app/Resources/assets/style/main.scss @@ -1,7 +1,8 @@ .default-theme { .ui.main { - padding-top: 40px; + padding-top: 10px; + margin-top: 40px; min-height: calc(100% - 67px); } @@ -20,6 +21,10 @@ } } + .ui.card { + border-radius: 0; + } + .ui.fixed + .ui.grid { border-radius: 0; border: 0; @@ -64,6 +69,16 @@ background-size: cover; } + .number-range { + margin: 1em 0.6em 3em; + } + + .pull-left { + float: left; + } + .pull-right { + float: right; + } } @each $i in 5 10 15 20 25 30 40 50 60 { diff --git a/app/Resources/assets/style/mixins.scss b/app/Resources/assets/style/mixins.scss new file mode 100644 index 0000000..06decdd --- /dev/null +++ b/app/Resources/assets/style/mixins.scss @@ -0,0 +1,13 @@ +// Calculeate brightness of a given color. +@function brightness($color) { + @return ((red($color) * .299) + (green($color) * .587) + (blue($color) * .114)) / 255 * 100%; +} + +// Compares contrast of a given color to the light/dark arguments and returns whichever is most "contrasty" +@function color-contrast($color, $dark, $light) { + $color-brightness: brightness($color); + $light-text-brightness: brightness($light); + $dark-text-brightness: brightness($dark); + + @return if(abs($color-brightness - $light-text-brightness) > abs($color-brightness - $dark-text-brightness), $light, $dark); +} \ No newline at end of file diff --git a/app/Resources/assets/style/part.scss b/app/Resources/assets/style/part.scss index 1d48b12..670b75a 100644 --- a/app/Resources/assets/style/part.scss +++ b/app/Resources/assets/style/part.scss @@ -1,14 +1,14 @@ -.model-meta { - background: #E0E1E2; - text-align: center; +.part { + .content { + padding: 7px !important; - .quantity { - font-weight: 700; - color: #444444; - } - .number { - margin: 0.2em; - display: inline-block; - color: #000000; + .header { + font-size: 14px !important; + margin: 0; + } + .description { + font-size: 12px; + margin: 0 !important; + } } } \ No newline at end of file diff --git a/app/Resources/assets/style/set.scss b/app/Resources/assets/style/set.scss new file mode 100644 index 0000000..e7b67f1 --- /dev/null +++ b/app/Resources/assets/style/set.scss @@ -0,0 +1,7 @@ +.set { + padding: 10px !important; + .content .header { + font-size: 14px !important; + margin-bottom: 3px; + } +} \ No newline at end of file diff --git a/app/Resources/assets/style/style.scss b/app/Resources/assets/style/style.scss index c7d7b53..852049e 100644 --- a/app/Resources/assets/style/style.scss +++ b/app/Resources/assets/style/style.scss @@ -1,8 +1,10 @@ @import "variables"; +@import "mixins"; @import "main"; @import "modelviewer"; -@import "model"; +@import "part"; +@import "set"; @import "colors"; @import "reviews"; \ No newline at end of file diff --git a/app/Resources/views/form/search.html.twig b/app/Resources/views/form/search.html.twig new file mode 100644 index 0000000..1bd44d0 --- /dev/null +++ b/app/Resources/views/form/search.html.twig @@ -0,0 +1,9 @@ +{% block number_range_widget %} +
+

+
+ + {{ form_widget(form.from) }} + {{ form_widget(form.to) }} +
+{% endblock %} diff --git a/app/Resources/views/html.html.twig b/app/Resources/views/html.html.twig index 0c017fd..101b711 100644 --- a/app/Resources/views/html.html.twig +++ b/app/Resources/views/html.html.twig @@ -12,7 +12,6 @@ {% block body %} {% endblock %} - {% block javascripts %} diff --git a/app/Resources/views/macros/blocks.html.twig b/app/Resources/views/macros/blocks.html.twig index d926d2d..199a93e 100644 --- a/app/Resources/views/macros/blocks.html.twig +++ b/app/Resources/views/macros/blocks.html.twig @@ -1,65 +1,84 @@ {% macro partImage(number, filter, color = -1) %} - {% if filter == 'part_large' %} - {% set placeholder = asset("resources/images/unknown_large.png") %} - {% else %} - {% set placeholder = asset("resources/images/unknown.png") %} - {% endif %} - -
+
+ {% if filter == 'part_large' %} + {% set placeholder = asset("resources/images/unknown_large.png") %} + {% else %} + {% set placeholder = asset("resources/images/oval.svg") %} + {% endif %} + {##}
{% endmacro %} {% macro setImage(number, filter) %} -
+
{% if filter == 'set_large' %} {% set placeholder = asset("resources/images/unknown_large.png") %} {% else %} - {% set placeholder = asset("resources/images/unknown.png") %} + {% set placeholder = asset("resources/images/oval.svg") %} {% endif %} - - +
{% endmacro %} {% macro model(model, quantity = null, color = -1) %} - -
+ +
{% import _self as blocks %} - {{ blocks.partImage(model.number, 'part_min', color) }} -
- {% if quantity %}{{ quantity }}x{% endif %}{{ model.number }} - {#{{ model.name }}#} + {{ blocks.partImage(model.id, 'part_min', color) }} +
+

{{ model.id }}

+
+ {% if quantity %}
{{ quantity }}x
{% endif %} +
{% endmacro %} {% macro part(part, quantity = null, color = -1) %} - -
+ +
{% import _self as blocks %} - {{ blocks.partImage(part.number,'part_min', color) }} -
- {% if quantity %}{{ quantity }}x{% endif %}{{ part.number }} + {{ blocks.partImage(part.id,'part_min', color) }} +
+

{{ part.id }}

+
+ {% if quantity %}
{{ quantity }}x
{% endif %} +
{% endmacro %} -{% macro set(set) %} -
- - + {% endmacro %} {% macro empty(message) %} diff --git a/app/Resources/views/model/detail.html.twig b/app/Resources/views/model/detail.html.twig index 68bb64a..805dca6 100644 --- a/app/Resources/views/model/detail.html.twig +++ b/app/Resources/views/model/detail.html.twig @@ -2,24 +2,27 @@ {% import 'macros/blocks.html.twig' as blocks %} -{% block title %}#{{ model.number }} - {{ model.name }}{% endblock %} +{% block title %}{{ model.id }} - {{ model.name }}{% endblock %} -{% block header %}#{{ model.number }} - {{ model.name }}{% endblock %} +{% block header %}{{ model.name }}{% endblock %} {% block content %} -
- {{ blocks.partImage(model.number,'part_large') }} + {{ blocks.partImage(model.id,'part_large') }}
+ + + + - + @@ -46,14 +49,14 @@ {% endif %}
{{ 'model.number' | trans }}

{{ model.id }}

{{ 'model.category' | trans }}{{ model.category ? model.category.name }}{{ model.category ? model.category.name }}
{{ 'model.author' | trans }}{{ model.author.name }}{{ 'model.aliases' | trans }} {% for alias in model.aliases | slice(0,10)%} - {{ alias.number }}{% if not loop.last %},{% endif %} + {{ alias.id }}{% if not loop.last %},{% endif %} {% endfor %}
- {{ 'model.download'|trans }} + {{ 'model.download'|trans }}
@@ -64,7 +67,7 @@ Subparts ({{ model.subparts|length }}) Related ({{ related|length }}) Parents ({{ model.parents|length }}) - Sets ({{ sets|length }}) + {# Sets ({{ sets|length }})#}
@@ -96,20 +99,15 @@
-
-
-
+ {#
#} + {#
#} + {#
#} {#{% for set in sets %}#} - {##} + {#{{ blocks.set(set) }}#} {#{% endfor %}#} -
-
-
+ {#
#} + {#
#} + {#
#}
{% endblock %} diff --git a/app/Resources/views/model/index.html.twig b/app/Resources/views/model/index.html.twig index 04710f3..593ba3d 100644 --- a/app/Resources/views/model/index.html.twig +++ b/app/Resources/views/model/index.html.twig @@ -10,24 +10,23 @@
-
+

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

+ {##} {{ form_start(form) }} - {{ form_row(form.search) }} - + {{ form_rest(form) }}
- +
{{ form_end(form) }} -
+ {##}
{% for model in models %} {{ blocks.model(model) }} + {% else %} + {{ blocks.empty('empty.models') }} {% endfor %}
diff --git a/app/Resources/views/pagination/knp_pagination.html.twig b/app/Resources/views/pagination/knp_pagination.html.twig index 7eaa57b..0b8e931 100644 --- a/app/Resources/views/pagination/knp_pagination.html.twig +++ b/app/Resources/views/pagination/knp_pagination.html.twig @@ -1,5 +1,5 @@ {% if pageCount > 1 %} -