Skip to content

Commit

Permalink
fix issuelist embed #565
Browse files Browse the repository at this point in the history
  • Loading branch information
mfortini committed Jun 9, 2020
1 parent 06288ec commit f0ae0ad
Showing 1 changed file with 47 additions and 38 deletions.
85 changes: 47 additions & 38 deletions _layouts/issuelist_embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@

<div class="col-md-12 col-sm-12 col-12"> <div id="map" class="w-100" style="height: 600px;"></div> </div>

<div class="col-12">

{%- assign allcatfilteredissues = '' | split: '' -%}
{%- for categorytuple in issuecategories -%}
Expand All @@ -110,51 +109,61 @@

{%- if filteredissues.size > 0 -%}
<div class="row">
{%- assign allcatfilteredissues = allcatfilteredissues | concat: filteredissues | uniq -%}
<div class="row">
<div class="col-12">
<h2 id="{{category['permalink']}}">{{category["displayname"]}} <span class="badge badge-pill badge-primary">{{filteredissues.size}}</span></h2>
{%- if page.justLatestIssues -%}
{%- assign filteredissues = filteredissues | sort: 'number' | reverse | slice: 0,5 -%}
{%- endif -%}
{%- for member in filteredissues -%}
<div class="col-md-12 col-sm-12 col-12 mb-15">
<div class="card" id="issue{{member.number}}">
<div class="card-body issuepanel">
<a href="{{site.url}}/issues/{{member.number}}"><h4 class="card-title">{{member.title}}</h4></a>
<dl class="row">
{%- for item in member.issue.data -%}
{%- if item[1] != blank -%}
<dt class="col-sm-3">{{item[0] | replace: "_", " " | capitalize_all}}</dt>
{%- if item[0] == "Descrizione" -%}
{%- assign itemrepr = item[1] | newline_to_br | auto_link -%}
<dd class="col-sm-9">
{{itemrepr}}
</dd>
{%- else -%}
<dd class="col-sm-9">{{item[1] | newline_to_br | auto_link | truncatewords: 100}}</dd>
{%- endif -%}
{%- endif -%}
{%- endfor -%}
</dl>
{%- include social-share-issue.html -%}
<div class="col-12 col-lg-12 col-md-12">
{%- assign allcatfilteredissues = allcatfilteredissues | concat: filteredissues | uniq -%}
<div class="row">
<div class="col-12 col-lg-12 col-md-12">
<h2 id="{{category['permalink']}}">{{category["displayname"]}}
{% if page.justLatestIssues %}<a href="{{category['permalink']}}" title="Vedi tutte le segnalazioni della categoria {{category['displayname']}}">{% endif %}
<span class="badge badge-pill badge-primary">
{{filteredissues.size}}
</span>
{% if page.justLatestIssues %}</a>{% endif %}
</h2>
<div class="row d-flex shuffleissues">
<div class="col-12">

{%- if page.justLatestIssues -%}
{%- assign filteredissues = filteredissues | sort: 'number' | reverse | slice: 0,5 -%}
{%- endif -%}

{% if page.justLatestIssues != true and category["subcategories"] %}
{% assign filteredissues_category = filteredissues %}
{% for subcategorytuple in category["subcategories"] %}
{% assign subcategory = subcategorytuple[0] %}
{% assign subcategoryname = subcategorytuple[1]["displayname"] %}
{%- assign filteredissues = filteredissues_category | where_exp: "member","member.issue.labels contains subcategory" -%}
{% if filteredissues.size > 0 %}
<h3 id="{{subcategory | slugify}}">{{subcategoryname}} <span class="badge badge-pill badge-primary">{{filteredissues.size}}</span></h3>

{% include issuelist_cards.html %}

{%- endif -%}
{%- endfor -%}
{% else %}
{% include issuelist_cards.html %}
{%- endif -%}

</div>
</div>
</div>
{%- endfor -%}
</div>
{% if category["includefooter"] != blank %}
{% assign includefooter = category["includefooter"] %}
{% include {{includefooter}} %}
{% endif %}
{%- if page.justLatestIssues -%}
<div class="row">
<div class="col-12 col-lg-12 col-md-12"><a href="{{category['permalink']}}" title="Vedi tutte le segnalazioni della categoria {{category['displayname']}}" class="btn btn-primary btn-lg">{{site.data.i18n.translations["see_all"]}} {{category["displayname"]}}</a></div>
<hr class="col-12 col-lg-12 col-md-12">
</div>
{%- endif -%}
</div>
{%- if page.justLatestIssues -%}
<div class="row">
<div class="col"><a href="{{category['permalink']}}" class="btn btn-primary btn-lg">Vedi tutte {{category["displayname"]}}</a></div>
<hr class="col-12">
</div>
{%- endif -%}
</div>

{%- endif -%}
{%- endfor -%}


{%- if page.categorieMapAll -%}
{%- assign filteredissues = geofilteredissues -%}
{%- else -%}
Expand All @@ -167,7 +176,7 @@ <h2 id="{{category['permalink']}}">{{category["displayname"]}} <span class="badg
</div>
{% endif %}
</div>
</div>
</div>
</div>

{%- include issuemap.html -%}
Expand Down

0 comments on commit f0ae0ad

Please sign in to comment.