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

109 lines
3.7 KiB
Text
Raw Normal View History

<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 %>
<%= if t == :articles do %>
<article class="article" vocab="https://schema.org/" typeof="Article">
<h3 property="name">
<a href={"/" <> item["slug"]}>
<%= item["title"] %>
</a>
</h3>
<time property="datePublished"><%= item["pubDate"] %></time>
</article>
<% end %>
<%= if t == :events do %>
<article class="event" vocab="https://schema.org/" typeof="Event">
<h3>
<a property="name" href={"/" <> item["slug"]}>
<%= item["title"] %>
</a>
</h3>
<p property="description"><%= item["lead"] %></p>
<%= if item["poster"] do %>
<img
property="thumbnail"
src={ "https://n.madr.se/assets/" <> item["poster"] <> "?key=poster"}
loading="lazy"
alt="Affisch"
width="200"
/>
<% end %>
</article>
<% end %>
<%= if t == :links do %>
<article vocab="https://schema.org/" typeof="WebContent Review" class="bookmark">
<h3>
<span property="name"><%= item["title"] %></span>
<a class="permalink" href={"/" <> item["slug"]} title="Permalänk">#</a>
</h3>
<div property="reviewBody">
<%= item["contents"] |> Earmark.as_html!() |> raw %>
</div>
<div class="source">
Källa: <a href={item["source"]} rel="external"><%= item["h1"] %></a>
</div>
</article>
<% end %>
<%= if t == :albums do %>
<article class="album" vocab="https://schema.org/" typeof="MusicAlbum">
<h3>
<span property="byArtist"><%= item["artist"] %></span>
- <%= Enum.map(item["songs"], fn %{"title" => name} -> name end) |> csl() %>,
från <span property="name"><%= item["album"] %></span>
(<span property="copyrightYear"><%= item["year"] %></span>)
<a
class="permalink"
href={"/" <> to_string(item["year"]) <> "/brutal-legend-" <> item["externalId"]}
>
#
</a>
</h3>
<ul>
<%= for song <- item["songs"] do %>
<li><%= song["artist"]["name"] <> " - " <> song["title"] %></li>
<% end %>
</ul>
<%= if item["cover"] do %>
<img
property="thumbnail"
src={"https://n.madr.se/assets/" <> item["cover"] <> "?key=rectangular"}
alt="Skivomslag"
loading="lazy"
height="75"
width="75"
/>
<% end %>
</article>
<% end %>
<% end %>
</section>
<% end %>