2020-05-03 07:57:52 +12:00
<?php
$collection = $this->getParam('collection', []);
$rules = $collection->getAttribute('rules', []);
2020-06-11 16:37:12 +12:00
$maxCells = 10;
2020-05-03 07:57:52 +12:00
?>
2019-08-07 01:57:12 +12:00
2020-03-09 08:27:21 +13:00
< div
2019-08-08 06:10:53 +12:00
data-service="database.getCollection"
data-param-collection-id="{{router.params.id}}"
2020-03-09 08:27:21 +13:00
data-scope="sdk"
data-event="load,database.updateCollection"
2019-08-08 06:10:53 +12:00
data-name="project-collection">
2019-08-17 18:06:56 +12:00
2020-03-09 08:27:21 +13:00
< div class = "cover" >
< h1 class = "zone xl margin-bottom-large" >
2020-06-10 02:43:24 +12:00
< a data-ls-attrs = "href=/console/database?project={{router.params.project}}" class = "back text-size-small link-return-animation--start" > < i class = "icon-left-open" > < / i > Database< / a >
2019-08-17 18:06:56 +12:00
2020-03-09 08:27:21 +13:00
< br / >
2019-08-17 18:06:56 +12:00
2020-03-10 04:48:51 +13:00
< span data-ls-bind = "{{project-collection.name}}" > < / span >
2020-03-09 08:27:21 +13:00
< / h1 >
2019-08-17 18:06:56 +12:00
< / div >
2020-04-21 20:12:06 +12:00
< div data-ui-modal class = "modal width-large box close" data-button-hide = "on" data-open-event = "open-json" >
< button type = "button" class = "close pull-end" data-ui-modal-close = "" > < i class = "icon-cancel" > < / i > < / button >
2020-04-21 20:29:09 +12:00
< h2 > JSON View< / h2 >
2020-04-21 20:12:06 +12:00
< div class = "margin-bottom" >
< input type = "hidden" data-ls-bind = "{{project-collection}}" data-forms-code / >
< / div >
< button data-ui-modal-close = "" type = "button" class = "reverse" > Cancel< / button >
< / div >
2020-03-09 08:27:21 +13:00
< div class = "zone xl" >
< ul class = "phases clear" data-ui-phases data-selected = "{{router.params.tab}}" >
< li data-state = "/console/database/collection?id={{router.params.id}}&project={{router.params.project}}" >
2020-04-02 10:41:29 +13:00
2020-03-09 08:27:21 +13:00
< h2 > Documents< / h2 >
2020-03-15 17:54:55 +13:00
2020-03-16 06:16:42 +13:00
< form class = "box padding-small margin-bottom search"
data-service="database.listDocuments"
data-event="submit"
data-param-collection-id="{{router.params.id}}"
data-param-search="{{router.params.search}}"
data-param-limit="<?php echo APP_PAGING_LIMIT ; ?> "
data-param-offset=""
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-documents"
data-success="state"
data-success-param-state-keys="search,offset">
< div class = "row thin responsive" >
< div class = "col span-10" >
< input name = "search" id = "searchDocuments" type = "search" autocomplete = "off" placeholder = "Search" class = "margin-bottom-no" data-ls-bind = "{{router.params.search}}" >
< / div >
< div class = "col span-2 desktops-only" >
< button class = "fill" title = "Search" aria-label = "Search" > < i class = "icon-search" > < / i > < / button >
< / div >
< / div >
< / form >
2020-03-15 17:54:55 +13:00
< div
data-service="database.listDocuments"
data-event="load,database.createDocument,database.updateDocument,database.deleteDocument"
2020-03-16 06:16:42 +13:00
data-param-collection-id="{{router.params.id}}"
2020-03-15 17:54:55 +13:00
data-param-search="{{router.params.search}}"
data-param-limit="<?php echo APP_PAGING_LIMIT ; ?> "
data-param-offset="{{router.params.offset}}"
2020-04-02 10:41:29 +13:00
data-param-order-type="DESC"
2020-03-15 17:54:55 +13:00
data-scope="sdk"
data-name="project-documents">
< div data-ls-if = "0 == {{project-documents.sum}}" class = "box margin-bottom" >
2020-05-22 13:39:00 +12:00
< h3 class = "margin-bottom-small text-bold" > No Documents Found< / h3 >
2020-03-15 17:54:55 +13:00
< p class = "margin-bottom-no" > Create your first document to get started< / p >
< / div >
2020-03-16 06:16:42 +13:00
< div data-ls-if = "({{project-documents.sum}})" >
< div class = "margin-bottom-small margin-end-small text-align-end text-size-small" > < span data-ls-bind = "{{project-documents.sum}}" > < / span > documents found< / div >
2020-03-17 07:41:56 +13:00
< div class = "box margin-bottom y-scroll" >
2020-04-19 01:57:28 +12:00
< table class = "vertical" >
2020-03-16 06:16:42 +13:00
< thead >
2020-05-03 07:57:52 +12:00
< tr >
2020-06-11 16:37:12 +12:00
<?php foreach ( $rules as $i => $rule ) :
if($i > $maxCells) {
break;
}
2020-05-03 07:57:52 +12:00
$label = (isset($rule['label'])) ? $rule['label'] : '';
?>
< th width = "120" > <?php echo $this -> escape ( $label ); ?> </ th >
<?php endforeach ; ?>
2020-03-16 06:16:42 +13:00
< / tr >
< / thead >
< tbody data-ls-loop = "project-documents.documents" data-ls-as = "node" >
2020-05-03 07:57:52 +12:00
< tr >
2020-06-11 16:37:12 +12:00
<?php foreach ( $rules as $i => $rule ) :
if($i > $maxCells) {
break;
}
2020-10-15 10:34:57 +13:00
$label = $rule['label'] ?? '';
$key = $rule['key'] ?? '';
$type = $rule['type'] ?? '';
$array = $rule['array'] ?? '';
2020-05-03 07:57:52 +12:00
?>
2020-05-03 21:49:22 +12:00
< td data-title = " <?php echo $this -> escape ( $label ); ?> : " class = "text-size-small text-height-small" >
2020-05-03 22:46:13 +12:00
< a data-ls-attrs = "href=/console/database/document?id={{node.$id}}&collection={{router.params.id}}&project={{router.params.project}}&buster={{project-collection.dateUpdated}}" >
2020-05-03 07:57:52 +12:00
<?php if ( ! $array ) : ?>
<?php switch ( $type ) :
case 'fileId': ?>
2021-02-19 00:57:30 +13:00
< img data-ls-if = "{{node. <?php echo $this -> escape ( $key ); ?> }} != ''" src = "" data-ls-attrs = "src={{env.ENDPOINT}}/v1/storage/files/{{node. <?php echo $this -> escape ( $key ); ?> }}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class = "avatar" width = "30" height = "30" loading = "lazy" />
2020-05-03 07:57:52 +12:00
<?php break ; ?>
<?php case 'document' : ?>
{...}
<?php break ; ?>
<?php default : ?>
< span data-ls-bind = "{{node. <?php echo $this -> escape ( $key ); ?> }}" data-ls-attrs = "title={{node. <?php echo $this -> escape ( $key ); ?> }}" ></ span >
<?php break ; ?>
<?php endswitch ; ?>
<?php else : ?>
[...]
<?php endif ; ?>
< / a >
< / td >
<?php endforeach ; ?>
2020-03-16 06:16:42 +13:00
< / tr >
< / tbody >
< / table >
< / div >
< / div >
2021-04-03 19:29:13 +13:00
< div class = "pull-end text-align-center paging" >
2020-03-16 06:16:42 +13:00
< form
data-service="database.listDocuments"
data-event="submit"
data-param-collection-id="{{router.params.id}}"
data-param-search="{{router.params.search}}"
data-param-limit="<?php echo APP_PAGING_LIMIT ; ?> "
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-documents"
data-success="state"
data-success-param-state-keys="search,offset">
< button name = "offset" data-paging-back data-offset = "{{router.params.offset}}" data-sum = "{{project-documents.sum}}" class = "margin-end round small" aria-label = "Back" > < i class = "icon-left-open" > < / i > < / button >
< / form >
< span data-ls-bind = "{{router.params.offset|pageCurrent}} / {{project-documents.sum|pageTotal}}" > < / span >
< form
data-service="database.listDocuments"
data-event="submit"
data-param-collection-id="{{router.params.id}}"
data-param-search="{{router.params.search}}"
data-param-limit="<?php echo APP_PAGING_LIMIT ; ?> "
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-documents"
data-success="state"
data-success-param-state-keys="search,offset">
< button name = "offset" data-paging-next data-offset = "{{router.params.offset}}" data-sum = "{{project-documents.sum}}" class = "margin-start round small" aria-label = "Next" > < i class = "icon-right-open" > < / i > < / button >
< / form >
2020-03-15 17:54:55 +13:00
< / div >
2021-04-03 19:29:13 +13:00
< a data-ls-if = "{{project-collection.rules.length}} > 0" data-ls-attrs = "href=/console/database/document?collection={{router.params.id}}&project={{router.params.project}}&buster={{project-collection.dateUpdated}}" class = "button" >
Add Document
< / a >
2020-03-15 17:54:55 +13:00
< / div >
2020-03-09 08:27:21 +13:00
< / li >
2020-04-25 07:58:40 +12:00
< li data-state = "/console/database/collection/settings?id={{router.params.id}}&project={{router.params.project}}" >
< h2 > Settings< / h2 >
2020-03-09 08:27:21 +13:00
< div class = "row responsive margin-top-negative" >
< div class = "col span-8 margin-bottom" >
2020-03-17 07:41:56 +13:00
< form
2021-01-18 19:29:26 +13:00
data-analytics
data-analytics-activity
2020-03-09 08:27:21 +13:00
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Update Database Collection"
data-service="database.updateCollection"
data-scope="sdk"
data-event="submit"
data-param-collection-id="{{router.params.id}}"
2020-05-31 17:56:13 +12:00
data-success="alert,trigger,redirect"
2020-03-09 08:27:21 +13:00
data-success-param-alert-text="Updated collection successfully"
data-success-param-trigger-events="database.updateCollection"
2020-05-31 17:56:13 +12:00
data-success-param-redirect-url="/console/database/collection/settings?id={{serviceData.$id}}& project={{router.params.project}}"
2020-03-09 08:27:21 +13:00
data-failure="alert"
data-failure-param-alert-text="Failed to update collection"
data-failure-param-alert-classname="error">
< label > < / label >
2020-03-16 06:16:42 +13:00
2020-04-28 06:36:21 +12:00
< div class = "box" >
2021-07-20 23:36:27 +12:00
< label for = "collection-id" > ID< / label >
2021-07-20 22:12:39 +12:00
< input name = "collectionId" id = "collectionId" type = "text" autocomplete = "off" data-ls-bind = "{{project-collection.collectionId}}" data-forms-text-direction required placeholder = "Collection Id" maxlength = "128" / >
2020-03-09 08:27:21 +13:00
< label for = "collection-name" > Name< / label >
2020-09-08 09:28:40 +12:00
< input name = "name" id = "collection-name" type = "text" autocomplete = "off" data-ls-bind = "{{project-collection.name}}" data-forms-text-direction required placeholder = "Collection Name" maxlength = "128" / >
2020-03-09 08:27:21 +13:00
2020-04-02 10:41:29 +13:00
< h3 class = "margin-bottom-small" > Rules< / h3 >
2020-03-09 08:27:21 +13:00
< div data-ls-if = "(!{{project-collection.rules.length}})" >
2020-03-13 20:21:33 +13:00
< hr class = "margin-bottom-no margin-top-no" / >
< div class = "margin-bottom-xl margin-top-xl margin-end margin-start text-align-center" >
< h4 class = "text-fade text-size-small" > No attribute rules added yet.< / h4 >
2020-03-09 08:27:21 +13:00
< / div >
< / div >
2020-03-15 17:54:55 +13:00
< input type = "hidden" id = "rulesInit" name = "rules" data-cast-to = "array-empty" >
2020-03-09 08:27:21 +13:00
< div data-ls-if = "({{project-collection.rules.length}})" >
2020-03-30 08:38:15 +13:00
< ul data-ls-loop = "project-collection.rules" data-ls-as = "rule" class = "sortable" >
2020-03-17 07:41:56 +13:00
< li data-forms-remove data-forms-move-up data-forms-move-down >
< div class = "toggle list sorts" data-ls-ui-open >
2020-03-13 20:21:33 +13:00
< i class = "icon-up-open pull-end margin-top-tiny" > < / i >
< i class = "icon-down-open pull-end margin-top-tiny" > < / i >
2020-03-17 07:41:56 +13:00
< h4 class = "margin-bottom" >
< div class = "pull-start margin-end-large margin-bottom-small" >
2020-04-26 08:33:35 +12:00
< button type = "button" disabled class = "margin-bottom strip round" data-move-down > < i class = "icon-down-dir" > < / i > < / button >
2020-03-30 08:38:15 +13:00
< button type = "button" class = "margin-bottom strip round" data-move-down > < i class = "icon-down-dir" > < / i > < / button >
< button type = "button" class = "margin-bottom strip round" data-move-up > < i class = "icon-up-dir" > < / i > < / button >
2020-03-31 02:30:37 +13:00
< button type = "button" disabled class = "margin-bottom strip round" data-move-up > < i class = "icon-up-dir" > < / i > < / button >
2020-03-17 07:41:56 +13:00
< / div >
2020-03-13 20:21:33 +13:00
< span data-ls-bind = "{{rule.label}}" > < / span >
2020-03-17 07:41:56 +13:00
< span data-ls-if = "({{rule.array}}.toString() == 'false')" >
2020-03-30 08:38:15 +13:00
< span class = "text-fade text-size-small" data-ls-bind = " {{rule.type}} " > < / span >
2020-03-13 20:21:33 +13:00
< / span >
2020-03-17 07:41:56 +13:00
< span data-ls-if = "({{rule.array}}.toString() == 'true')" >
2020-03-30 08:38:15 +13:00
< span class = "text-size-small text-fade" data-ls-bind = " {{rule.type}}[] " > < / span >
2020-03-13 20:21:33 +13:00
< / span >
2020-03-15 17:54:55 +13:00
2020-03-17 07:41:56 +13:00
< div data-ls-if = "{{rule.required}}.toString() == 'true'" >
2020-03-15 17:54:55 +13:00
< span class = "text-size-xs text-danger text-fade" > required< / span >
< / div >
2020-03-17 07:41:56 +13:00
< div data-ls-if = "({{rule.required}}.toString() == 'false')" >
2020-03-15 17:54:55 +13:00
< span class = "text-size-xs text-fade" > optional< / span >
< / div >
2020-03-13 20:21:33 +13:00
< / h4 >
2020-03-17 07:41:56 +13:00
< hr class = "margin-top-no fade" / >
2020-03-15 17:54:55 +13:00
< fieldset data-ls-attrs = "name=rules" data-cast-to = "array" >
2020-03-13 20:21:33 +13:00
< input name = "$id" type = "hidden" data-ls-bind = "{{rule.$id}}" / >
< input name = "$collection" type = "hidden" data-ls-bind = "{{rule.$collection}}" / >
< div class = "row thin" >
< div class = "col span-6" >
< label data-ls-attrs = "for=rule-label-{{rule.$id}}" > Label
< span class = "tooltip" data-tooltip = "Attribute internal display name" > < i class = "icon-info-circled" > < / i > < / span >
< / label >
< input name = "label" type = "text" data-ls-bind = "{{rule.label}}" / >
< / div >
< div class = "col span-6" >
< label data-ls-attrs = "for=rule-key-{{rule.$id}}" > Key
< span class = "tooltip small" data-tooltip = "Attribute key name. Used as the document JSON key in the Database API" > < i class = "icon-info-circled" > < / i > < / span >
< / label >
< div class = "input-copy" >
2020-06-11 09:42:16 +12:00
< input data-forms-copy name = "key" type = "text" data-ls-bind = "{{rule.key}}" maxlength = "32" pattern = "^(\d|\w)+$" title = "No spaces or special charts allowed" / >
2020-03-13 20:21:33 +13:00
< / div >
< / div >
< / div >
2020-04-04 08:27:18 +13:00
2020-03-13 20:21:33 +13:00
< label data-ls-attrs = "for=rule-type-{{rule.$id}}" > Rule Type< / label >
< select data-ls-attrs = "id=rule-type-{{rule.$id}}" name = "type" required data-ls-bind = "{{rule.type}}" >
2020-03-17 07:41:56 +13:00
< optgroup label = "General" >
< option value = "text" > Text< / option >
< option value = "numeric" > Numeric< / option >
< option value = "boolean" > Boolean< / option >
< option value = "wildcard" > Wildcard (*)< / option >
< / optgroup >
2020-05-19 00:16:07 +12:00
<!-- <optgroup label="Links">
2020-05-03 07:57:52 +12:00
< option value = "fileId" > File ID< / option >
< option value = "documentId" > Document ID< / option >
2020-05-19 00:16:07 +12:00
< / optgroup > -->
2020-03-17 07:41:56 +13:00
< optgroup label = "Advanced" >
< option value = "email" > Email< / option >
< option value = "url" > URL< / option >
< option value = "ip" > IP< / option >
2020-04-25 05:09:09 +12:00
< option value = "markdown" > Markdown< / option >
2020-05-03 07:57:52 +12:00
< option value = "document" > Document (Embeded)< / option >
2020-04-28 06:36:21 +12:00
< / optgroup >
2020-03-13 20:21:33 +13:00
< / select >
2020-04-02 10:41:29 +13:00
2020-03-13 20:21:33 +13:00
< div class = "margin-bottom" >
2020-03-15 17:54:55 +13:00
< input name = "required" type = "hidden" data-forms-switch data-ls-bind = "{{rule.required}}" data-cast-to = "boolean" / > Required < span class = "tooltip" data-tooltip = "Mark whether this is a required attribute" > < i class = "icon-info-circled" > < / i > < / span >
2020-03-13 20:21:33 +13:00
< / div >
< div class = "margin-bottom" >
2020-03-15 17:54:55 +13:00
< input name = "array" type = "hidden" data-forms-switch data-ls-bind = "{{rule.array}}" data-cast-to = "boolean" / > Array < span class = "tooltip" data-tooltip = "Mark whether this attribute should act as an array" > < i class = "icon-info-circled" > < / i > < / span >
2020-03-13 20:21:33 +13:00
< / div >
2020-04-04 08:27:18 +13:00
< div data-ls-template = "template-validation-{{rule.type}}" data-type = "script" class = "margin-bottom" > < / div >
2020-03-13 20:21:33 +13:00
< / fieldset >
2020-03-09 08:27:21 +13:00
2020-04-28 06:36:21 +12:00
< button type = "button" data-ls-ui-trigger = "splice-rule-{{$index}}" class = "reverse danger margin-bottom" > Remove< / button >
<!-- <button type="button" data - remove="" class="reverse danger margin - bottom">Remove</button> -->
2020-03-15 17:54:55 +13:00
< / div >
2020-03-09 08:27:21 +13:00
< / li >
< / ul >
< / div >
2020-03-13 20:21:33 +13:00
< hr class = "margin-bottom-no margin-top-no" / >
2020-03-09 08:27:21 +13:00
2020-03-15 17:54:55 +13:00
< button type = "button" data-ls-ui-trigger = "add-rule" class = "reverse margin-top" > < i class = "icon-plus" > < / i > Add< / button >
2020-03-09 08:27:21 +13:00
2020-06-13 23:13:53 +12:00
< div class = "toggle margin-bottom margin-top" data-ls-ui-open data-button-aria = "Open Permissions" >
2020-03-09 08:27:21 +13:00
< i class = "icon-plus pull-end margin-top-tiny" > < / i >
< i class = "icon-minus pull-end margin-top-tiny" > < / i >
< h3 class = "margin-bottom-large" > Permissions< / h3 >
2020-06-13 23:13:53 +12:00
< label for = "collection-read" > Read Access < span class = "text-size-small" > (< a data-ls-attrs = "href={{env.HOME}}/docs/permissions" target = "_blank" rel = "noopener" > Learn more< / a > )< / span > < / label >
2020-03-09 08:27:21 +13:00
< input type = "hidden" id = "collection-read" name = "read" data-forms-tags data-cast-to = "json" data-ls-bind = "{{project-collection.$permissions.read}}" placeholder = "User ID, Team ID or Role" / >
2020-05-30 22:21:36 +12:00
< div class = "text-fade text-size-xs margin-top-negative-small margin-bottom" > Add * for wildcard access< / div >
2020-03-09 08:27:21 +13:00
2020-06-13 23:13:53 +12:00
< label for = "collection-write" > Write Access < span class = "text-size-small" > (< a data-ls-attrs = "href={{env.HOME}}/docs/permissions" target = "_blank" rel = "noopener" > Learn more< / a > )< / label >
2020-03-09 08:27:21 +13:00
< input type = "hidden" id = "collection-write" name = "write" data-forms-tags data-cast-to = "json" data-ls-bind = "{{project-collection.$permissions.write}}" placeholder = "User ID, Team ID or Role" / >
2020-05-30 22:21:36 +12:00
< div class = "text-fade text-size-xs margin-top-negative-small margin-bottom" > Add * for wildcard access< / div >
2020-03-09 08:27:21 +13:00
< / div >
< button > Update< / button >
< / form >
< / div >
< / div >
< div class = "col span-4 sticky-top" >
< label > Collection ID< / label >
< div class = "input-copy margin-bottom" >
< input id = "id" type = "text" autocomplete = "off" placeholder = "" data-ls-bind = "{{project-collection.$id}}" disabled data-forms-copy class = "margin-bottom-no" / >
< / div >
< ul class = "margin-bottom-large text-fade text-size-small" >
2020-04-21 20:12:06 +12:00
< li class = "margin-bottom-small" > < i class = "icon-angle-circled-right margin-start-tiny margin-end-tiny" > < / i > < button data-ls-ui-trigger = "open-json" class = "link text-size-small" > View as JSON< / button > < / li >
2020-07-15 23:22:38 +12:00
< li class = "margin-bottom-small" > < i class = "icon-angle-circled-right margin-start-tiny margin-end-tiny" > < / i > Last Updated: < span data-ls-bind = "{{project-collection.dateUpdated|dateText}}" > < / span > < / li >
< li class = "margin-bottom-small" > < i class = "icon-angle-circled-right margin-start-tiny margin-end-tiny" > < / i > Created: < span data-ls-bind = "{{project-collection.dateCreated|dateText}}" > < / span > < / li >
2020-03-09 08:27:21 +13:00
< / ul >
< form name = "database.deleteCollection" class = "margin-bottom"
2021-01-18 19:29:26 +13:00
data-analytics
data-analytics-activity
2020-03-09 08:27:21 +13:00
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Database Collection"
data-service="database.deleteCollection"
data-event="submit"
data-param-collection-id="{{router.params.id}}"
data-confirm="Are you sure you want to delete this collection?"
data-success="alert,trigger,redirect"
data-success-param-alert-text="Collection deleted successfully"
data-success-param-trigger-events="database.deleteCollection"
data-success-param-redirect-url="/console/database?project={{router.params.project}}"
data-failure="alert"
data-failure-param-alert-text="Failed to delete collection"
data-failure-param-alert-classname="error">
< button type = "submit" class = "danger fill" > Delete Collection< / button >
< / form >
< / div >
< / div >
2020-04-28 06:36:21 +12:00
< ul data-ls-loop = "project-collection.rules" data-ls-as = "rule" class = "sortable" >
< li data-forms-remove data-forms-move-up data-forms-move-down >
< form
2021-01-18 19:29:26 +13:00
data-analytics
2020-04-28 06:36:21 +12:00
data-analytics-event="splice-rule-{{$index}}"
data-analytics-category="console"
data-analytics-label="Spliced Collection Rule"
data-service="container.path"
data-event="splice-rule-{{$index}}"
data-scope="window.ls"
data-success="reset">
< input type = "hidden" name = "path" value = "project-collection.rules" / >
< input type = "hidden" name = "type" value = "splice" / >
< input type = "hidden" name = "value" data-ls-bind = "{{$index}}" / >
< / form >
< / li >
< / ul >
2020-03-15 17:54:55 +13:00
< div data-ui-modal class = "box modal close" data-button-alias = "none" data-open-event = "add-rule" >
< button type = "button" class = "close pull-end" data-ui-modal-close = "" > < i class = "icon-cancel" > < / i > < / button >
2020-04-04 08:27:18 +13:00
< h1 > Add Rule< / h1 >
2020-03-15 17:54:55 +13:00
< form
2021-01-18 19:29:26 +13:00
data-analytics
data-analytics-activity
2020-03-15 17:54:55 +13:00
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Added Collection Rule"
data-service="container.path"
data-event="submit"
data-scope="window.ls"
data-success="reset">
< input type = "hidden" name = "path" value = "project-collection.rules" / >
< input type = "hidden" name = "type" value = "append" / >
2020-05-11 16:39:00 +12:00
< fieldset name = "value" data-cast-to = "object" >
2020-03-16 06:16:42 +13:00
< input name = "$id" type = "hidden" value = "" / >
2020-03-15 17:54:55 +13:00
< input name = "$collection" type = "hidden" value = "rules" / >
< div class = "row thin" >
< div class = "col span-6" >
< label for = "rule-label-new" > Label
< span class = "tooltip" data-tooltip = "Attribute internal display name" > < i class = "icon-info-circled" > < / i > < / span >
< / label >
< input name = "label" type = "text" required / >
< / div >
< div class = "col span-6" >
< label for = "rule-key-new" > Key
< span class = "tooltip small" data-tooltip = "Attribute key name. Used as the document JSON key in the Database API" > < i class = "icon-info-circled" > < / i > < / span >
< / label >
< div class = "input-copy" >
2020-06-11 09:42:16 +12:00
< input data-forms-copy name = "key" type = "text" required maxlength = "32" pattern = "^(\d|\w)+$" title = "No spaces or special charts allowed" / >
2020-03-15 17:54:55 +13:00
< / div >
< / div >
< / div >
< label for = "rule-type-new" > Rule Type< / label >
< select name = "type" required >
2020-03-17 07:41:56 +13:00
< optgroup label = "General" >
< option value = "text" > Text< / option >
< option value = "numeric" > Numeric< / option >
< option value = "boolean" > Boolean< / option >
< option value = "wildcard" > Wildcard (*)< / option >
< / optgroup >
2020-05-19 00:16:07 +12:00
<!-- <optgroup label="Links">
2020-05-03 07:57:52 +12:00
< option value = "fileId" > File ID< / option >
< option value = "documentId" > Document ID< / option >
2020-05-19 00:16:07 +12:00
< / optgroup > -->
2020-03-17 07:41:56 +13:00
< optgroup label = "Advanced" >
< option value = "email" > Email< / option >
< option value = "url" > URL< / option >
< option value = "ip" > IP< / option >
2020-04-25 05:09:09 +12:00
< option value = "markdown" > Markdown< / option >
2020-05-03 07:57:52 +12:00
< option value = "document" > Document (Embeded)< / option >
2020-04-28 06:36:21 +12:00
< / optgroup >
2020-03-15 17:54:55 +13:00
< / select >
2020-04-04 08:27:18 +13:00
< input name = "default" type = "hidden" value = "" / >
< input name = "required" type = "hidden" value = "false" data-cast-to = "boolean" / >
< input name = "array" type = "hidden" value = "false" data-cast-to = "boolean" / >
2020-03-15 17:54:55 +13:00
< / fieldset >
< hr class = "margin-top-no" / >
< button type = "submit" > Create< / button > < button data-ui-modal-close = "" type = "button" class = "reverse" > Cancel< / button >
< / form >
< / div >
< / li >
2020-03-09 08:27:21 +13:00
< / ul >
2019-08-07 02:28:42 +12:00
< / div >
2020-04-04 08:27:18 +13:00
< / div >
< script type = "text/html" id = "template-validation-text" >
< div class = "margin-bottom" >
< label data-ls-attrs = "for=rule-default-{{rule.$id}}" > Default Value< / label >
2020-04-19 01:57:28 +12:00
< input name = "default" type = "text" data-ls-bind = "{{rule.default}}" data-forms-text-direction / >
2020-04-04 08:27:18 +13:00
< / div >
< / script >
< script type = "text/html" id = "template-validation-numeric" >
< div class = "margin-bottom" >
< label data-ls-attrs = "for=rule-default-{{rule.$id}}" > Default Value< / label >
2020-06-10 15:11:53 +12:00
< input name = "default" type = "number" data-ls-bind = "{{rule.default}}" data-cast-to = "numeric" placeholder = "0" step = "any" / >
2020-04-04 08:27:18 +13:00
< / div >
< / script >
< script type = "text/html" id = "template-validation-boolean" >
< div class = "margin-bottom" >
< label data-ls-attrs = "for=rule-default-{{rule.$id}}" > Default Value< / label >
< input name = "default" data-ls-bind = "{{rule.default}}" type = "hidden" data-forms-switch data-cast-to = "boolean" / >
< / div >
< / script >
< script type = "text/html" id = "template-validation-text" >
< div class = "margin-bottom" >
< label data-ls-attrs = "for=rule-default-{{rule.$id}}" > Default Value< / label >
2020-04-19 01:57:28 +12:00
< input name = "default" type = "text" data-ls-bind = "{{rule.default}}" data-forms-text-direction / >
2020-04-04 08:27:18 +13:00
< / div >
< / script >
2020-05-03 07:57:52 +12:00
< script type = "text/html" id = "template-validation-documentId" >
2020-05-04 17:04:30 +12:00
< div data-ls-template = "template-validation-document-array-false" data-type = "script" > < / div >
2020-05-03 07:57:52 +12:00
< div class = "margin-bottom text-align-center margin-top-xl margin-bottom-large" data-ls-if = "{{project-collections.sum}} == 1" >
No Collections Found.
< / div >
< / script >
2020-04-04 08:27:18 +13:00
< script type = "text/html" id = "template-validation-document" >
2020-04-21 20:12:06 +12:00
< div data-ls-template = "template-validation-document-array-{{rule.array}}" data-type = "script" > < / div >
< div class = "margin-bottom text-align-center margin-top-xl margin-bottom-large" data-ls-if = "{{project-collections.sum}} == 1" >
No Collections Found.
< / div >
< / script >
< script type = "text/html" id = "template-validation-document-array-true" >
2020-04-04 08:27:18 +13:00
< label data-ls-attrs = "for=rule-list-{{rule.$id}}" class = "margin-bottom" > Allowed Collections< / label >
2020-10-30 09:11:16 +13:00
< div data-ls-loop = "project-collections.collections" data-ls-as = "project" data-ls-key = "$index2" class = "tiles cell-3 margin-bottom-negative" >
2020-04-21 20:12:06 +12:00
< div class = "margin-bottom" data-ls-if = "{{project.$id}} != {{router.params.id}}" >
2021-02-02 22:50:13 +13:00
< input type = "checkbox" name = "list" data-ls-attrs = "value={{project.$id}},id={{project.$id}}" data-ls-bind = "{{rule.list}}" / > < label data-ls-attrs = "for={{project.$id}}" data-ls-bind = "{{project.name}}" > < / label >
2020-04-04 08:27:18 +13:00
< / div >
< / div >
< / script >
2020-04-21 20:12:06 +12:00
< script type = "text/html" id = "template-validation-document-array-false" >
< label data-ls-attrs = "for=rule-list-{{rule.$id}}" class = "margin-bottom" > Allowed Collection< / label >
2020-10-30 09:11:16 +13:00
< div data-ls-loop = "project-collections.collections" data-ls-as = "project" data-ls-key = "$index2" class = "tiles cell-3 margin-bottom-negative" >
2020-04-21 20:12:06 +12:00
< div class = "margin-bottom" data-ls-if = "{{project.$id}} != {{router.params.id}}" >
2021-04-06 23:52:49 +12:00
< input type = "radio" data-ls-attrs = "value={{project.$id}},id=[{{rule.$id}}].{{project.$id}},name=[{{rule.$id}}].list" data-ls-bind = "{{rule.list|firstElement}}" data-cast-to = "array" required / >
2021-02-02 22:50:13 +13:00
< label data-ls-attrs = "for={{project.$id}}" data-ls-bind = "{{project.name}}" > < / label >
2020-04-21 20:12:06 +12:00
< / div >
< / div >
< / script >
2020-04-04 08:27:18 +13:00
< div class = "margin-top"
data-service="database.listCollections"
data-event="load,database.createCollection,database.updateCollection,database.deleteCollection"
data-scope="sdk"
data-name="project-collections">
2020-06-10 02:43:24 +12:00
< / div >