app/helpers/workarea/admin/releases_helper.rb in workarea-admin-3.4.45 vs app/helpers/workarea/admin/releases_helper.rb in workarea-admin-3.5.0.beta.1

- old
+ new

@@ -97,10 +97,14 @@ def discount_links(ids) model_links(Pricing::Discount, ids) end + def segment_links(ids) + model_links(Segment, ids) + end + def for_each_content_block_from_changeset(content, change_hash) change_hash.each do |id, changes| block = content.blocks.detect { |b| b.id.to_s == id.to_s } yield(block, changes) if block.present? end @@ -169,38 +173,18 @@ Date.parse(day).day end def calendar_day_classes(day) date = Date.parse(day) - today = Time.zone.now.to_date + today = Date.current classes = ['calendar__day'] classes << 'calendar__day--odd-month' if date.month.odd? classes << 'calendar__day--today' if date == today classes << 'calendar__day--start-of-week' if date == date.beginning_of_week(start_day = :sunday) classes << 'calendar__day--end-of-week' if date == date.end_of_week(start_day = :sunday) classes - end - - def calendar_release_classes(day, release) - date = Date.parse(day) - - classes = ['calendar__release'] - classes << 'calendar__release--start' if release.published_on_date?(date) - classes << 'calendar__release--end' if release.ended_on_date?(date) - classes << 'calendar__release--content' if release.content_release? - - classes - end - - def calendar_release_styles(release) - return if release.undo_at.blank? - - color = Digest::MD5.hexdigest(release.name)[0, 6] - text_color = release_text_color(color) - - "background-color: ##{color}; color: ##{text_color};" end private def model_links(klass, ids)