Fixes integrations index page javascript (thx vscode autoformatting)

This commit is contained in:
Franck Nijhof 2019-10-02 00:31:18 +02:00
parent f1b8b6753f
commit 09421e929b
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -84,55 +84,25 @@ regenerate: false
{% endraw %} {% endraw %}
<script type="text/javascript"> <script type="text/javascript">
// This object contains all components we have // This object contains all components we have
var allComponents = [{ var allComponents = [
% - {%- for component in components -%}
for component in components - % {%- if component.ha_category -%}
} { {%- assign sliced_version = component.ha_release | split: '.' -%}
% - {%- assign minor_version = sliced_version[1]|plus: 0 -%}
if component.ha_category - % {%- assign major_version = sliced_version[0]|plus: 0 -%}
} { {%- assign featured_first = true -%}
% -assign sliced_version = component.ha_release | split: '.' - % {%- for ha_category in component.ha_category -%}
} { {url:"{{ component.url }}", title:"{{component.title}}", cat:"{{ha_category | slugify}}", featured: {% if component.featured and featured_first %}true{% else %}false{% endif %}, v: "{{major_version}}.{{minor_version}}", logo: "{{component.logo}}"},
% -assign minor_version = sliced_version[1] | plus: 0 - % {%- assign featured_first = false -%}
} { {%- endfor -%}
% -assign major_version = sliced_version[0] | plus: 0 - % {% endif -%}
} { {%- endfor -%}
% -assign featured_first = true - %
} {
% -
for ha_category in component.ha_category - %
} {
url: "{{ component.url }}",
title: "{{component.title}}",
cat: "{{ha_category | slugify}}",
featured: {
%
if component.featured and featured_first %
}
true {
%
else %
}
false {
% endif %
},
v: "{{major_version}}.{{minor_version}}",
logo: "{{component.logo}}"
},
{
% -assign featured_first = false - %
} {
% -endfor - %
} {
% endif - %
} {
% -endfor - %
}
false false
]; ];
allComponents.pop(); // remove placeholder element at the end allComponents.pop(); // remove placeholder element at the end
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
(function () { (function () {
var template = $('#component-template').html(); var template = $('#component-template').html();