1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

update ui

This commit is contained in:
Damodar Lohani 2021-08-09 11:32:05 +05:45
parent 328071a8e6
commit 0988423a67
4 changed files with 179 additions and 179 deletions

View file

@ -22,8 +22,8 @@ $maxCells = 10;
</div> </div>
<div data-ui-modal class="modal width-large box close" data-button-hide="on" data-open-event="open-json"> <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> <button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h2>JSON View</h2> <h2>JSON View</h2>
<div class="margin-bottom"> <div class="margin-bottom">
@ -80,52 +80,52 @@ $maxCells = 10;
<div data-ls-if="({{project-documents.sum}})"> <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> <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>
<div class="box margin-bottom y-scroll"> <div class="box margin-bottom y-scroll">
<table class="vertical"> <table class="vertical">
<thead> <thead>
<tr> <tr>
<?php foreach($rules as $i => $rule): <?php foreach ($rules as $i => $rule):
if($i > $maxCells) { if ($i > $maxCells) {
break; break;
} }
$label = (isset($rule['label'])) ? $rule['label'] : ''; $label = (isset($rule['label'])) ? $rule['label'] : '';
?> ?>
<th width="120"><?php echo $this->escape($label); ?></th> <th width="120"><?php echo $this->escape($label); ?></th>
<?php endforeach; ?> <?php endforeach;?>
</tr> </tr>
</thead> </thead>
<tbody data-ls-loop="project-documents.documents" data-ls-as="node"> <tbody data-ls-loop="project-documents.documents" data-ls-as="node">
<tr> <tr>
<?php foreach($rules as $i => $rule): <?php foreach ($rules as $i => $rule):
if($i > $maxCells) { if ($i > $maxCells) {
break; break;
} }
$label = $rule['label'] ?? ''; $label = $rule['label'] ?? '';
$key = $rule['key'] ?? ''; $key = $rule['key'] ?? '';
$type = $rule['type'] ?? ''; $type = $rule['type'] ?? '';
$array = $rule['array'] ?? ''; $array = $rule['array'] ?? '';
?> ?>
<td data-title="<?php echo $this->escape($label); ?>: " class="text-size-small text-height-small"> <td data-title="<?php echo $this->escape($label); ?>: " class="text-size-small text-height-small">
<a data-ls-attrs="href=/console/database/document?id={{node.$id}}&collection={{router.params.id}}&project={{router.params.project}}&buster={{project-collection.dateUpdated}}"> <a data-ls-attrs="href=/console/database/document?id={{node.$id}}&collection={{router.params.id}}&project={{router.params.project}}&buster={{project-collection.dateUpdated}}">
<?php if(!$array): ?> <?php if (!$array): ?>
<?php switch($type): <?php switch ($type):
case 'fileId': ?> case 'fileId': ?>
<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" /> <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" />
<?php break; ?> <?php break;?>
<?php case 'document': ?> <?php case 'document': ?>
{...} {...}
<?php break; ?> <?php break;?>
<?php default: ?> <?php default: ?>
<span data-ls-bind="{{node.<?php echo $this->escape($key); ?>}}" data-ls-attrs="title={{node.<?php echo $this->escape($key); ?>}}"></span> <span data-ls-bind="{{node.<?php echo $this->escape($key); ?>}}" data-ls-attrs="title={{node.<?php echo $this->escape($key); ?>}}"></span>
<?php break; ?> <?php break;?>
<?php endswitch; ?> <?php endswitch;?>
<?php else: ?> <?php else: ?>
[...] [...]
<?php endif; ?> <?php endif;?>
</a> </a>
</td> </td>
<?php endforeach; ?> <?php endforeach;?>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -215,7 +215,7 @@ $maxCells = 10;
<div class="toggle list sorts" data-ls-ui-open> <div class="toggle list sorts" data-ls-ui-open>
<i class="icon-up-open pull-end margin-top-tiny"></i> <i class="icon-up-open pull-end margin-top-tiny"></i>
<i class="icon-down-open pull-end margin-top-tiny"></i> <i class="icon-down-open pull-end margin-top-tiny"></i>
<h4 class="margin-bottom"> <h4 class="margin-bottom">
<div class="pull-start margin-end-large margin-bottom-small"> <div class="pull-start margin-end-large margin-bottom-small">
<button type="button" disabled class="margin-bottom strip round" data-move-down><i class="icon-down-dir"></i></button> <button type="button" disabled class="margin-bottom strip round" data-move-down><i class="icon-down-dir"></i></button>
@ -248,7 +248,7 @@ $maxCells = 10;
<fieldset data-ls-attrs="name=rules" data-cast-to="array"> <fieldset data-ls-attrs="name=rules" data-cast-to="array">
<input name="$id" type="hidden" data-ls-bind="{{rule.$id}}" /> <input name="$id" type="hidden" data-ls-bind="{{rule.$id}}" />
<input name="$collection" type="hidden" data-ls-bind="{{rule.$collection}}" /> <input name="$collection" type="hidden" data-ls-bind="{{rule.$collection}}" />
<div class="row thin"> <div class="row thin">
<div class="col span-6"> <div class="col span-6">
<label data-ls-attrs="for=rule-label-{{rule.$id}}">Label <label data-ls-attrs="for=rule-label-{{rule.$id}}">Label
@ -287,11 +287,11 @@ $maxCells = 10;
<option value="document">Document (Embeded)</option> <option value="document">Document (Embeded)</option>
</optgroup> </optgroup>
</select> </select>
<div class="margin-bottom"> <div class="margin-bottom">
<input name="required" type="hidden" data-forms-switch data-ls-bind="{{rule.required}}" data-cast-to="boolean" /> &nbsp; Required <span class="tooltip" data-tooltip="Mark whether this is a required attribute"><i class="icon-info-circled"></i></span> <input name="required" type="hidden" data-forms-switch data-ls-bind="{{rule.required}}" data-cast-to="boolean" /> &nbsp; Required <span class="tooltip" data-tooltip="Mark whether this is a required attribute"><i class="icon-info-circled"></i></span>
</div> </div>
<div class="margin-bottom"> <div class="margin-bottom">
<input name="array" type="hidden" data-forms-switch data-ls-bind="{{rule.array}}" data-cast-to="boolean" /> &nbsp; Array <span class="tooltip" data-tooltip="Mark whether this attribute should act as an array"><i class="icon-info-circled"></i></span> <input name="array" type="hidden" data-forms-switch data-ls-bind="{{rule.array}}" data-cast-to="boolean" /> &nbsp; Array <span class="tooltip" data-tooltip="Mark whether this attribute should act as an array"><i class="icon-info-circled"></i></span>
</div> </div>
@ -314,16 +314,16 @@ $maxCells = 10;
<div class="toggle margin-bottom margin-top" data-ls-ui-open data-button-aria="Open Permissions"> <div class="toggle margin-bottom margin-top" data-ls-ui-open data-button-aria="Open Permissions">
<i class="icon-plus pull-end margin-top-tiny"></i> <i class="icon-plus pull-end margin-top-tiny"></i>
<i class="icon-minus pull-end margin-top-tiny"></i> <i class="icon-minus pull-end margin-top-tiny"></i>
<h3 class="margin-bottom-large">Permissions</h3> <h3 class="margin-bottom-large">Permissions</h3>
<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> <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>
<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" /> <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" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
<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> <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>
<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" /> <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" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
</div> </div>
<button>Update</button> <button>Update</button>
@ -402,9 +402,9 @@ $maxCells = 10;
<input type="hidden" name="path" value="project-collection.rules" /> <input type="hidden" name="path" value="project-collection.rules" />
<input type="hidden" name="type" value="append" /> <input type="hidden" name="type" value="append" />
<fieldset name="value" data-cast-to="object"> <fieldset name="value" data-cast-to="object">
<input name="$id" type="hidden" value="" /> <input name="$id" type="hidden" value="" />
<input name="$collection" type="hidden" value="rules" /> <input name="$collection" type="hidden" value="rules" />
<div class="row thin"> <div class="row thin">
@ -445,11 +445,11 @@ $maxCells = 10;
<option value="document">Document (Embeded)</option> <option value="document">Document (Embeded)</option>
</optgroup> </optgroup>
</select> </select>
<input name="default" type="hidden" value="" /> <input name="default" type="hidden" value="" />
<input name="required" type="hidden" value="false" data-cast-to="boolean" /> <input name="required" type="hidden" value="false" data-cast-to="boolean" />
<input name="array" type="hidden" value="false" data-cast-to="boolean" /> <input name="array" type="hidden" value="false" data-cast-to="boolean" />
</fieldset> </fieldset>
<hr class="margin-top-no" /> <hr class="margin-top-no" />

