Repository URL to install this package:
|
Version:
0.4.8.1 ▾
|
module Scrapbook
# View helpers for in-engine views
module LibraryHelper
def metadata_fields
Scrapbook.config.metadata_fields.values
end
def freehand_cropping?
current_context.target_resolution.width_only?
end
def free_crop_ratios
[[3, 2], [4, 3], [5, 4], [16, 9], [1, 1]]
end
def current_context
Context.find(context_source)
end
def hint_text(translation_name, context = current_context, options = {})
t_opts = { context: context.title,
file_type_category: context.file_type_category }.merge(options)
translation = t(translation_name, t_opts)
content_tag :p, translation, class: 'hint-text'
end
private
def context_source
return params[:context] if params[:context].present?
return @placement.context_name if @placement
end
end
end