Sha256: 95d30a005f90e507af3b2e3769fb078327a1d6c42ff75861cea7293abfd59794

Contents?: true

Size: 1.6 KB

Versions: 9

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_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

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-2.8.3 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.7.5 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.7.4 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.8.2 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.8.1 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.7.3 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.7.2 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.7.1 app/helpers/alchemy/admin/pages_helper.rb
alchemy_cms-2.7.0 app/helpers/alchemy/admin/pages_helper.rb