diff --git a/app/components/events/card_component.html.erb b/app/components/events/card_component.html.erb new file mode 100644 index 0000000000..b6a9bc1542 --- /dev/null +++ b/app/components/events/card_component.html.erb @@ -0,0 +1,8 @@ +
  • + <%= link_to(path, class: "link--black") do %> +
    + <%= content_tag(heading_tag, title) %> + <%= tag.p(helpers.safe_html_format(description)) %> +
    + <% end %> +
  • diff --git a/app/components/events/card_component.rb b/app/components/events/card_component.rb new file mode 100644 index 0000000000..ce88e14a09 --- /dev/null +++ b/app/components/events/card_component.rb @@ -0,0 +1,12 @@ +class Events::CardComponent < ViewComponent::Base + attr_reader :title, :description, :path, :heading_tag + + def initialize(card:, heading_tag: "h3") + @title = card.title + @description = card.description + @path = card.path + @heading_tag = heading_tag + + super + end +end diff --git a/app/views/teaching_events/about_git_events.html.erb b/app/views/teaching_events/about_git_events.html.erb index 3d961419e7..ce80149468 100644 --- a/app/views/teaching_events/about_git_events.html.erb +++ b/app/views/teaching_events/about_git_events.html.erb @@ -51,7 +51,7 @@
    <%= tag.nav(class: "category__nav-cards") do %> <% end %>