parent
3c206b52e3
commit
e9ce9ad97c
@ -1,11 +1,22 @@
|
|||||||
module Admins::SubjectsHelper
|
module Admins::SubjectsHelper
|
||||||
def display_subject_status(subject)
|
def display_subject_status(subject)
|
||||||
style =
|
style =
|
||||||
case subject.status
|
case subject.public
|
||||||
when 0 then 'text-secondary'
|
when 0 then 'text-secondary'
|
||||||
when 1 then 'text-warning'
|
when 1 then 'text-warning'
|
||||||
when 2 then 'text-success'
|
when 2 then 'text-success'
|
||||||
end
|
end
|
||||||
raw content_tag(:span, t("subject.public.#{subject.public}"), class: style)
|
|
||||||
|
status =
|
||||||
|
if subject.public == 2
|
||||||
|
"publiced"
|
||||||
|
elsif subject.public == 1
|
||||||
|
"pending"
|
||||||
|
elsif subject.status == 2
|
||||||
|
"processed"
|
||||||
|
else
|
||||||
|
"editing"
|
||||||
|
end
|
||||||
|
raw content_tag(:span, t("subject.public.#{status}"), class: style)
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in new issue