website/lib/pages/projects_page.ex

35 lines
856 B
Elixir

defmodule Website.ProjectsPage do
use Tableau.Page,
layout: Website.PageLayout,
permalink: "/projects",
title: "Projects"
use Phoenix.Component
def template(assigns) do
~H"""
<div>
<div>
<%= for type <- @data["projects"] do %>
<div :for={{status, projects} <- type}>
<h2><%= status %></h2>
<div>
<div :for={project <- projects}>
<%= if project["link"] do %>
<a href={project["link"]}><%= project["name"] %></a>
<% else %>
<%= project["name"] %>
<% end %>
<p class="mt-0 text-sm">
<%= project["description"] %>
</p>
</div>
</div>
</div>
<% end %>
</div>
</div>
"""
end
end