education.ex 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. <div class="period">
  13. <Date.date date={@start_date} /> - <Date.date date={@end_date} />
  14. </div>
  15. <div class="box">
  16. <h1><%= @institution %></h1>
  17. <h2><%= @area %></h2>
  18. <p><%= @summary %></p>
  19. </div>
  20. </div>
  21. """
  22. end
  23. # TODO: Almost the same as in Work heading, but not quite.
  24. def css(),
  25. do: """
  26. .education h1,
  27. .education h2,
  28. .education p {
  29. margin: 0;
  30. }
  31. .box {
  32. display: flex;
  33. flex-direction: column;
  34. gap: 0.5em;
  35. background-color: #eee;
  36. padding: 0.5em;
  37. margin-bottom: 1em;
  38. }
  39. .box > h1 {
  40. font-weight: bold;
  41. }
  42. .box > h2 {
  43. font-weight: normal;
  44. padding-left: 0.5em;
  45. }
  46. .box > p {
  47. font-weight: lighter;
  48. padding-left: 0.5em;
  49. }
  50. """
  51. end