education.ex 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. defmodule CvGenView.Education do
  2. use Phoenix.Component
  3. alias CvGenView.Date
  4. attr(:institution, :string, required: true)
  5. attr(:location, :string, required: true)
  6. attr(:start_date, :string, required: true)
  7. attr(:end_date, :string, required: true)
  8. attr(:summary, :string, required: true)
  9. def education(assigns) do
  10. ~H"""
  11. <div class="education">
  12. <Date.time_span start_date={@start_date} end_date={@end_date} />
  13. <div class="box">
  14. <h1><%= @institution %></h1>
  15. <h2><%= @area %></h2>
  16. <p><%= @summary %></p>
  17. </div>
  18. </div>
  19. """
  20. end
  21. # TODO: Almost the same as in Work heading, but not quite.
  22. def css(),
  23. do: """
  24. .education h1,
  25. .education h2,
  26. .education p {
  27. margin: 0;
  28. }
  29. .box {
  30. display: flex;
  31. flex-direction: column;
  32. gap: 0.5em;
  33. background-color: #eee;
  34. padding: 0.5em;
  35. margin-bottom: 1em;
  36. }
  37. .box > h1 {
  38. font-weight: bold;
  39. }
  40. .box > h2 {
  41. font-weight: normal;
  42. padding-left: 0.5em;
  43. }
  44. .box > p {
  45. font-weight: lighter;
  46. padding-left: 0.5em;
  47. }
  48. """
  49. end