v0.1: replace shell-rendered site with Grav-native pages + theme
- Drop site/ + RenderSite.sh: repo now carries grav/user/pages as native Grav markdown pages (home/services/terms/sign/execution) - Add knel-contract theme: inherits quark2 via stream fallback, adds sign.html.twig (Twig) driving the DocuSeal flow through the APISIX gateway; esign wiring lives in the theme yaml for forks to retarget - CreateDocument.sh refreshes the Grav services page from the rendered catalogs instead of invoking the removed site renderer Ticket: https://projects.knownelement.com/issues/924
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
name: knel-contract
|
||||
slug: knel-contract
|
||||
type: theme
|
||||
version: 0.1.0
|
||||
description: KNEL services contract site theme
|
||||
author: KNEL
|
||||
@@ -0,0 +1,17 @@
|
||||
enabled: true
|
||||
|
||||
# Any quark2 template not overridden here falls through to quark2
|
||||
streams:
|
||||
schemes:
|
||||
theme:
|
||||
type: ReadOnlyStream
|
||||
prefixes:
|
||||
'':
|
||||
- user/themes/knel-contract
|
||||
- user/themes/quark2
|
||||
|
||||
# E-sign wiring (forks: point these at your own gateway/template)
|
||||
esign:
|
||||
api_url: 'https://apigw.knownelement.com/contract-sign/api/submissions'
|
||||
sign_url: 'https://esign.knownelement.com'
|
||||
template_id: '2'
|
||||
@@ -0,0 +1,69 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="sign-page">
|
||||
{{ page.content|raw }}
|
||||
|
||||
<style>
|
||||
.sign-page form { max-width: 32rem; }
|
||||
.sign-page label { display: block; margin: 0.75rem 0 0.25rem; font-weight: 600; }
|
||||
.sign-page input { display: block; width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px; }
|
||||
.sign-page button { margin-top: 1rem; padding: 0.6rem 1.4rem; cursor: pointer; }
|
||||
</style>
|
||||
<form id="esign-form">
|
||||
<label for="esign-name">Full name</label>
|
||||
<input type="text" id="esign-name" name="name" required>
|
||||
|
||||
<label for="esign-email">Email address</label>
|
||||
<input type="email" id="esign-email" name="email" required>
|
||||
|
||||
<label for="esign-entity">Entity (Party 2)</label>
|
||||
<input type="text" id="esign-entity" name="entity" required>
|
||||
|
||||
<button type="submit">Request signature link</button>
|
||||
</form>
|
||||
|
||||
<p id="esign-status"></p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var form = document.getElementById('esign-form');
|
||||
var status = document.getElementById('esign-status');
|
||||
var config = {{ grav.config.themes['knel-contract'].esign|json_encode|raw }};
|
||||
|
||||
form.addEventListener('submit', function (ev) {
|
||||
ev.preventDefault();
|
||||
status.textContent = 'Requesting signing link…';
|
||||
var name = document.getElementById('esign-name').value;
|
||||
var email = document.getElementById('esign-email').value;
|
||||
var entity = document.getElementById('esign-entity').value;
|
||||
|
||||
fetch(config.api_url, {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({
|
||||
template_id: Number(config.template_id),
|
||||
send_email: false,
|
||||
submitters: [
|
||||
{role: 'First Party', name: name, email: email},
|
||||
{role: 'Second Party', name: name + ' (' + entity + ')', email: email}
|
||||
]
|
||||
})
|
||||
}).then(function (r) {
|
||||
if (!r.ok) { throw new Error('gateway returned ' + r.status); }
|
||||
return r.json();
|
||||
}).then(function (data) {
|
||||
var slug = data.submitters && data.submitters[0] && data.submitters[0].slug;
|
||||
if (slug) {
|
||||
window.location.href = config.sign_url + '/s/' + slug;
|
||||
} else {
|
||||
status.textContent = 'Signing request created. Check ' + email + ' for the signing link.';
|
||||
}
|
||||
}).catch(function (e) {
|
||||
status.textContent = 'Could not create the signing request (' + e.message + '). Contact the KNEL helpdesk.';
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,10 @@
|
||||
slug: knel-contract
|
||||
name: 'KNEL Contract'
|
||||
type: theme
|
||||
version: 0.1.0
|
||||
description: 'KNEL services contract site. Inherits Quark2; adds the DocuSeal e-sign page template.'
|
||||
icon: file-text
|
||||
author:
|
||||
name: Known Element Enterprises LLC
|
||||
keywords: contract
|
||||
license: AGPL-3.0
|
||||
Reference in New Issue
Block a user