summaryrefslogtreecommitdiff
path: root/addons/hw_posbox_homepage/views/six_payment_terminal.html
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/hw_posbox_homepage/views/six_payment_terminal.html
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/hw_posbox_homepage/views/six_payment_terminal.html')
-rw-r--r--addons/hw_posbox_homepage/views/six_payment_terminal.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/addons/hw_posbox_homepage/views/six_payment_terminal.html b/addons/hw_posbox_homepage/views/six_payment_terminal.html
new file mode 100644
index 00000000..622c6a84
--- /dev/null
+++ b/addons/hw_posbox_homepage/views/six_payment_terminal.html
@@ -0,0 +1,61 @@
+{% extends "layout.html" %}
+{% from "loading.html" import loading_block_ui %}
+{% block head %}
+ <script>
+ var _onQueryDone = function () {
+ $('.message-status').html('Updated configuration <br> Refreshing page');
+ setTimeout(function () {
+ location.reload();
+ }, 30000);
+ }
+ $(document).ready(function () {
+ $('#terminal-id').submit(function(e){
+ e.preventDefault();
+ $('.loading-block').removeClass('o_hide');
+ $.ajax({
+ url: '/six_payment_terminal_add',
+ type: 'post',
+ data: $('#terminal-id').serialize(),
+ }).always(_onQueryDone);
+ });
+ $('#terminal-clear').submit(function(e){
+ e.preventDefault();
+ $('.loading-block').removeClass('o_hide');
+ $.ajax({
+ url: '/six_payment_terminal_clear',
+ type: 'get',
+ }).always(_onQueryDone);
+ });
+ });
+ </script>
+{% endblock %}
+{% block content %}
+ <h2 class="text-center">Six Payment Terminal</h2>
+ <p>
+ Set the Terminal ID (TID) of the terminal you want to use.
+ </p>
+ <form id="terminal-id" action='/six_payment_terminal_add' method='POST'>
+ <table align="center">
+ <tr>
+ <td>Terminal ID</td>
+ <td><input type="text" name="terminal_id"></td>
+ </tr>
+ <tr>
+ <td/>
+ <td><input class="btn" type="submit" value="Connect"/></td>
+ </tr>
+ </table>
+ {{ loading_block_ui(loading_message) }}
+ </form>
+ {% if terminalId %}
+ <p class="text-center font-small">
+ Current Terminal Id: <strong>{{ terminalId }}</strong>
+ </p>
+ <div class="text-center font-small" style="margin: 10px auto;">
+ You can clear the terminal configuration
+ <form id="terminal-clear" style="display: inline-block;margin-left: 4px;">
+ <input class="btn btn-sm" type="submit" value="Clear"/>
+ </form>
+ </div>
+ {% endif %}
+{% endblock %}