-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViUR3 #15
base: main
Are you sure you want to change the base?
ViUR3 #15
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html linguist-language=Jinja2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +0,0 @@ | ||
[submodule "vi"] | ||
path = vi | ||
url = git@github.com:viur-framework/vi.git | ||
[submodule "deploy/server"] | ||
path = deploy/server | ||
url = git@github.com:viur-framework/server.git | ||
[submodule "sources/less/ignite"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is ignite no longer a submdule? |
||
path = sources/less/ignite | ||
url = git@github.com:viur-framework/ignite.git | ||
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
#[[source]] | ||
#url = "https://test.pypi.org/simple/" | ||
#verify_ssl = true | ||
#name = "testpypi" | ||
|
||
[packages] | ||
viur-core = "*" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please use a specific version? |
||
|
||
[dev-packages] | ||
viur-cli = "*" | ||
|
||
[requires] | ||
python_version = "3.9" |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This file specifies files that are *not* uploaded to Google Cloud Platform | ||
# using gcloud. It follows the same syntax as .gitignore, with the addition of | ||
# "#!include" directives (which insert the entries of the given .gitignore-style | ||
# file at that point). | ||
# | ||
# For more information, run: | ||
# $ gcloud topic gcloudignore | ||
# | ||
.gcloudignore | ||
# If you would like to upload your .git directory, .gitignore file or files | ||
# from your .gitignore file, remove the corresponding line | ||
# below: | ||
.git | ||
.gitignore | ||
|
||
# Python pycache: | ||
__pycache__/ | ||
# Ignored by the build system | ||
/setup.cfg | ||
|
||
node_modules/ | ||
/viur/docs/ | ||
/viur/CHANGELOG.md | ||
/viur/LICENSE | ||
/viur/README.md | ||
/viur/.readthedocs.yml | ||
Comment on lines
+22
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These shouldn't be necessary, if we load the core from pip |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,48 @@ | ||
#application: ignite-docs | ||
#version: 1 | ||
runtime: python27 | ||
api_version: 1 | ||
threadsafe: False | ||
runtime: python39 | ||
|
||
# (1) Under some circumstances, you need to set a higher instance_class, | ||
# like F2 or F4. Unfortunately, this will increase App Engine cost, | ||
# see https://cloud.google.com/appengine/pricing. | ||
instance_class: F1 | ||
default_expiration: "30s" | ||
|
||
# (2) To get more memory and concurrent requests, a separate gunicorn is run. | ||
entrypoint: gunicorn -b :$PORT -w 1 --threads 2 --disable-redirect-access-to-syslog main:app | ||
|
||
# (3) Limited scaling is default, to keep frontend instance hours low. | ||
# Please change these values on your demands. | ||
automatic_scaling: | ||
max_concurrent_requests: 2 | ||
max_instances: 1 | ||
max_idle_instances: 1 | ||
|
||
handlers: | ||
# (4) For a local Pyodide installation, activate below and run get-pyodide.py from project root. | ||
# Leave the comments to use the CDN-version of Pyodide, which also runs very well. | ||
#- url: /pyodide/(.*\.(wasm|data))$ | ||
# static_files: pyodide/\1 | ||
# upload: pyodide/.*\.(wasm|data)$ | ||
# mime_type: application/wasm | ||
#- url: /pyodide | ||
# static_dir: pyodide | ||
|
||
# (5) Activate this when vi_plugins should be used | ||
#- url: /vi_plugins/s | ||
# static_dir: vi_plugins | ||
|
||
- url: /vi/s | ||
static_dir: vi | ||
- url: /static | ||
static_dir: static | ||
application_readable: true | ||
- url: /resources | ||
static_dir: server/resources | ||
- url: /_tasks | ||
script: ignite-docs.application | ||
- url: /admin/user/getAuthMethod | ||
script: ignite-docs.application | ||
- url: /admin/.* | ||
script: ignite-docs.application | ||
- url: /vi.* | ||
script: ignite-docs.application | ||
static_dir: viur/core/resources | ||
- url: /favicon.ico | ||
static_files: static/meta/favicon.ico | ||
upload: favicon.ico | ||
- url: /.* | ||
script: ignite-docs.application | ||
|
||
libraries: | ||
- name: jinja2 | ||
version: latest | ||
- url: /robots.txt | ||
static_files: static/meta/robots.txt | ||
upload: robots.txt | ||
|
||
inbound_services: | ||
- warmup | ||
|
||
builtins: | ||
- deferred: on |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cron: | ||
- description: Task trigger | ||
url: /_tasks | ||
url: /_tasks/cron | ||
schedule: every 4 hours |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<input | ||
class="switch-input ignt-input--boolean ignt-input--{{ boneName }} | ||
{{ "is-required" if boneParams.required }} | ||
{{ "is-readonly" if boneParams.readOnly }} | ||
{{ "is-invalid" if boneErrors else "is-valid" }}" | ||
name="{{ boneName }}" | ||
value="{{ boneValue or "" }}" | ||
{{ "required" if boneParams.required }} | ||
{{ "readonly" if boneParams.readOnly }} | ||
{% if boneErrors %} aria-invalid="true" {% endif %} | ||
> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="switch ignt-switch"> | ||
<input | ||
class="switch-input ignt-input--boolean ignt-input--{{ boneName }} | ||
{{ "is-required" if boneParams.required }} | ||
{{ "is-readonly" if boneParams.readOnly }} | ||
{{ "is-invalid" if boneErrors else "is-valid" }}" | ||
id="ignt-id-{{ boneName }}" | ||
type="checkbox" | ||
name="{{ boneName }}" | ||
value="True" | ||
{{ "checked" if boneValue }} | ||
{{ "required" if boneParams.required }} | ||
{{ "readonly" if boneParams.readOnly }} | ||
{% if boneErrors %} aria-invalid="true" {% endif %} | ||
> | ||
<label class="switch-label" for="ignt-id-{{ boneName }}"></label> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="hidden2formfield"> | ||
<script src="https://www.google.com/recaptcha/api.js?render={{ boneValue }}"></script> | ||
<input type="hidden" class="recaptcha" name="g-recaptcha-response" | ||
data-sitekey="{{ boneValue }}" | ||
data-action="{{ boneParams["action"]|default("form") }}"> | ||
</div> | ||
|
||
<script> | ||
(function () { | ||
function fetchToken(input) { | ||
grecaptcha.ready(function () { | ||
const {sitekey, action} = input.dataset; | ||
grecaptcha.execute(sitekey, {action}) | ||
.then(token => { | ||
input.value = token; | ||
// A reCAPTCHA token expires after two minutes, | ||
// refresh it 10 seconds before. | ||
setTimeout(fetchToken, (2 * 60 - 10) * 1000, input); | ||
}); | ||
}); | ||
} | ||
|
||
document.querySelectorAll('.recaptcha').forEach(fetchToken); | ||
})(); | ||
</script> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<input | ||
class="input ignt-input ignt-input--color ignt-input--{{ boneName }} | ||
{{ "is-required" if boneParams.required }} | ||
{{ "is-readonly" if boneParams.readOnly }} | ||
{{ "is-invalid" if boneErrors else "is-valid" }}" | ||
name="{{ boneName }}" | ||
type="color" | ||
title="{{ boneParams.tooltip or boneParams.descr or boneName }}" | ||
id="ignt-id-{{ boneName }}" | ||
value="{{ boneValue|default("", true) }}" | ||
{{ "readonly" if boneParams.readOnly }} | ||
{{ "required" if boneParams.required }} | ||
{% if boneErrors %} aria-invalid="true" {% endif %} | ||
> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div | ||
id="ignt-id-{{ boneName }}" | ||
class="input-group"> | ||
{% if boneParams.date and boneParams.time %} | ||
{# Current Webbrowsers dont support a datetime input yet so we'll split it up until they do #} | ||
<input type="date" class="input ignt-input ignt-input--date" value="{% if boneValue %}{{ boneValue.strftime("%Y-%m-%d") }}{% endif %}" | ||
name="{{ boneName }}-date" {% if boneParams.readOnly %}disabled="disabled"{% endif %}> | ||
<input type="time" class="input ignt-input ignt-input--time" value="{% if boneValue %}{{ boneValue.strftime("%H:%M:%S") }}{% endif %}" | ||
name="{{ boneName }}-time" {% if boneParams.readOnly %}disabled="disabled"{% endif %}> | ||
<input type="hidden" value="{% if boneValue %}{{ boneValue.strftime("%Y-%M-%d") }}{% endif %}" | ||
name="{{ boneName }}" class="js-viur-bones-date-doubleinput"> | ||
{% elif boneParams.date %} | ||
<input type="date" class="input ignt-input ignt-input--date" value="{% if boneValue %}{{ boneValue.strftime("%Y-%m-%d") }}{% endif %}" | ||
name="{{ boneName }}" {% if boneParams.readOnly %}disabled="disabled"{% endif %}> | ||
{% elif boneParams.time %} | ||
<input type="time" class="input ignt-input ignt-input--time" value="{% if boneValue %}{{ boneValue.strftime("%H:%M:%S") }}{% endif %}" | ||
name="{{ boneName }}-time" {% if boneParams.readOnly %}disabled="disabled"{% endif %}> | ||
{% else %} | ||
<!-- You messed up this datebone somehow --> | ||
{% endif %} | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% if boneValue and (boneParams["type"] == "relational" or boneParams["type"].startswith("relational.")) %} | ||
{% set boneValue = boneValue["dest"]["key"] %} | ||
{% endif %} | ||
<input type="hidden" name="{{ boneName }}" value="{{ boneValue or "" }}"> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{%- if boneParams.precision < 0 -%} | ||
{# if precision is < 0, we only allow powers of 10 to be selected by forcing the last n digits to be allways | ||
zero (ie. ..., 0, 10, 20, ... or ..., 0, 100, 200, ...). We ensure that the last digits of our min/max value | ||
matches that alley by foring the last n digits to be 0. Otherwise we might end up in shifted alleys | ||
( ..., -4, 6, 16, ... or the like) #} | ||
{%- set min = (boneParams.min|string)[:-(boneParams.precision|abs)]+"0"*(boneParams.precision|abs) -%} | ||
{%- set max = (boneParams.max|string)[:-(boneParams.precision|abs)]+"0"*(boneParams.precision|abs) -%} | ||
{%- else -%} | ||
{% set min = boneParams.min -%} | ||
{% set max = boneParams.max -%} | ||
{%- endif -%} | ||
|
||
<input | ||
class="input ignt-input ignt-input-numeric ignt-input--{{ boneName }} | ||
{{ "is-required" if boneParams.required }} | ||
{{ "is-readonly" if boneParams.readOnly }} | ||
{{ "is-invalid" if boneErrors else "is-valid" }}" | ||
value="{{ boneValue|default("", true) }}" | ||
name="{{ boneName }}" | ||
type="number" | ||
title="{{ boneParams.tooltip or boneParams.descr or boneName }}" | ||
id="ignt-id-{{boneName}}" | ||
{% if min %} min="{{ min }}" {% endif %} | ||
{% if max %} max="{{ max }}" {% endif %} | ||
{{ "readonly" if boneParams.readOnly }} | ||
{{ "required" if boneParams.required }} | ||
{% if boneErrors %} aria-invalid="true" {% endif %} | ||
> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<input | ||
class="input ignt-input ignt-input--password ignt-ignt--{{ boneName }} | ||
{{ "is-required" if boneParams.required }} | ||
{{ "is-readonly" if boneParams.readOnly }} | ||
{{ "is-invalid" if boneErrors else "is-valid" }}" | ||
name="{{ boneName }}" | ||
type="password" | ||
title="{{ boneParams.tooltip or boneParams.descr or boneName }}" | ||
id="ignt-id-{{ boneName }}" | ||
value="{{ boneValue|default("", true) }}" | ||
{{ "required" if boneParams.required }} | ||
{{ "readonly" if boneParams.readOnly }} | ||
{% if boneErrors %} aria-invalid="true" {% endif %} | ||
> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{ renderEditForm( | ||
skel={ | ||
"structure": boneParams.using, | ||
"value": boneValue or {}, | ||
"errors": boneErrors | ||
}, | ||
prefix=boneName | ||
) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<select | ||
id="ignt-id-{{ boneName }}" | ||
name="{{ boneName }}" | ||
class="select ignt-select ignt-select--{{ boneName }} | ||
{{ "is-required" if boneParams.required }} | ||
{{ "is-readonly" if boneParams.readOnly }} | ||
{{ "is-invalid" if boneWasInvalid else "is-valid" }}" | ||
{{'readonly' if boneParams.readOnly}} | ||
{{'required' if boneParams.required}} | ||
> | ||
{% set ns = namespace(cursor="") %} | ||
{% for i in range(0, 1000, 100) %} | ||
{% if ns.cursor == "" %} | ||
{% set skellist = getList(boneParams.module, limit=100) %} | ||
{% set ns.cursor = skellist.getCursor() %} | ||
{% elif ns.cursor != none %} | ||
{% set skellist = getList(boneParams.module, cursor=ns.cursor, limit=100) %} | ||
{% set ns.cursor = skellist.getCursor() %} | ||
{% else %} | ||
{% set skellist = [] %} | ||
{% endif %} | ||
{% for entry in skellist %} | ||
{% if loop.first %} | ||
<option value="" {{ "selected" if not boneValue }} {{ "disabled" if boneParams.required}} hidden> | ||
- | ||
</option> | ||
{% endif %} | ||
<option value="{{ entry["key"] }}" {{ "selected" if boneValue and entry["key"] == boneValue["dest"]["key"] }}> | ||
{{ entry["name"] }} | ||
</option> | ||
{% endfor %} | ||
{% endfor %} | ||
|
||
</select> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is standard gitignore file in viur base. The VI is served by the viur-cli.