2024-04-04 10:21:23 +02:00
|
|
|
# frozen_string_literal: true
|
2024-04-02 19:33:19 +02:00
|
|
|
module SearchHelper
|
|
|
|
def rating_display(rating)
|
|
|
|
case rating
|
2024-04-04 10:21:23 +02:00
|
|
|
when 'everyone'
|
2024-04-02 19:33:19 +02:00
|
|
|
tag.div class: 'frating ev', title: 'Rated Everyone' do
|
|
|
|
'Everyone'
|
|
|
|
end
|
2024-04-04 10:21:23 +02:00
|
|
|
when 'teen'
|
|
|
|
tag.div class: 'frating', title: 'Rated Teen' do
|
|
|
|
'Teen'
|
|
|
|
end
|
|
|
|
when 'explicit'
|
|
|
|
tag.div class: 'frating', title: 'Rated Explicit' do
|
|
|
|
'Explicit'
|
|
|
|
end
|
2024-04-02 19:33:19 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def status_display(status)
|
|
|
|
case status
|
2024-04-04 10:21:23 +02:00
|
|
|
when 'complete'
|
2024-04-02 19:33:19 +02:00
|
|
|
tag.div class: 'fstatus sc', title: 'Complete' do
|
|
|
|
'Complete'
|
|
|
|
end
|
2024-04-04 10:21:23 +02:00
|
|
|
when 'incomplete'
|
2024-04-02 19:33:19 +02:00
|
|
|
tag.div class: 'fstatus si', title: 'Incomplete' do
|
|
|
|
'Incomplete'
|
|
|
|
end
|
2024-04-04 10:21:23 +02:00
|
|
|
when 'hiatus'
|
2024-04-03 03:02:26 +02:00
|
|
|
tag.div class: 'fstatus sh', title: 'On Hiatus' do
|
|
|
|
'On Hiatus'
|
|
|
|
end
|
2024-04-04 10:21:23 +02:00
|
|
|
when 'cancelled'
|
2024-04-02 19:33:19 +02:00
|
|
|
tag.div class: 'fstatus sn', title: 'Cancelled' do
|
|
|
|
'Cancelled'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def tag_to_html(t)
|
2024-04-03 01:46:43 +02:00
|
|
|
tag.div class: "ftag #{t.name.downcase.gsub(' ', '-')}", title: t.name do
|
2024-04-02 19:33:19 +02:00
|
|
|
t.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-04-03 01:34:24 +02:00
|
|
|
def character_display(t)
|
2024-04-14 02:59:15 +02:00
|
|
|
tag.img class: 'character', src: "/img/characters/#{t.image_name}.png", title: t.name, alt: t.name[0]
|
2024-04-02 19:33:19 +02:00
|
|
|
end
|
|
|
|
end
|