forked from datacontract/datacontract-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
116 lines (102 loc) · 3.66 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!doctype html>
<html>
<head>
<!-- Recommended meta tags -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- PyScript CSS -->
<link rel="stylesheet" href="https://pyscript.net/releases/2024.1.1/core.css">
<!-- CSS for examples -->
<link rel="stylesheet" href="./assets/css/examples.css" />
<link rel="stylesheet" href="./datacontract/pyscript/html/css/main.css" type="text/css"/>
<!-- This script tag bootstraps PyScript -->
<script type="module" src="https://pyscript.net/releases/2024.1.1/core.js"></script>
<script src="https://www.unpkg.com/ace-builds@latest/src-noconflict/ace.js"></script>
<script src="https://www.unpkg.com/ace-builds@latest/src-noconflict/ext-language_tools.js"></script>
<script src="https://www.unpkg.com/ace-builds@latest/src-noconflict/mode-yaml.js"></script>
<script src="https://www.unpkg.com/ace-builds@latest/src-noconflict/theme-chrome.js"></script>
<script src="https://cdn.jsdelivr.net/npm/ace-linters"></script>
<!-- for splashscreen -->
<style>
#loading { outline: none; border: none; background: transparent }
</style>
<script type="module">
const loading = document.getElementById('loading');
addEventListener('py:ready', () => loading.close());
loading.showModal();
</script>
<title>Todo App</title>
<link rel="icon" type="image/png" href="./assets/favicon.png" />
<style>
.line-through {
text-decoration: line-through;
}
</style>
</head>
<body>
<dialog id="loading">
<h1>Loading...</h1>
</dialog>
<nav class="navbar" style="background-color: #000000">
<div class="app-header">
<a href="/">
<img src="./assets/logo.png" class="logo" />
</a>
<a class="title" href="" style="color: #f0ab3c">Todo App</a>
</div>
</nav>
<section class="pyscript">
<main>
<section>
<div>
<h1>To Do List</h1>
</div>
<div>
<input id="new-task-content" type="text" />
<button id="new-task-btn" type="submit" py-click="add_task">
Add task
</button>
</div>
<div id="list-tasks-container"></div>
<template id="task-template">
<section class="task py-li-element">
<label class="flex items-center p-2">
<input style="vertical-align: middle;" type="checkbox" />
<p style="display: inline;"></p>
</label>
</section>
</template>
</section>
</main>
<script type="py" src="./datacontract/pyscript.py" config="./pyscript.toml"></script>
</section>
<section>
<main>
<div id="convert-button">
<button id="convert-btn" type="button" py-click="export_to_output_type">
Convert
</button>
</div>
<div id="code-containers">
<div class="code-container code-container-input" id="convert-input-container">
<label for="convert-input-type">Choose input type:</label>
<select name="convert-input-type" id="convert-input-type">
<option value="data-contract-spec" selected>Data Contract Specification</option>
<option value="odcs">Open Data Contract Specification (ODCS)</option>
</select>
<div class="code" id="input-yaml"></div>
</div>
<div class="code-container code-container-output" id="convert-output-container">
<label for="convert-output-type">Choose output type:</label>
<select name="convert-output-type" id="convert-output-type">
<option value="dbt">DBT</option>
<option value="sql" selected>SQL</option>
<option value="sodacl">SodaCL</option>
</select>
<div class="code" id="output-text"></div>
</div>
</div>
</main>
</section>
</body>
</html>