-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
200 lines (154 loc) · 7.94 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.css">
<link rel="stylesheet" type="text/css" href="css/ftf.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js" integrity="sha384-SlE991lGASHoBfWbelyBPLsUlwY1GwNDJo3jSJO04KZ33K2bwfV9YBauFfnzvynJ" crossorigin="anonymous"></script>
<title>FarmToFork</title>
</head>
<body>
<div id="ftf-container">
<!-- This is where our content will be inserted -->
<div class="ftf-header">
<h1>🍖 Farm to Fork</h1>
<div class="ftf-button ftf-primary">{{farmToFork.currentIdentity.publicKey}}</div>
</div>
<!-- Page container -->
<div class="ftf-page-container">
<!-- Menu -->
<div class="ftf-menu">
<div class="ftf-menu-item" v-on:click="menuClicked('identity')">
<i class="fas fa-user"></i>
<div class="ftf-menu-item-link">Identity</div>
</div>
<hr>
<div class="ftf-menu-item" v-on:click="menuClicked('assets')">
<i class="fas fa-industry"></i>
<div class="ftf-menu-item-link">Your assets</div>
</div>
<div class="ftf-menu-item" v-on:click="menuClicked('all-assets')">
<i class="fas fa-utensils"></i>
<div class="ftf-menu-item-link">All assets</div>
</div>
</div>
<!-- Content container -->
<div class="ftf-content-container">
<!-- Identity pane -->
<div v-if="isActive('identity')" class="ftf-content-pane">
<div class="ftf-box">
<h2>Your Identity</h2>
<hr>
<p>In this proof of concept, your identity simply is your keypair.</p>
</div>
<div class="ftf-box ftf-full ftf-wide">
<h2>Generating an identity</h2>
<hr>
<p>Enter a seed below and press the 'generate' button to generate your new identity.</p>
<div class="ftf-control">
<input v-model="identitySeedInput" type="password">
<div class="ftf-input-button" v-on:click="identityButtonClicked()">generate</div>
</div>
</div>
</div>
<!-- Asset pane -->
<div v-if="isActive('assets')" class="ftf-content-pane">
<div class="ftf-box">
<h2>Assets | Food-items</h2>
<hr>
<p>In this proof of concept, the assets in our transactions are food-items that are currently in circulation in the market.</p>
</div>
<div class="ftf-box ftf-full ftf-wide">
<h2>Create a new food-item</h2>
<p>Enter a description for the food-item you want to introduce to the market:</p>
<div class="ftf-control">
<input v-model="assetInput" type="text">
<div class="ftf-input-button" v-on:click="assetButtonClicked()">create</div>
</div>
<br>
<h2>Your food-items</h2>
<table>
<thead>
<tr>
<th>description</th>
<th>transaction ID</th>
</tr>
</thead>
<tbody>
<tr v-for="asset in assets" v-on:click="transactionClicked(asset.id, true)">
<td>{{asset.asset.data.item}}</td>
<td>{{asset.id}}</td>
</tr>
<tr v-if="assets.size == 0">
<td colspan="2" style="text-align: left">No food-items.</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Transactions pane -->
<div v-if="isActive('transactions')" class="ftf-content-pane">
<div class="ftf-box ftf-wide">
<h2>Transaction chain</h2>
<hr>
<p>Each asset on the BigchainDB has a list of transactions that have been performed upon it.</p>
</div>
<div class="ftf-box ftf-wide ftf-box-no-margin" v-if="myAssets">
<h2>Perform action on food-item: {{activeTransaction.asset.data.item}}</h2>
<p>Enter an action to perform:</p>
<div class="ftf-control">
<input type="text" v-model="actionInput">
<div class="ftf-input-button" v-on:click="actionButtonClicked()">process</div>
</div>
<h2>OR</h2>
<h2>Transfer the asset to another business</h2>
<p>This action is the equivalent of selling the product to another firm that will in turn process it for their purpose.</p>
<p>The receiver enters their password:</p>
<div class="ftf-control">
<input type="password" v-model="otherFirmInput">
<div class="ftf-input-button" v-on:click="otherFirmButtonClicked()">transfer</div>
</div>
</div>
<span class="ftf-full" v-for="transaction in transactionsForAsset.slice().reverse()">
<div class="ftf-arrow ftf-full"></div>
<div class="ftf-box ftf-wide ftf-box-no-margin">
<h2>{{transaction.metadata.action}}</h2>
<p>{{new Date(transaction.metadata.date).toLocaleString()}}</p>
</div>
</span>
</div>
<!-- All assets pane -->
<div v-if="isActive('all-assets')" class="ftf-content-pane">
<div class="ftf-box">
<h2>All assets | food-items</h2>
<hr>
<p>All data on a bigchaindb network (that you participate to) is visible to you, even the assets that never belonged to you. This is what provides the transparancy.</p>
</div>
<div class="ftf-box ftf-full">
<table>
<thead>
<tr>
<th>Description</th>
<th>transaction ID</th>
</tr>
</thead>
<tbody>
<tr v-for="asset of allAssets" v-on:click="transactionClicked(asset.id, false)">
<td>{{asset.data.item}}</td>
<td>{{asset.id}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Vue.js -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<!-- Our bundled code -->
<script src="js/bundle.js"></script>
<!-- The code linking our webapp to the code we wrote -->
<script src="js/ftf-web.js"></script>
</body>
</html>