-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLink-Trello.html
More file actions
351 lines (291 loc) · 13.1 KB
/
Link-Trello.html
File metadata and controls
351 lines (291 loc) · 13.1 KB
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="CityZen volunteer software documentation">
<meta name="author" content="Rick Mason">
<title>CityZen documentation</title>
<link rel="canonical" href="https://getbootstrap.com/docs/4.4/examples/dashboard/">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!-- Custom styles for this template -->
<!-- Dashboard.css -->
<link rel="stylesheet" href="./Media/dashboard.css">
<!-- Favicons -->
<!-- Need to create Cityzen favicons - Olde English C perhaps? -->
<link rel="apple-touch-icon" href="./Media/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="./Media/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="./Media/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="icon" href="http://127.0.0.1:4000/Media/favicons/android-chrome-192x192.png" sizes="192x192" type="image/png">
<link rel="icon" href="./Media/favicons/android-chrome-512x512.png" sizes="512x512" type="image/png">
<link rel="icon" href="http://127.0.0.1:4000/Media/favicons/mstile-150x150.png">
<link rel="manifest" href="./Media/favicons/site.webmanifest.json">
<link rel="mask-icon" href="/docs/4.4/assets/img/favicons/safari-pinned-tab.svg" color="#563d7c">
<link rel="icon" href="./media/favicons/favicon.ico">
<meta name="msapplication-config" content="http://127.0.0.1:4000/Media/favicons/browserconfig.xml">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-form@4.10.3/dist/vue-form.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js.map"></script>
<meta name="theme-color" content="#563d7c">
</head>
<body>
<nav class="navbar navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-sm-3 col-md-2 mr-0" href="index.html">CityZen</a>
</nav>
<div class="container-fluid"> <!-- Begin left hand menu -->
<div class="row">
<nav class="col-md-2 d-none d-md-block bg-light sidebar">
<div class="sidebar-sticky">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="index.html">
<span data-feather="home"></span>
Introduction <span class="sr-only">(current)</span>
</a>
</li>
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
<span>Setup</span>
<a class="d-flex align-items-center text-muted" href="#" aria-label="Setup">
<span data-feather="plus-circle"></span>
</a>
</h6>
<li class="nav-item">
<a class="nav-link" href="setting-up-trello.html">
<span data-feather="setup-trello"></span>
Setting up Trello
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="setting-up-cityzen.html">
<span data-feather="setup-citiyzen"></span>
Setting up CityZen
</a>
</li>
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
<span>Developers</span>
<a class="d-flex align-items-center text-muted" href="#" aria-label="Meta">
<span data-feather="plus-circle"></span>
</a>
</h6>
<li class="nav-item">
<a class="nav-link" href="npm-install.html">
<span data-feather="npm install"></span>
NPM Install
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="GitHub-install.html">
<span data-feather="GitHub install"></span>
GitHub Install
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Docker-install.html">
<span data-feather="Docker install"></span>
Docker Install
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="Link-Trello.html">
<span data-feather="Link Trello"></span>
Link Trello
</a>
</li>
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
<span>Meta</span>
<a class="d-flex align-items-center text-muted" href="#" aria-label="Meta">
<span data-feather="plus-circle"></span>
</a>
</h6>
<li class="nav-item">
<a class="nav-link" href="meet-the-team.html">
<span data-feather="meet-the-team"></span>
Meet the team
</a>
</li>
</ul>
</div>
</nav> <!-- End left hand menu -->
<div>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Linking to Trello</h1>
</div>
<h4>Linking to Trello</h4>
<p>
The CityZen-Server needs your contact information from Trello. This information is three number-letter combinations that identify your account and list.
These are stored in a file called .env that you place in the root of the CityZen-Server. Two of them you can gather and
the third we will provide. We will generate the file, all you must do is download it and save to the CityZen-Server root
on your server.
</p>
<p>
The first thing to retrieve from Trello is the Trello_API_Key. Login into your Trello account. Then go to <a href="https://trello.com/app-key" target="_blank">https://trello.com/app-key</a>
Copy it to the form field below.
</p>
<p>
The second thing to retrieve from Trello is the Trello_API_Token. Go to <a href=" https://trello.com/app-key" target="_blank"> https://trello.com/app-key</a> Click on the token link to generate a token and copy it to the form below.
</p>
<p>
The third thing to retrieve from Trello is the board list ID. Look carefully at the URL string in your browser. Make sure to
select the personal board you want to use from the main menu. The board list ID is the 8 digit number right after trello.com/b/. Copy it also to the form.
</p>
<p>
Place both in the form below. If your server for CityZen is not on the same domain as your webserver you can have
server permissions issues so we need to add one more line to the .env file. If that is the case then tick the checkbox
on the form below. We will look up the third piece of information which is called Trello_List_ID. If you have more than
one list in Trello then the dropdown will help you select the correct one.
Trello_API_Token
</p>
<div id="app" >
<vue-form :state="formstate" @submit.prevent="onSubmit" >
<validate auto-label class="form-group required-field" :class="fieldClassName(formstate.apiKey)">
<table width="800">
<tr>
<td><label>Trello API Key <span style="color:red;">*</span> </label></td>
<td></td>
</tr>
<tr>
<td>
<input type="text" name="apiKey" class="form-control" required v-model.lazy="model.apiKey"/>
</td>
<td>
<field-messages name="apiKey" >
<div> <img src="./Media/checkmark-24.png" height="24" width="24"></div>
<div slot="required"> Required</div>
</field-messages>
</td>
</tr>
</table>
</validate>
<validate auto-label class="form-group required-field" :class="fieldClassName(formstate.apiToken)">
<table width="800">
<tr>
<td><label>Trello API Token <span style="color:red;">*</span></label></td>
<td></td>
</tr>
<tr>
<td>
<input type="text" name="apiToken" class="form-control" required v-model.lazy="model.apiToken" />
</td>
<td>
<field-messages name="apiToken">
<div> <img src="./Media/checkmark-24.png" height="24" width="24"></div>
<div slot="required"> Required</div>
</field-messages>
</td>
</tr>
</table>
</validate>
<validate auto-label class="form-group required-field" :class="fieldClassName(formstate.boardListID)">
<table width="800">
<tr>
<td><label>Board List ID <span style="color:red;">*</span> </label></td>
<td></td>
</tr>
<tr>
<td>
<input type="text" name="boardListID" class="form-control" required v-model.lazy="model.boardListID"/>
</td>
<td>
<field-messages name="boardListID">
<div> <img src="./Media/checkmark-24.png" height="24" width="24"></div>
<div slot="required"> Required</div>
</field-messages>
</td>
</tr>
</table>
</validate>
<div class="form-check">
<input v-model="model.corsYN" type="checkbox" name="corsYN" />
<label>Server and website are on different domains </label>
</div>
<br/><br/>
<button type="submit" class="btn btn-primary" >Download File</button>
</vue-form>
</div>
</div>
<div class="col-md-5 text-justify float-right">
<a class="nav-link" href="meet-the-team.html">Meet the Team
<svg class="bi bi-caret-right-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M12.14 8.753l-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 011.659-.753l5.48 4.796a1 1 0 010 1.506z"/>
</svg>
</a>
</div>
</main>
</div>
</div>
<script type="module">
var installDoc = ''
var vm = new Vue({
el: '#app',
mixins: [new VueForm({
inputClasses: {
valid: 'form-control-success',
invalid: 'form-control-danger'
}
})],
// Vue.component('field-messages', { /* ... */ }),
// Vue.component('validate', { /* ... */ }),
data: {
formstate: {},
model: {
apiKey: '',
apiToken: '',
boardListID: '',
corsYN: ''
}
},
created: function() {
this.clonedModel = JSON.parse(JSON.stringify(this.model));
},
methods: {
fieldClassName: function(field) {
if (!field) {
return '';
}
if ((field.$touched || field.$submitted) && field.$valid) {
return 'has-success';
}
if ((field.$touched || field.$submitted) && field.$invalid) {
return 'has-danger';
}
},
onSubmit: function () {
console.log(this.formstate.$valid);
if (this.model.corsYN === true) {
// console.log('is checked');
installDoc ='CORS_ALLOWED_ORIGINS=http://localhost:8080' + '\n' + 'TRELLO_API_KEY=' + this.model.apiKey + '\n' + 'TRELLO_API_TOKEN=' + this.model.apiToken + '\n' + 'TRELLO_LIST_ID=' + this.model.boardListID + '\n'
} else {
// console.log('not checked');
installDoc = 'TRELLO_API_KEY=' + this.model.apiKey + '\n' + 'TRELLO_API_TOKEN=' + this.model.apiToken + '\n' + 'TRELLO_LIST_ID=' + this.model.boardListID + '\n'
}
// console.log(installDoc);
function SaveAsFile(t,f,m) {
try {
var b = new Blob([t],{type:m});
saveAs(b, f);
} catch (e) {
window.open("data:"+m+"," + encodeURIComponent(t), '_blank','');
}
}
SaveAsFile(installDoc,"cityzen.env","text/plain;charset=utf-8");
},
onReset: function() {
this.model = JSON.parse(JSON.stringify(this.clonedModel));
console.log('reset');
}
// otherwise submit form
}
});
</script>
<style>
.required-field > label::after {
content: '*';
color: red;
margin-left: 0.25rem;
}
</style>
</body>
</html>