Sha256: baa90008f5a9a118d6b919b023126f64cd4393bc341db347f84c7d0dd34f74ab

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

- site_path = @cms_index.url(relative: false)

%h2
  = link_to @cms_index.page.label, site_path

- @archive_pages.each do |page|
  %h3
    = link_to page.label, page.url
  .date
    = page.published_at(@cms_index.datetime_fragment).to_s(:db)

= comfy_paginate @archive_pages

%h4 Archives
- case ActiveRecord::Base.connection.adapter_name.downcase.to_sym
- when :mysql, :mysql2
  - dates = @cms_index.children(true).chronologically(@cms_index.datetime_fragment).group(:year, :month).unscope(:order).order(year: :desc, month: :desc).pluck(Arel.sql("YEAR(comfy_cms_fragments.datetime) as year, MONTH(comfy_cms_fragments.datetime) as month"))
- when :sqlite
  - dates = @cms_index.children(true).chronologically(@cms_index.datetime_fragment).group(:year, :month).unscope(:order).order(year: :desc, month: :desc).pluck(Arel.sql("strftime('%Y', comfy_cms_fragments.datetime) as year, strftime('%m', comfy_cms_fragments.datetime) as month"))
- else
  - raise NotImplementedError, "Unknown adapter type '#{ActiveRecord::Base.connection.adapter_name}'"
- dates.each do |(year, month)|
  %li
    = comfy_archive_link_to_month year, month

%h4 Categories
- @cms_index.categories(true).each do |category|
  = comfy_archive_link_to_category category

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comfy_archive-0.3.0 app/views/comfy/archive/index/index.html.haml