defmodule CvGenView do
use Phoenix.Component
import CvGenView.Date, only: [date: 1]
@after_compile __MODULE__
embed_templates("templates/*")
attr(:work, :map)
def work(assigns) do
~H"""
<%= @work.name %>
- Poste
- <%= @work.position %>
- Date début
- <.date class="start_date" date={@work.startDate} />
<%= unless is_nil(@work[:endDate]) do %>
- Date fin
- <.date class="end_date" date={@work.endDate} />
<% end %>
- Paris
<%= @work.summary %>
<%= for highlight <- @work.highlights do %>
- <%= highlight %>
<% end %>
"""
end
attr(:skill, :map)
def skill(assigns) do
~H"""
<%= @skill.name %>
<%= for kw <- @skill.keywords do %>
- <%= kw %>
<% end %>
"""
end
attr(:educ, :map)
def education(assigns) do
~H"""
<%= @educ.institution %>
- <%= @educ[:location] %>
- Date début
- <.date class="start_date" date={@educ.startDate} />
- Date fin
- <.date class="end_date" date={@educ.endDate} />
"""
end
attr(:lang, :map)
def language(assigns) do
~H"""
<%= @lang.language %> (<%= @lang.fluency %>)
"""
end
def __after_compile__(_env, _bytecode) do
CvGen.generate()
end
end