Sha256: fd2ad08d90418b0b6849a7e8bfb230987e03c244fef7e078fcac093a1931a389

Contents?: true

Size: 957 Bytes

Versions: 12

Compression:

Stored size: 957 Bytes

Contents

# frozen_string_literal: true

class Occams::Admin::Cms::Revisions::TranslationController < Occams::Admin::Cms::Revisions::BaseController
  def show
    @current_content = @record.fragments.each_with_object({}) do |b, c|
      c[b.identifier] = b.content
    end
    @versioned_content = @record.fragments.each_with_object({}) do |b, c|
      d = @revision.data['fragments_attributes'].detect { |r| r[:identifier] == b.identifier }
      c[b.identifier] = d.try(:[], :content)
    end

    render 'occams/admin/cms/revisions/show'
  end

private

  def load_record
    @page   = @site.pages.find(params[:page_id])
    @record = @page.translations.find(params[:translation_id])
  rescue ActiveRecord::RecordNotFound
    flash[:danger] = I18n.t('occams.admin.cms.revisions.record_not_found')
    redirect_to occams_admin_cms_site_pages_path(@site)
  end

  def record_path
    edit_occams_admin_cms_site_page_translation_path(@site, @page, @record)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
occams-1.1.0 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.8 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.7.3 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.7.2 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.7.1 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.7 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.6.1 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.6 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.5 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.4 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.3 app/controllers/occams/admin/cms/revisions/translation_controller.rb
occams-1.0.2 app/controllers/occams/admin/cms/revisions/translation_controller.rb