Module:CRTModel: Difference between revisions

No edit summary
No edit summary
Tag: Reverted
Line 273: Line 273:
td:node(ul)
td:node(ul)
-- Add upload link as a button - Tailwind-inspired style
-- Add upload link as a button - Tailwind-inspired style with hover
local uploadDiv = mw.html.create('div')
local uploadDiv = mw.html.create('div')
uploadDiv:css('margin-top', '0.5em'):css('text-align', 'center')
uploadDiv:css('margin-top', '0.5em'):css('text-align', 'center')
uploadDiv:wikitext('[' .. tostring(uploadUrl) .. ' <span style="display:inline-block;padding:0.5rem 1rem;background-color:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;border-radius:0.375rem;font-size:0.875rem;font-weight:500;text-decoration:none;">Upload a document</span>]')
uploadDiv:wikitext('[' .. tostring(uploadUrl) .. ' <span class="upload-doc-btn" style="display:inline-block;padding:0.5rem 1rem;background-color:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;border-radius:0.375rem;font-size:0.875rem;font-weight:500;text-decoration:none;transition:background-color 0.2s ease;">Upload a document</span>]')
td:node(uploadDiv)
td:node(uploadDiv)
else
else
-- Just show the upload link as a button - Tailwind-inspired style
-- Just show the upload link as a button - Tailwind-inspired style with hover
local uploadDiv = mw.html.create('div')
local uploadDiv = mw.html.create('div')
uploadDiv:css('text-align', 'center')
uploadDiv:css('text-align', 'center')
uploadDiv:wikitext('[' .. tostring(uploadUrl) .. ' <span style="display:inline-block;padding:0.5rem 1rem;background-color:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;border-radius:0.375rem;font-size:0.875rem;font-weight:500;text-decoration:none;">Upload a document</span>]')
uploadDiv:wikitext('[' .. tostring(uploadUrl) .. ' <span class="upload-doc-btn" style="display:inline-block;padding:0.5rem 1rem;background-color:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;border-radius:0.375rem;font-size:0.875rem;font-weight:500;text-decoration:none;transition:background-color 0.2s ease;">Upload a document</span>]')
td:node(uploadDiv)
td:node(uploadDiv)
Line 302: Line 302:
end
end


return tostring(tbl)
-- Add CSS for hover effect at the end of the infobox
local styleTag = '<style>.upload-doc-btn:hover { background-color: #dbeafe !important; }</style>'
return styleTag .. tostring(tbl)
end
end


return p
return p
MediaWiki Appliance - Powered by TurnKey Linux