move colored buttons from ruby to tailwind/html

This commit is contained in:
2023-01-21 19:30:32 +02:00
parent 84fef50e16
commit 15dd0bb557
8 changed files with 50 additions and 69 deletions

View File

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

View File

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