Delint helpers

This commit is contained in:
Michael Ball 2020-01-27 22:42:37 -08:00
parent 6dd501663c
commit 1ec99a5018
2 changed files with 16 additions and 22 deletions

View file

@ -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)

View file

@ -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)