Browse Source

Fixed errors

development
Godwin 9 years ago
parent
commit
a8a498684e
  1. 11
      app/assets/stylesheets/bumbleberry-settings.json
  2. 111
      app/helpers/application_helper.rb

11
app/assets/stylesheets/bumbleberry-settings.json

@ -1,5 +1,14 @@
{ {
"stylesheets": ["application", "translations", "email-example"], "stylesheets": ["application", "translations", "email-example"],
"precompile": {
"test": {
"chrome": ["50"]
},
"development": {
"chrome": ["50"],
"ios_saf": ["8", "9"]
}
},
"background-color": "#FFFEFE", "background-color": "#FFFEFE",
"breakpoint-unit": "px", "breakpoint-unit": "px",
"unresponsive-width": 1000, "unresponsive-width": 1000,
@ -21,7 +30,7 @@
"reset-order": "n" "reset-order": "n"
}, },
"medium": { "medium": {
"range": [564], "range": [680],
"grid": "y", "grid": "y",
"offset": "n", "offset": "n",
"reset-order": "n" "reset-order": "n"

111
app/helpers/application_helper.rb

@ -151,84 +151,6 @@ module ApplicationHelper
content_for?(section) ? content_for(section) : default content_for?(section) ? content_for(section) : default
end end
# def _(key, behavior = nil, behavior_size = nil, locale: nil, vars: {}, html: nil, blockData: {}, &block)
# options = vars
# options[:fallback] = true
# if behavior
# options[:behavior] = behavior
# options[:behavior_size] = behavior_size
# end
# if locale
# options[:locale] = locale.to_sym
# end
# #if vars
# # puts "\nVARS:\t#{vars}\n"
# #end
# I18n.translate(key, options)
#
# #queued_keys = nil
# #result = nil
#
# #if key.kind_of?(Hash)
# # blockData.merge!(key)
# # key = key.keys
# #end
#
# #if block_given?
# # @@keyQueue ||= Array.new
#
# # if key.kind_of?(Array)
# # @@keyQueue += key
# # else
# # @@keyQueue << key
# # end
# #end
#
# #if key.kind_of?(Array)
# # new_key = key.shift
# # if key.count > 0
# # queued_keys = key.dup
# # end
# # key = new_key
# #end
#
# #if blockData[key]
# # behavior = blockData[key][:behavior] || nil
# # behavior_size = blockData[key][:behavior_size] || nil
# # vars = blockData[key][:vars] || {}
# #end
#
# #@@lastTranslation = nil
# #generate_control = _can_translate?
#
# #puts "\nLLOOCCAALLEE:\t#{locale.to_s}"
# #translation = _do_translate(key, vars, behavior, behavior_size, locale)
#
# #if block_given?
# # html = capture(&block)
# #end
#
# #if html
# # translation['html'] = html.gsub('%' + key + '%', translation['untranslated'])
# #end
#
# #if generate_control
# # @@lastTranslation = translation
# # @@allTranslations ||= Hash.new
# # @@allTranslations[key] = key
#
# # result = _translate_me(translation)
# #end
#
# #result ||= translation['html'] || (behavior.to_s == 'strict' ? nil : translation['untranslated'])
#
# #if queued_keys
# # return _ queued_keys, behavior, behavior_size, vars: vars, html: result, blockData: blockData
# #end
#
#return result
# end
def _translate_me(translation) def _translate_me(translation)
@@translationsOnThisPage = true @@translationsOnThisPage = true
datakeys = '' datakeys = ''
@ -263,17 +185,20 @@ module ApplicationHelper
false false
end end
#def _!() def url_for_locale(locale)
# if @@keyQueue url_for(params
# return '%' + @@keyQueue.shift + '%' .merge({action: (params[:_original_action] || params[:action])}
# end .merge(url_params(locale)))
#end .delete(:_original_action)
)
end
#def _?() def registration_steps(conference = @conference)
# if @@keyQueue {
# return '%' + @@keyQueue[0] + '%' pre: [:policy, :basic_info, :workshops],
# end open: [:policy, :basic_info, :questions, :payment, :workshops]
#end }[@this_conference.registration_status]
end
def sortable(objects, id = 'id', url: nil, &block) def sortable(objects, id = 'id', url: nil, &block)
result = '<ul class="sortable sortable-' + objects[0].class.name.underscore.gsub('_', '-') + (url ? ('" data-url="' + url) : '') + '" data-id="' + id + '">' result = '<ul class="sortable sortable-' + objects[0].class.name.underscore.gsub('_', '-') + (url ? ('" data-url="' + url) : '') + '" data-id="' + id + '">'
@ -640,7 +565,15 @@ module ApplicationHelper
return hash.length > 1 ? _("geography.formats.#{hash.keys.join('_')}", vars: hash) : hash.values.first return hash.length > 1 ? _("geography.formats.#{hash.keys.join('_')}", vars: hash) : hash.values.first
end end
def nav_link(link, title, class_name = nil) def nav_link(link, title = nil, class_name = nil)
if title.nil? && link.is_a?(Symbol)
title = link
link = send("#{link.to_s}_path")
end
if class_name.nil? && title.is_a?(Symbol)
class_name = title
title = _"page_titles.#{title.to_s.titlecase}"
end
classes = [] classes = []
classes << class_name if class_name.present? classes << class_name if class_name.present?
classes << 'current' if current_page?(link.gsub(/(^.*)\/$/, '\1')) classes << 'current' if current_page?(link.gsub(/(^.*)\/$/, '\1'))

Loading…
Cancel
Save