mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 15:26:59 +00:00
Fixes integrations index page javascript (thx vscode autoformatting)
This commit is contained in:
parent
f1b8b6753f
commit
09421e929b
@ -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 - %
|
false
|
||||||
} {
|
];
|
||||||
% -
|
allComponents.pop(); // remove placeholder element at the end
|
||||||
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>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function () {
|
(function () {
|
||||||
var template = $('#component-template').html();
|
var template = $('#component-template').html();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user