- cache activity do
  .card.activity{class: activity.active ? '' : 'card-finished'}
    = link_to activity_path(slug: activity.slug) do
      -# = image_tag activity.thumbnail_url ? activity.thumbnail_url : placeholder_image, class: 'img-card', alt: planting.crop_name

    - if member_signed_in? && current_member.id == activity.owner_id
      = link_to activity_path(slug: activity.slug) do
        .activity-quick-actions
          .dropdown
            %a.activity-menu.btn.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-bs-toggle" => "dropdown", type: "button", href: '#'}

            .dropdown-menu{"aria-labelledby" => "activity-menu"}
              = activity_edit_button(activity, classes: 'dropdown-item')
              = activity_copy_button(activity, classes: 'dropdown-item')

              - if activity.active
                = activity_finish_button(activity, classes: 'dropdown-item')

              - if can? :destroy, activity
                .dropdown-divider
                = delete_button(activity, classes: 'dropdown-item text-danger')
    .card-body
      = link_to activity_path(slug: activity.slug) do
        %h4= activity.name
        - if activity.due_date
          %small.due-date{title: activity.due_date}
            = standard_time_distance(activity.due_date.to_date, Time.zone.now.to_date)
        %div
          %small.text-justify{title: activity.description}= activity.description.truncate(150)
      %p
        %ul.list-unstyled
        - if activity.garden_name && activity.garden_slug
          %li
            %small= link_to activity.garden_name, garden_path(slug: activity.garden_slug)
        - if activity.planting_name && activity.planting_slug
          %li
            %small= link_to activity.planting_name, planting_path(slug: activity.planting_slug)

    .card-footer
      %small.chip.member-chip
        = link_to member_path(slug: activity.owner_slug) do
          = activity.owner_login_name
