diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4091792d..a9a07726 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -178,20 +178,22 @@ module ApplicationHelper 'hidden' if Date.today > conference.end_date end + # TODO:Snap!Con: Replace this with a search for a conference logo. def nav_root_link_for(conference) - link_text = ( - conference.try(:organization).try(:name) || - ENV['OSEM_NAME'] || - 'OSEM' - ) link_to( image_tag('snapcon_logo.png'), root_path, class: 'navbar-brand', - title: 'Open Source Event Manager' + title: ENV['OSEM_NAME'] ) end + def nav_link_text(conference) + conference.try(:organization).try(:name) || + ENV['OSEM_NAME'] || + 'OSEM' + end + # returns the url to be used for logo on basis of sponsorship level position def get_logo(object) if object.try(:sponsorship_level) diff --git a/app/helpers/format_helper.rb b/app/helpers/format_helper.rb index 9dc7abc5..6aa198d6 100644 --- a/app/helpers/format_helper.rb +++ b/app/helpers/format_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'redcarpet/render_strip' module FormatHelper @@ -43,12 +44,11 @@ module FormatHelper def target_progress_color(progress) progress = progress.to_i - result = - case - when progress >= 90 then 'green' - when progress < 90 && progress >= 80 then 'orange' - else 'red' - end + result = case + when progress >= 90 then 'green' + when progress < 90 && progress >= 80 then 'orange' + else 'red' + end result end @@ -100,19 +100,11 @@ module FormatHelper end def icon_for_todo(bool) - if bool - 'fa fa-check' - else - 'fa fa-times' - end + bool ? 'fa fa-check' : 'fa fa-times' end def class_for_todo(bool) - if bool - 'todolist-ok' - else - 'todolist-missing' - end + bool ? 'todolist-ok' : 'todolist-missing' end def word_pluralize(count, singular, plural = nil)