| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- defmodule CvGenView.Work do
- use Phoenix.Component
- import CvGenView.Date, only: [date: 1]
- attr(:name, :string, required: true)
- attr(:start_date, :any, required: true)
- attr(:end_date, :any, default: nil)
- attr(:summary, :string, required: true)
- attr(:location, :string, required: true)
- attr(:highlights, :list, required: true)
- def work(assigns) do
- ~H"""
- <div class="work">
- <div class="heading">
- <h1><%= @name %></h1>
- <span class="location"><%= @location %></span>
- <div class="period">
- <%= @start_date %> - <%= @end_date || "aujourd'hui" %>
- </div>
- </div>
- <p class="summary" lang="en"><%= @summary %></p>
- <ul class="highlights">
- <%= for highlight <- @highlights do %>
- <li><%= highlight %></li>
- <% end %>
- </ul>
- </div>
- """
- end
- def css,
- do: """
- .work h1 {
- margin: 0;
- }
- .work > .heading {
- display: grid;
- grid-template-areas:
- "header location"
- "period _";
- row-gap: 0.5em;
- background-color: #eee;
- padding: 0.5em;
- }
- .work > .heading > h1 {
- font-weight: bold;
- }
- .work > .heading > .location {
- font-weight: bold;
- justify-self: end;
- }
- .work > .heading > .period {
- font-weight: lighter;
- }
- """
- end
|