25/lib/mse25_web/controllers/item_html/annual.html.heex

109 lines
3.4 KiB
Text
Raw Normal View History

<header>
<ol class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="/" rel="home">
<span itemprop="name">madr.se</span>
</a>
<meta itemprop="position" content="1" />
</li>
</ol>
<h1><%= @page_title %></h1>
<ul>
<li><a href={"/" <> to_string(@year - 1)}>Tillbaka till <%= @year - 1 %></a></li>
<li><a href={"/" <> to_string(@year + 1)}>Framåt till <%= @year + 1 %></a></li>
</ul>
<ul>
<%= if @link_count > 0 do %>
<li><%= @link_count %> länkar värda att uppmärksamma och kommentera</li>
<% end %>
<%= if @article_count > 0 do %>
<li><%= @article_count %> inlägg i webbloggen</li>
<% end %>
<%= if @event_count > 0 do %>
<li><%= @event_count %> besökta evenemang</li>
<% end %>
<%= if @brutal_legends_count > 0 do %>
<li>
<%= @brutal_legends_count %>
<%= if @brutal_legends_count == 1 do %>
köpt vinylskiva
<% else %>
köpta vinylskivor
<% end %>
till Brütal Legend-samlingen
</li>
<% end %>
</ul>
<%= for {month, items} <- @timeline do %>
<section id={"m" <> month}>
<h2><%= month_name(month) <> ", " <> to_string(@year) %></h2>
<%= for item = %{t: t} <- items do %>
<article>
<%= if t == :articles do %>
<h3>
<a href={"/" <> item["slug"]}>
<%= item["title"] %>
</a>
</h3>
<% end %>
<%= if t == :events do %>
<h3>
<a href={"/" <> item["slug"]}>
<%= item["title"] %>
</a>
</h3>
<p><%= item["lead"] %></p>
<%= if item["poster"] do %>
<img
src={ "https://n.madr.se/assets/" <> item["poster"] <> "?key=poster"}
loading="lazy"
alt="Affisch"
width="200"
/>
<% end %>
<% end %>
<%= if t == :links do %>
<h3>
<%= item["title"] %>
</h3>
<p><%= raw(Earmark.as_html!(item["contents"])) %></p>
Källa:
<a href={"/" <> item["source"]}>
<%= item["h1"] %>
</a>
<% end %>
<%= if t == :albums do %>
<h3>
<%= item["artist"] <>
" - " <> item["album"] <> " (" <> to_string(item["year"]) <> ")" %>
<a
class="permalink"
href={"/" <> to_string(@year) <> "/brutal-legend-" <> item["externalId"]}
>
#
</a>
</h3>
<%= if item["contents"] do %>
<p><%= raw(Earmark.as_html!(item["contents"])) %></p>
<% end %>
<ul>
<%= for song <- item["songs"] do %>
<li><%= song["artist"]["name"] <> " - " <> song["title"] %></li>
<% end %>
</ul>
<%= if item["cover"] do %>
<img
src={"https://n.madr.se/assets/" <> item["cover"] <> "?key=rectangular"}
alt="Skivomslag"
loading="lazy"
height="75"
width="75"
/>
<% end %>
<% end %>
</article>
<% end %>
</section>
<% end %>
</header>