mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-14 12:56:54 +00:00
Add category for Works with Home Assistant partners (#31019)
This commit is contained in:
parent
6ec05712cd
commit
1a399a57c4
@ -32,7 +32,10 @@ regenerate: false
|
|||||||
|
|
||||||
<div class="filter-button-group">
|
<div class="filter-button-group">
|
||||||
<a href='#all' class="btn">All ({{tot}})</a>
|
<a href='#all' class="btn">All ({{tot}})</a>
|
||||||
<a href='#featured' class="btn featured">Featured</a>
|
<div class="featured">
|
||||||
|
<a href='#featured' class="btn">Featured</a>
|
||||||
|
<a href='#works-with-home-assistant' class="btn">Partners</a>
|
||||||
|
</div>
|
||||||
<div class="version_select">Added in: <select name="versions">
|
<div class="version_select">Added in: <select name="versions">
|
||||||
<option value="#"></option>
|
<option value="#"></option>
|
||||||
{%- for group in components_by_version -%}
|
{%- for group in components_by_version -%}
|
||||||
@ -121,7 +124,7 @@ var allComponents = [
|
|||||||
{% capture category %}"{{ ha_category | slugify | downcase }}"{% endcapture %}
|
{% capture category %}"{{ ha_category | slugify | downcase }}"{% endcapture %}
|
||||||
{% assign categories = categories | push: category %}
|
{% assign categories = categories | push: category %}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
{url:"{{ component.url }}", title:"{{component.title}}", cat: [{{categories|join: ","}}], featured: {% if component.featured %}true{% else %}false{% endif %}, v: "{{major_version}}.{{minor_version}}", logo: "{{component.logo}}", domain: "{{component.ha_domain}}", ha_brand: "{{component.ha_brand}}"},
|
{url:"{{ component.url }}", title:"{{component.title}}", cat: [{{categories|join: ","}}], featured: {% if component.featured %}true{% else %}false{% endif %}, v: "{{major_version}}.{{minor_version}}", logo: "{{component.logo}}", domain: "{{component.ha_domain}}", ha_brand: "{{component.ha_brand}}", wwha: {% if component.works_with %}true{% else %}false{% endif %}},
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
false
|
false
|
||||||
@ -210,6 +213,12 @@ allComponents.pop(); // remove placeholder element at the end
|
|||||||
return comp.featured;
|
return comp.featured;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} else if (hash === '#works-with-home-assistant' || hash === '') {
|
||||||
|
// only show those partners of the Works with Home Assistant program
|
||||||
|
filter = function (comp) {
|
||||||
|
return comp.wwha;
|
||||||
|
};
|
||||||
|
|
||||||
} else if (hash.indexOf('#version/') === 0) {
|
} else if (hash.indexOf('#version/') === 0) {
|
||||||
// compare against a version
|
// compare against a version
|
||||||
search = decodeURIComponent(hash).substring(9).toLowerCase();
|
search = decodeURIComponent(hash).substring(9).toLowerCase();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user