Delint helpers
This commit is contained in:
parent
6dd501663c
commit
1ec99a5018
2 changed files with 16 additions and 22 deletions
|
|
@ -178,20 +178,22 @@ module ApplicationHelper
|
||||||
'hidden' if Date.today > conference.end_date
|
'hidden' if Date.today > conference.end_date
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO:Snap!Con: Replace this with a search for a conference logo.
|
||||||
def nav_root_link_for(conference)
|
def nav_root_link_for(conference)
|
||||||
link_text = (
|
|
||||||
conference.try(:organization).try(:name) ||
|
|
||||||
ENV['OSEM_NAME'] ||
|
|
||||||
'OSEM'
|
|
||||||
)
|
|
||||||
link_to(
|
link_to(
|
||||||
image_tag('snapcon_logo.png'),
|
image_tag('snapcon_logo.png'),
|
||||||
root_path,
|
root_path,
|
||||||
class: 'navbar-brand',
|
class: 'navbar-brand',
|
||||||
title: 'Open Source Event Manager'
|
title: ENV['OSEM_NAME']
|
||||||
)
|
)
|
||||||
end
|
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
|
# returns the url to be used for logo on basis of sponsorship level position
|
||||||
def get_logo(object)
|
def get_logo(object)
|
||||||
if object.try(:sponsorship_level)
|
if object.try(:sponsorship_level)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'redcarpet/render_strip'
|
require 'redcarpet/render_strip'
|
||||||
|
|
||||||
module FormatHelper
|
module FormatHelper
|
||||||
|
|
@ -43,12 +44,11 @@ module FormatHelper
|
||||||
|
|
||||||
def target_progress_color(progress)
|
def target_progress_color(progress)
|
||||||
progress = progress.to_i
|
progress = progress.to_i
|
||||||
result =
|
result = case
|
||||||
case
|
when progress >= 90 then 'green'
|
||||||
when progress >= 90 then 'green'
|
when progress < 90 && progress >= 80 then 'orange'
|
||||||
when progress < 90 && progress >= 80 then 'orange'
|
else 'red'
|
||||||
else 'red'
|
end
|
||||||
end
|
|
||||||
|
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
@ -100,19 +100,11 @@ module FormatHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def icon_for_todo(bool)
|
def icon_for_todo(bool)
|
||||||
if bool
|
bool ? 'fa fa-check' : 'fa fa-times'
|
||||||
'fa fa-check'
|
|
||||||
else
|
|
||||||
'fa fa-times'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def class_for_todo(bool)
|
def class_for_todo(bool)
|
||||||
if bool
|
bool ? 'todolist-ok' : 'todolist-missing'
|
||||||
'todolist-ok'
|
|
||||||
else
|
|
||||||
'todolist-missing'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def word_pluralize(count, singular, plural = nil)
|
def word_pluralize(count, singular, plural = nil)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue