Sfoglia il codice sorgente

improve layout consistency and make it more consise

Daniel Sheffield 8 mesi fa
parent
commit
26fb5f6faf

+ 3 - 0
sqlpage/grocery/categories.sql

@@ -1,5 +1,8 @@
 SET title = 'Categories';
 SET filter_config = '[
+  {"name": "products[]", "width": 4},
+  {"name": "categories[]", "width": 4},
+  {"name": "groups[]", "width": 4},
   {"name": "tags[]", "type": "hidden"},
   {"name": "log_scale", "type": "hidden"},
   {"name": "start", "type": "hidden"},

+ 3 - 0
sqlpage/grocery/groups.sql

@@ -1,5 +1,8 @@
 SET title = 'Groups';
 SET filter_config = '[
+  {"name": "products[]", "width": 4},
+  {"name": "categories[]", "width": 4},
+  {"name": "groups[]", "width": 4},
   {"name": "tags[]", "type": "hidden"},
   {"name": "log_scale", "type": "hidden"},
   {"name": "start", "type": "hidden"},

+ 3 - 0
sqlpage/grocery/products.sql

@@ -1,5 +1,8 @@
 SET title = 'Products';
 SET filter_config = '[
+  {"name": "products[]", "width": 4},
+  {"name": "categories[]", "width": 4},
+  {"name": "groups[]", "width": 4},
   {"name": "tags[]", "type": "hidden"},
   {"name": "log_scale", "type": "hidden"},
   {"name": "start", "type": "hidden"},

+ 4 - 0
sqlpage/grocery/tags.sql

@@ -1,5 +1,9 @@
 SET title = 'Tags';
 SET filter_config = '[
+  {"name": "products[]", "width": 4},
+  {"name": "categories[]", "width": 4},
+  {"name": "groups[]", "width": 4},
+  {"name": "tags[]", "width": 4},
   {"name": "start", "width": 4},
   {"name": "end", "width": 4},
   {"name": "log_scale", "type": "hidden"},

+ 1 - 2
sqlpage/grocery/transactions.sql

@@ -1,7 +1,6 @@
 SET title = 'Transactions';
 SET filter_config = '[
-  {"name": "start", "width": 6},
-  {"name": "end", "width": 6},
+  {"name": "unit_count[]", "width": 4},
   {"name": "log_scale", "type": "hidden"}
 ]';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 0 - 5
sqlpage/grocery/trend.sql

@@ -1,7 +1,2 @@
 SET title = 'Trend';
-SET filter_config = '[
-  {"name": "start", "width": 4},
-  {"name": "end", "width": 4},
-  {"name": "log_scale", "width": 4}
-]';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 1 - 2
sqlpage/grocery/volume.sql

@@ -1,7 +1,6 @@
 SET title = 'Volume';
 SET filter_config = '[
-  {"name": "start", "width": 6},
-  {"name": "end", "width": 6},
+  {"name": "unit_count[]", "width": 4},
   {"name": "log_scale", "type": "hidden"}
 ]';
 SELECT 'dynamic' AS component, sqlpage.run_sql('sqlpage/internal/entry.sql') AS properties;

+ 13 - 13
sqlpage/sqlpage/json/filters.json

@@ -1,19 +1,27 @@
 [
   { "name": "products[]", "label": "Products",
     "type": "select", "dropdown": true, "multiple": true,
-    "width": 4
+    "width": 3
   },
   { "name": "categories[]", "label": "Categories",
     "type": "select", "dropdown": true, "multiple": true,
-    "width": 4
+    "width": 3
   },
   { "name": "groups[]", "label": "Groups",
     "type": "select", "dropdown": true, "multiple": true,
-    "width": 4
+    "width": 3
   },
   { "name": "tags[]", "label": "Tags",
     "type": "select", "dropdown": true, "multiple": true,
-    "width": 4
+    "width": 3
+  },
+  { "name": "start", "label": "From",
+    "type": "date",
+    "width": 2
+  },
+  { "name": "end", "label": "To",
+    "type": "date",
+    "width": 2
   },
   { "name": "unit_volume", "label": "Unit (vol.)",
     "type": "select", "multiple": false, "dropdown": true,
@@ -25,21 +33,13 @@
   },
   { "name": "unit_count[]", "label": "Unit (count)",
     "type": "select", "multiple": true, "dropdown": true,
-    "width": 4
-  },
-  { "name": "start", "label": "From",
-    "type": "date",
-    "width": 2
-  },
-  { "name": "end", "label": "To",
-    "type": "date",
     "width": 2
   },
   { "name": "log_scale", "label": "Log Scale", "value": "true",
     "type": "checkbox",
     "width": 2
   },
-  { "name": "apply", "label": "", "value": "Aply",
+  { "name": "apply", "label": "", "value": "Apply",
     "type": "submit",  "formaction": "/grocery/internal/apply.sql",
     "width": 2
   },