-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
133 lines (129 loc) · 4.63 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Builder with AngularJS</title>
<style>
textarea {
width: 100%;
height: 100px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://form-builder.aidbox.app/static/aidbox-forms-builder-webcomponent.js"></script>
</head>
<body ng-app="formBuilderApp" ng-controller="FormBuilderController">
<div class="flex flex-col h-screen w-full">
<header
class="sticky top-0 z-20 flex flex-shrink-0 h-16 w-full items-center justify-between bg-white px-4 shadow-sm md:px-6">
<nav class="flex items-center gap-6">
<a href="#" class="flex items-center gap-2 text-lg font-semibold md:text-base">
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="h-6 w-6"
>
<path d="M12 6v4"></path>
<path d="M14 14h-4"></path>
<path d="M14 18h-4"></path>
<path d="M14 8h-4"></path>
<path d="M18 12h2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h2"></path>
<path d="M18 22V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v18"></path>
</svg>
<span class="sr-only">Medical Care System</span>
</a>
<div class="hidden gap-6 text-sm font-medium md:flex">
<a class="font-bold" href="#">
Questionnaires
</a>
<a class="text-gray-500" href="#">
Clients
</a>
<a class="text-gray-500" href="#">
Questionnaire Responses
</a>
</div>
</nav>
<div class="flex items-center gap-2">
<button
class="inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-10 w-10 rounded-full">
<img
src="https://generated.vusercontent.net/placeholder.svg"
width="32"
height="32"
class="rounded-full"
alt="Avatar"
style="aspect-ratio: 32 / 32; object-fit: cover;"
/>
<span class="sr-only">Toggle user menu</span>
</button>
</div>
</header>
<div class="flex flex-1">
<div class="flex flex-col bg-gray-100 p-4 md:w-[260px]">
<div class="mb-4 flex items-center justify-between">
<h3 class="text-lg font-semibold">Questionnaires</h3>
</div>
<div class="overflow-auto">
<nav class="grid gap-2">
<button
ng-repeat="questionnaire in questionnaires"
class="rounded-md bg-white p-2 text-sm font-medium transition-colors hover:bg-gray-200 text-left pr-4 relative"
ng-on-click="selectQuestionnaire(questionnaire.id)"
>
{{ questionnaire.title }}
<span
ng-if="questionnaire.id === id"
class="bg-red-500 outline outline-2 outline-red-200 w-2 h-2 rounded-full absolute right-3 top-1/2 -translate-y-1/2"
>
<span class="sr-only">Currently editing</span>
</span>
</button>
</nav>
</div>
</div>
<main class="flex-1 flex">
<aidbox-form-builder
style="width: 100%; border: none; align-self: stretch; display: flex"
form-id="{{ id }}"
show-share
hide-back
>
</aidbox-form-builder>
</main>
</div>
</div>
<script>
angular.module('formBuilderApp', [])
.controller('FormBuilderController', ['$scope', function ($scope) {
$scope.questionnaires = [
{
"title": "Harris Hip Score panel",
"id": "100283-1"
},
{
"title": "Meat allergen panel",
"id": "100751-7"
},
{
"title": "Schmid fall risk",
"id": "101549-4"
},
];
$scope.id = $scope.questionnaires[0].id;
$scope.selectQuestionnaire = function (id) {
$scope.id = id;
};
}]);
</script>
</body>
</html>