form.sql 699 B

123456789101112131415161718192021222324252627282930313233343536
  1. SET ":view" = COALESCE(:content, '') <> '';
  2. SELECT 'button' AS component;
  3. SELECT 'Open' AS title
  4. , 1 AS width
  5. , '/goto?action=open' AS link
  6. ;
  7. SELECT 'New' AS title
  8. , 1 AS width
  9. , 'gray-500' AS color
  10. , '/goto' AS link
  11. ;
  12. SELECT 'form' AS component
  13. , '/goto/' AS action
  14. , 'Shrtn It!' AS validate
  15. , :tabler_color AS validate_color
  16. , 'post' AS method
  17. WHERE NOT :view
  18. ;
  19. SELECT 'action' AS name
  20. , '' AS label
  21. , 'hidden' AS type
  22. , 'Shrtn It!' AS value
  23. WHERE NOT :view
  24. ;
  25. SELECT 'content' AS name
  26. , '' AS label
  27. , 'input' AS type
  28. , :content AS value
  29. , 'Paste URL here...' AS placeholder
  30. WHERE NOT :view
  31. ;
  32. SELECT 'dynamic' AS component, sqlpage.run_sql('goto/preview.sql') AS properties
  33. WHERE :content <> ''
  34. ;