submit button and unifed usage colors

This commit is contained in:
2022-12-02 15:23:39 +02:00
parent 9d125ace16
commit 10cd945472
7 changed files with 23 additions and 17 deletions

View File

@ -12,15 +12,22 @@ module Merged
def green_button( text, url)
button( text , url , "bg-green-500" )
end
def submit_button(text)
clazz = "bg-blue-500 " + button_classes
content_tag(:button , class: clazz , type: :submit) do
text
end
end
def button(text , url , color)
claz = color + " ml-3 inline-block rounded-lg px-4 py-3 text-md font-medium text-white"
link_to(url) do
content_tag(:button , class: claz ) do
content_tag(:button , class: color + " " + button_classes ) do
text
end
end
end
def button_classes
"ml-3 inline-block rounded-lg px-4 py-3 text-md font-medium text-white"
end
end
end

View File

@ -1,5 +1,6 @@
module Merged
module ViewHelper
include MergedHelper
# section should be hash with at least 'template' key
def find_template(section)
"merged/view/" + section.template