Sha256: 11784ac7e608c54eec6c2eb30fdc477aed60c44fdede2160c26c26ba6744939e

Contents?: true

Size: 1.39 KB

Versions: 9

Compression:

Stored size: 1.39 KB

Contents

module Bhf
  module ApplicationHelper

    def show_t(platform)
      t("bhf.helpers.entry.models.#{platform.model_name}.show", platform_title: platform.title_singular.titleize, default: t('bhf.helpers.entry.show')).html_safe
    end

    def new_t(platform)
      t("bhf.helpers.entry.models.#{platform.model_name}.new", platform_title: platform.title_singular.titleize, default: t('bhf.helpers.entry.new')).html_safe
    end

    def duplicate_t(platform)
      t("bhf.helpers.entry.models.#{platform.model_name}.duplicate", platform_title: platform.title_singular.titleize, default: t('bhf.helpers.entry.duplicate')).html_safe
    end

    def edit_t(platform)
      t("bhf.helpers.entry.models.#{platform.model_name}.edit", platform_title: platform.title_singular.titleize, default: t('bhf.helpers.entry.edit')).html_safe
    end

    def delete_t(platform)
      t("bhf.helpers.entry.models.#{platform.model_name}.delete", platform_title: platform.title_singular.titleize, default: t('bhf.helpers.entry.delete')).html_safe
    end

    def find_smallest_size_url_for_file(file)
      if file.exists?(:thumb)
        file.url(:thumb)
      elsif file.exists?(:medium)
        file.url(:medium)
      else
        file.url
      end
    end

    def type_is_image?(type)
      Bhf.configuration.image_types.include?(type)
    end

    def bhf_main_logo(area)
      Bhf.configuration.logo.call(area)
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bhf-1.0.0.beta16 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta15 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta14 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta13 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta12 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta11 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta10 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta9 app/helpers/bhf/application_helper.rb
bhf-1.0.0.beta8 app/helpers/bhf/application_helper.rb