Sha256: 20a4bd0a53bb1ed51a6305b4b91f8c2881aaa3e58eda2ca2547ba891c1ac8ca9

Contents?: true

Size: 1.01 KB

Versions: 10

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    # This cell renders the Medium (:m) meeting card
    # for an given instance of a Meeting
    class MeetingMCell < Decidim::CardMCell
      include MeetingCellsHelper

      def date
        render
      end

      private

      def resource_icon
        icon "meetings", class: "icon--big"
      end

      def spans_multiple_dates?
        start_date != end_date
      end

      def meeting_date
        return render(:multiple_dates) if spans_multiple_dates?
        render(:single_date)
      end

      def formatted_start_time
        model.start_time.strftime("%H:%M")
      end

      def formatted_end_time
        model.end_time.strftime("%H:%M")
      end

      def start_date
        model.start_time.to_date
      end

      def end_date
        model.end_time.to_date
      end

      def can_join?
        model.can_be_joined_by?(current_user)
      end

      def show_footer_actions?
        options[:show_footer_actions]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-meetings-0.14.4 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.14.3 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.14.2 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.14.1 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.13.1 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.12.2 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.13.0 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.12.1 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.13.0.pre1 app/cells/decidim/meetings/meeting_m_cell.rb
decidim-meetings-0.12.0 app/cells/decidim/meetings/meeting_m_cell.rb