Daniel Sheffield пре 4 месеци
родитељ
комит
44ab3ba065
2 измењених фајлова са 11 додато и 0 уклоњено
  1. 1 0
      util-sqlpage/code/form-fuel.sql
  2. 10 0
      util-sqlpage/code/form.sql

+ 1 - 0
util-sqlpage/code/form-fuel.sql

@@ -8,6 +8,7 @@ SET ":used" = COALESCE(:used, (SELECT used FROM code_detail WHERE hash = $hash))
 SET ":validate" = 'Update';
 SET "$action" = 'Update';
 SET ":method" = 'post';
+SET ":preview" = (SELECT used FROM code_detail WHERE hash = $hash);
 SET ":autofill" = TRUE;
 SET ":filter_config" = '[
   {"name": "store", "required": true},

+ 10 - 0
util-sqlpage/code/form.sql

@@ -18,6 +18,16 @@ SET ":filter_options" = (
   ) q
 );
 
+SELECT 'card' AS component
+, 1 AS columns
+WHERE COALESCE($hash, '') <> '';
+SELECT COALESCE(type||' ','') || COALESCE(store||' ', '') || COALESCE(expiry, created) AS title
+, COALESCE(content->>'content'||' ', '') || COALESCE(content->>'type', '') AS description
+, $preview AS top_image
+, $tabler_color AS color
+WHERE COALESCE($hash, '') <> ''
+;
+
 SELECT 'form' AS component
 , '/code.sql' AS action
 , $validate AS validate