Sha256: 56eb17887662e24d3f1c6241f1f38ea835e19d835fe6b4e7ddcde5ebc4d7ad9e

Contents?: true

Size: 953 Bytes

Versions: 17

Compression:

Stored size: 953 Bytes

Contents

# frozen_string_literal: true

class Comfy::Admin::Cms::Revisions::TranslationController < Comfy::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 "comfy/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("comfy.admin.cms.revisions.record_not_found")
    redirect_to comfy_admin_cms_site_pages_path(@site)
  end

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

end

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
comfortable_mexican_sofa-2.0.19 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
PixelForce_ETS-0.0.2 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
PixelForce_ETS-0.0.1 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
kcyEtsTest2-0.0.4 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
kcyEtsTest2-0.0.3 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
kcyEtsTest2-0.0.2 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
kcyEtsTest2-0.0.1 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
kcyEtsTest-0.0.1 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
kcyEtsTest-2.2.19 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
ComfortableMexicanSofa-2.0.18 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
kcy1-1.0 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
comfortable_mexican_sofa-2.0.18 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
comfortable_mexican_sofa-2.0.17 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
comfortable_mexican_sofa-2.0.16 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
comfortable_mexican_sofa-2.0.15 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
comfortable_mexican_sofa-2.0.14 app/controllers/comfy/admin/cms/revisions/translation_controller.rb
comfortable_mexican_sofa-2.0.13 app/controllers/comfy/admin/cms/revisions/translation_controller.rb