mirror of
https://github.com/inventree/inventree-website.git
synced 2025-06-12 10:05:36 +00:00
simplify cat/tags
This commit is contained in:
42
_layouts/collection/collection_refpage.html
Normal file
42
_layouts/collection/collection_refpage.html
Normal file
@ -0,0 +1,42 @@
|
||||
---
|
||||
layout: content
|
||||
---
|
||||
|
||||
{% assign all_items = "" | split: "/" %}
|
||||
{% for col_item in site[page.collection] %}
|
||||
{% for item in col_item[page.reference] %}
|
||||
{% assign preprocessed = item | strip %}
|
||||
{% unless preprocessed == "" %}
|
||||
{% assign all_items = all_items | push: preprocessed %}
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% assign all_items = all_items | uniq | sort %}
|
||||
|
||||
<i class="fa fa-tag"></i>
|
||||
{% for item in all_items %}
|
||||
{% unless tag == "" %}
|
||||
<a class="label" href="{{ page.permalink | prepend: site.baseurl }}#{{ item | slugify }}">
|
||||
<span class="badge">{{ item }}</span>
|
||||
</a>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
|
||||
{% for item in all_items %}
|
||||
{% unless item == "" %}
|
||||
<h2 id="{{ item | slugify }}">{{ item }}</h2>
|
||||
|
||||
<div>
|
||||
{% for plugin in site[page.collection] %}
|
||||
{% assign col_items = "" | split: "/" %}
|
||||
{% for item in plugin[page.reference] %}
|
||||
{% assign lower_item = item %}
|
||||
{% assign col_items = col_items | push: lower_item %}
|
||||
{% endfor %}
|
||||
{% if col_items contains item %}
|
||||
{% include plugin_card.html plugin=plugin %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endunless %}
|
||||
{% endfor %}
|
Reference in New Issue
Block a user