Sha256: 9c8f5e2ff299da8aca6279c898409b19e33cc6b05e7a012b768e438444524850

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

class SunrisePost < Sunrise::AbstractModel
  self.resource_name = 'Post'

  available_index_views [:thumbs]

  index :thumbs do
    scope { Post.recently }
    preview ->(post) { post.cover.try(:thumb) || post.picture.try(:thumb) }

    field :published_at
    field :joined_tags

    group :search do
      field :title
      field :published_at
    end
  end

  form do
    field :title, as: :text, input_html: { rows: 2 }, translate: true
    field :description, as: :text, input_html: { rows: 6 }, translate: true
    field :slug

    field :published_at
    field :content, as: :ckeditor, input_html: { height: 400, width: 900 }, translate: true

    group :meta_tags, holder: :sidebar do
      field :tag_title, as: :text, input_html: { rows: 2 }, translate: true
      field :tag_keywords, translate: true
      field :tag_description, as: :text, input_html: { rows: 5 }, translate: true
    end

    group :bottom, holder: :bottom do
      field :picture, as: :uploader
      field :cover, as: :uploader
      field :logo, as: :uploader
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
translation_cms-0.1.5 app/sunrise/sunrise_post.rb