app/presenters/decidim/calendar/event_presenter.rb in decidim-calendar-0.13.1.3 vs app/presenters/decidim/calendar/event_presenter.rb in decidim-calendar-0.19.0

- old
+ new

@@ -4,19 +4,19 @@ module Calendar class EventPresenter < SimpleDelegator def color case __getobj__.class.name when "Decidim::ParticipatoryProcessStep" - "#238ff7" + "#3A4A9F" when "Decidim::Meetings::Meeting" - "#fabc6c" + "#ed1c24" when "Decidim::Calendar::ExternalEvent" - "#5fbd4c" + "#ed650b" when "Decidim::Debates::Debate" - "#d87537" + "#099329" when "Decidim::Consultation" - "#A854BD" + "#92278f" end end def type case __getobj__.class.name @@ -81,23 +81,33 @@ elsif respond_to?(:end_voting_date) end_voting_date else end_time end + @finish || start end def full_title @full_title ||= case __getobj__.class.name when "Decidim::ParticipatoryProcessStep" - participatory_process.title.merge(title) do |_k, v, o| - "#{v} - #{o}" - end + participatory_process.title else title end end + def subtitle + @subtitle ||= case __getobj__.class.name + when "Decidim::ParticipatoryProcessStep" + title + else + "" + end + end + def all_day? + return false if start.nil? || finish.nil? + (start.to_date..finish.to_date).count > 1 end end end end