|
- {% extends 'base.html' %}
-
- {% block content %}
- <!-- <div class="cell-margin">
- <div class="mb-8">
- <h2>
- {% block title %}
- {% autoescape false %}
- {{ type + 's' | replace(" ","<br>") }}
- {% endautoescape %}
- {% endblock %}
- </h2>
- <p>
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget viverra magna. Nam in ante ultricies
- purus feugiat vestibulum et ac erat. Donec in sagittis ante. Maecenas non mauris et eros commodo fringilla.
- Integer accumsan ullamcorper diam, non rhoncus tellus molestie ut. Maecenas finibus pretium dolor ac sagittis.
- </p>
- </div>
- </div> -->
-
- {% macro filter_dropdown(id, filter, plural='') %}
- <select name="{{ id }}" hx-trigger="change">
- <option value="all" {% if request.args.get(id, '' ) == '' %} selected {% endif %}
- hx-get="{{ request.base_url }}?{% for key in request.args %}{% if key != id %}&{{ key }}={{ request.args.get(key) }}{% endif %}{% endfor %}"
- hx-push-url="true">
- {% if plural != '' %}
- All {{ plural }}
- {% else %}
- All {{ id }}s
- {% endif%}
- </option>
- {% for thing in filter %}
- <option value="{{ thing[0] }}" {% if request.args.get(id)==thing[0]|string %} selected {% endif %}
- hx-get="{{ request.base_url }}?{{ id }}={{ thing[0] }}{% for key in request.args %}{% if key != id %}&{{ key }}={{ request.args.get(key) }}{% endif %}{% endfor %}"
- hx-push-url="true">
- {{ thing[1] }}
- </option>
- {% endfor %}
- </select>
- {% endmacro%}
-
- {% macro filter_dropdown_nokey(id, filter, plural='') %}
- <select name="{{ id }}" hx-trigger="change">
- <option value="all" {% if request.args.get(id, '' ) == '' %} selected {% endif %}
- hx-get="{{ request.base_url }}?{% for key in request.args %}{% if key != id %}&{{ key }}={{ request.args.get(key) }}{% endif %}{% endfor %}"
- hx-push-url="true">
- {% if plural != '' %}
- All {{ plural }}
- {% else %}
- All {{ id }}s
- {% endif%}
- </option>
- {% for thing in filter %}
- <option value="{{ thing }}" {% if request.args.get(id)==thing|string %} selected {% endif %}
- hx-get="{{ request.base_url }}?{{ id }}={{ thing }}{% for key in request.args %}{% if key != id %}&{{ key }}={{ request.args.get(key) }}{% endif %}{% endfor %}"
- hx-push-url="true">
- {{ thing }}
- </option>
- {% endfor %}
- </select>
- {% endmacro%}
-
- <div class="border-b-2 border-black grid lg:grid-cols-[52rem,30rem] content-start">
- <div class="mx-2 lg:ml-[13rem] text my-8 meta lg:max-w-[30rem]">
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultricies egestas felis at dignissim. Morbi ut bibendum
- nisl. Integer ac sollicitudin risus. Vivamus et est est. Ut vitae lacus nec justo tincidunt interdum. Fusce sapien odio,
- commodo nec est et, interdum varius risus. Curabitur vehicula consequat auctor.
- </div>
- </div>
- <div class="" >
- <div id="resources" >
-
- {{ view_switch() }}
-
- <div class="flex gap-8">
- {% if practices_filter %}
- {{ filter_dropdown('practice', practices_filter) }}
- {% endif %}
- {% if year_filter %}
- {{ filter_dropdown_nokey('year', year_filter) }}
- {% endif %}
- {% if typology_filter %}
- {{ filter_dropdown_nokey('typology', typology_filter, 'typologies') }}
- {% endif %}
- {% if languages_filter %}
- {{ filter_dropdown_nokey('scriptingLanguage', languages_filter, 'scripting languages') }}
- {% endif %}
- {% if licenses_filter %}
- {{ filter_dropdown_nokey('license', licenses_filter) }}
- {% endif %}
- {% if status_filter %}
- {{ filter_dropdown_nokey('status', status_filter, 'statuses') }}
- {% endif %}
- </div>
-
- <div>
- {% if view == 'list' %}
- {% for resource in resources %}
- {{ resource_list(resource, loop) }}
- {% endfor %}
- {% else %}
- {% for resource in resources %}
- {{ resource_with_related(resource, loop) }}
- {% endfor %}
- {% endif %}
- </div>
- </div>
- </div>
-
-
- {% endblock %}
|