move colored buttons from ruby to tailwind/html
This commit is contained in:
@ -14,22 +14,6 @@ module Merged
|
||||
name += "*" unless card.option("compulsory") == "no"
|
||||
name
|
||||
end
|
||||
def blue_button( text, url)
|
||||
button( text , url , "bg-cyan-200" )
|
||||
end
|
||||
def red_button( text, url)
|
||||
button( text , url , "bg-red-300" )
|
||||
end
|
||||
def green_button( text, url)
|
||||
button( text , url , "bg-green-200" )
|
||||
end
|
||||
def button(text , url , color)
|
||||
link_to(url) do
|
||||
content_tag(:button , class: color + " " + button_classes ) do
|
||||
text
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def last_change_digit
|
||||
last = ChangeSet.current.last
|
||||
|
@ -42,16 +42,13 @@ module Merged
|
||||
|
||||
def view_button(element , extra_classes = "")
|
||||
return "" unless element.has_option?("button_link")
|
||||
["<button class='#{button_classes} ",
|
||||
["<button class='button ",
|
||||
extra_classes,
|
||||
" hover:border-2'>" ,
|
||||
" >" ,
|
||||
"<a href='#{element.option("button_link")}'>" ,
|
||||
element.option("button_text") ,
|
||||
"</a>",
|
||||
" </button>"].join.html_safe
|
||||
end
|
||||
def view_button_classes(element)
|
||||
button_classes + " hover:border-4"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user