From e78dc8752140b9bdac677957e1d142d9ae3927fa Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 15 Mar 2020 19:16:42 +0200 Subject: [PATCH] Work in progress --- app/init.php | 2 +- app/views/console/database/collection.phtml | 93 +++++++++++++++++---- public/scripts/filters.js | 18 ++-- 3 files changed, 89 insertions(+), 24 deletions(-) diff --git a/app/init.php b/app/init.php index 404d08a08..3ce0451c9 100644 --- a/app/init.php +++ b/app/init.php @@ -25,7 +25,7 @@ const APP_EMAIL_SECURITY = 'security@localhost.test'; // Default security email const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s'; const APP_MODE_ADMIN = 'admin'; const APP_PAGING_LIMIT = 15; -const APP_CACHE_BUSTER = 61; +const APP_CACHE_BUSTER = 64; const APP_VERSION_STABLE = '0.5.0'; const APP_STORAGE_UPLOADS = '/storage/uploads'; const APP_STORAGE_CACHE = '/storage/cache'; diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index 3bab4eb6b..ddf381355 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -21,12 +21,34 @@
  • Documents

    + +
    Create your first document to get started

    -
    - - - - - - - - - - - - -
    +
    +
    documents found
    + +
    + + + + + + + + + + +
    + + +
    +
    +
    + +
    +
    + +
    + + + +
    + +
  • @@ -60,7 +119,7 @@
    -
    +
    @@ -237,6 +297,7 @@
    +
    diff --git a/public/scripts/filters.js b/public/scripts/filters.js index d9c1c973a..cb0636e52 100644 --- a/public/scripts/filters.js +++ b/public/scripts/filters.js @@ -371,15 +371,19 @@ window.ls.filter return result.length; }) - .add("documentLabel", function(document, rule) { + .add("documentLabel", function($value, rule, filter) { + let value = $value[rule['key']] ? $value[rule['key']] : null; - console.log(document, rule); - - if(document[rule['key']]) { - return document[rule['key']]; - } + switch (rule['type']) { + case 'bool': + case 'boolean': + return (value) ? 'true' : 'false'; + break; - return ''; + default: + return value; + break; + } }); function abbreviate(number, maxPlaces, forcePlaces, forceLetter) {