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 %}
<script type="text/javascript">
// This object contains all components we have
var allComponents = [{
% -
for component in components - %
} {
% -
if component.ha_category - %
} {
% -assign sliced_version = component.ha_release | split: '.' - %
} {
% -assign minor_version = sliced_version[1] | plus: 0 - %
} {
% -assign major_version = sliced_version[0] | plus: 0 - %
} {
% -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
];
allComponents.pop(); // remove placeholder element at the end
// This object contains all components we have
var allComponents = [
{%- for component in components -%}
{%- if component.ha_category -%}
{%- assign sliced_version = component.ha_release | split: '.' -%}
{%- assign minor_version = sliced_version[1]|plus: 0 -%}
{%- assign major_version = sliced_version[0]|plus: 0 -%}
{%- 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
];
allComponents.pop(); // remove placeholder element at the end
</script>
<script type="text/javascript">
(function () {
var template = $('#component-template').html();