Sha256: 5c88ef5aa99ba3680de26f02d6b9ecdc12bdd051d4fb88bfd9a3a2b45d707269

Contents?: true

Size: 1.6 KB

Versions: 24

Compression:

Stored size: 1.6 KB

Contents

module Alchemy
  module Admin
    module PagesHelper
      include Alchemy::BaseHelper

      # Used for rendering the folder link in +Admin::Pages#index+ sitemap.
      #
      def sitemap_folder_link(page)
        if page.folded?(current_alchemy_user.id)
          css_class = 'folded'
          title = _t('Show childpages')
        else
          css_class = 'collapsed'
          title = _t('Hide childpages')
        end
        link_to(
          '',
          alchemy.fold_admin_page_path(page),
          remote: true,
          method: :post,
          class: "page_folder #{css_class} spinner",
          title: title,
          id: "fold_button_#{page.id}"
        )
      end

      # Returns options tags for the screen sizes select in page edit view.
      #
      def preview_sizes_for_select
        options_for_select([
          'auto',
          [_t('240', :scope => 'preview_sizes'), 240],
          [_t('320', :scope => 'preview_sizes'), 320],
          [_t('480', :scope => 'preview_sizes'), 480],
          [_t('768', :scope => 'preview_sizes'), 768],
          [_t('1024', :scope => 'preview_sizes'), 1024],
          [_t('1280', :scope => 'preview_sizes'), 1280]
        ])
      end

      # Returns the translated explanation of the pageĀ“s status.
      #
      def combined_page_status(page)
        page.status.map do |state, value|
          next if state == :locked
          val = content_tag(:span, '', class: page.send(state) ? "page_status #{state}" : "page_status not_#{state}")
          val += page.status_title(state)
        end.delete_if(&:blank?).join("<br>").html_safe
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
alchemy_cms-3.1.3 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.2.0.beta app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.9.1 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.1 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.0.4 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.rc3 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.rc2 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.rc1 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.beta6 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.beta5 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.beta4 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.0.3 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.beta3 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.beta2 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.1.0.beta1 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.0.2 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.0.1 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.0.0 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-3.0.0.rc8 app/helpers/alchemy/admin/pages_helper.rb