View file

@ -1,8 +1,8 @@
<?php <?php
use Appwrite\Database\Database; use Appwrite\Database\Database;
use Utopia\View;
use Appwrite\Database\Validator\Authorization; use Appwrite\Database\Validator\Authorization;
use Utopia\View;
$collection = $this->getParam('collection', null); $collection = $this->getParam('collection', null);
$searchFiles = $this->getParam('searchFiles', null); $searchFiles = $this->getParam('searchFiles', null);
@ -16,18 +16,18 @@ $collections = [];
<?php echo $searchFiles->render(); ?> <?php echo $searchFiles->render(); ?>
<?php foreach($rules as $rule): // Form to append child document <?php foreach ($rules as $rule): // Form to append child document
$key = $rule['key'] ?? ''; $key = $rule['key'] ?? '';
$label = $rule['label'] ?? ''; $label = $rule['label'] ?? '';
$type = $rule['type'] ?? ''; $type = $rule['type'] ?? '';
$list = $rule['list'] ?? []; $list = $rule['list'] ?? [];
?> ?>
<?php foreach($list as $item): <?php foreach ($list as $item):
if($item === $collection->getId()) { if ($item === $collection->getId()) {
continue; // Do not allow rec recrusion continue; // Do not allow rec recrusion
} }
if(!isset($collections[$item])) { if (!isset($collections[$item])) {
Authorization::disable(); //TODO Try and avoid calling the DB from the template Authorization::disable(); //TODO Try and avoid calling the DB from the template
$collections[$item] = $db->getDocument($item, false); $collections[$item] = $db->getDocument($item, false);
Authorization::reset(); Authorization::reset();
@ -35,7 +35,7 @@ $collections = [];
$childCollection = $collections[$item]; $childCollection = $collections[$item];
if(!$childCollection->getId() || $childCollection->getCollection() !== Database::SYSTEM_COLLECTION_COLLECTIONS) { if (!$childCollection->getId() || $childCollection->getCollection() !== Database::SYSTEM_COLLECTION_COLLECTIONS) {
continue; continue;
} }
@ -43,114 +43,114 @@ $collections = [];
->setParam('collection', $childCollection) ->setParam('collection', $childCollection)
; ;
echo $searchDocuments->render(); ?> echo $searchDocuments->render();?>
<?php endforeach; ?> <?php endforeach;?>
<?php endforeach; ?> <?php endforeach;?>
<?php foreach($rules as $rule): // Form to append child document <?php foreach ($rules as $rule): // Form to append child document
$key = $rule['key'] ?? ''; $key = $rule['key'] ?? '';
$label = $rule['label'] ?? ''; $label = $rule['label'] ?? '';
$type = $rule['type'] ?? ''; $type = $rule['type'] ?? '';
$list = $rule['list'] ?? []; $list = $rule['list'] ?? [];
$array = $rule['array'] ?? false; $array = $rule['array'] ?? false;
?>
<?php if($type !== 'document' && $array): ?>
<form class="margin-bottom-no"
data-service="container.path"
data-event="collection-child-<?php echo $this->escape($namespace.'.'.$key); ?>"
data-scope="window.ls"
data-success="reset">
<input type="hidden" name="path" value="<?php echo $this->escape($namespace.'.'.$key); ?>" />
<input type="hidden" name="type" value="append" />
<input type="hidden" name="value" value="" />
</form>
<?php endif; ?>
<?php if($type !== 'document'): ?>
<?php continue; ?>
<?php endif; ?>
<?php foreach($list as $item):
if($item === $collection->getId()) {
continue; // Do not allow rec recrusion
}
if(!isset($collections[$item])) {
Authorization::disable(); //TODO Try and avoid calling the DB from the template
$collections[$item] = $db->getDocument($item, false);
Authorization::reset();
}
$childCollection = $collections[$item];
if(!$childCollection->getId() || $childCollection->getCollection() !== Database::SYSTEM_COLLECTION_COLLECTIONS) {
continue;
}
?> ?>
<form class="margin-bottom-no"
data-service="container.path"
data-event="collection-child-<?php echo $this->escape($namespace.'.'.$key); ?>-<?php echo $this->escape($childCollection->getId()); ?>"
data-scope="window.ls"
data-success="reset">
<input type="hidden" name="path" value="<?php echo $this->escape($namespace.'.'.$key); ?>" /> <?php if ($type !== 'document' && $array): ?>
<input type="hidden" name="type" value="append" />
<fieldset name="value" data-cast-to="object">
<input name="$id" type="hidden" value="" />
<input name="$collection" type="hidden" value="<?php echo $this->escape($childCollection->getId()); ?>" />
</fieldset>
</form>
<script type="text/html" id="collection-<?php echo ($array) ? 'array-' : ''; ?><?php echo $this->escape($childCollection->getId()); ?>"> <form class="margin-bottom-no"
<?php data-service="container.path"
data-event="collection-child-<?php echo $this->escape($namespace . '.' . $key); ?>"
data-scope="window.ls"
data-success="reset">
$comp = new View(__DIR__.'/form.phtml'); <input type="hidden" name="path" value="<?php echo $this->escape($namespace . '.' . $key); ?>" />
<input type="hidden" name="type" value="append" />
$comp <input type="hidden" name="value" value="" />
->setParam('collection', $childCollection) </form>
->setParam('namespace', ($array) ? 'node' : $namespace.'.'.$key)
->setParam('key', $key)
->setParam('array', $array)
->setParam('parent', 0)
;
echo $comp->render(); <?php endif;?>
?>
</script>
<?php endforeach; ?>
<?php endforeach; ?>
<?php foreach($rules as $rule): // Form to remove array $index key <?php if ($type !== 'document'): ?>
<?php continue;?>
<?php endif;?>
<?php foreach ($list as $item):
if ($item === $collection->getId()) {
continue; // Do not allow rec recrusion
}
if (!isset($collections[$item])) {
Authorization::disable(); //TODO Try and avoid calling the DB from the template
$collections[$item] = $db->getDocument($item, false);
Authorization::reset();
}
$childCollection = $collections[$item];
if (!$childCollection->getId() || $childCollection->getCollection() !== Database::SYSTEM_COLLECTION_COLLECTIONS) {
continue;
}
?>
<form class="margin-bottom-no"
data-service="container.path"
data-event="collection-child-<?php echo $this->escape($namespace . '.' . $key); ?>-<?php echo $this->escape($childCollection->getId()); ?>"
data-scope="window.ls"
data-success="reset">
<input type="hidden" name="path" value="<?php echo $this->escape($namespace . '.' . $key); ?>" />
<input type="hidden" name="type" value="append" />
<fieldset name="value" data-cast-to="object">
<input name="$id" type="hidden" value="" />
<input name="$collection" type="hidden" value="<?php echo $this->escape($childCollection->getId()); ?>" />
</fieldset>
</form>
<script type="text/html" id="collection-<?php echo ($array) ? 'array-' : ''; ?><?php echo $this->escape($childCollection->getId()); ?>">
<?php
$comp = new View(__DIR__ . '/form.phtml');
$comp
->setParam('collection', $childCollection)
->setParam('namespace', ($array) ? 'node' : $namespace . '.' . $key)
->setParam('key', $key)
->setParam('array', $array)
->setParam('parent', 0)
;
echo $comp->render();
?>
</script>
<?php endforeach;?>
<?php endforeach;?>
<?php foreach ($rules as $rule): // Form to remove array $index key
$key = $rule['key'] ?? ''; $key = $rule['key'] ?? '';
$label = $rule['label'] ?? ''; $label = $rule['label'] ?? '';
$type = $rule['type'] ?? ''; $type = $rule['type'] ?? '';
$list = $rule['list'] ?? false; $list = $rule['list'] ?? false;
$array = $rule['array'] ?? false; $array = $rule['array'] ?? false;
if(!$array) { if (!$array) {
continue; continue;
} }
?> ?>
<ul data-ls-loop="<?php echo $this->escape($namespace.'.'.$key); ?>" data-ls-as="xxx"> <ul data-ls-loop="<?php echo $this->escape($namespace . '.' . $key); ?>" data-ls-as="xxx">
<li> <li>
<form <form
data-service="container.path" data-service="container.path"
data-event="splice-<?php echo $this->escape($namespace.'.'.$key); ?>-{{$index}}" data-event="splice-<?php echo $this->escape($namespace . '.' . $key); ?>-{{$index}}"
data-scope="window.ls" data-scope="window.ls"
data-success="reset"> data-success="reset">
<input type="hidden" name="path" value="<?php echo $this->escape($namespace.'.'.$key); ?>" /> <input type="hidden" name="path" value="<?php echo $this->escape($namespace . '.' . $key); ?>" />
<input type="hidden" name="type" value="splice" /> <input type="hidden" name="type" value="splice" />
<input type="hidden" name="value" data-ls-bind="{{$index}}" /> <input type="hidden" name="value" data-ls-bind="{{$index}}" />
</form> </form>
</li> </li>
</ul> </ul>
<?php endforeach; ?> <?php endforeach;?>
<div <div
data-service="database.getDocument" data-service="database.getDocument"
@ -173,8 +173,8 @@ $collections = [];
</div> </div>
<div data-ui-modal class="modal width-large box close" data-button-hide="on" data-open-event="open-json"> <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> <button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h2>JSON View</h2> <h2>JSON View</h2>
<div class="margin-bottom"> <div class="margin-bottom">
@ -215,57 +215,57 @@ $collections = [];
<!-- <div class="document-nav" data-forms-nav> <!-- <div class="document-nav" data-forms-nav>
<ul class="text-align-end margin-end-small"> <ul class="text-align-end margin-end-small">
<?php foreach($rules as $rule): // Form to append child document <?php foreach ($rules as $rule): // Form to append child document
$key = $rule['key'] ?? ''; $key = $rule['key'] ?? '';
$label = $rule['label'] ?? ''; $label = $rule['label'] ?? '';
$type = $rule['type'] ?? ''; $type = $rule['type'] ?? '';
$list = $rule['list'] ?? []; $list = $rule['list'] ?? [];
?> ?>
<li class="text-size-small"> <li class="text-size-small">
<span class="link text-fade" data-forms-nav-link="<?php echo $this->escape($key); ?>"><?php echo $this->escape($label); ?></span> <span class="link text-fade" data-forms-nav-link="<?php echo $this->escape($key); ?>"><?php echo $this->escape($label); ?></span>
</li> </li>
<?php endforeach; ?> <?php endforeach;?>
</ul> </ul>
</div> --> </div> -->
<?php if(empty($rules)): ?> <?php if (empty($rules)): ?>
<div class="margin-bottom-xl margin-top-xl margin-end margin-start text-align-center"> <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.<br /><br /><a data-ls-attrs="href=/console/database/collection/settings?id={{router.params.collection}}&project={{router.params.project}}">Update Collection</a></h4> <h4 class="text-fade text-size-small">No attribute rules added yet.<br /><br /><a data-ls-attrs="href=/console/database/collection/settings?id={{router.params.collection}}&project={{router.params.project}}">Update Collection</a></h4>
</div> </div>
<?php else: ?> <?php else: ?>
<?php <?php
$comp = new View(__DIR__.'/form.phtml'); $comp = new View(__DIR__ . '/form.phtml');
$comp
->setParam('collection', $collection)
->setParam('collections', $collections)
->setParam('namespace', $namespace)
->setParam('key', 'data')
->setParam('parent', 1)
;
echo $comp->render(); $comp
?> ->setParam('collection', $collection)
->setParam('collections', $collections)
->setParam('namespace', $namespace)
->setParam('key', 'data')
->setParam('parent', 1)
;
echo $comp->render();
?>
<div class="toggle margin-bottom" data-ls-ui-open data-button-aria="Open Permissions"> <div class="toggle margin-bottom" data-ls-ui-open data-button-aria="Open Permissions">
<i class="icon-plus pull-end margin-top-tiny"></i> <i class="icon-plus pull-end margin-top-tiny"></i>
<i class="icon-minus pull-end margin-top-tiny"></i> <i class="icon-minus pull-end margin-top-tiny"></i>
<h3 class="margin-bottom-large">Permissions</h3> <h3 class="margin-bottom-large">Permissions</h3>
<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> <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>
<input type="hidden" id="collection-read" name="read" data-forms-tags data-cast-to="json" data-ls-bind="{{project-document.$permissions.read}}" placeholder="User ID, Team ID or Role" /> <input type="hidden" id="collection-read" name="read" data-forms-tags data-cast-to="json" data-ls-bind="{{project-document.$permissions.read}}" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
<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> <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>
<input type="hidden" id="collection-write" name="write" data-forms-tags data-cast-to="json" data-ls-bind="{{project-document.$permissions.write}}" placeholder="User ID, Team ID or Role" /> <input type="hidden" id="collection-write" name="write" data-forms-tags data-cast-to="json" data-ls-bind="{{project-document.$permissions.write}}" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
</div> </div>
<button data-ls-if="({{project-document.$id}})">Update</button> <button data-ls-if="({{project-document.$id}})">Update</button>
<button data-ls-if="(!{{project-document.$id}})">Create</button> <button data-ls-if="(!{{project-document.$id}})">Create</button>
<?php endif; ?> <?php endif;?>
</div> </div>
</form> </form>

View file

@ -453,7 +453,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
<label for="execute">Execute Access <span class="tooltip small" data-tooltip="Choose who can execute this function using the client API."><i class="icon-info-circled"></i></span> <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</span></label> <label for="execute">Execute Access <span class="tooltip small" data-tooltip="Choose who can execute this function using the client API."><i class="icon-info-circled"></i></span> <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</span></label>
<input type="hidden" id="execute" name="execute" data-forms-tags data-cast-to="json" data-ls-bind="{{project-function.execute}}" placeholder="User ID, Team ID or Role" /> <input type="hidden" id="execute" name="execute" data-forms-tags data-cast-to="json" data-ls-bind="{{project-function.execute}}" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
<label for="timeout">Timeout (seconds) <span class="tooltip small" data-tooltip="Limit the execution time of your function."><i class="icon-info-circled"></i></span></label> <label for="timeout">Timeout (seconds) <span class="tooltip small" data-tooltip="Limit the execution time of your function."><i class="icon-info-circled"></i></span></label>
<input name="timeout" id="function-timeout" type="number" autocomplete="off" data-ls-bind="{{project-function.timeout}}" min="1" max="<?php echo $this->escape($timeout); ?>" data-cast-to="integer" /> <input name="timeout" id="function-timeout" type="number" autocomplete="off" data-ls-bind="{{project-function.timeout}}" min="1" max="<?php echo $this->escape($timeout); ?>" data-cast-to="integer" />

View file

@ -107,11 +107,11 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
<label for="file-read">Read Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label> <label for="file-read">Read Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label>
<input type="hidden" data-ls-attrs="id=file-read-{{file.$id}}" name="read" data-forms-tags data-cast-to="json" data-ls-bind="{{file.$read}}" placeholder="User ID, Team ID or Role" /> <input type="hidden" data-ls-attrs="id=file-read-{{file.$id}}" name="read" data-forms-tags data-cast-to="json" data-ls-bind="{{file.$read}}" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
<label for="file-write">Write Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label> <label for="file-write">Write Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label>
<input type="hidden" data-ls-attrs="id=file-write-{{file.$id}}" name="write" data-forms-tags data-cast-to="json" data-ls-bind="{{file.$write}}" placeholder="User ID, Team ID or Role" /> <input type="hidden" data-ls-attrs="id=file-write-{{file.$id}}" name="write" data-forms-tags data-cast-to="json" data-ls-bind="{{file.$write}}" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
</form> </form>
<form class="strip" <form class="strip"
@ -255,11 +255,11 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
<label for="file-read">Read Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label> <label for="file-read">Read Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label>
<input type="hidden" id="file-read" name="read" data-forms-tags data-cast-to="json" value="<?php echo htmlentities(json_encode(['role:all'])); ?>" placeholder="User ID, Team ID or Role" /> <input type="hidden" id="file-read" name="read" data-forms-tags data-cast-to="json" value="<?php echo htmlentities(json_encode(['role:all'])); ?>" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
<label for="file-write">Write Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label> <label for="file-write">Write Access (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label>
<input type="hidden" id="file-write" name="write" data-forms-tags data-cast-to="json" value="" placeholder="User ID, Team ID or Role" /> <input type="hidden" id="file-write" name="write" data-forms-tags data-cast-to="json" value="" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div> <div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add 'role:all' for wildcard access</div>
<footer> <footer>
<button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button> <button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>