-
Notifications
You must be signed in to change notification settings - Fork 6
/
system.json
707 lines (707 loc) · 262 KB
/
system.json
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
{
"name": "System",
"conditions": "ContractConditions(\"@1DeveloperCondition\")",
"data": [
{
"Name": "admin_link",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "If(#sort#==1){\n SetVar(sort_name, \"{id: 1}\")\n}.ElseIf(#sort#==2){\n SetVar(sort_name, \"{id: -1}\")\n}.ElseIf(#sort#==3){\n SetVar(sort_name, \"{name: 1}\")\n}.ElseIf(#sort#==4){\n SetVar(sort_name, \"{name: -1}\")\n}.Else{\n SetVar(sort, \"1\")\n SetVar(sort_name, \"{id: 1}\")\n}\n\nIf(Or(#width#==12,#width#==6,#width#==4)){\n}.Else{\n SetVar(width, \"12\")\n}\n\nForm(){\n Div(clearfix){\n Div(pull-left ml-sm){\n DBFind(\"@1applications\",apps).Where({\"ecosystem\": \"#ecosystem_id#\"})\n Select(Name:AppId, Source:apps, NameColumn: name, ValueColumn: id, Value: #buffer_value_app_id#, Class: bg-gray-lighter).Style(border: 0px; padding-top: 4px;)\n }\n Div(pull-left ml-sm){\n Button(Class: btn bg-gray fa fa-refresh, Page: #this_page#, PageParams: \"sort=#sort#,width=#width#,current_page=#current_page#\", Contract: @1SelectApp, Params: \"ApplicationId=Val(AppId)\")\n }\n Div(pull-right){\n If(#sort#==1){\n Button(Body: Em(Class: fa fa-long-arrow-down) Sort by ID, Class: btn bg-gray-lighter ml-sm, Page: #this_page#, PageParams: \"sort=2,width=#width#,current_page=#current_page#\")\n }.ElseIf(#sort#==2){\n Button(Body: Em(Class: fa fa-long-arrow-up) Sort by ID, Class: btn bg-gray-lighter ml-sm, Page: #this_page#, PageParams: \"sort=1,width=#width#,current_page=#current_page#\")\n }.Else{\n Button(Body: Sort by ID, Class: btn bg-gray ml-sm, Page: #this_page#, PageParams: \"sort=1,width=#width#,current_page=#current_page#\")\n }\n If(#sort#==3){\n Button(Body: Em(Class: fa fa-long-arrow-down) Sort by NAME, Class: btn bg-gray-lighter ml-sm mr-sm, Page: #this_page#, PageParams: \"sort=4,width=#width#,current_page=#current_page#\")\n }.ElseIf(#sort#==4){\n Button(Body: Em(Class: fa fa-long-arrow-up) Sort by NAME, Class: btn bg-gray-lighter ml-sm mr-sm, Page: #this_page#, PageParams: \"sort=3,width=#width#,current_page=#current_page#\")\n }.Else{\n Button(Body: Sort by NAME, Class: btn bg-gray ml-sm mr-sm, Page: #this_page#, PageParams: \"sort=3,width=#width#,current_page=#current_page#\")\n }\n }\n Div(pull-right){\n If(#hideLink#==0){\n }.ElseIf(#width#==12){\n Button(Body: Em(Class: fa fa-bars), Class: btn bg-gray-lighter mr-sm, Page: #this_page#, PageParams: \"sort=#sort#,width=12,current_page=#current_page#\")\n }.Else{\n Button(Body: Em(Class: fa fa-bars), Class: btn bg-gray mr-sm, Page: #this_page#, PageParams: \"sort=#sort#,width=12,current_page=#current_page#\")\n }\n If(#hideLink#==0){\n }.ElseIf(#width#==6){\n Button(Body: Em(Class: fa fa-th-large), Class: btn bg-gray-lighter mr-sm, Page: #this_page#, PageParams: \"sort=#sort#,width=6,current_page=#current_page#\")\n }.Else{\n Button(Body: Em(Class: fa fa-th-large), Class: btn bg-gray mr-sm, Page: #this_page#, PageParams: \"sort=#sort#,width=6,current_page=#current_page#\")\n }\n If(#hideLink#==0){\n }.ElseIf(#width#==4){\n Button(Body: Em(Class: fa fa-th), Class: btn bg-gray-lighter mr-sm, Page: #this_page#, PageParams: \"sort=#sort#,width=4,current_page=#current_page#\")\n }.Else{\n Button(Body: Em(Class: fa fa-th), Class: btn bg-gray mr-sm, Page: #this_page#, PageParams: \"sort=#sort#,width=4,current_page=#current_page#\")\n }\n }\n }\n}.Style(\n height: 33px;\n overflow: hidden;\n)",
"Type": "blocks"
},
{
"Name": "export_info",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1buffer_data\").Columns(\"value->app_id,value->app_name,value->menu_name,value->menu_id,value->count_menu\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n\nIf(#buffer_value_app_id# > 0){\n DBFind(\"@1pages\", src_pages).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(250).Order(\"name\").Count(count_pages)\n DBFind(\"@1blocks\", src_blocks).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(250).Order(\"name\").Count(count_blocks)\n DBFind(\"@1app_params\", src_parameters).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(250).Order(\"name\").Count(count_parameters)\n DBFind(\"@1languages\", src_languages).Where({\"id\": 0}).Limit(250).Order(\"name\").Count(count_languages)\n DBFind(\"@1contracts\", src_contracts).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(250).Order(\"name\").Count(count_contracts)\n DBFind(\"@1tables\", src_tables).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(250).Order(\"name\").Count(count_tables)\n}\n\nDiv(panel panel-primary){\n If(#buffer_value_app_id# > 0){\n Div(){\n Button(Body: \"$@1export$ - #buffer_value_app_name#\", Class: btn btn-primary btn-block, Page: @1export_download, Contract: @1Export)\n }\n }.Else{\n Div(panel-heading, \"$@1export$\")\n }\n Form(){\n Div(list-group-item){\n Div(clearfix){\n Div(pull-left){\n Span(\"$@1pages$\")\n }\n Div(pull-right){\n If(#count_pages# > 0){\n Span(\"(#count_pages#)\")\n }.Else{\n Span(\"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 text-left text-muted){\n If(#count_pages# > 0){\n ForList(src_pages){\n Span(Class: h6, Body: \"#name#, \")\n }\n }.Else{\n Span(Class: h6, Body: \"$@1nothing_selected$\")\n }\n }\n }\n }\n Div(list-group-item){\n Div(clearfix){\n Div(pull-left){\n Span(\"$@1blocks$\")\n }\n Div(pull-right){\n If(#count_blocks# > 0){\n Span(\"(#count_blocks#)\")\n }.Else{\n Span(\"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 text-left text-muted){\n If(#count_blocks# > 0){\n ForList(src_blocks){\n Span(Class: h6, Body: \"#name#, \")\n }\n }.Else{\n Span(Class: h6, Body: \"$@1nothing_selected$\")\n }\n }\n }\n }\n Div(list-group-item){\n Div(clearfix){\n Div(pull-left){\n Span(\"$@1menu$\")\n }\n Div(pull-right){\n If(#buffer_value_app_id# > 0){\n Span(\"(#buffer_value_count_menu#)\")\n }.Else{\n Span(\"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 text-left text-muted){\n If(And(#buffer_value_app_id#>0,#buffer_value_count_menu#>0)){\n Span(Class: h6, Body:\"#buffer_value_menu_name#\")\n }.Else{\n Span(Class: h6, Body:\"$@1nothing_selected$\")\n }\n }\n }\n }\n Div(list-group-item){\n Div(clearfix){\n Div(pull-left){\n Span(\"$@1params$\")\n }\n Div(pull-right){\n If(#count_parameters# > 0){\n Span(\"(#count_parameters#)\")\n }.Else{\n Span(\"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 text-left text-muted){\n If(#count_parameters# > 0){\n ForList(src_parameters){\n Span(Class: h6, Body: \"#name#, \")\n }\n }.Else{\n Span(Class: h6, Body: \"$@1nothing_selected$\")\n }\n }\n }\n }\n Div(list-group-item){\n Div(clearfix){\n Div(pull-left){\n Span(\"$@1lang_res$\")\n }\n Div(pull-right){\n If(#count_languages# > 0){\n Span(\"(#count_languages#)\")\n }.Else{\n Span(\"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 text-left text-muted){\n If(#count_languages# > 0){\n ForList(src_languages){\n Span(Class: h6, Body: \"#name#, \")\n }\n }.Else{\n Span(Class: h6, Body: \"$@1nothing_selected$\")\n }\n }\n }\n }\n Div(list-group-item){\n Div(clearfix){\n Div(pull-left){\n Span(\"$@1contracts$\")\n }\n Div(pull-right){\n If(#count_contracts# > 0){\n Span(\"(#count_contracts#)\")\n }.Else{\n Span(\"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 text-left text-muted){\n If(#count_contracts# > 0){\n ForList(src_contracts){\n Span(Class: h6, Body: \"#name#, \")\n }\n }.Else{\n Span(Class: h6, Body: \"$@1nothing_selected$\")\n }\n }\n }\n }\n Div(list-group-item){\n Div(clearfix){\n Div(pull-left){\n Span($@1tables$)\n }\n Div(pull-right){\n If(#count_tables# > 0){\n Span(\"(#count_tables#)\")\n }.Else{\n Span(\"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 text-left text-muted){\n If(#count_tables# > 0){\n ForList(src_tables){\n Span(Class: h6, Body: \"#name#, \")\n }\n }.Else{\n Span(Class: h6, Body: \"$@1nothing_selected$\")\n }\n }\n }\n }\n If(#buffer_value_app_id# > 0){\n Div(panel-footer text-right){\n Button(Body: $@1export$, Class: btn btn-primary, Page: @1export_download, Contract: @1Export)\n }\n }\n }\n}",
"Type": "blocks"
},
{
"Name": "export_link",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "If(And(#res_type#!=\"pages\",#res_type#!=\"blocks\",#res_type#!=\"menu\",#res_type#!=\"parameters\",#res_type#!=\"languages\",#res_type#!=\"contracts\",#res_type#!=\"tables\")){\n SetVar(res_type, \"pages\")\n}\n\nDiv(breadcrumb){\n If(#res_type#==\"pages\"){\n Span(Class: text-muted, Body: \"$@1pages$\")\n }.Else{\n LinkPage(Body: \"$@1pages$\", Page: @1export_resources,, \"res_type=pages\")\n }\n Span(|,mh-sm)\n If(#res_type#==\"blocks\"){\n Span(Class: text-muted, Body: \"$@1blocks$\")\n }.Else{\n LinkPage(Body: \"$@1blocks$\", Page: @1export_resources,, \"res_type=blocks\")\n }\n Span(|,mh-sm)\n If(#res_type#==\"menu\"){\n Span(Class: text-muted, Body: \"$@1menu$\")\n }.Else{\n LinkPage(Body: \"$@1menu$\", Page: @1export_resources,, \"res_type=menu\")\n }\n Span(|,mh-sm)\n If(#res_type#==\"parameters\"){\n Span(Class: text-muted, Body: \"$@1app_params$\")\n }.Else{\n LinkPage(Body: \"$@1app_params$\", Page: @1export_resources,, \"res_type=parameters\")\n }\n Span(|,mh-sm)\n If(#res_type#==\"languages\"){\n Span(Class: text-muted, Body: \"$@1lang_res$\")\n }.Else{\n LinkPage(Body: \"$@1lang_res$\", Page: @1export_resources,, \"res_type=languages\")\n }\n Span(|,mh-sm)\n If(#res_type#==\"contracts\"){\n Span(Class: text-muted, Body: \"$@1contracts$\")\n }.Else{\n LinkPage(Body: \"$@1contracts$\", Page: @1export_resources,, \"res_type=contracts\")\n }\n Span(|,mh-sm)\n If(#res_type#==\"tables\"){\n Span(Class: text-muted, Body: \"$@1tables$\")\n }.Else{\n LinkPage(Body: \"$@1tables$\", Page: @1export_resources,, \"res_type=tables\")\n }\n}",
"Type": "blocks"
},
{
"Name": "pager",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(#this_table#).Where(#where#).Order({\"id\": 1}).Count(records_count)\n\nIf(#pager_limit# < #records_count#){\n SetVar(previous_page, Calculate(Exp: #current_page# - 1, Type: int))\n SetVar(next_page, Calculate(Exp: #current_page# + 1, Type: int))\n\n SetVar(count_div_limit_int, Calculate(Exp: (#records_count# / #pager_limit#), Type: int))\n SetVar(remainder, Calculate(Exp: (#records_count# / #pager_limit#) - #count_div_limit_int#, Type: float))\n If(#remainder# != 0){\n SetVar(last_page, Calculate(Exp: #count_div_limit_int# + 1, Type: int))\n }.Else{\n SetVar(last_page, #count_div_limit_int#)\n }\n\n SetVar(last_page_plus_one, Calculate(Exp: #last_page# + 1, Type: int))\n SetVar(delta_last_page, Calculate(Exp: #last_page# - #current_page#))\n SetVar(range_l, Calculate(Exp: #current_page# - 4, Type: int))\n SetVar(range_r, Calculate(Exp: #current_page# + 6, Type: int))\n SetVar(range_l_max, Calculate(Exp: #last_page# - #pager_limit#, Type: int))\n SetVar(last_page_min_set, Calculate(Exp: #last_page_plus_one# - 10, Type: int))\n\n If(#current_page# < 5){\n If(#last_page# >= 10){\n Range(src_pages, 1, 11)\n }.Else{\n Range(src_pages, 1, #last_page_plus_one#)\n }\n }.ElseIf(#delta_last_page# < 6){\n If(#range_l_max# > 0){\n Range(src_pages, #last_page_min_set#, #last_page_plus_one#)\n }.Else{\n Range(src_pages, 1, #last_page_plus_one#)\n }\n }.Else{\n Range(src_pages, #range_l#, #range_r#)\n }\n\n Div(){\n Span(Class: pull-left){\n If(#current_page# == 1){\n Button(Body: Em(Class: fa fa-angle-double-left), Class: btn bg-gray-lighter disabled)\n }.Else{\n If(#search#){\n Button(Body: Em(Class: fa fa-angle-double-left), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=1,sort=#sort#,width=#width#,page_par=#page_par#,search=#search#\")\n }.Else{\n Button(Body: Em(Class: fa fa-angle-double-left), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=1,sort=#sort#,width=#width#,page_par=#page_par#\")\n }\n }\n }\n Span(Class: pull-left){\n If(#current_page# == 1){\n Button(Body: Em(Class: fa fa-angle-left), Class: btn bg-gray-lighter disabled)\n }.Else{\n If(#search#){\n Button(Body: Em(Class: fa fa-angle-left), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#previous_page#,sort=#sort#,width=#width#,page_par=#page_par#,search=#search#\")\n }.Else{\n Button(Body: Em(Class: fa fa-angle-left), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#previous_page#,sort=#sort#,width=#width#,page_par=#page_par#\")\n }\n }\n }\n Span(Class: pull-left){\n ForList(src_pages){\n Span(){\n If(#id# == #current_page#){\n Button(Body: #id#, Class: btn bg-primary-light, Page: #this_page#, PageParams: \"current_page=#id#,sort=#sort#,width=#width#,page_par=#page_par#\")\n }.Else{\n If(#search#){\n Button(Body: #id#, Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#id#,sort=#sort#,width=#width#,page_par=#page_par#,search=#search#\")\n }.Else{\n Button(Body: #id#, Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#id#,sort=#sort#,width=#width#,page_par=#page_par#\")\n }\n }\n }\n }\n }\n Span(Class: pull-left){\n If(#current_page# == #last_page#){\n Button(Body: Em(Class: fa fa-angle-right), Class: btn bg-gray-lighter disabled)\n }.Else{\n If(#search#){\n Button(Body: Em(Class: fa fa-angle-right), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#next_page#,sort=#sort#,width=#width#,page_par=#page_par#,search=#search#\")\n }.Else{\n Button(Body: Em(Class: fa fa-angle-right), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#next_page#,sort=#sort#,width=#width#,page_par=#page_par#\")\n }\n }\n }\n Span(Class: pull-left){\n If(#current_page# == #last_page#){\n Button(Body: Em(Class: fa fa-angle-double-right), Class: btn bg-gray-lighter disabled)\n }.Else{\n If(#search#){\n Button(Body: Em(Class: fa fa-angle-double-right), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#last_page#,sort=#sort#,width=#width#,page_par=#page_par#,search=#search#\")\n }.Else{\n Button(Body: Em(Class: fa fa-angle-double-right), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#last_page#,sort=#sort#,width=#width#,page_par=#page_par#\")\n }\n }\n }\n }.Style(\n .btn {\n font-size: 10px;\n text-align:left;\n width:50px;\n }\n )\n}",
"Type": "blocks"
},
{
"Name": "pager_for_popup",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(#this_table#).Where(#where#).Order({\"id\": 1}).Count(records_count)\n\nIf(#pager_limit# < #records_count#){\n If(#page_par#==\"\"){\n SetVar(page_par,)\n }\n SetVar(previous_page, Calculate(Exp: #current_page# - 1, Type: int))\n SetVar(next_page, Calculate(Exp: #current_page# + 1, Type: int))\n\n SetVar(count_div_limit_int, Calculate(Exp: (#records_count# / #pager_limit#), Type: int))\n SetVar(remainder, Calculate(Exp: (#records_count# / #pager_limit#) - #count_div_limit_int#, Type: float))\n If(#remainder# != 0){\n SetVar(last_page, Calculate(Exp: #count_div_limit_int# + 1, Type: int))\n }.Else{\n SetVar(last_page, #count_div_limit_int#)\n }\n\n SetVar(last_page_plus_one, Calculate(Exp: #last_page# + 1, Type: int))\n SetVar(delta_last_page, Calculate(Exp: #last_page# - #current_page#))\n SetVar(range_l, Calculate(Exp: #current_page# - 4, Type: int))\n SetVar(range_r, Calculate(Exp: #current_page# + 6, Type: int))\n SetVar(range_l_max, Calculate(Exp: #last_page# - #pager_limit#, Type: int))\n SetVar(last_page_min_set, Calculate(Exp: #last_page_plus_one# - 10, Type: int))\n\n If(#current_page# < 5){\n If(#last_page# >= 10){\n Range(src_pages, 1, 11)\n }.Else{\n Range(src_pages, 1, #last_page_plus_one#)\n }\n }.ElseIf(#delta_last_page# < 6){\n If(#range_l_max# > 0){\n Range(src_pages, #last_page_min_set#, #last_page_plus_one#)\n }.Else{\n Range(src_pages, 1, #last_page_plus_one#)\n }\n }.Else{\n Range(src_pages, #range_l#, #range_r#)\n }\n\n Div(){\n Span(Class: pull-left){\n If(#current_page# == 1){\n Button(Body: Em(Class: fa fa-angle-double-left), Class: btn bg-gray-lighter disabled)\n }.Else{\n Button(Body: Em(Class: fa fa-angle-double-left), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=1,current_header=#current_header#,back_page=#back_page#,back_header=#back_header#,page_par=#page_par#,search=#search#\").Popup(Header: #current_header#, Width: \"50\")\n }\n }\n Span(Class: pull-left){\n If(#current_page# == 1){\n Button(Body: Em(Class: fa fa-angle-left), Class: btn bg-gray-lighter disabled)\n }.Else{\n Button(Body: Em(Class: fa fa-angle-left), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#previous_page#,current_header=#current_header#,back_page=#back_page#,back_header=#back_header#,page_par=#page_par#,search=#search#\").Popup(Header: #current_header#, Width: \"50\")\n }\n }\n Span(Class: pull-left){\n ForList(src_pages){\n Span(){\n If(#id# == #current_page#){\n Button(Body: #id#, Class: btn bg-primary-light, Page: #this_page#, PageParams: \"current_page=#id#,current_header=#current_header#,back_page=#back_page#,back_header=#back_header#,page_par=#page_par#,search=#search#\").Popup(Header: #current_header#, Width: \"50\")\n }.Else{\n Button(Body: #id#, Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#id#,current_header=#current_header#,back_page=#back_page#,back_header=#back_header#,page_par=#page_par#,search=#search#\").Popup(Header: #current_header#, Width: \"50\")\n }\n }\n }\n }\n Span(Class: pull-left){\n If(#current_page# == #last_page#){\n Button(Body: Em(Class: fa fa-angle-right), Class: btn bg-gray-lighter disabled)\n }.Else{\n Button(Body: Em(Class: fa fa-angle-right), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#next_page#,current_header=#current_header#,back_page=#back_page#,back_header=#back_header#,page_par=#page_par#,search=#search#\").Popup(Header: #current_header#, Width: \"50\")\n }\n }\n Span(Class: pull-left){\n If(#current_page# == #last_page#){\n Button(Body: Em(Class: fa fa-angle-double-right), Class: btn bg-gray-lighter disabled)\n }.Else{\n Button(Body: Em(Class: fa fa-angle-double-right), Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#last_page#,current_header=#current_header#,back_page=#back_page#,back_header=#back_header#,page_par=#page_par#,search=#search#\").Popup(Header: #current_header#, Width: \"50\")\n }\n }\n }.Style(\n .btn {\n font-size: 10px;\n text-align:left;\n width:50px;\n }\n )\n}",
"Type": "blocks"
},
{
"Name": "pager_header",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "If(#pager_limit# == \"\"){\n SetVar(pager_limit, 25)\n}\nIf(#current_page# == \"\"){\n SetVar(current_page, 1)\n}\nSetVar(pager_offset, Calculate(Exp: (#current_page# - 1) * #pager_limit#, Type: int))\nSetVar(current_page, #current_page#)",
"Type": "blocks"
},
{
"Name": "search",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "Form(input-group){\n Div(input-group-addon){\n #search_name#\n }\n Input(Name: search, Value: #search#, Placeholder: $@1text_to_search$)\n Div(input-group-btn){\n If(#search#){\n Button(Class: btn bg-gray-lighter fa fa-close mtl buttons, Page: #this_page#, PageParams: \"page_par=#page_par#\")\n }\n Button(Class: btn bg-gray-lighter mtl buttons, Page: #this_page#, PageParams: \"search=Val(search),page_par=#page_par#\", Body: Em(Class: fa fa-search) $@1search$)\n }\n}.Style(\n .buttons{border: 1px solid #dde6e9;}\n)",
"Type": "blocks"
},
{
"Name": "developer_menu",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "MenuItem(Title:$@1applications$, Page:@1apps_list, Icon:\"icon-paper-plane\")\nMenuItem(Title:$@1ecosystem_parameters$, Page:@1params_list, Icon:\"icon-settings\")\nMenuItem(Title:$@1menu$, Page:@1menus_list, Icon:\"icon-list\")\nMenuItem(Title:$@1sections$, Page:@1section_list, Icon:\"icon-frame\")\nMenuItem(Title:$@1lang_res$, Page:@1app_langres, Icon:\"icon-globe\")\nMenuItem(Title:$@1dashboard$, Page:@1developer_index, Icon:\"icon-wrench\")",
"Type": "menu"
},
{
"Name": "developer_resources",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "MenuItem(Title:$@1contracts$, Page:@1app_contracts, Icon:\"icon-briefcase\")\nMenuItem(Title:$@1pages$, Page:@1app_pages, Icon:\"icon-screen-desktop\")\nMenuItem(Title:$@1blocks$, Page:@1app_blocks, Icon:\"icon-grid\")\nMenuItem(Title:$@1tables$, Page:@1app_tables, Icon:\"icon-calendar\")\nMenuItem(Title:$@1binaries$, Page:@1app_binary, Icon:\"icon-picture\")\nMenuItem(Title:$@1app_params$, Page:@1app_params, Icon:\"icon-settings\")",
"Type": "menu"
},
{
"Name": "config",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "{\n \"name\": \"System\",\n \"conditions\": \"ContractConditions(\\\"DeveloperCondition\\\")\",\n \"data\": [\n {\n \"Name\": \"developer_menu\",\n \"Conditions\": \"ContractConditions(\\\"DeveloperCondition\\\")\",\n \"Value\": \"MenuItem(Title:$@1applications$, Page:@1apps_list, Icon:\\\"icon-paper-plane\\\")\\nMenuItem(Title:$@1apps_catalog$, Page:@1apps_catalog, Icon:\\\"icon-folder\\\")\\nMenuItem(Title:$@1ecosystem_parameters$, Page:@1params_list, Icon:\\\"icon-settings\\\")\\nMenuItem(Title:$@1menu$, Page:@1menus_list, Icon:\\\"icon-list\\\")\\nMenuItem(Title:$@1sections$, Page:@1section_list, Icon:\\\"icon-frame\\\")\\nMenuItem(Title:$@1lang_res$, Page:@1app_langres, Icon:\\\"icon-globe\\\")\\nMenuItem(Title:$@1dashboard$, Page:@1developer_index, Icon:\\\"icon-wrench\\\")\",\n \"Type\": \"menu\"\n },\n {\n \"Name\": \"developer_resources\",\n \"Conditions\": \"ContractConditions(\\\"DeveloperCondition\\\")\",\n \"Value\": \"MenuItem(Title:$@1contracts$, Page:@1app_contracts, Icon:\\\"icon-briefcase\\\")\\nMenuItem(Title:$@1pages$, Page:@1app_pages, Icon:\\\"icon-screen-desktop\\\")\\nMenuItem(Title:$@1blocks$, Page:@1app_blocks, Icon:\\\"icon-grid\\\")\\nMenuItem(Title:$@1tables$, Page:@1app_tables, Icon:\\\"icon-calendar\\\")\\nMenuItem(Title:$@1binaries$, Page:@1app_binary, Icon:\\\"icon-picture\\\")\\nMenuItem(Title:$@1app_params$, Page:@1app_params, Icon:\\\"icon-settings\\\")\",\n \"Type\": \"menu\"\n },\n {\n \"Name\": \"default_page\",\n \"Conditions\": \"ContractConditions(\\\"DeveloperCondition\\\")\",\n \"Value\": \"Include(@1profile)\",\n \"Menu\": \"default_menu\",\n \"Type\": \"pages\"\n },\n {\n \"Name\": \"role_admin\",\n \"Conditions\": \"ContractConditions(\\\"DeveloperCondition\\\")\",\n \"Value\": \"0\",\n \"Type\": \"app_params\"\n },\n {\n \"Name\": \"role_creates_roles\",\n \"Conditions\": \"ContractConditions(\\\"DeveloperCondition\\\")\",\n \"Value\": \"0\",\n \"Type\": \"app_params\"\n },\n {\n \"Name\": \"role_developer\",\n \"Conditions\": \"ContractConditions(\\\"DeveloperCondition\\\")\",\n \"Value\": \"0\",\n \"Type\": \"app_params\"\n }\n ]\n}",
"Type": "app_params"
},
{
"Name": "role_admin",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "0",
"Type": "app_params"
},
{
"Name": "role_consortium_member",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "0",
"Type": "app_params"
},
{
"Name": "role_consortium_member_candidate",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "0",
"Type": "app_params"
},
{
"Name": "role_creates_roles",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "0",
"Type": "app_params"
},
{
"Name": "role_delegate",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "0",
"Type": "app_params"
},
{
"Name": "role_developer",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "0",
"Type": "app_params"
},
{
"Name": "role_investor_with_voting_rights",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "0",
"Type": "app_params"
},
{
"Name": "app_binary",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n If(#buffer_value_app_id# > 0){\n DBFind(\"@1applications\", src_app).Where({\"id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n\n Div(mr-lg ml-lg){\n SetTitle($@1binaries$: #application_name#)\n AddToolButton(Title:$@1binary_upload$, Page: @1app_upload_binary, Icon: icon-plus, PageParams: \"application_id=#application_id#\")\n\n SetVar(this_table, @1binaries).(this_page, @1app_binary).(pager_limit, 50)\n SetVar(where, {\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n SetVar(hideLink, 0)\n Include(@1pager_header)\n Include(@1admin_link)\n\n DBFind(#this_table#, src).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where(#where#).Custom(_name){\n LinkPage(Page: @1app_upload_binary, PageParams: \"id=#id#,application_id=#buffer_value_app_id#\", Body: #name#)\n }.Custom(_img){\n Div(pull-right){\n Image(Src: Binary().ById(#id#), Class: preview).Style(height: 40px; widht 40px;)\n }\n }.Count(cnt)\n\n Form(panel panel-primary){\n Div(panel-body){\n Div(row){\n Div(col-md-#width# col-sm-12){\n If(#cnt#>0){\n Div(list-group-item){\n Div(row){\n Div(col-md-12){\n Table(src,\"=_name,=data,=_img\")\n }\n }\n }\n }\n }\n }\n Div(mt){\n Include(@1pager)\n }\n }\n }\n }\n }.Else{\n SetTitle($@1binaries$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1apps_select_error$)\n }\n }\n}.Else{\n SetTitle($@1binaries$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_resources",
"Type": "pages"
},
{
"Name": "app_blocks",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n If(#buffer_value_app_id# > 0){\n DBFind(\"@1applications\", src_app).Where({\"id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n\n Div(mr-lg ml-lg){\n SetTitle($@1blocks$: #application_name#)\n AddToolButton(Title: $@1create$, Page: editor, Icon: icon-plus, PageParams: \"create=block,appId=#buffer_value_app_id#\")\n\n SetVar(this_table, @1blocks).(this_page, @1app_blocks).(pager_limit, 50)\n SetVar(where, {\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n Include(@1pager_header)\n Include(@1admin_link)\n\n DBFind(#this_table#, src).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where(#where#)\n\n Form(panel panel-primary){\n Div(panel-body){\n Div(row){\n ForList(src){\n Div(col-md-#width# col-sm-12){\n Div(list-group-item){\n Div(row){\n Div(col-md-4){\n LinkPage(Body: \"#name#\", Class: text-primary, Page: editor, PageParams: \"open=block,name=#name#\")\n }\n Div(col-md-8){\n Div(pull-right){\n LinkPage(Body: Em(Class: fa fa-history), Class: text-primary h4 mh-sm, Page: @1history, PageParams: \"id=#id#,type=block\")\n LinkPage(Body: Em(Class: fa fa-cogs), Class: text-primary h4 mh-sm, Page: @1properties_edit, PageParams: \"edit_property_id=#id#,type=block\")\n }\n }\n }\n }\n }\n }\n }\n Div(mt){\n Include(@1pager)\n }\n }\n }\n }\n }.Else{\n SetTitle($@1blocks$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1apps_select_error$)\n }\n }\n}.Else{\n SetTitle($@1blocks$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_resources",
"Type": "pages"
},
{
"Name": "app_contracts",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n If(#buffer_value_app_id# > 0){\n DBFind(\"@1applications\", src_app).Where({\"id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n\n Div(mr-lg ml-lg){\n SetTitle($@1contracts$: #application_name#)\n AddToolButton(Title: $@1create$, Page: editor, Icon: icon-plus, PageParams: \"create=contract,appId=#buffer_value_app_id#\")\n\n SetVar(this_table, @1contracts).(this_page, @1app_contracts).(pager_limit, 50)\n SetVar(where, {\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n Include(@1pager_header)\n Include(@1admin_link)\n\n DBFind(#this_table#, src).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where(#where#)\n\n Form(panel panel-primary){\n Div(panel-body){\n Div(row){\n ForList(src){\n Div(col-md-#width# col-sm-12){\n Div(list-group-item){\n Div(row){\n Div(col-md-4){\n LinkPage(Body: #name#, Class: text-primary, Page: editor, PageParams: \"open=contract,name=#name#\")\n }\n Div(col-md-8){\n Div(pull-right){\n LinkPage(Body: Em(Class: fa fa-history), Class: text-primary h4 mh-sm, Page: @1history, PageParams: \"id=#id#,type=contract\")\n LinkPage(Body: Em(Class: fa fa-cogs), Class: text-primary h4 mh-sm, Page: @1properties_edit, PageParams: \"edit_property_id=#id#,type=contract\")\n }\n Div(pull-right){\n If(#wallet_id# != 0){\n Span(Class: h5, Body: Em(Class: fa fa-check)).Style(margin-right: 50px;)\n }.Else{\n Span(Class: h5 text-muted, Body: Em(Class: fa fa-minus)).Style(margin-right: 50px;)\n }\n }\n }\n }\n }\n }\n }\n }\n Div(mt){\n Include(@1pager)\n }\n }\n }\n }\n }.Else{\n SetTitle($@1contracts$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1apps_select_error$)\n }\n }\n}.Else{\n SetTitle($@1contracts$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_resources",
"Type": "pages"
},
{
"Name": "app_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(content-wrapper){\n SetTitle($@1application$)\n Div(breadcrumb){\n LinkPage($@1applications$, @1apps_list)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n If(#id# > 0){\n Span(Class: text-muted, Body: $@1editing$)\n }.Else{\n Span(Class: text-muted, Body: $@1new_app$)\n }\n }\n\n Form(){\n If(#id# > 0){\n DBFind(\"@1applications\", src_apps).Columns(\"id,name,conditions,deleted\").Where({\"id\": \"#id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n Div(form-group){\n Label($@1name$)\n Input(Name: Name, Disabled: \"true\", Value: #application_name#)\n }\n Div(form-group){\n Label($@1change_conditions$)\n Input(Name: Conditions, Value: #application_conditions#)\n }\n Div(form-group){\n Div(row){\n Div(text-left col-md-6){\n If(#application_deleted# == 0){\n Button(Body: $@1delete$, Class: btn btn-danger, Page: @1apps_list, Contract: @1DelApplication, Params: \"ApplicationId=#application_id#,Value=1\")\n }\n }\n Div(text-right col-md-6){\n Button(Body: $@1save$, Class: btn btn-primary, Page: @1apps_list, Contract: @1EditApplication, Params: \"ApplicationId=#id#\")\n }\n }\n }\n }.Else{\n Div(form-group){\n Label($@1name$)\n Input(Name: Name)\n }\n Div(form-group){\n Label($@1change_conditions$)\n Input(Name: Conditions)\n }\n Div(form-group){\n Div(text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Page: @1apps_list, Contract: @1NewApplication)\n }\n }\n }\n }\n }\n}.Else{\n SetTitle($@1application$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "app_langres",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1app_langres).(this_table, @1languages)\n Include(@1pager_header)\n\n SetTitle(\"$@1lang_res$\")\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1application_lang_res$\"))\n AddToolButton(Title: \"$@1create$\", Page: @1langres_add, Icon: icon-plus)\n\n If(#search#){\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"$or\": [{\"name\": {\"$ilike\": \"#search#\"}}, {\"res\": {\"$ilike\": \"#search#\"}}]})\n }.Else{\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\"})\n }\n\n Div(list-group-item ml-lg mr-lg pt-lg){\n SetVar(search_name, LangRes(@1name))\n Include(@1search)\n }\n\n DBFind(#this_table#, src).Where(#where#).Order({\"name\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(lang_name){\n LinkPage(Page: @1langres_edit, Class: text-primary h5, Body: \"#name#\", PageParams: \"lang_id=#id#\")\n }.Custom(_res){\n Span(Class: text-muted h6, Body: \"#res#\")\n }.Count(count)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n If(#count# > 0){\n Table(src, \"$@1name$=lang_name,$@1value$=_res\")\n }.Else{\n Div(Class: text-center h4 text-muted, Body: \"$@1lang_res$ $@1not_founded$\")\n }\n }.Style(\n margin-top:-15px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1lang_res$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "app_pages",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n If(#buffer_value_app_id# > 0){\n DBFind(\"@1applications\", src_app).Where({\"id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n\n Div(mr-lg ml-lg){\n SetTitle($@1pages$ : #application_name#)\n AddToolButton(Title: $@1create$, Page: editor, Icon: icon-plus, PageParams: \"create=page,appId=#buffer_value_app_id#\")\n\n SetVar(this_table, @1pages).(this_page, @1app_pages).(pager_limit, 50)\n SetVar(where, {\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n Include(@1pager_header)\n Include(@1admin_link)\n\n DBFind(#this_table#, src).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where(#where#)\n\n Form(panel panel-primary){\n Div(panel-body){\n Div(row){\n ForList(src){\n Div(col-md-#width# col-sm-12){\n Div(list-group-item){\n Div(row){\n Div(col-md-4){\n LinkPage(Body: #name#, Class: text-primary, Page: editor, PageParams: \"open=page,name=#name#\")\n }\n Div(col-md-8){\n Div(pull-right){\n LinkPage(Body: Em(Class: fa fa-eye), Class: text-primary h4 mh-sm, Page: \"#name#\")\n LinkPage(Body: Em(Class: fa fa-history), Class: text-primary h4 mh-sm, Page: @1history, PageParams: \"id=#id#,type=page\")\n LinkPage(Body: Em(Class: fa fa-cogs), Class: text-primary h4 mh-sm, Page: @1properties_edit, PageParams: \"edit_property_id=#id#,type=page\")\n }\n }\n }\n }\n }\n }\n }\n Div(mt){\n Include(@1pager)\n }\n }\n }\n }\n }.Else{\n SetTitle($@1pages$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1apps_select_error$)\n }\n }\n}.Else{\n SetTitle($@1pages$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_resources",
"Type": "pages"
},
{
"Name": "app_params",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n If(#buffer_value_app_id# > 0){\n DBFind(\"@1applications\", src_app).Where({\"id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n\n Div(mr-lg ml-lg){\n SetTitle($@1app_params$: #application_name#)\n AddToolButton(Title: $@1create$, Page: @1app_params_edit, Icon: icon-plus, PageParams: \"application_id=#application_id#,create=create\")\n\n SetVar(this_table, @1app_params).(this_page, @1app_params).(pager_limit, 50)\n SetVar(where, {\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n Include(@1pager_header)\n Include(@1admin_link)\n\n DBFind(#this_table#, src).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where(#where#)\n\n Form(panel panel-primary){\n Div(panel-body){\n Div(row){\n ForList(src){\n Div(col-md-#width# col-sm-12){\n Div(list-group-item){\n Div(row){\n Div(col-md-4){\n LinkPage(Body: \"#name#\", Class: text-primary, Page: @1app_params_edit, PageParams: \"id=#id#\")\n }\n Div(col-md-8){\n Span(Class: text-muted h6, Body: \"#value#\")\n }\n }\n }\n }\n }\n }\n Div(mt){\n Include(@1pager)\n }\n }\n }\n }\n }.Else{\n SetTitle($@1app_params$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1apps_select_error$)\n }\n }\n}.Else{\n SetTitle($@1app_params$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_resources",
"Type": "pages"
},
{
"Name": "app_params_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n If(#back_page#){}.Else{\n SetVar(back_page, @1app_params)\n }\n Div(content-wrapper){\n If(#create# == create){\n SetVar(param_name, \"$@1new_parameter$\")\n }.Else{\n DBFind(\"@1app_params\", src_params).Where({\"id\": \"#id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(param)\n }\n\n SetTitle($@1app_param$)\n Div(Class: breadcrumb){\n LinkPage($@1app_params$, @1app_params)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span(Class: text-muted, Body: #param_name#)\n }\n\n Form(){\n Div(form-group){\n Label(\"$@1name$\")\n If(#create# == create){\n Input(Name: name)\n }.Else{\n Input(Name: name, Value: #param_name#, Disabled: \"true\")\n }\n }\n Div(form-group){\n If(#create# == create){\n Input(Type: textarea, Name: value).Style(height: 500px !important;)\n }.Else{\n Input(Type: textarea, Name: value, Value: \"#param_value#\").Style(height: 500px !important;)\n }\n }\n Div(form-group){\n Label($@1change_conditions$)\n If(#create# == create){\n Input(Name: conditions)\n }.Else{\n Input(Name: conditions, Value: #param_conditions#)\n }\n }\n Div(form-group text-right){\n If(#create# == create){\n Button(Class: btn btn-primary, Body: $@1save$, Contract: @1NewAppParam, Params: \"Name=Val(name),Value=Val(value),Conditions=Val(conditions),ApplicationId=#application_id#\", Page: #back_page#)\n }.Else{\n Button(Class: btn btn-primary, Body: $@1save$, Contract: @1EditAppParam, Params: \"Id=#id#,Value=Val(value),Conditions=Val(conditions)\", Page: #back_page#)\n }\n }\n }\n }\n}.Else{\n SetTitle($@1new_parameter$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "app_tables",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n If(#buffer_value_app_id# > 0){\n DBFind(\"@1applications\", src_app).Where({\"id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n\n Div(mr-lg ml-lg){\n SetTitle($@1tables$: #application_name#)\n AddToolButton(Title: $@1create$, Page: @1table_create, Icon: icon-plus, PageParams: \"application_id=#application_id#\")\n\n SetVar(this_table, @1tables).(this_page, @1app_tables).(pager_limit, 50)\n SetVar(where, {\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n Include(@1pager_header)\n Include(@1admin_link)\n\n DBFind(#this_table#, src).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where(#where#)\n\n Form(panel panel-primary){\n Div(panel-body){\n Div(row){\n ForList(src){\n Div(col-md-#width# col-sm-12){\n Div(list-group-item){\n Div(row){\n Div(col-md-4){\n LinkPage(Page: @1table_view, Class: text-primary h5, Body: \"#name#\", PageParams: \"tabl_id=#id#\")\n }\n Div(col-md-8){\n Div(pull-right){\n LinkPage(Body: Em(Class: fa fa-cogs), Class: text-primary h4, Page: @1table_edit, PageParams: \"tabl_id=#id#\")\n }\n Div(pull-right){\n DBFind(#name#).Columns(\"id\").Count(countvar)\n Span(Class: h5 text-muted, Body: #countvar#).Style(margin-right: 50px;)\n }\n }\n }\n }\n }\n }\n }\n Div(mt){\n Include(@1pager)\n }\n }\n }\n }\n }.Else{\n SetTitle($@1tables$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1apps_select_error$)\n }\n }\n}.Else{\n SetTitle($@1tables$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_resources",
"Type": "pages"
},
{
"Name": "app_upload_binary",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(content-wrapper){\n SetTitle($@1binaries$)\n Div(breadcrumb){\n LinkPage($@1binaries$, @1app_binary)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n If(#id# > 0){\n Span($@1edit$, text-muted)\n DBFind(\"@1binaries\").Where({\"id\": \"#id#\", \"ecosystem\": \"#ecosystem_id#\"}).Columns(name).Vars(binary)\n }.Else{\n Span($@1button_upload$, text-muted)\n }\n }\n\n Form(){\n Div(form-group){\n Div(text-left){\n Label($@1name$)\n }\n If(#id# > 0){\n Input(Name: Name, Disabled: disabled, Value: #binary_name#)\n }.Else{\n Input(Name: Name)\n }\n }\n Div(form-group){\n Div(text-left){\n Label($@1file$)\n }\n Input(Name: Data, Type: file)\n }\n Div(form-group text-right){\n Input(Name: ApplicationId, Value: #application_id#, Class: hidden)\n Button(Body: $@1button_upload$, Contract: @1UploadFile, Class: btn btn-primary, Page: @1app_binary)\n }\n }\n }\n}.Else{\n SetTitle($@1binaries$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "apps_catalog",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1apps_catalog).(this_table, @1applications)\n Include(@1pager_header)\n\n SetTitle($@1apps_catalog$)\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: $@1apps_catalog_desc$))\n\n If(#search#){\n SetVar(where, {\"ecosystem\": 1, \"deleted\": 0, \"name\": {\"$ilike\": \"#search#\"}})\n }.Else{\n SetVar(where, {\"ecosystem\": 1, \"deleted\": 0})\n }\n\n Div(list-group-item ml-lg mr-lg pt-lg){\n SetVar(search_name, LangRes(@1name))\n Include(@1search)\n }\n\n DBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(inst_app){\n If(#ecosystem_id# != 1){\n SetVar(config_id,0)\n DBFind(\"@1applications\").Where({\"name\": \"#name#\", \"ecosystem\": \"#ecosystem_id#\"}).Count(inst_app)\n DBFind(\"@1app_params\").Where({\"app_id\": \"#id#\", \"ecosystem\": 1, \"name\": \"config\"}).Vars(config)\n If(#config_id# > 0){\n If(#inst_app# == 0){\n Button(Class: btn-xs pull-right btn-link, Contract: @1AppInstall, Params: \"ApplicationId=#id#\", Page: #this_page#){\n Span(Class: h5, Body: $@1install$)\n }\n }.Else{\n Span(Body: $@1installed$, Class: text-muted pull-right)\n }\n }\n }\n }.Count(count)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n If(#count# > 0){\n Table(src, \"ID=id,$@1name$=name,=inst_app\")\n }.Else{\n Div(Class: text-center h4 text-muted, Body: \"$@1applications$ $@1not_founded$\")\n }\n }.Style(\n margin-top:-15px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1apps_catalog$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "apps_list",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1apps_list).(this_table, @1applications)\n Include(@1pager_header)\n\n SetTitle(\"$@1applications$\")\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1apps_list$\"))\n AddToolButton(Title: $@1import$, Page: @1import_upload, Icon: icon-cloud-upload)\n AddToolButton(Title: $@1apps_inactive$, Page: @1apps_list_inactive, Icon: icon-close)\n AddToolButton(Title: $@1create$, Page: @1app_edit, Icon: icon-plus)\n\n If(#search#){\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"deleted\": 0, \"name\": {\"$ilike\": \"#search#\"}})\n }.Else{\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"deleted\": 0})\n }\n\n Div(list-group-item ml-lg mr-lg pt-lg){\n SetVar(search_name, LangRes(@1name))\n Include(@1search)\n }\n\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_id,value->app_name,value->menu_name,value->menu_id,value->count_menu\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n DBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_export){\n Button(Class: btn-xs btn-link, Contract: @1ExportNewApp, Params: \"ApplicationId=#id#\", Page: @1export_resources){\n Span(Class: h5, Body: \"$@1export$\")\n }\n }.Custom(custom_name){\n If(#id#==#buffer_value_app_id#){\n Button(Class: btn-xs btn-link, Page: @1app_contracts){\n Span(Class: h5, Body: #name#)\n }\n }.Else{\n Button(Class: btn-link btn-xs, Contract: @1SelectApp, Params: \"ApplicationId=#id#\", Page: @1app_contracts){\n Span(Class: h5, Body: #name#)\n }\n }\n }.Custom(custom_actions){\n Span(Class: pull-right){\n LinkPage(Class: text-primary h4, Body: Em(Class: fa fa-cogs), Page: @1app_edit, PageParams: \"id=#id#\")\n }\n }.Count(count)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n If(#count# > 0){\n Table(src, \"$@1name$=custom_name,$@1conditions$=conditions,$@1export$=_export,=custom_actions\")\n }.Else{\n Div(Class: text-center h4 text-muted, Body: \"$@1applications$ $@1not_founded$\")\n }\n }.Style(\n margin-top:-15px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1applications$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "apps_list_inactive",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1apps_list_inactive).(this_table, @1applications)\n Include(@1pager_header)\n\n SetTitle(\"$@1apps_inactive$\")\n Span(Class: h5 m0 mb ml-lg){\n LinkPage(Class: ml-sm, Body: $@1applications$, Page: @1apps_list)\n Span(Class: text-muted, Body: /).Style(margin-right: 10px; margin-left: 10px;)\n Span(Class: text-muted, Body: \"$@1apps_inactive$\")\n }.Style(\n display: inline-block;\n )\n\n If(#search#){\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"deleted\": 1, \"name\": {\"$ilike\": \"#search#\"}})\n }.Else{\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"deleted\": 1})\n }\n\n Div(list-group-item ml-lg mr-lg pt-lg){\n SetVar(search_name, LangRes(@1name))\n Include(@1search)\n }\n\n DBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_actions){\n Span(Class: pull-right){\n Button(Class: btn btn-link, Page: @1apps_list_inactive, Contract: @1DelApplication, Params: \"ApplicationId=#id#\", Body: \"$@1restore$\")\n }\n }.Count(count)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n If(#count# > 0){\n Table(src, \"$@1name$=name,$@1conditions$=conditions,=_actions\")\n }.Else{\n Div(Class: text-center h4 text-muted, Body: \"$@1inactive_warning$\")\n }\n }.Style(\n margin-top:-15px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1apps_inactive$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "column_add",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(content-wrapper){\n SetTitle($@1new_column$)\n Div(breadcrumb){\n Div(){\n LinkPage($@1tables$, @1app_tables)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n LinkPage($@1edit_table$, @1table_edit, PageParams:\"tabl_id=#tabl_id#\")\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span($@1new_column$, text-muted)\n }\n }\n\n Form(panel panel-default){\n Div(panel-body){\n Div(form-group){\n Label($@1column$)\n Input(Name: ColumnName)\n }\n Div(form-group){\n Data(src_type,\"type,name\"){\n text,\"Text\"\n number,\"Number\"\n varchar,\"Varchar\"\n datetime,\"Date/Time\"\n money,\"Money\"\n double,\"Double\"\n character,\"Character\"\n json,\"JSON\"\n }\n Label($@1type$)\n Select(Name: Coltype, Source: src_type, NameColumn: name, ValueColumn: type, Value:\"text\")\n }\n Div(form-group){\n Label($@1updating$)\n Input(Name: UpdateColumn, Value: \"true\")\n }\n Div(form-group){\n Label($@1reading$)\n Input(Name: ReadColumn, Value: \"true\")\n }\n }\n Div(panel-footer clearfix text-right){\n Button(Body: $@1column_add$, Contract: @1NewColumn, Class: btn btn-primary, Page: @1table_edit, PageParams: \"tabl_id=#tabl_id#\", Params: \"TableName=#next_table_name#,Name=Val(ColumnName),Type=Val(Coltype),UpdatePerm=Val(UpdateColumn),ReadPerm=Val(ReadColumn)\")\n }\n }\n }\n}.Else{\n SetTitle($@1new_column$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "column_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(content-wrapper){\n SetTitle($@1edit_column$)\n Div(breadcrumb){\n Div(){\n LinkPage($@1tables$, @1app_tables)\n Span(/,mh)\n LinkPage($@1edit_table$, @1table_edit, PageParams:\"tabl_id=#tabl_id#\")\n Span(/,mh)\n Span($@1edit_column$, text-muted)\n }\n }\n\n DBFind(\"@1tables\").Columns(\"id,name,columns,conditions\").Where({\"id\": \"#tabl_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(table)\n JsonToSource(src_columns, #table_columns#)\n Form(panel panel-default){\n Div(panel-body){\n ForList(src_columns){\n If(#key# == #name_column#){\n Div(form-group){\n Label($@1column$)\n Input(Name: ColumnName, Disabled: \"true\", Value: #name_column#)\n }\n Div(form-group){\n Label($@1type$)\n SetVar(col_type, GetColumnType(#table_name#, #key#))\n If(#col_type# == character){\n SetVar(input_type, \"Character\")\n }\n If(#col_type# == text){\n SetVar(input_type, \"Text\")\n }\n If(#col_type# == number){\n SetVar(input_type, \"Number\")\n }\n If(#col_type# == money){\n SetVar(input_type, \"Money\")\n }\n If(#col_type# == varchar){\n SetVar(input_type, \"Varchar\")\n }\n If(#col_type# == datetime){\n SetVar(input_type, \"Date/Time\")\n }\n If(#col_type# == double){\n SetVar(input_type, \"Double\")\n }\n If(#col_type# == json){\n SetVar(input_type, \"JSON\")\n }\n If(#col_type# == bytea){\n SetVar(input_type, \"Binary Data\")\n }\n If(#col_type# == uuid){\n SetVar(input_type, \"UUID\")\n }\n Input(Name: Coltype, Disabled: \"true\", Value: #input_type#)\n }\n\n SetVar(isObject,0)\n JsonToSource(condition,#value#)\n ForList(condition){\n SetVar(isObject,1)\n If(#key#==read){\n Div(form-group){\n Label($@1reading$)\n Input(Name: ReadColumn, Value: #value#)\n }\n }.ElseIf(#key#==update){\n Div(form-group){\n Label($@1updating$)\n Input(Name: UpdateColumn, Value: #value#)\n }\n }\n }\n If(#isObject#==0){\n Div(form-group){\n Label($@1reading$)\n Input(Name: ReadColumn, Value: true)\n }\n Div(form-group){\n Label($@1updating$)\n Input(Name: UpdateColumn, Value: #value#)\n }\n }\n }\n }\n }\n Div(panel-footer clearfix text-right){\n Button(Body: $@1save$, Contract: @1EditColumn, Class: btn btn-primary, Page: @1table_edit, PageParams: \"tabl_id=#tabl_id#\", Params: \"TableName=#table_name#,Name=Val(ColumnName),Type=Val(Coltype),UpdatePerm=Val(UpdateColumn),ReadPerm=Val(ReadColumn)\")\n }\n }\n }\n}.Else{\n SetTitle($@1edit_column$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "developer_index",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1developer_index).(deleters_count,0)\n DBFind(\"@1contracts\").Where({\"name\": \"ItemChangeAppId\", \"ecosystem\": 1}).Count(changer_count)\n DBFind(\"@1applications\",src_apps).Where({\"deleted\": 0, \"ecosystem\": \"#ecosystem_id#\"}).Order(\"id\").Count(apps_count)\n\n If(And(#Restore#,#Table#,#Id#)){\n Form(){\n Select(Name:AppId, NameColumn: name, ValueColumn: id, Source: src_apps, Class:mb)\n Div(){\n Button(Class: btn btn-default, Page: #this_page#, PageParams: \"appid=0\", Body: \"$@1cancel$\")\n Button(Class: btn btn-primary pull-right, Page: #this_page#, PageParams: \"appid=Val(AppId)\", Contract: @1ItemChangeAppId, Params: \"Table=#Table#,Id=#Id#,AppId=Val(AppId)\", Body: \"$@1confirm_button$\")\n }\n }\n }.ElseIf(#block#){\n Span(Class: h5 m0 mb ml-lg){\n LinkPage(Class: ml-sm, Body: $@1dashboard$, Page: #this_page#)\n Span(Class: text-muted mh-sm, Body: /)\n Span(Class: text-muted, Body: $@1block$: #block#)\n }.Style(\n display: inline-block;\n )\n Include(Name:#block#)\n }.Else{\n DBFind(\"@1buffer_data\").Columns(\"value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n If(#Single#==binaries){\n Data(tables, \"Table,Page,Name\"){\n @1binaries,@1app_upload_binary,$@1binaries$\n }\n }.ElseIf(#Single#==languages){\n Data(tables, \"Table,Cols,Page,Name\"){\n @1languages,\"id,name,res\",@1langres_add,$@1lang_res$\n }\n }.Else{\n Data(tables, \"Table,Cols,Page,Name\"){\n @1contracts,\"id,app_id,name,wallet_id\",editor,$@1contracts$\n @1pages,\"id,app_id,name\",editor,$@1pages$\n @1blocks,\"id,app_id,name\",editor, $@1blocks$\n @1tables,\"id,app_id,name\",@1table_create,$@1tables$\n @1app_params,\"id,app_id,name,value\",@1app_params_edit,$@1app_params$\n }\n }\n SetVar(active_btn,\"btn btn-info\").(create_icon,fa fa-plus-square).(cols,3)\n\n If(#appid#!=\"\"){\n SetVar(where, {\"app_id\": \"#appid#\", \"ecosystem\": \"#ecosystem_id#\"})\n }.Else{\n If(#buffer_value_app_id#>0){\n DBFind(\"@1applications\").Where({\"id\": \"#buffer_value_app_id#\", \"deleted\": 0, \"ecosystem\": \"#ecosystem_id#\"}).Vars(check)\n If(#check_id# > 0){\n SetVar(appid, #buffer_value_app_id#).(where, {\"app_id\": \"#appid#\", \"ecosystem\": \"#ecosystem_id#\"})\n }.Else{\n SetVar(where, {\"id\": {\"$gt\": 0}, \"ecosystem\": \"#ecosystem_id#\"}).(appid, 1)\n }\n }.Else{\n SetVar(where, {\"id\": {\"$gt\": 0}, \"ecosystem\": \"#ecosystem_id#\"}).(appid, 1)\n }\n }\n\n If(#appid#==0){\n SetVar(application_name,trash)\n }.ElseIf(#appid#>0){\n DBFind(\"@1applications\").Where({\"id\": \"#appid#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(application)\n }\n If(And(#appid# == 1,#ecosystem_id# != 1)){\n SetTitle($@1dashboard$: $@1select_application$)\n }.Else{\n SetTitle($@1dashboard$: #application_name#)\n }\n\n Div(mr-lg ml-lg){\n Div(){\n If(#Single#){\n Div(text-right){\n Button(Page: #this_page#, PageParams: \"appid=#appid#\", Class: btn btn-default fa fa-close mr-sm)\n }\n }.Else{\n Div(row){\n Div(col-sm-12 btn-group){\n ForList(src_apps){\n If(#src_apps_index#==1){\n If(#appid#==0){\n LinkPage(Class: #active_btn# disabled ml-sm, Body: Span(Class:fa fa-trash))\n }.Else{\n LinkPage(Page: #this_page#, Class: btn btn-default ml-sm, PageParams: \"appid=0\", Body: Span(Class:fa fa-trash))\n }\n }\n If(#appid#==#id#){\n LinkPage(Class: #active_btn# disabled ml-sm, Body:\"#id#:#name#\")\n }.Else{\n LinkPage(Page: #this_page#, Class: btn btn-default ml-sm, PageParams: \"appid=#id#\", Body:\"#id#:#name#\")\n }\n }\n }\n }\n }\n }\n Div(panel panel-primary){\n Div(panel-body){\n If(And(#appid# == 1,#ecosystem_id# != 1)){\n Span(Class: text-muted,Body: $@1dashboard_hint$)\n }.Else{\n SetVar(limit,250)\n ForList(tables){\n If(#Table#==@1binaries){\n DBFind(#Table#, src_table).Limit(#limit#).Order({\"id\": \"-1\"}).Where(#where#).Count(items_count).Custom(_name){\n LinkPage(Page: #Page#, PageParams: \"id=#id#,application_id=#appid#\"){#name#}\n }.Custom(_img){\n Image(Src: Binary().ById(#id#), Class: preview)\n }\n }.ElseIf(#Table#==@1languages){\n If(#search#){\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"$or\": [{\"name\": {\"$ilike\": \"#search#\"}}, {\"res\": {\"$ilike\": \"#search#\"}}]})\n }.Else{\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\"})\n }\n DBFind(#Table#, src_table).Limit(#limit#).Columns(#Cols#).Order(\"name\").Where(#where#).Count(items_count)\n }.Else{\n DBFind(#Table#, src_table).Limit(#limit#).Columns(#Cols#).Order(\"name\").Where(#where#).Count(items_count)\n }\n Div(list-group-item clearfix){\n If(#Table#==@1languages){\n Form(){\n Div(input-group){\n Div(input-group-addon){\n LangRes(@1search)\n }\n Input(Name: search, Value: #search#)\n Div(input-group-btn){\n Button(Class: btn btn-primary fa fa-search, Page: #this_page#, PageParams: \"appid=#appid#,search=Val(search),Single=#Single#\")\n If(#search#){\n Button(Class: btn btn-default fa fa-close mr-sm, Page: #this_page#, PageParams: \"appid=#appid#,Single=#Single#\")\n }\n }\n }\n }\n }\n Div(h3 pull-left mt-lg){\n #Name#\n }\n If(#appid#>0){\n Div(pull-right mt-lg){\n If(#Table#==@1contracts){\n LinkPage(Page: #Page#, PageParams: \"create=contract,appId=#appid#\"){\n Em(Class: #create_icon#) $@1create_button$ Em(Class: #create_icon#)\n }\n }.ElseIf(#Table#==@1pages){\n LinkPage(Page: #Page#, PageParams: \"create=page,appId=#appid#\"){\n Em(Class: #create_icon#) $@1create_button$ Em(Class: #create_icon#)\n }\n }.ElseIf(#Table#==@1blocks){\n LinkPage(Page: #Page#, PageParams: \"create=block,appId=#appid#\"){\n Em(Class: #create_icon#) $@1create_button$ Em(Class: #create_icon#)\n }\n }.ElseIf(#Table#==@1tables){\n LinkPage(Page: #Page#, PageParams: \"application_id=#appid#\"){\n Em(Class: #create_icon#) $@1create_button$ Em(Class: #create_icon#)\n }\n }.ElseIf(#Table#==@1app_params){\n LinkPage(Page: #Page#, PageParams: \"application_id=#appid#,create=create\"){\n Em(Class: #create_icon#) $@1create_button$ Em(Class: #create_icon#)\n }\n }.ElseIf(#Table#==@1binaries){\n LinkPage(Page: #Page#, PageParams: \"application_id=#appid#\"){\n Em(Class: #create_icon#) $@1create_button$ Em(Class: #create_icon#)\n }\n }.ElseIf(#Table#==@1languages){\n LinkPage(Page: #Page#){\n Em(Class: #create_icon#) $@1create_button$ Em(Class: #create_icon#)\n }\n }\n }\n }\n Div(row pd){\n Div(col-sm-12){\n If(#Table#==@1binaries){\n If(#items_count#>0){\n Div(items){\n Table(src_table,\"=id,$@1edit_link$=_name,$@1download_link$=data,=_img\")\n }\n }.Else{\n Div(text-muted h4 text-center){\n #Name# $@1not_founded$\n }\n }\n }.Else{\n SetVar(value,).(res,)\n If(#items_count#>0){\n Div(cols){\n ForList(src_table){\n Div(clearfix item){\n Div(pull-right){\n If(#Table#==@1contracts){\n If(#wallet_id#!=0){\n Span($@1binded$, text-success mr-lg)\n }\n LinkPage(Class: text-muted fa fa-history, Page: @1history, PageParams: \"id=#id#,type=contract\")\n LinkPage(Class: text-muted fa fa-cogs, Page: @1properties_edit, PageParams: \"edit_property_id=#id#,type=contract\")\n }\n If(#Table#==@1pages){\n LinkPage(Class: text-muted fa fa-eye, Page: #name#)\n LinkPage(Class: text-muted fa fa-history, Page: @1history, PageParams: \"id=#id#,type=page\")\n LinkPage(Class: text-muted fa fa-cogs, Page: @1properties_edit, PageParams: \"edit_property_id=#id#,type=page\")\n }\n If(#Table#==@1blocks){\n LinkPage(Class: text-muted fa fa-eye, Page: #this_page#, PageParams:\"block=#name#\")\n LinkPage(Class: text-muted fa fa-history, Page: @1history, PageParams: \"id=#id#,type=block\")\n LinkPage(Class: text-muted fa fa-cogs, Page: @1properties_edit, PageParams: \"edit_property_id=#id#,type=block\")\n }\n If(#Table#==@1tables){\n LinkPage(Class: text-muted fa fa-eye, Page: @1table_view, PageParams: \"tabl_id=#id#,table_name=#name#\")\n }\n If(#Table#!=@1languages){\n If(#changer_count#==1){\n If(#appid#==0){\n Button(Class: btn-link text-muted fa fa-recycle, Page: #this_page#, PageParams: \"Restore=1,Table=#Table#,Id=#id#\").Popup(30, \"$@1restore_select$\")\n }.Else{\n If(#ecosystem_id#==1){\n Button(Class: btn-link text-muted fa fa-trash, Page: #this_page#, PageParams: \"appid=#appid#\", Contract: ItemChangeAppId, Params: \"Table=#Table#,Id=#id#,AppId=0\").Alert(\"$@1remove_confirmation$\", \"$@1confirm_button$\", \"$@1cancel$\")\n }.Else{\n Button(Class: btn-link text-muted fa fa-trash, Page: #this_page#, PageParams: \"appid=#appid#\", Contract: @1ItemChangeAppId, Params: \"Table=#Table#,Id=#id#,AppId=0\").Alert(\"$@1remove_confirmation$\", \"$@1confirm_button$\", \"$@1cancel$\")\n\n }\n }\n }\n }\n }\n If(#Table#==@1contracts){\n LinkPage(Page: #Page#, PageParams: \"open=contract,name=#name#,back_page=#this_page#\"){#name#}\n }\n If(#Table#==@1pages){\n LinkPage(Page: #Page#, PageParams: \"open=page,name=#name#,back_page=#this_page#\"){#name#}\n }\n If(#Table#==@1blocks){\n LinkPage(Page: #Page#, PageParams: \"open=block,name=#name#,back_page=#this_page#\"){#name#}\n }\n If(#Table#==@1tables){\n LinkPage(Page: @1table_edit, PageParams: \"tabl_id=#id#,back_page=#this_page#\"){#name#}\n }\n If(#Table#==@1app_params){\n LinkPage(Page: #Page#, PageParams: \"id=#id#,back_page=#this_page#\"){#name#}\n }\n If(#Table#==@1languages){\n LinkPage(Page: @1langres_edit, PageParams: \"lang_id=#id#,back_page=#this_page#\"){#name#}\n }\n If(`#value#`!=\"\"){\n :Div(text-muted){`#value#`}.Style(max-height:1.5em;overflow:hidden;)\n }.ElseIf(`#res#`!=\"\"){\n :Div(text-muted){`#res#`}\n }\n }\n }\n }\n }.Else{\n Div(text-muted h4 text-center){\n #Name# $@1not_founded$\n }\n }\n }\n }\n }\n }\n }\n }\n }\n If(And(#appid# == 1,#ecosystem_id# != 1)){\n }.Else{\n If(#Single#){\n }.Else{\n Div(panel-footer){\n Button(Page: #this_page#, PageParams: \"Single=binaries,appid=#appid#\", Class: btn btn-default mr, Body: $@1binaries$)\n Button(Page: #this_page#, PageParams: \"Single=languages\", Class: btn btn-default, Body: $@1languages$)\n }\n }\n }\n }\n }.Style(\n .pull-right a {\n margin-right:10px;\n }\n .text-muted {\n color: #909fa7!important;\n }\n .cols {\n -moz-column-count: #cols#;\n -webkit-column-count: #cols#;\n column-count: #cols#;\n }\n .item:hover {\n background-color: #fafafa;\n }\n .items tr:hover {\n background-color: #fafafa;\n }\n .preview {\n height:30px;\n }\n )\n }\n}.Else{\n SetTitle($@1dashboard$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "export_download",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(fullscreen){\n SetTitle($@1export$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1payload$)\n }\n\n DBFind(\"@1buffer_data\", src_buffer).Columns(\"value->app_name,value->app_id\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n DBFind(\"@1binaries\", src_binaries).Where({\"name\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\", \"app_id\": \"#buffer_value_app_id#\"}).Custom(app_name){\n Span(#buffer_value_app_name#)\n }\n\n Table(Source: src_binaries, \"$@1application$=app_name,=data\").Style(\n tbody > tr:nth-of-type(odd) {\n background-color: #fafbfc;\n }\n tbody > tr > td {\n word-break: break-all;\n font-weight: 400;\n font-size: 13px;\n color: #666;\n border-top: 1px solid #eee;\n vertical-align: middle;\n }\n tr > *:first-child {\n padding-left:20px;\n }\n tr > *:last-child {\n padding-right:20px;\n text-align:right;\n }\n thead {\n background-color: #eee;\n }\n )\n }\n}.Else{\n SetTitle($@1export$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "export_resources",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1export_resources).(pager_limit, 25)\n Div(content-wrapper){\n If(#page_par#){\n SetVar(res_type, #page_par#)\n }\n\n SetTitle($@1application_export$)\n Div(breadcrumb text-muted){\n $@1application_export_select$\n }\n DBFind(\"@1buffer_data\").Columns(\"value->app_id,value->app_name,value->menu_name,value->menu_id,value->count_menu\").Where({\"key\": \"export\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(buffer)\n Include(@1export_link)\n\n If(#buffer_value_app_id# > 0){\n If(#res_type#==\"pages\"){\n SetVar(this_table, @1pages).(where, {\"app_id\": #buffer_value_app_id#}).(page_par, \"pages\")\n Include(@1pager_header)\n DBFind(\"@1pages\", src).Count(pages_count).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Custom(_cbox){\n Input(Name: cbox, Type: checkbox, Value: true, Disabled: 1)\n }.Order(\"id\")\n }\n If(#res_type#==\"blocks\"){\n SetVar(this_table, @1blocks).(where, {\"app_id\": #buffer_value_app_id#}).(page_par, \"blocks\")\n Include(@1pager_header)\n DBFind(\"@1blocks\", src).Count(pages_count).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Custom(_cbox){\n Input(Name: cbox, Type: checkbox, Value: true, Disabled: 1)\n }.Order(\"id\")\n }\n If(#res_type#==\"menu\"){\n SetVar(this_table, @1menu).(where, {\"id\": {\"$in\": [#buffer_value_menu_id#]}}).(page_par, \"menu\")\n Include(@1pager_header)\n DBFind(\"@1menu\", src).Count(pages_count).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where({\"id\": {\"$in\": [#buffer_value_menu_id#]}, \"ecosystem\": \"#ecosystem_id#\"}).Custom(_cbox){\n Input(Name: cbox, Type: checkbox, Value: true, Disabled: 1)\n }.Order(\"id\")\n }\n If(#res_type#==\"parameters\"){\n SetVar(this_table, @1app_params).(where, {\"app_id\": #buffer_value_app_id#}).(page_par, \"parameters\")\n Include(@1pager_header)\n DBFind(\"@1app_params\", src).Count(pages_count).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Custom(_cbox){\n Input(Name: cbox, Type: checkbox, Value: true, Disabled: 1)\n }.Order(\"id\")\n }\n If(#res_type#==\"languages\"){\n SetVar(this_table, @1languages).(page_par, \"languages\")\n Include(@1pager_header)\n DBFind(\"@1languages\", src).Count(pages_count).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where({\"id\": 0}).Custom(_cbox){\n Input(Name: cbox, Type: checkbox, Value: true, Disabled: 1)\n }.Order(\"id\")\n }\n If(#res_type#==\"contracts\"){\n SetVar(this_table, @1contracts).(where, {\"app_id\": #buffer_value_app_id#}).(page_par, \"contracts\")\n Include(@1pager_header)\n DBFind(\"@1contracts\", src).Count(pages_count).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Custom(_cbox){\n Input(Name: cbox, Type: checkbox, Value: true, Disabled: 1)\n }.Order(\"id\")\n }\n If(#res_type#==\"tables\"){\n SetVar(this_table, @1tables).(where, {\"app_id\": #buffer_value_app_id#}).(page_par, \"tables\")\n Include(@1pager_header)\n DBFind(\"@1tables\", src).Count(pages_count).Limit(#pager_limit#).Order(#sort_name#).Offset(#pager_offset#).Where({\"app_id\": \"#buffer_value_app_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Custom(_cbox){\n Input(Name: cbox, Type: checkbox, Value: true, Disabled: 1)\n }.Order(\"id\")\n }\n }\n Div(row){\n Div(col-md-9){\n Table(src, \"ID=id,$@1name$=name,=_cbox\")\n If(#pages_count# > #pager_limit#){\n Include(@1pager)\n }\n }\n Div(col-md-3){\n Include(@1export_info)\n }\n }\n }.Style(\n tbody > tr:nth-of-type(odd) {\n background-color: #fafbfc;\n }\n tbody > tr > td {\n word-break: break-all;\n font-weight: 400;\n font-size: 13px;\n color: #666;\n border-top: 1px solid #eee;\n vertical-align: middle;\n padding: 8px 20px !important;\n }\n tr > *:first-child {\n padding-left:20px;\n width: 80px;\n }\n tr > *:last-child {\n padding-right:15px;\n width: 50px;\n text-align:right;\n }\n thead {\n background-color: #eee;\n }\n )\n}.Else{\n SetTitle($@1application_export$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "history",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1history)\n If(#view_mode# == \"\"){\n SetVar(view_mode, \"compact\")\n }\n If(#view_mode# == compact){\n SetVar(compact_button, \"bg-gray-lighter\")\n SetVar(full_button, \"bg-gray\")\n }.Else{\n SetVar(full_button, \"bg-gray-lighter\")\n SetVar(compact_button, \"bg-gray\")\n }\n SetVar(element_id, #id#)\n If(#type# == page){\n DBFind(\"@1pages\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1page_history$: #res_name#)\n SetVar(contract_name, \"@1EditPage\")\n GetHistory(Source: src_history, Name: pages, Id: #element_id#)\n }.ElseIf(#type# == block){\n DBFind(\"@1blocks\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1block_history$: #res_name#)\n SetVar(contract_name, \"@1EditBlock\")\n GetHistory(Source: src_history, Name: blocks, Id: #element_id#)\n }.ElseIf(#type# == contract){\n DBFind(\"@1contracts\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1contract_history$: #res_name#)\n SetVar(contract_name, \"@1EditContract\")\n GetHistory(Source: src_history, Name: contracts, Id: #element_id#)\n }.ElseIf(#type# == menu){\n DBFind(\"@1menu\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1menu_history$: #res_name#)\n SetVar(contract_name, \"@1EditMenu\")\n GetHistory(Source: src_history, Name: menu, Id: #element_id#)\n }\n\n Div(mr-lg text-right){\n Button(Page: #this_page#, PageParams: \"view_mode=compact,type=#type#,id=#element_id#\", Class: btn #compact_button# mr-sm, Body: Em(Class: fa fa-bars) $@1compact$)\n Button(Page: #this_page#, PageParams: \"view_mode=full,type=#type#,id=#element_id#\", Class: btn #full_button# mr-sm, Body: Em(Class: fa fa-arrows-alt) $@1full$)\n }.Style(margin-top: -33px; z-index: 1001;)\n\n Div(fullscreen){\n Div(list-group-item ml-lg mr-lg){\n Div(table){\n Div(table__head){\n Div(table__row){\n Div(table__cell){$@1id$}\n Div(table__cell){$@1value$}\n Div(table__cell){}\n }\n }\n Div(table__row){\n Div(table__cell table__cell_collapse){$@1current$}\n Div(table__cell){\n If(#view_mode# == compact){\n VarAsIs(value_as_is, #res_value#)\n Span(#value_as_is#)\n }.ElseIf(#view_mode# == full){\n VarAsIs(value_as_is, #res_value#)\n Code(#value_as_is#)\n }\n }\n Div(table__cell table__cell_collapse){}\n }\n ForList(src_history){\n If(#id#>0){\n Div(table__row){\n Div(table__cell table__cell_collapse){#id#}\n Div(table__cell){\n If(#view_mode# == compact){\n VarAsIs(value_as_is, #value#)\n Span(#value_as_is#)\n }.ElseIf(#view_mode# == full){\n VarAsIs(value_as_is, #value#)\n Code(#value_as_is#)\n }\n }\n Div(table__cell table__cell_collapse){\n Div(text-right){\n Button(Class: btn bg-gray-lighter mr-sm, Body: Em(Class: fa fa-eye), Page: @1history_compare, PageParams: \"type=#type#,element_id=#element_id#,history_id=#id#\")\n Button(Class: btn bg-gray-lighter, Body: Em(Class: fa fa-undo), Page: #this_page#, PageParams: \"type=#type#,id=#element_id#,view_mode=#view_mode#\", Contract: #contract_name#, Params: \"Id=#element_id#,Value=#value_as_is#\").Alert(Text: \"$@1want_restore_history_value$\", ConfirmButton: \"$@1yes$\", CancelButton: \"$@1no$\", Icon: icon-question)\n }.Style(min-width: 120px;)\n }\n }\n }\n }\n }\n }\n }.Style(\n .table {\n display: table;\n }\n\n .table > div:not(.table__body) {\n display: table-row-group;\n }\n\n .table .table__head {\n display: table-header-group;\n }\n\n .table .table__head .table__cell {\n font-weight: 700;\n color: #888;\n background: #fff !important;\n border-left: 0 !important;\n border-right: 0 !important;\n border-top: 0 !important;\n }\n\n .table .table__row {\n display: table-row;\n flex-direction: row;\n flex-wrap: no-wrap;\n }\n\n .table .table__row:nth-child(even) {\n background: #f8f9fc;\n }\n\n .table .table__row .table__cell {\n border-top: solid 1px #eee;\n }\n\n .table .table__cell {\n display: table-cell;\n padding: 8px 10px;\n }\n\n .table .table__cell.table__cell_collapse {\n width: 1px;\n }\n )\n}.Else{\n SetTitle($@1page_history$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "history_compare",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(back_page, @1history)\n\n If(#type# == page){\n DBFind(\"@1pages\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1page_history$: #res_name# [$@1id$: #history_id#])\n SetVar(contract_name, \"@1EditPage\")\n GetHistory(Source: src_history, Name: pages, Id: #element_id#, RollbackId: #history_id#)\n }.ElseIf(#type# == block){\n DBFind(\"@1blocks\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1block_history$: #res_name# [$@1id$: #history_id#])\n SetVar(contract_name, \"@1EditBlock\")\n GetHistory(Source: src_history, Name: blocks, Id: #element_id#, RollbackId: #history_id#)\n }.ElseIf(#type# == contract){\n DBFind(\"@1contracts\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1contract_history$: #res_name# [$@1id$: #history_id#])\n SetVar(contract_name, \"@1EditContract\")\n GetHistory(Source: src_history, Name: contracts, Id: #element_id#, RollbackId: #history_id#)\n }.ElseIf(#type# == menu){\n DBFind(\"@1menu\").Where({\"id\": \"#element_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Limit(1).Vars(res)\n SetTitle($@1menu_history$: #res_name# [$@1id$: #history_id#])\n SetVar(contract_name, \"@1EditMenu\")\n GetHistory(Source: src_history, Name: menu, Id: #element_id#, RollbackId: #history_id#)\n }\n\n Div(fullscreen){\n Div(list-group-item ml-lg mr-lg){\n Div(table){\n Div(table__head){\n Div(table__row){\n Div(table__cell){$@1current_value$}\n Div(table__cell){$@1history_value$}\n }\n }\n ForList(src_history){\n Div(table__row){\n Div(table__cell){\n VarAsIs(value_as_is, #res_value#)\n Code(#value_as_is#)\n }\n Div(table__cell table__cell_collapse){\n VarAsIs(value_as_is, #value#)\n Code(#value_as_is#)\n }\n }\n }\n }\n Div(text-center){\n Button(Page: #back_page#, PageParams: \"type=#type#,id=#element_id#\", Class: btn bg-gray-lighter, Body: $@1back$)\n Button(Contract: #contract_name#, Params: \"Id=#element_id#,Value=#value_as_is#\", Page: #back_page#, PageParams: \"type=#type#,id=#element_id#\", Class: btn btn-primary, Body: $@1restore$).Alert(Text: \"$@1want_restore_history_value$\", ConfirmButton: \"$@1yes$\", CancelButton: \"$@1no$\", Icon: icon-question)\n }\n }\n }.Style(\n .table {\n display: table;\n margin-bottom: 10px;\n }\n\n .table > div:not(.table__body) {\n display: table-row-group;\n }\n\n .table .table__head {\n display: table-header-group;\n }\n\n .table .table__head .table__cell {\n font-weight: 700;\n color: #888;\n background: #fff !important;\n border-left: 0 !important;\n border-right: 0 !important;\n border-top: 0 !important;\n }\n\n .table .table__row {\n display: table-row;\n flex-direction: row;\n flex-wrap: no-wrap;\n }\n\n .table .table__row:nth-child(odd) {\n background: #f8f9fc;\n }\n\n .table .table__row .table__cell {\n border-top: solid 1px #eee;\n width: 50%;\n }\n\n .table .table__cell {\n display: table-cell;\n padding: 8px 10px;\n }\n\n .table .table__cell.table__cell_collapse {\n width: 1px;\n }\n )\n}.Else{\n SetTitle($@1page_history$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "import_app",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "Div(content-wrapper){\n DBFind(\"@1buffer_data\").Columns(\"id,value->name,value->data\").Where({\"key\": \"import\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(import)\n DBFind(\"@1buffer_data\").Columns(\"value->app_name,value->pages,value->pages_count,value->blocks,value->blocks_count,value->menu,value->menu_count,value->parameters,value->parameters_count,value->languages,value->languages_count,value->contracts,value->contracts_count,value->tables,value->tables_count\").Where({\"key\": \"import_info\", \"account\": \"#account_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(info)\n\n SetTitle(\"$@1import$ - #info_value_app_name#\")\n Data(data_info, \"DataName,DataCount,DataInfo\"){\n Pages,\"#info_value_pages_count#\",\"#info_value_pages#\"\n Blocks,\"#info_value_blocks_count#\",\"#info_value_blocks#\"\n Menu,\"#info_value_menu_count#\",\"#info_value_menu#\"\n Parameters,\"#info_value_parameters_count#\",\"#info_value_parameters#\"\n Language resources,\"#info_value_languages_count#\",\"#info_value_languages#\"\n Contracts,\"#info_value_contracts_count#\",\"#info_value_contracts#\"\n Tables,\"#info_value_tables_count#\",\"#info_value_tables#\"\n }\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1import_data$)\n }\n\n Div(panel panel-primary){\n ForList(data_info){\n Div(list-group-item){\n Div(row){\n Div(col-md-10 mc-sm text-left){\n Span(Class: text-bold, Body: \"#DataName#\")\n }\n Div(col-md-2 mc-sm text-right){\n If(#DataCount# > 0){\n Span(Class: text-bold, Body: \"(#DataCount#)\")\n }.Else{\n Span(Class: text-muted, Body: \"(0)\")\n }\n }\n }\n Div(row){\n Div(col-md-12 mc-sm text-left){\n If(#DataCount# > 0){\n Span(Class: h6, Body: \"#DataInfo#\")\n }.Else{\n Span(Class: text-muted h6, Body: $@1nothing_selected$)\n }\n }\n }\n }\n }\n If(#import_id# > 0){\n Div(list-group-item text-right){\n VarAsIs(imp_data, \"#import_value_data#\")\n Button(Body: $@1import$, Class: btn btn-primary, Page: @1apps_list).CompositeContract(@1Import, \"#imp_data#\")\n }\n }\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "import_upload",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "Div(content-wrapper){\n DBFind(\"@1roles\").Where({\"ecosystem\": \"#ecosystem_id#\"}).Count(roles_count)\n If(Or(#ecosystem_id#==1,#roles_count#>0)){\n SetTitle($@1import$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1payload_select$)\n }\n Form(panel panel-primary){\n Div(list-group-item){\n Input(Name: Data, Type: file)\n }\n Div(list-group-item text-right){\n Button(Body: $@1load$, Class: btn btn-primary, Contract: @1ImportUpload, Page: @1import_app)\n }\n }\n }.Else{\n Div(panel panel-primary){\n Div(list-group-item text-center){\n P(Class: h3 m0 text-bold, Body: $@1installing_platform_apps$)\n }\n Div(list-group-item){\n Span(Class: h4, Body: $@1installing_text$)\n }\n Div(panel-footer text-right clearfix){\n Button(Body: $@1platform_apps_install$, Class: btn btn-primary, Page: @1apps_list).CompositeContract(@1PlatformAppsInstall, \"[{}]\").CompositeContract(@1RolesInstall, \"[{}]\")\n }\n }\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "langres_add",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n If(#name#){}.Else{\n SetVar(name,)\n }\n Div(content-wrapper){\n SetTitle($@1lang_res$)\n Div(Class: breadcrumb){\n LinkPage($@1lang_res$, @1app_langres)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span(Class: text-muted, Body: $@1new_langres$)\n }\n\n Form(panel panel-default){\n Div(panel-body){\n Div(row){\n Div(col-md-12){\n Label($@1name$)\n Input(Name:Name, Value:#name#)\n }\n }\n Div(row text-muted){\n Div(col-md-1 mt-lg){\n Label(){$@1localization$}\n }\n Div(col-md-10 mt-lg){\n Label(){$@1value$}\n }\n Div(col-md-1 mt-lg){\n Label(){$@1action$}\n }\n }\n If(#cs#==\"\"){\n SetVar(cs,0)\n }\n If(#del# == 1){\n SetVar(cs,Calculate(#cs# - 1))\n }.Else{\n SetVar(cs,Calculate(#cs# + 1))\n }\n Range(params_range, 0, #cs#)\n ForList(Source: params_range){\n Div(row mt-sm){\n Div(col-md-1){\n Input(Name:LocaleArr)\n }.Style(input {padding: 6px;text-align:center;})\n Div(col-md-10){\n Input(Name:ValueArr)\n }\n Div(col-md-1){\n If(And(#cs#==#params_range_index#,#cs#>1)){\n Button(Class:fa fa-trash btn btn-default, PageParams: \"cs=#cs#,del=1\", Page: @1langres_add)\n }\n }\n }\n }\n Div(row){\n Div(col-md-12 mt-lg){\n LinkPage(Body:$@1locale_add$, Page: @1langres_add, PageParams:\"cs=#cs#\")\n }\n }\n }\n Div(panel-footer text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Contract: @1NewLangJoint, Page: @1app_langres)\n }\n }\n }\n}.Else{\n SetTitle($@1lang_res$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "langres_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page,\"@1langres_edit\")\n If(#back_page#==\"\"){\n SetVar(back_page,\"@1app_langres\")\n }\n Div(content-wrapper){\n SetTitle($@1lang_res$)\n Div(Class: breadcrumb){\n LinkPage($@1lang_res$, @1app_langres)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span(Class: text-muted, Body: $@1editing$)\n }\n\n Form(panel panel-default){\n Div(panel-body){\n DBFind(\"@1languages\", src_leng).Vars(pre).Where({\"id\": \"#lang_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n Div(row){\n Div(col-md-12){\n Label($@1name$)\n Input(Name: LangName, Disabled: \"true\", Value: #pre_name#)\n }\n }\n Div(row){\n Div(col-md-1 mt-lg){\n Label(Class: text-muted, Body: $@1localization$)\n }\n Div(col-md-9 mt-lg){\n Label(Class: text-muted, Body: $@1value$)\n }\n Div(col-md-2 mt-lg){\n Label(Class: text-muted, Body: $@1action$)\n }\n }\n\n JsonToSource(pv, #pre_res#)\n ForList(Source: pv, Index:s_ind){\n SetVar(max_sec, #s_ind#)\n }\n If(#cs#==\"\"){\n SetVar(cs, #max_sec#)\n }\n If(Or(#del_flag#==1,#del_data#>0)){\n SetVar(cs, Calculate(Exp:#cs#-1, Type: int))\n }\n\n SetVar(next_sec, Calculate(Exp:#cs#+1, Type: int))\n SetVar(data_sec, Calculate(Exp:#cs#-#max_sec#, Type: int))\n\n ForList(Source: pv, Index:s_ind){\n If(#s_ind#>#cs#){\n }.Else{\n Div(row){\n Div(col-md-1 mt-sm){\n Input(Name: LocaleArr, Value: `#key#`)\n }.Style(input {padding: 6px;text-align:center;})\n Div(col-md-9 mt-sm){\n Input(Name: ValueArr, Value: `#value#`)\n }\n Div(col-md-2 mt-sm){\n If(And(#s_ind#>1,#s_ind#==#cs#)){\n Button(Body: Em(Class: fa fa-trash), Class: btn btn-default, PageParams: \"lang_id=#lang_id#,cs=#cs#,del_data=#s_ind#\", Page: #this_page#)\n }\n }\n }\n }\n }\n Range(params_range, #max_sec#, #cs#)\n ForList(Source: params_range, Index:s_ind){\n Div(row){\n Div(col-md-1 mt-sm){\n Input(Name:LocaleArr)\n }.Style(input {padding: 6px;text-align:center;})\n Div(col-md-9 mt-sm){\n Input(Name:ValueArr)\n }\n Div(col-md-2 mt-sm){\n If(#s_ind#==#data_sec#){\n Button(Body: Em(Class: fa fa-trash), Class: btn btn-default, PageParams: \"lang_id=#lang_id#,cs=#cs#,del_flag=1\", Page: #this_page#)\n }\n }\n }\n }\n Div(row){\n Div(col-md-12 mt-lg){\n LinkPage(Body: $@1locale_add$, Page: @1langres_edit, PageParams: \"lang_id=#lang_id#,cs=#next_sec#\")\n }\n }\n }\n Div(panel-footer text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Contract: @1EditLangJoint, Params: \"Id=#lang_id#\", Page: #back_page#)\n }\n }\n }\n}.Else{\n SetTitle($@1lang_res$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "menus_list",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1menus_list).(this_table, @1menu)\n Include(@1pager_header)\n\n SetTitle(\"$@1menu$\")\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1menu_section$\"))\n AddToolButton(Title: $@1create$, Page: editor, Icon: icon-plus, PageParams: \"create=menu,appId=0\")\n\n If(#search#){\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"name\": {\"$ilike\": \"#search#\"}})\n }.Else{\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\"})\n }\n\n Div(list-group-item ml-lg mr-lg pt-lg){\n SetVar(search_name, LangRes(@1name))\n Include(@1search)\n }\n\n DBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(action){\n Span(Class: pull-right){\n LinkPage(Body: Em(Class: fa fa-history), Class: text-primary h4 mh-sm, Page: @1history, PageParams: \"id=#id#,type=menu\")\n LinkPage(Body: Em(Class: fa fa-cogs), Class: text-primary h4, Page: @1properties_edit, PageParams: \"edit_property_id=#id#,type=menu\")\n }\n }.Custom(_name){\n LinkPage(Page: editor, Class: text-primary h5, Body: \"#name#\", PageParams: \"open=menu,name=#name#\")\n }.Count(count)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n If(#count# > 0){\n Table(src, \"$@1name$=_name,$@1header$=title,$@1conditions$=conditions,=action\")\n }.Else{\n Div(Class: text-center h4 text-muted, Body: \"$@1menu$ $@1not_founded$\")\n }\n }.Style(\n margin-top:-15px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1menu$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "params_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n If(#back_page#==\"\"){\n SetVar(back_page, @1params_list)\n }\n Div(content-wrapper){\n If(#stylesheet# == stylesheet){\n DBFind(\"@1parameters\", src_params).Where({\"name\": \"#stylesheet#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(param)\n }.Else{\n If(#id#>0){\n DBFind(\"@1parameters\", src_params).Where({\"id\": \"#id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(param)\n }.Else{\n SetVar(param_name, $@1new_parameter$)\n }\n }\n\n SetTitle($@1ecosystem_parameters$)\n Div(Class: breadcrumb){\n LinkPage($@1ecosystem_parameters$, @1params_list)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span(Class: text-muted, Body: #param_name#)\n }\n Form(){\n Div(form-group){\n Label($@1name$)\n If(#param_id#>0){\n Input(Name: name, Value: #param_name#, Disabled: \"true\")\n }.Else{\n Input(Name: name)\n }\n }\n Div(form-group){\n If(#param_id#>0){\n Input(Type: textarea, Name: value, Value: \"#param_value#\").Style(height: 500px !important;)\n }.Else{\n Input(Type: textarea, Name: value).Style(height: 500px !important;)\n }\n }\n Div(form-group){\n Label($@1change_conditions$)\n If(#param_id#>0){\n Input(Name: conditions, Value: #param_conditions#)\n }.Else{\n Input(Name: conditions)\n }\n }\n Div(form-group text-right){\n If(#param_id#>0){\n DBFind(\"@1applications\").Where({\"ecosystem\": 1, \"name\": \"Basic\"}).Columns(\"name,id\").Vars(application)\n SetVar(tid, AppParam(App: #application_id#, Name: voting_template_ecosysparams, Ecosystem: 1))\n If(#tid# > 0){\n DBFind(\"@1voting_templates\").Where({\"ecosystem\": \"#ecosystem_id#\", \"id\": \"#tid#\"}).Columns(\"subject->voters\").Vars(template)\n }\n If(And(#template_subject_voters#>0,#template_subject_voters#==#role_id#)){\n Button(Class: btn btn-primary, Body: $@1voting$, Contract: @1VotingRunEditEcosysParam, Params: \"Id=#param_id#,Value=Val(value)\", Page: @1voting_list)\n }.Else{\n Button(Class: btn btn-primary, Body: $@1save$, Contract: @1EditParameter, Params: \"Id=#param_id#,Value=Val(value),Conditions=Val(conditions)\", Page: #back_page#)\n }\n }.Else{\n Button(Class: btn btn-primary, Body: $@1save$, Contract: @1NewParameter, Params: \"Name=Val(name),Value=Val(value),Conditions=Val(conditions)\", Page: #back_page#)\n }\n }\n }\n }\n}.Else{\n SetTitle($@1ecosystem_parameters$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "params_list",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1params_list).(this_table, @1parameters)\n Include(@1pager_header)\n\n SetTitle(\"$@1ecosystem_parameters$\")\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1sysparams_section$\"))\n AddToolButton(Title: $@1style_manage$, Page: @1params_edit, Icon: icon-picture, PageParams:\"stylesheet=stylesheet\")\n AddToolButton(Title: $@1create$, Page: @1params_edit, Icon: icon-plus)\n\n If(#search#){\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"name\": {\"$ilike\": \"#search#\"}})\n }.Else{\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\"})\n }\n\n Div(list-group-item ml-lg mr-lg pt-lg){\n SetVar(search_name, LangRes(@1name))\n Include(@1search)\n }\n\n DBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_name){\n LinkPage(Page: @1params_edit, Class: text-primary h5, Body: \"#name#\", PageParams: \"id=#id#\")\n }.Count(count)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n If(#count# > 0){\n Table(src, \"$@1name$=_name,$@1value$=value,$@1conditions$=conditions\")\n }.Else{\n Div(Class: text-center h4 text-muted, Body: \"$@1ecosystem_parameters$ $@1not_founded$\")\n }\n }.Style(\n margin-top:-15px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1ecosystem_parameters$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "properties_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(Class: content-wrapper){\n SetTitle($@1edit_properties$)\n Div(breadcrumb){\n Div(){\n If(#type# == page){\n LinkPage($@1pages$, @1app_pages)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span($@1edit_page$, text-muted)\n DBFind(\"@1pages\", src_page).Where({\"id\": \"#edit_property_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(item)\n DBFind(\"@1menu\", src_menus).Where({\"ecosystem\": \"#ecosystem_id#\"})\n }\n If(#type# == contract){\n DBFind(\"@1contracts\", src_contract).Columns(\"id,name,value,wallet_id,token_id,conditions,app_id\").Where({\"id\": \"#edit_property_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(item)\n LinkPage($@1contracts$, @1app_contracts)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span($@1edit_contract$, text-muted)\n }\n If(#type# == block){\n LinkPage($@1blocks$, @1app_blocks)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span($@1edit_block$, text-muted)\n DBFind(\"@1blocks\", src_block).Where({\"id\": \"#edit_property_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(item)\n }\n If(#type# == menu){\n LinkPage($@1menu$, @1menus_list)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span($@1edit_menu$, text-muted)\n DBFind(\"@1menu\", src_menu).Where({\"id\": \"#edit_property_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Vars(item)\n }\n }\n }\n Form(){\n Div(form-group){\n Label($@1name$)\n Input(Name: Name, Value: #item_name#, Disabled: \"true\")\n }\n If(#type# == page){\n Div(form-group){\n Label($@1menu$)\n Select(Name: Menu, Source: src_menus, NameColumn: name, ValueColumn: name, Value: #item_menu#)\n }\n Div(form-group){\n Label($@1conditions$)\n Input(Name: Conditions, Value: #item_conditions#)\n }\n Div(form-group){\n Label($@1page_validate_count$)\n Input(Name: ValidateCount, Type: number, Value: #item_validate_count#)\n }\n Div(form-group){\n Label($@1page_validate_mode$)\n Input(Name: ValidateMode, Type: number, Value: #item_validate_mode#)\n }\n Div(form-group text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Page: @1app_pages, Contract: @1EditPage, Params: \"Menu=Val(Menu),Conditions=Val(Conditions),Id=#edit_property_id#\")\n }\n }\n If(#type# == contract){\n Div(){\n Div(form-group){\n Label($@1bind_wallet$)\n Div(row){\n Div(col-md-12){\n If(#item_wallet_id# == 0){\n Input(Name: WalletV, Value: 0, Disabled: \"true\")\n }.Else{\n SetVar(account_key, AddressToId(#account_id#))\n If(#item_wallet_id#==#account_key#){\n Div(input-group){\n SetVar(address_item_wallet_id, Address(#item_wallet_id#))\n Input(Name: WalletV, Value: #address_item_wallet_id#, Disabled: \"true\")\n Div(input-group-btn){\n Button(Body: $@1unbind$, Class: btn bg-gray-lighter buttons, Contract: @1UnbindWallet, Params: \"Id=#edit_property_id#\", Page: @1properties_edit, PageParams: \"edit_property_id=#edit_property_id#,type=#type#\").Alert(Text: $@1want_unbind_contract$, ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\n }\n }\n }.Else{\n SetVar(address_item_wallet_id, Address(#item_wallet_id#))\n Input(Name: WalletV, Value: #address_item_wallet_id#, Disabled: \"true\")\n }\n }\n }\n }\n }\n Div(form-group){\n Div(row){\n Div(col-md-12){\n Span(Body: \"$@1contract_binding_another_user_desc$\", Class: m0 text-muted)\n Div(input-group){\n Input(Name: Wallet, Placeholder: \"xxxx-xxxx-xxxx-xxxx-xxxx\")\n Div(input-group-btn){\n Button(Body: $@1bind$, Class: btn bg-gray-lighter buttons, Contract: @1BindWallet, Params: \"Id=#edit_property_id#,WalletId=Val(Wallet)\", Page: @1properties_edit, PageParams: \"edit_property_id=#edit_property_id#,type=#type#\").Alert(Text: $@1want_bind_contract$, ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\n }\n }\n }\n }\n }\n Div(form-group){\n Label($@1conditions$)\n Input(Name: Conditions, Value: #item_conditions#)\n }\n Div(form-group text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Page: @1app_contracts, Contract: @1EditContract, Params: \"Conditions=Val(Conditions),WalletId=Val(Wallet),Id=#edit_property_id#\")\n }\n }.Style(\n .buttons {\n border: 1px solid #dde6e9;\n }\n )\n }\n If(#type# == block){\n Div(form-group){\n Label($@1conditions$)\n Input(Name: Conditions, Value: #item_conditions#)\n }\n Div(form-group text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Page: @1app_blocks, Contract: @1EditBlock, Params: \"Conditions=Val(Conditions),Id=#edit_property_id#\")\n }\n }\n If(#type# == menu){\n Div(form-group){\n Label($@1menu_title$)\n Input(Name: Title, Value: #item_title#)\n }\n Div(form-group){\n Label($@1conditions$)\n Input(Name: Conditions, Value: #item_conditions#)\n }\n Div(form-group text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Page: @1menus_list, Contract: @1EditMenu, Params: \"Conditions=Val(Conditions),Id=#edit_property_id#,NameTitle=Val(Title)\")\n }\n }\n }\n }\n}.Else{\n SetTitle($@1edit_properties$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "section_access",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1sections\").Where({\"ecosystem\": \"#ecosystem_id#\", \"id\": \"#id#\"}).Vars(section)\n DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(system_app)\n\n Div(content-wrapper){\n SetTitle($@1section_access_rights$)\n Div(Class: breadcrumb){\n LinkPage($@1sections$, @1section_list)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span(Class: text-muted, Body: #section_title#)\n }\n Form(){\n Div(form-group){\n Label($@1roles_access$)\n DBFind(\"@1roles\", src_roles).Where({\"ecosystem\": \"#ecosystem_id#\", \"deleted\": 0}).Columns(\"id,role_name\").Order(\"id\")\n Div(input-group mb-sm){\n Select(Name: access_rid, Source:src_roles, NameColumn:role_name, ValueColumn: id)\n Div(input-group-btn){\n Button(Class: btn btn-primary fa fa-plus, Page: section_access, PageParams:\"id=#section_id#\", Contract: @1SectionRoles, Params:\"Id=#section_id#,Rid=Val(access_rid),Operation=add\")\n }\n }\n DBFind(\"@1sections\").Where({\"ecosystem\": \"#ecosystem_id#\", \"id\": \"#section_id#\"}).Columns(\"roles_access\").Vars(json)\n If(#json_roles_access#==\"[]\"){\n Span(Body: $@1available_sections$, Class: m0 text-muted)\n }.Else{\n DBFind(\"@1roles\", src_roles_access).Where({\"ecosystem\": \"#ecosystem_id#\", \"id\": {\"$in\": #json_roles_access#}}).Columns(\"id,role_name\")\n ForList(src_roles_access){\n SetVar(role_admin, AppParam(App: #system_app_id#, Name: \"role_admin\"))\n If(#role_id# == #role_admin#){\n Button(Class: btn btn-info mr-sm mb-sm, Page: @1section_access, PageParams:\"id=#section_id#\", Contract: @1SectionRoles, Params:\"Id=#section_id#,Rid=#id#,Operation=remove\", Body: Span(Class: fa fa-remove) #role_name#)\n }.Else{\n Button(Class: btn btn-default mr-sm mb-sm, Page: @1section_access, PageParams:\"id=#section_id#\", Contract: @1SectionRoles, Params:\"Id=#section_id#,Rid=#id#,Operation=remove\", Body: Span(Class: fa fa-remove) #role_name#)\n }\n }\n }\n }\n }\n }\n}.Else{\n SetTitle($@1section_access_rights$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "section_add",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(content-wrapper){\n SetTitle($@1section_add$)\n Div(breadcrumb){\n LinkPage($@1sections$, @1section_list)\n Span(/, mh)\n Span(Class: text-muted, Body: $@1new_section$)\n }\n\n Form(){\n Div(form-group){\n Label($@1title$)\n Input(Name: Title)\n }\n Div(form-group){\n Data(src_status, \"name,value\"){\n $@1hidden_section$,0\n $@1regular_section$,1\n $@1main_section$,2\n }\n Label($@1status$)\n Select(Name: Status, Value: #section_status#, Source: src_status, NameColumn: \"name\", ValueColumn: \"value\")\n Span(Body: $@1main_section_warning$, Class: m0 text-muted)\n }\n Div(form-group){\n Label($@1link$)\n Input(Name: Urlname)\n }\n Div(form-group){\n Label($@1section_main_page$)\n Input(Name: Page)\n }\n Div(form-group){\n Button(Class: btn btn-primary, Body: $@1save$, Contract: @1NewSection, Page: @1section_list)\n }\n }\n }\n}.Else{\n SetTitle($@1section_add$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "section_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n DBFind(\"@1sections\").Where({\"ecosystem\": \"#ecosystem_id#\", \"id\": \"#id#\"}).Vars(section)\n Div(content-wrapper){\n SetTitle($@1section_edit$)\n Div(breadcrumb){\n LinkPage($@1sections$, @1section_list)\n Span(/, mh)\n Span(Class: text-muted, Body: #section_title#)\n }\n\n Form(){\n Div(form-group){\n Label($@1title$)\n Input(Name: Title, Value: #section_title#)\n }\n Div(form-group){\n Data(src_status, \"name,value\"){\n $@1hidden_section$,0\n $@1regular_section$,1\n $@1main_section$,2\n }\n Label($@1status$)\n If(#section_status#==2){\n Input(Name: placeholder, Value: \"$@1main_section$\", Disabled: \"true\")\n Span(Body: $@1main_section_warning$, Class: m0 text-muted)\n }.Else{\n Select(Name: Status, Value: #section_status#, Source: src_status, NameColumn: \"name\", ValueColumn: \"value\")\n }\n }\n Div(form-group){\n Label($@1link$)\n Input(Name: Urlname, Value: #section_urlname#)\n }\n Div(form-group){\n Label($@1section_main_page$)\n Input(Name: Page, Value: #section_page#)\n }\n Div(form-group){\n If(#section_status#==2){\n Button(Class: btn btn-primary, Body: $@1save$, Contract: @1EditSection, Page: @1section_list, Params: \"Id=#section_id#,Status=#section_status#\")\n }.Else{\n Button(Class: btn btn-primary, Body: $@1save$, Contract: @1EditSection, Page: @1section_list, Params: \"Id=#section_id#\")\n }\n }\n }\n }\n}.Else{\n SetTitle($@1section_edit$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "section_list",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n SetVar(this_page, @1section_list).(this_table, @1sections)\n Include(@1pager_header)\n\n SetTitle(\"$@1sections$\")\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1sections_manage_page$\"))\n AddToolButton(Title: $@1create$, Page: @1section_add, Icon: icon-plus)\n\n If(#search#){\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\", \"title\": {\"$ilike\": \"#search#\"}})\n }.Else{\n SetVar(where, {\"ecosystem\": \"#ecosystem_id#\"})\n }\n\n Div(list-group-item ml-lg mr-lg pt-lg){\n SetVar(search_name, LangRes(@1title))\n Include(@1search)\n }\n\n DBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(custom_status){\n If(#status# == 0){\n $@1hidden_section$\n }\n If(#status# == 1){\n $@1regular_section$\n }\n If(#status# == 2){\n $@1main_section$\n }\n }.Custom(custom_order){\n Button(Body: Em(Class: fa fa-arrow-down), Class: btn-xs btn-link, Page: @1section_list, Contract: @1SectionLevelDown, Params: \"Id=#id#\")\n Button(Body: Em(Class: fa fa-arrow-up), Class: btn-xs btn-link, Page: @1section_list, Contract: @1SectionLevelUp, Params: \"Id=#id#\")\n }.Custom(custom_action){\n Span(Class: pull-right){\n LinkPage(Body: Em(Class: fa fa-cogs), Class: text-primary h4, Page: @1section_access, PageParams: \"id=#id#\")\n }\n }.Custom(_title){\n LinkPage(Page: @1section_edit, Class: text-primary h5, Body: \"#title#\", PageParams: \"id=#id#\")\n }.Count(count)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n If(#count# > 0){\n Table(src, \"$@1title$=_title,$@1link$=urlname,$@1section_page$=page,$@1status$=custom_status,=custom_order,=custom_action\")\n }.Else{\n Div(Class: text-center h4 text-muted, Body: \"$@1sections$ $@1not_founded$\")\n }\n }.Style(\n margin-top:-15px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1sections$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "table_create",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(content-wrapper){\n SetTitle($@1table_create$)\n Div(breadcrumb){\n Div(){\n LinkPage($@1tables$, @1app_tables)\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span($@1table_create$, text-muted)\n }\n }\n\n Data(src_type,\"type,name\"){\n text,\"Text\"\n number,\"Number\"\n varchar,\"Varchar\"\n datetime,\"Date/Time\"\n money,\"Money\"\n double,\"Double\"\n character,\"Character\"\n json,\"JSON\"\n }\n Form(){\n Div(panel panel-default){\n Div(panel-body){\n Div(row){\n Div(col-sm-12){\n Label($@1name$)\n Input(Name:Name)\n }\n }\n Div(row mt-lg){\n Div(col-xs-4 col-md-4){\n Label(Class: text-muted, Body: $@1columns$)\n Input(Name:disinp, Disabled: true, Value: id)\n }\n Div(col-xs-6 col-md-7){\n Label(Class: text-muted, Body: $@1type$)\n Input(Name: disinp, Disabled: true, Value: Number)\n }\n Div(col-xs-2 col-md-1){\n Label(Class: text-muted, Body: $@1actions$)\n }\n }\n If(#cs#==\"\"){\n SetVar(cs, Calculate( Exp: 0, Type: int))\n }\n If(#del# == 1){\n SetVar(cs, Calculate( Exp: #cs# - 1, Type: int))\n }.Else{\n SetVar(cs, Calculate( Exp: #cs# + 1, Type: int))\n }\n Range(params_range, 0, #cs#)\n ForList(Source: params_range){\n Div(row mt-sm){\n Div(col-xs-4 col-md-4){\n Input(Name:ColumnsArr)\n }\n Div(col-xs-6 col-md-7){\n Select(Name: TypesArr, Source: src_type, NameColumn: name, ValueColumn: type)\n }\n Div(col-xs-2 col-md-1){\n If(And(#cs#==#params_range_index#, #cs# > 1)){\n Button(Body: Em(Class: fa fa-trash), Class: btn btn-default, PageParams: \"cs=#cs#,del=1,application_id=#application_id#\", Page: @1table_create)\n }\n }\n }\n }\n }\n Div(panel-footer text-right){\n Button(Body: $@1column_add$, Class: btn btn-primary, Page: @1table_create, PageParams: \"cs=#cs#,application_id=#application_id#\")\n }\n }\n Div(row){\n Div(col-xs-6 col-sm-6 col-md-6){\n Div(panel panel-default){\n Div(panel-heading, Body: $@1write_permissions$)\n Div(panel-body){\n Div(form-group){\n Label($@1insert$)\n Input(Name: InsertPerm, Value: ContractConditions(\"MainCondition\"))\n }\n Div(form-group){\n Label($@1updating$)\n Input(Name: UpdatePerm, Value: ContractConditions(\"MainCondition\"))\n }\n Div(form-group){\n Label($@1new_column$)\n Input(Name: NewColumnPerm, Value: ContractConditions(\"MainCondition\"))\n }\n Div(form-group){\n Label($@1reading$)\n Input(Name: ReadPerm, Value: \"true\")\n }\n }\n Div(panel-footer text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Contract: @1NewTableJoint, Page: @1app_tables, Params: \"ApplicationId=#application_id#\")\n }\n }\n }\n }\n }\n }\n}.Else{\n SetTitle($@1table_create$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "table_edit",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n Div(content-wrapper){\n DBFind(\"@1tables\").Columns(\"id,name,columns,conditions,permissions->insert,permissions->update,permissions->new_column,permissions->read\").Vars(pre).Where({\"id\": \"#tabl_id#\", \"ecosystem\": \"#ecosystem_id#\"})\n\n SetTitle($@1tables$)\n Div(breadcrumb){\n Div(){\n LinkPage($@1tables$, @1app_tables)\n Span(/, mh)\n LinkPage(#pre_name#, @1table_view,, \"tabl_id=#tabl_id#\")\n Span(/, mh)\n Span($@1edit_table$, text-muted)\n }\n }\n\n Form(){\n Div(panel panel-default){\n Div(panel-body){\n Div(row){\n Div(col-xs-3 col-md-3 h4){\n Label($@1name$)\n }\n Div(col-xs-2 col-md-2 h4){\n Label($@1type$)\n }\n Div(col-xs-5 col-md-5 h4){\n Label($@1conditions$)\n }\n Div(col-xs-2 col-md-2 text-right){\n }\n }\n JsonToSource(src_columns, #pre_columns#)\n ForList(src_columns){\n SetVar(name_column,#key#)\n Div(list-group-item){\n Div(row){\n Div(col-xs-3 col-md-3 h5){\n Span(#key#)\n }\n Div(col-xs-2 col-md-2 h5){\n SetVar(col_type,GetColumnType(#pre_name#, #key#))\n If(#col_type# == text){\n Span(\"Text\")\n }.ElseIf(#col_type# == number){\n Span(\"Number\")\n }.ElseIf(#col_type# == money){\n Span(\"Money\")\n }.ElseIf(#col_type# == varchar){\n Span(\"Varchar\")\n }.ElseIf(#col_type# == datetime){\n Span(\"Date/Time\")\n }.ElseIf(#col_type# == double){\n Span(\"Double\")\n }.ElseIf(#col_type# == character){\n Span(\"Character\")\n }.ElseIf(#col_type# == json){\n Span(\"JSON\")\n }.ElseIf(#col_type# == bytea){\n Span(\"Binary Data\")\n }.ElseIf(#col_type# == uuid){\n Span(\"UUID\")\n }\n }\n Div(col-xs-5 col-md-5){\n SetVar(isObject,0)\n JsonToSource(condition,#value#)\n ForList(condition){\n SetVar(isObject,1)\n If(#key#==read){\n Div(){\n Span($@1reading$:,text-muted)\n Span(#value#,ml-sm)\n }\n }.ElseIf(#key#==update){\n Div(){\n Span($@1updating$:,text-muted)\n Span(#value#,ml-sm)\n }\n }\n }\n If(#isObject#==0){\n Div(){\n Span($@1reading$:,text-muted)\n Span(true,ml-sm)\n }\n Div(){\n Span($@1updating$:,text-muted)\n Span(#value#,ml-sm)\n }\n }\n }\n Div(col-xs-2 col-md-2 text-right){\n Button(Body: $@1edit$, Class: btn btn-primary, Page: @1column_edit, PageParams: \"name_column=#name_column#,tabl_id=#tabl_id#\")\n }\n }\n }\n }\n }\n Div(panel-footer text-right){\n Button(Body: $@1column_add$, Class: btn btn-primary, Page: @1column_add, PageParams: \"next_table_name=#pre_name#,tabl_id=#tabl_id#\")\n }\n }\n Div(row){\n Div(col-xs-6 col-md-6){\n Div(panel panel-default){\n Div(panel-heading){$@1write_permissions$}\n Div(panel-body){\n Div(form-group){\n Label($@1insert$)\n Input(Name: InsertPerm, Type: text, Value: #pre_permissions_insert#)\n }\n Div(form-group){\n Label($@1updating$)\n Input(Name: UpdatePerm, Type: text, Value: #pre_permissions_update#)\n }\n Div(form-group){\n Label($@1new_column$)\n Input(Name: NewColumnPerm, Type: text, Value: #pre_permissions_new_column#)\n }\n Div(form-group){\n Label($@1reading$)\n Input(Name: ReadPerm, Type: text, Value: #pre_permissions_read#)\n }\n }\n Div(panel-footer text-right){\n Button(Body: $@1save$, Class: btn btn-primary, Contract: @1EditTable, Page: @1app_tables, Params: \"Name=#pre_name#\")\n }\n }\n }\n Div(col-xs-6 col-md-6){\n Div(panel panel-default){\n Div(panel-heading){$@1conditions_for_change$}\n Div(panel-body){\n Div(form-group){\n Input(Name: Insert_condition, Disabled: true, Type: text, Value: #pre_conditions#)\n }\n }\n }\n }\n }\n }\n }\n}.Else{\n SetTitle($@1tables$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "table_view",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "DBFind(\"@1applications\").Where({\"ecosystem\": \"#ecosystem_id#\", \"name\": \"System\"}).Vars(application)\nSetVar(role_developer_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_developer))\nSetVar(role_admin_id, AppParam(Ecosystem: #ecosystem_id#, App: #application_id#, Name: role_admin))\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_developer_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(developer_access)\nDBFind(\"@1roles_participants\").Where({\"ecosystem\": \"#ecosystem_id#\", \"$and\": [{\"role->id\": {\"$in\": [#role_admin_id#]}}, {\"role->id\": \"#role_id#\"}], \"member->account\": \"#account_id#\", \"deleted\": 0}).Vars(admin_access)\n\nIf(Or(#developer_access_id#>0,#admin_access_id#>0)){\n If(#page_par#!=\"\"){\n SetVar(Name: tabl_id, Value: #page_par#)\n }.Else{\n SetVar(Name: page_par, Value: #tabl_id#)\n }\n DBFind(\"@1tables\").Where({\"id\": \"#tabl_id#\", \"ecosystem\": \"#ecosystem_id#\"}).Columns(\"id,name\").Vars(pre)\n\n SetTitle($@1tables$)\n Div(breadcrumb){\n LinkPage($@1tables$, @1app_tables)\n Span(/,mh)\n Span(#pre_name#, text-muted)\n Span(/,mh)\n LinkPage(Body:$@1edit$, Page: @1table_edit, PageParams: \"tabl_id=#tabl_id#\")\n }\n\n SetVar(this_table, #pre_name#).(this_page, @1table_view).(pager_limit, 50)\n SetVar(where, {\"id\": {\"$neq\": 0}})\n Include(@1pager_header)\n\n DBFind(#this_table#, src).Limit(#pager_limit#).Offset(#pager_offset#).Where(#where#)\n\n Div(fullscreen){\n Div(table-responsive ml-lg mr-lg){\n Div(list-group-item){\n Table(src)\n }.Style(\n margin-top:-10px;\n tbody > tr:nth-of-type(odd) {\n background-color: #f8f9fc;\n }\n )\n }\n }\n Div(mt-sm ml-lg mr-sm mb-sm){\n Include(@1pager)\n }\n}.Else{\n SetTitle($@1tables$)\n Div(breadcrumb){\n Span(Class: text-muted, Body: $@1role_change_no_view_permission$)\n }\n}",
"Menu": "developer_menu",
"Type": "pages"
},
{
"Name": "AdminCondition",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "// This contract is used to set \"admin\" rights.\n// Usually the \"admin\" role is used for this.\n// The role ID is written to the ecosystem parameter and can be changed.\n// The contract requests the role ID from the ecosystem parameter and the contract checks the rights.\n\ncontract AdminCondition {\n conditions {\n // check for Founder\n if EcosysParam(\"founder_account\") == AddressToId($account_id) {\n return\n }\n\n // check for Admin role\n var app_id int role_id string\n app_id = Int(DBFind(\"@1applications\").Where({\"ecosystem\": $ecosystem_id, \"name\": \"System\"}).One(\"id\"))\n role_id = AppParam(app_id, \"role_admin\", $ecosystem_id)\n\n if Size(role_id) == 0 {\n warning \"AdminCondition: Sorry, you do not have access to this action\"\n }\n if !RoleAccess(Int(role_id)) {\n warning \"AdminCondition: Sorry, you do not have access to this action\"\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "DeveloperCondition",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "// This contract is used to set \"developer\" rights. \n// Usually the \"developer\" role is used for this.\n// The role ID is written to the ecosystem parameter and can be changed.\n// The contract requests the role ID from the ecosystem parameter and the contract checks the rights.\n\ncontract DeveloperCondition {\n conditions {\n // check for Founder\n if EcosysParam(\"founder_account\") == AddressToId($account_id) {\n return\n }\n\n // check for Developer role\n var app_id int role_id string\n app_id = Int(DBFind(\"@1applications\").Where({\"ecosystem\": $ecosystem_id, \"name\": \"System\"}).One(\"id\"))\n role_id = AppParam(app_id, \"role_developer\", $ecosystem_id)\n\n if Size(role_id) == 0 {\n warning \"DeveloperCondition: Sorry, you do not have access to this action\"\n }\n if !RoleAccess(Int(role_id)) {\n warning \"DeveloperCondition: Sorry, you do not have access to this action\"\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "NewApplication",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewApplication {\n data {\n Name string\n Conditions string\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions, $ecosystem_id)\n\n if Size($Name) == 0 {\n warning LangRes(\"@1app_name_missing\", \"en\")\n }\n\n if DBFind(\"@1applications\").Where({\"name\": $Name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_app_exists\", \"en\"), $Name)\n }\n }\n\n action {\n $result = DBInsert(\"@1applications\", {\"name\": $Name, \"conditions\": $Conditions, \"ecosystem\": $ecosystem_id})\n }\n}",
"Type": "contracts"
},
{
"Name": "AppendMenu",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract AppendMenu {\n data {\n Id int\n Value string\n }\n\n conditions {\n DeveloperCondition()\n\n ConditionById(\"menu\", false)\n }\n\n action {\n var row map\n row = DBFind(\"@1menu\").Columns(\"value\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n var val string\n val = row[\"value\"] + \"\\r\\n\" + $Value\n DBUpdate(\"@1menu\", $Id, {\"value\": val})\n }\n}",
"Type": "contracts"
},
{
"Name": "AppendPage",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract AppendPage {\n data {\n Id int\n Value string\n }\n\n conditions {\n DeveloperCondition()\n\n RowConditions(\"@1pages\", $Id, false)\n }\n\n action {\n var value string\n var row map\n row = DBFind(\"@1pages\").Columns(\"value\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id})Row()\n value = row[\"value\"]\n if Contains(value, \"PageEnd:\") {\n value = Replace(value, \"PageEnd:\", $Value) + \"\\r\\nPageEnd:\"\n } else {\n value = value + \"\\r\\n\" + $Value\n }\n DBUpdate(\"@1pages\", $Id, {\"value\": value })\n }\n}",
"Type": "contracts"
},
{
"Name": "BindWallet",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract BindWallet {\n data {\n Id int\n WalletId string \"optional\"\n }\n\n func sendInvite() {\n if GetContractByName(\"@1NotificationsSend\") == 0 {\n warning LangRes(\"@1notifications_install_needed\", \"en\")\n } else {\n $request = DBFind(\"@1notifications\").Where({\"recipient->account\": $WalletId, \"page_name\": \"contract_bind_request\", \"page_params->contract_id\": $Id, \"ecosystem\": $ecosystem_id, \"closed\": 0}).Columns(\"id\")\n if $request {\n warning LangRes(\"@1request_sent_already\", \"en\")\n }\n\n var notific params map\n params[\"contract_id\"] = $Id\n params[\"contract_name\"] = $cur[\"name\"]\n notific[\"MemberAccount\"] = $WalletId\n notific[\"Sender\"] = 1\n notific[\"Icon\"] = \"icon icon-link\"\n notific[\"Header\"] = LangRes(\"@1request_contract_binding\", \"en\")\n notific[\"Body\"] = LangRes(\"@1details_view\", \"en\")\n notific[\"Page\"] = \"contract_bind_request\"\n notific[\"Params\"] = params\n CallContract(\"@1NotificationsSend\", notific)\n }\n }\n\n func closeInvite() {\n if GetContractByName(\"@1NotificationsClose\") == 0 {\n warning LangRes(\"@1notifications_install_needed\", \"en\")\n } else {\n $request = DBFind(\"@1notifications\").Where({\"recipient->account\": $account_id, \"page_name\": \"contract_bind_request\", \"page_params->contract_id\": $Id, \"ecosystem\": $ecosystem_id, \"closed\": 0}).Columns(\"id\")\n var i int r map\n while i < Len($request) {\n r = $request[i]\n var params map\n params[\"NotificId\"] = Int(r[\"id\"])\n CallContract(\"@1NotificationsClose\", params)\n i = i + 1\n }\n }\n }\n\n conditions {\n DeveloperCondition()\n\n $cur = DBFind(\"@1contracts\").Columns(\"id,name,conditions,wallet_id\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n if !$cur {\n warning Sprintf(LangRes(\"@1contract_x_not_exist\", \"en\"), $Id)\n }\n if Size($WalletId) == 0 {\n warning LangRes(\"@1wallet_not_found\", \"en\")\n }\n RowConditions(\"@1contracts\", $Id, false)\n }\n\n action {\n if $WalletId == \"\" || $WalletId == $account_id {\n BndWallet($Id, $ecosystem_id)\n closeInvite()\n } else {\n sendInvite()\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "BufferManager",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract BufferManager {\n data {\n Action string\n Key string\n Val string \"optional\"\n }\n\n func decodeArray(s string) array {\n var ar array\n if HasPrefix($buf[\"value\"], \"[\") {\n ar = JSONDecode($buf[\"value\"])\n }\n return ar\n }\n\n action {\n $emptyVal = JSONEncode(\"\")\n $buf = DBFind(\"@1buffer_data\").Where({\"ecosystem\": $ecosystem_id, \"key\": $Key, \"account\": $account_id}).Row()\n if !$buf {\n var buf map, id int\n id = DBInsert(\"@1buffer_data\", {\"ecosystem\": $ecosystem_id, \"key\": $Key, \"value\": $emptyVal, \"account\": $account_id})\n buf[\"id\"] = Str(id)\n buf[\"value\"] = \"\"\n buf[\"account\"] = $account_id\n buf[\"key\"] = Str($Key)\n $buf = buf\n }\n var id int\n id = Int($buf[\"id\"])\n if $Action == \"clean\" {\n DBUpdate(\"@1buffer_data\", id, {\"value\": $emptyVal})\n }\n if $Action == \"set\" {\n DBUpdate(\"@1buffer_data\", id, {\"value\": $Val})\n }\n if $Action == \"array_add_value\" {\n var ar array enc string\n ar = decodeArray($buf[\"value\"])\n ar = Append(ar, $Val)\n enc = JSONEncode(ar)\n DBUpdate(\"@1buffer_data\", id, {\"value\": enc})\n }\n if $Action == \"array_remove_value\" {\n var ar arNew array i int enc string\n ar = decodeArray($buf[\"value\"])\n while i < Len(ar){\n if ar[i] != $Val{\n arNew = Append(arNew, ar[i])\n }\n i = i + 1\n }\n enc = JSONEncode(arNew)\n DBUpdate(\"@1buffer_data\", id, {\"value\": enc})\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "CallDelayedContract",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract CallDelayedContract {\n data {\n Id int\n }\n\n conditions {\n var rows array\n rows = DBFind(\"@1delayed_contracts\").Where({\"id\": $Id, \"deleted\": 0})\n\n if !Len(rows) {\n warning Sprintf(LangRes(\"@1template_delayed_contract_not_exist\", \"en\"), $Id)\n }\n $cur = rows[0]\n $limit = Int($cur[\"limit\"])\n $counter = Int($cur[\"counter\"])\n var account_key int\n account_key = AddressToId($account_id)\n \n if account_key != Int($cur[\"key_id\"]) {\n warning LangRes(\"@1access_denied\", \"en\")\n }\n\n if $block < Int($cur[\"block_id\"]) {\n warning Sprintf(LangRes(\"@1template_delayed_contract_error\", \"en\"), $Id, $cur[\"block_id\"], $block)\n }\n\n if $limit > 0 && $counter >= $limit {\n warning Sprintf(LangRes(\"@1template_delayed_contract_limited\", \"en\"), $Id)\n }\n }\n\n action {\n $counter = $counter + 1\n\n var block_id int\n block_id = $block\n if $limit == 0 || $limit > $counter {\n block_id = block_id + Int($cur[\"every_block\"])\n }\n\n DBUpdate(\"@1delayed_contracts\", $Id, {\"counter\": $counter, \"block_id\": block_id})\n\n var params map\n CallContract($cur[\"contract\"], params)\n }\n}",
"Type": "contracts"
},
{
"Name": "CheckNodesBan",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract CheckNodesBan {\n action {\n UpdateNodesBan($block_time)\n }\n}",
"Type": "contracts"
},
{
"Name": "UploadBinary",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract UploadBinary {\n data {\n ApplicationId int\n Name string\n Data bytes\n DataMimeType string \"optional\"\n MemberAccount string \"optional\"\n }\n\n conditions {\n DeveloperCondition()\n\n if Size($MemberAccount) > 0 {\n $UserID = $MemberAccount\n } else {\n $UserID = $account_id\n }\n\n $Id = Int(DBFind(\"@1binaries\").Where({\"app_id\": $ApplicationId, \"account\": $UserID, \"name\": $Name, \"ecosystem\": $ecosystem_id}).One(\"id\"))\n\n if $Id == 0 {\n if $ApplicationId == 0 {\n warning LangRes(\"@1aid_cannot_zero\", \"en\")\n }\n }\n }\n\n action {\n var hash string\n hash = Hash($Data)\n\n if $DataMimeType == \"\" {\n $DataMimeType = \"application/octet-stream\"\n }\n\n if $Id != 0 {\n DBUpdate(\"@1binaries\", $Id, {\"data\": $Data, \"hash\": hash, \"mime_type\": $DataMimeType})\n } else {\n $Id = DBInsert(\"@1binaries\", {\"app_id\": $ApplicationId, \"account\": $UserID, \"name\": $Name, \"data\": $Data, \"hash\": hash, \"mime_type\": $DataMimeType, \"ecosystem\": $ecosystem_id})\n }\n\n $result = $Id\n }\n}",
"Type": "contracts"
},
{
"Name": "DelApplication",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract DelApplication {\n data {\n ApplicationId int\n Value int \"optional\"\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1applications\").Columns(\"id,ecosystem\").Where({\"id\": $ApplicationId, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n\n if $Value < 0 || $Value > 1 {\n warning LangRes(\"@1value_incorrect\", \"en\")\n }\n RowConditions(\"@1applications\", $ApplicationId, false)\n }\n\n action {\n DBUpdate(\"@1applications\", $ApplicationId, {\"deleted\": $Value})\n }\n}",
"Type": "contracts"
},
{
"Name": "EditAppParam",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditAppParam {\n data {\n Id int\n Value string \"optional\"\n Conditions string \"optional\"\n }\n\n func onlyConditions() bool {\n return $Conditions && !$Value\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1app_params\").Columns(\"id,ecosystem\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n\n RowConditions(\"@1app_params\", $Id, onlyConditions())\n if $Conditions {\n ValidateCondition($Conditions, $ecosystem_id)\n }\n }\n\n action {\n var pars map\n if $Value {\n pars[\"value\"] = $Value\n }\n if $Conditions {\n pars[\"conditions\"] = $Conditions\n }\n if pars {\n DBUpdate(\"@1app_params\", $Id, pars)\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "EditApplication",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditApplication {\n data {\n ApplicationId int\n Conditions string \"optional\"\n }\n\n func onlyConditions() bool {\n return $Conditions && false\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1applications\").Columns(\"id,ecosystem\").Where({\"id\": $ApplicationId, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n\n RowConditions(\"@1applications\", $ApplicationId, onlyConditions())\n if $Conditions {\n ValidateCondition($Conditions, $ecosystem_id)\n }\n }\n\n action {\n var pars map\n if $Conditions {\n pars[\"conditions\"] = $Conditions\n }\n if pars {\n DBUpdate(\"@1applications\", $ApplicationId, pars)\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "EditBlock",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditBlock {\n data {\n Id int\n Value string \"optional\"\n Conditions string \"optional\"\n }\n\n func onlyConditions() bool {\n return $Conditions && !$Value\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1blocks\").Columns(\"id,ecosystem\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n RowConditions(\"@1blocks\", $Id, onlyConditions())\n if $Conditions {\n ValidateCondition($Conditions, $ecosystem_id)\n }\n }\n\n action {\n var pars map\n if $Value {\n pars[\"value\"] = $Value\n }\n if $Conditions {\n pars[\"conditions\"] = $Conditions\n }\n if pars {\n DBUpdate(\"@1blocks\", $Id, pars)\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "EditColumn",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditColumn {\n data {\n TableName string\n Name string\n UpdatePerm string\n ReadPerm string\n }\n\n conditions {\n DeveloperCondition()\n\n $TableName = ToLower($TableName)\n if !DBFind(\"@1tables\").Columns(\"name,ecosystem\").Where({\"name\": $TableName, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n var permissions map\n permissions[\"update\"] = $UpdatePerm\n permissions[\"read\"] = $ReadPerm\n $Permissions = permissions\n ColumnCondition($TableName, $Name, \"\", JSONEncode($Permissions))\n }\n\n action {\n PermColumn($TableName, $Name, JSONEncode($Permissions))\n }\n}",
"Type": "contracts"
},
{
"Name": "EditContract",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditContract {\n data {\n Id int \n Value string \"optional\"\n Conditions string \"optional\"\n }\n\n func onlyConditions() bool {\n return $Conditions && !$Value \n }\n\n conditions {\n DeveloperCondition()\n\n RowConditions(\"@1contracts\", $Id, onlyConditions())\n if $Conditions {\n ValidateCondition($Conditions, $ecosystem_id)\n }\n $cur = DBFind(\"@1contracts\").Columns(\"id,value,conditions,wallet_id,token_id\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n if !$cur {\n warning Sprintf(LangRes(\"@1template_contract_not_exist\", \"en\"), $Id)\n }\n if $Value {\n ValidateEditContractNewValue($Value, $cur[\"value\"])\n }\n\n $recipient = Int($cur[\"wallet_id\"])\n }\n\n action {\n UpdateContract($Id, $Value, $Conditions, $recipient, $cur[\"token_id\"])\n }\n}",
"Type": "contracts"
},
{
"Name": "EditDelayedContract",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditDelayedContract {\n data {\n Id int\n Contract string\n EveryBlock int\n Conditions string\n BlockID int \"optional\"\n Limit int \"optional\"\n Deleted int \"optional\"\n }\n\n conditions {\n DeveloperCondition()\n\n ConditionById(\"delayed_contracts\", true)\n\n if !HasPrefix($Contract, \"@\") {\n $Contract = \"@\" + Str($ecosystem_id) + $Contract\n }\n\n if GetContractByName($Contract) == 0 {\n warning Sprintf(LangRes(\"@1template_unknown_contract\", \"en\"), $Contract)\n }\n\n if $BlockID == 0 {\n $BlockID = $block + $EveryBlock\n }\n\n if $BlockID <= $block {\n warning LangRes(\"@1blockid_must_greater\", \"en\")\n }\n }\n\n action {\n var account_key int\n account_key = AddressToId($account_id)\n DBUpdate(\"@1delayed_contracts\", $Id, {\"contract\": $Contract, \"key_id\": account_key, \"block_id\": $BlockID, \"every_block\": $EveryBlock, \"counter\": 0, \"limit\": $Limit, \"deleted\": $Deleted, \"conditions\": $Conditions})\n }\n}",
"Type": "contracts"
},
{
"Name": "EditEcosystemName",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditEcosystemName {\n data {\n EcosystemID int\n NewName string\n }\n\n conditions {\n DeveloperCondition()\n\n var rows array\n rows = DBFind(\"@1ecosystems\").Where({\"id\": $EcosystemID})\n if !Len(rows) {\n warning Sprintf(LangRes(\"@1template_eco_not_exist\", \"en\"), $EcosystemID)\n }\n }\n\n action {\n EditEcosysName($EcosystemID, $NewName)\n }\n}",
"Type": "contracts"
},
{
"Name": "EditLang",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditLang {\n data {\n Id int\n Trans string\n }\n\n conditions {\n DeveloperCondition()\n\n EvalCondition(\"@1parameters\", \"changing_language\", \"value\")\n $lang = DBFind(\"@1languages\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n if !$lang {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n }\n\n action {\n EditLanguage($Id, $lang[\"name\"], $Trans)\n }\n}",
"Type": "contracts"
},
{
"Name": "EditLangJoint",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditLangJoint {\n data {\n Id int\n ValueArr array\n LocaleArr array\n }\n\n conditions {\n var i int\n while i < Len($LocaleArr) {\n if Size($LocaleArr[i]) == 0 {\n info LangRes(\"@1locale_empty\", \"en\")\n }\n if Size($ValueArr[i]) == 0 {\n info LangRes(\"@1value_empty\", \"en\")\n }\n i = i + 1\n }\n }\n\n action {\n var i int\n var Trans map\n while i < Len($LocaleArr) {\n Trans[$LocaleArr[i]] = $ValueArr[i]\n i = i + 1\n }\n var params map\n params[\"Id\"] = $Id\n params[\"Trans\"] = JSONEncode(Trans)\n CallContract(\"EditLang\", params)\n }\n}",
"Type": "contracts"
},
{
"Name": "EditMenu",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditMenu {\n data {\n Id int\n Value string \"optional\"\n Title string \"optional\"\n Conditions string \"optional\"\n }\n\n func onlyConditions() bool {\n return $Conditions && !$Value && !$Title\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1menu\").Columns(\"id,ecosystem\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n RowConditions(\"@1menu\", $Id, onlyConditions())\n if $Conditions {\n ValidateCondition($Conditions, $ecosystem_id)\n }\n }\n\n action {\n var pars map\n if $Value {\n pars[\"value\"] = $Value\n }\n if $Title {\n pars[\"title\"] = $Title\n }\n if $Conditions {\n pars[\"conditions\"] = $Conditions\n }\n if pars {\n DBUpdate(\"@1menu\", $Id, pars)\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "EditPage",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditPage {\n data {\n Id int\n Value string \"optional\"\n Menu string \"optional\"\n Conditions string \"optional\"\n ValidateCount int \"optional\"\n ValidateMode string \"optional\"\n }\n\n func onlyConditions() bool {\n return $Conditions && !$Value && !$Menu && !$ValidateCount\n }\n\n func preparePageValidateCount(count int) int {\n var min, max int\n min = Int(EcosysParam(\"min_page_validate_count\"))\n max = Int(EcosysParam(\"max_page_validate_count\"))\n if count < min {\n count = min\n } else {\n if count > max {\n count = max\n }\n }\n return count\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1pages\").Columns(\"id,ecosystem\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n RowConditions(\"@1pages\", $Id, onlyConditions())\n if $Conditions {\n ValidateCondition($Conditions, $ecosystem_id)\n }\n $ValidateCount = preparePageValidateCount($ValidateCount)\n }\n\n action {\n var pars map\n if $Value {\n pars[\"value\"] = $Value\n }\n if $Menu {\n pars[\"menu\"] = $Menu\n }\n if $Conditions {\n pars[\"conditions\"] = $Conditions\n }\n if $ValidateCount {\n pars[\"validate_count\"] = $ValidateCount\n }\n if $ValidateMode {\n if $ValidateMode != \"1\" {\n $ValidateMode = \"0\"\n }\n pars[\"validate_mode\"] = $ValidateMode\n }\n if pars {\n DBUpdate(\"@1pages\", $Id, pars)\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "EditParameter",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditParameter {\n data {\n Id int\n Value string \"optional\"\n Conditions string \"optional\"\n }\n\n func onlyConditions() bool {\n return $Conditions && !$Value\n }\n\n conditions {\n DeveloperCondition()\n\n $Id = Int($Id)\n RowConditions(\"@1parameters\", $Id, onlyConditions())\n if $Conditions {\n ValidateCondition($Conditions, $ecosystem_id)\n }\n\n $Name = DBFind(\"@1parameters\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).One(\"name\")\n if $Name == \"founder_account\" {\n var account string\n account = IdToAddress(Int($Value))\n if !DBFind(\"@1keys\").Where({\"account\": account, \"ecosystem\": $ecosystem_id, \"deleted\": 0}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_user_not_found\", \"en\"), $Value)\n }\n }\n if $Name == \"max_block_user_tx\" || $Name == \"money_digit\" || $Name == \"max_sum\" || $Name == \"min_page_validate_count\" || $Name == \"max_page_validate_count\" {\n if Size($Value) == 0 {\n warning LangRes(\"@1value_not_received\", \"en\")\n }\n if Int($Value) <= 0 {\n warning LangRes(\"@1value_must_greater_zero\", \"en\")\n }\n }\n }\n\n action {\n var pars map\n if $Value {\n if $Value == `\"\"` {\n pars[\"value\"] = \"\"\n } else {\n pars[\"value\"] = $Value\n }\n }\n if $Conditions {\n pars[\"conditions\"] = $Conditions\n }\n if pars {\n DBUpdate(\"@1parameters\", $Id, pars)\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "EditSection",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditSection {\n data {\n Id int\n Title string\n Status int\n Urlname string\n Page string\n }\n\n conditions {\n DeveloperCondition()\n\n if DBFind(\"@1sections\").Where({\"urlname\": $Urlname, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1section_exist\", \"en\")\n }\n if !DBFind(\"@1sections\").Columns(\"id,ecosystem\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n if $Status < 0 || $Status > 2 {\n warning LangRes(\"@1status_must_0_2\", \"en\")\n }\n if $Status == 0 || $Status == 1 {\n var status_check map\n status_check = DBFind(\"@1sections\").Columns(\"id,status\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n if Int(JSONDecode(status_check[\"status\"])) == 2 {\n warning LangRes(\"@1main_section_warning\", \"en\")\n }\n }\n if !DBFind(\"@1sections\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Columns(\"id\") {\n warning Sprintf(LangRes(\"@1template_section_not_exist\", \"en\"), $Id)\n }\n }\n\n action {\n if $Status == 2 {\n var status_check map\n var curr_id int\n status_check = DBFind(\"@1sections\").Columns(\"id,status\").Where({\"status\": $Status, \"ecosystem\": $ecosystem_id}).Row()\n curr_id = Int(JSONDecode(status_check[\"id\"]))\n DBUpdate(\"@1sections\", curr_id, {\"status\":1})\n }\n DBUpdate(\"@1sections\", $Id, {\"title\":$Title,\"status\":$Status,\"urlname\":$Urlname,\"page\":$Page})\n }\n}",
"Type": "contracts"
},
{
"Name": "EditTable",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract EditTable {\n data {\n Name string\n InsertPerm string\n UpdatePerm string\n ReadPerm string\n NewColumnPerm string\n }\n\n conditions {\n DeveloperCondition()\n\n if !$InsertPerm {\n info LangRes(\"@1insert_condition_empty\", \"en\")\n }\n if !$UpdatePerm {\n info LangRes(\"@1update_condition_empty\", \"en\")\n }\n if !$ReadPerm {\n info LangRes(\"@1read_condition_empty\", \"en\")\n }\n if !$NewColumnPerm {\n info LangRes(\"@1new_column_condition_empty\", \"en\")\n }\n\n var permissions map\n permissions[\"insert\"] = $InsertPerm\n permissions[\"update\"] = $UpdatePerm\n permissions[\"read\"] = $ReadPerm\n permissions[\"new_column\"] = $NewColumnPerm\n $Permissions = permissions\n TableConditions($Name, \"\", JSONEncode($Permissions))\n }\n\n action {\n PermTable($Name, JSONEncode($Permissions))\n }\n}",
"Type": "contracts"
},
{
"Name": "UploadFile",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract UploadFile {\n data {\n ApplicationId int\n Data file\n Name string \"optional\"\n }\n\n conditions {\n if $Name == \"\" {\n $Name = $Data[\"Name\"]\n }\n $Body = $Data[\"Body\"]\n $DataMimeType = $Data[\"MimeType\"]\n }\n\n action {\n $Id = @1UploadBinary(\"ApplicationId,Name,Data,DataMimeType\", $ApplicationId, $Name, $Body, $DataMimeType)\n $result = $Id\n }\n}",
"Type": "contracts"
},
{
"Name": "ExportNewApp",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract ExportNewApp {\n data {\n ApplicationId int\n }\n\n conditions {\n DeveloperCondition()\n\n $app_map = DBFind(\"@1applications\").Columns(\"id,name\").Where({\"id\": $ApplicationId, \"ecosystem\": $ecosystem_id}).Row()\n if !$app_map{\n warning LangRes(\"@1app_not_found\", \"en\")\n }\n }\n\n action {\n var i int pages_array menu_name_array menu_id_array pages_ret array\n // Search menu\n pages_ret = DBFind(\"@1pages\").Where({\"app_id\": $ApplicationId, \"ecosystem\": $ecosystem_id})\n while i < Len(pages_ret) {\n var page_map map\n page_map = pages_ret[i]\n\n pages_array = Append(pages_array, Sprintf(\"%v\", Str(page_map[\"menu\"])))\n i = i + 1\n }\n\n if Len(pages_array) > 0 {\n var where_for_menu map\n where_for_menu[\"name\"] = {\"$in\": pages_array}\n\n i = 0\n var menu_ret array\n menu_ret = DBFind(\"@1menu\").Where(where_for_menu)\n while i < Len(menu_ret) {\n var menu_map map\n menu_map = menu_ret[i]\n\n menu_name_array = Append(menu_name_array, Str(menu_map[\"name\"]))\n menu_id_array = Append(menu_id_array, Str(menu_map[\"id\"]))\n i = i + 1\n }\n }\n\n // Creating settings\n var value map\n value[\"app_id\"] = Str($ApplicationId)\n value[\"app_name\"] = Str($app_map[\"name\"])\n\n if Len(menu_name_array) > 0 {\n value[\"menu_id\"] = Str(Join(menu_id_array, \", \"))\n value[\"menu_name\"] = Str(Join(menu_name_array, \", \"))\n value[\"count_menu\"] = Str(Len(menu_name_array))\n } else {\n value[\"menu_id\"] = \"0\"\n value[\"menu_name\"] = \"\"\n value[\"count_menu\"] = \"0\"\n }\n\n @1BufferManager(\"Action,Key,Val\", \"set\", \"export\", JSONEncode(value))\n }\n}",
"Type": "contracts"
},
{
"Name": "Import",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract Import {\n data {\n Data string\n }\n\n conditions {\n DeveloperCondition()\n\n $ApplicationId = 0\n var app_map map\n app_map = DBFind(\"@1buffer_data\").Columns(\"value->app_name\").Where({\"key\": \"import_info\", \"account\": $account_id, \"ecosystem\": $ecosystem_id}).Row()\n\n if app_map {\n var app_id int ival string\n ival = Str(app_map[\"value.app_name\"])\n app_id = DBFind(\"@1applications\").Where({\"name\": ival, \"ecosystem\": $ecosystem_id}).One(\"id\")\n if app_id {\n $ApplicationId = Int(app_id)\n }\n }\n }\n\n action {\n var editors, creators map\n editors[\"pages\"] = \"EditPage\"\n editors[\"blocks\"] = \"EditBlock\"\n editors[\"menu\"] = \"EditMenu\"\n editors[\"app_params\"] = \"EditAppParam\"\n editors[\"languages\"] = \"EditLang\"\n editors[\"contracts\"] = \"EditContract\"\n editors[\"tables\"] = \"\" // nothing\n\n creators[\"pages\"] = \"NewPage\"\n creators[\"blocks\"] = \"NewBlock\"\n creators[\"menu\"] = \"NewMenu\"\n creators[\"app_params\"] = \"NewAppParam\"\n creators[\"languages\"] = \"NewLang\"\n creators[\"contracts\"] = \"NewContract\"\n creators[\"tables\"] = \"NewTable\"\n\n var dataImport array\n dataImport = JSONDecode($Data)\n var i int\n while i < Len(dataImport) {\n var item cdata map type name string\n cdata = dataImport[i]\n if cdata {\n cdata[\"ApplicationId\"] = $ApplicationId\n type = cdata[\"Type\"]\n name = cdata[\"Name\"]\n // Println(Sprintf(\"import %v: %v\", type, cdata[\"Name\"]))\n\n var tbl string\n tbl = \"@1\" + Str(type)\n if type == \"app_params\" {\n item = DBFind(tbl).Where({\"name\": name, \"ecosystem\": $ecosystem_id, \"app_id\": $ApplicationId}).Row()\n } else {\n item = DBFind(tbl).Where({\"name\": name, \"ecosystem\": $ecosystem_id}).Row()\n }\n var contractName string\n if item {\n contractName = editors[type]\n cdata[\"Id\"] = Int(item[\"id\"])\n if type == \"contracts\" {\n if item[\"conditions\"] == \"false\" {\n // ignore updating impossible\n contractName = \"\"\n }\n } elif type == \"menu\" {\n var menu menuItem string\n menu = Replace(item[\"value\"], \" \", \"\")\n menu = Replace(menu, \"\\n\", \"\")\n menu = Replace(menu, \"\\r\", \"\")\n menuItem = Replace(cdata[\"Value\"], \" \", \"\")\n menuItem = Replace(menuItem, \"\\n\", \"\")\n menuItem = Replace(menuItem, \"\\r\", \"\")\n if Contains(menu, menuItem) {\n // ignore repeated\n contractName = \"\"\n } else {\n cdata[\"Value\"] = item[\"value\"] + \"\\n\" + cdata[\"Value\"]\n }\n }\n } else {\n contractName = creators[type]\n }\n\n if contractName != \"\" {\n CallContract(contractName, cdata)\n }\n }\n i = i + 1\n }\n // Println(Sprintf(\"> time: %v\", $time))\n }\n}",
"Type": "contracts"
},
{
"Name": "ImportUpload",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract ImportUpload {\n data {\n Data file\n }\n\n conditions {\n DeveloperCondition()\n\n $Data = BytesToString($Data[\"Body\"])\n $limit = 10 // data piece size of import\n }\n\n action {\n // init buffer_data, cleaning old buffer\n @1BufferManager(\"Action,Key,Val\", \"clean\", \"import\", \"\")\n @1BufferManager(\"Action,Key,Val\", \"clean\", \"import_info\", \"\")\n\n var input map arrData array\n input = JSONDecode($Data)\n arrData = input[\"data\"]\n\n var pages_arr blocks_arr menu_arr parameters_arr languages_arr contracts_arr tables_arr array\n\n // IMPORT INFO\n var i lenArrData int item map\n lenArrData = Len(arrData)\n while i < lenArrData {\n item = arrData[i]\n\n if item[\"Type\"] == \"pages\" {\n pages_arr = Append(pages_arr, item[\"Name\"])\n } elif item[\"Type\"] == \"blocks\" {\n blocks_arr = Append(blocks_arr, item[\"Name\"])\n } elif item[\"Type\"] == \"menu\" {\n menu_arr = Append(menu_arr, item[\"Name\"])\n } elif item[\"Type\"] == \"app_params\" {\n parameters_arr = Append(parameters_arr, item[\"Name\"])\n } elif item[\"Type\"] == \"languages\" {\n languages_arr = Append(languages_arr, item[\"Name\"])\n } elif item[\"Type\"] == \"contracts\" {\n contracts_arr = Append(contracts_arr, item[\"Name\"])\n } elif item[\"Type\"] == \"tables\" {\n tables_arr = Append(tables_arr, item[\"Name\"])\n }\n\n i = i + 1\n }\n\n var inf map\n inf[\"app_name\"] = input[\"name\"]\n inf[\"pages\"] = Join(pages_arr, \", \")\n inf[\"pages_count\"] = Len(pages_arr)\n inf[\"blocks\"] = Join(blocks_arr, \", \")\n inf[\"blocks_count\"] = Len(blocks_arr)\n inf[\"menu\"] = Join(menu_arr, \", \")\n inf[\"menu_count\"] = Len(menu_arr)\n inf[\"parameters\"] = Join(parameters_arr, \", \")\n inf[\"parameters_count\"] = Len(parameters_arr)\n inf[\"languages\"] = Join(languages_arr, \", \")\n inf[\"languages_count\"] = Len(languages_arr)\n inf[\"contracts\"] = Join(contracts_arr, \", \")\n inf[\"contracts_count\"] = Len(contracts_arr)\n inf[\"tables\"] = Join(tables_arr, \", \")\n inf[\"tables_count\"] = Len(tables_arr)\n\n if 0 == inf[\"pages_count\"] + inf[\"blocks_count\"] + inf[\"menu_count\"] + inf[\"parameters_count\"] + inf[\"languages_count\"] + inf[\"contracts_count\"] + inf[\"tables_count\"] {\n warning \"Invalid or empty import file\"\n }\n\n // IMPORT DATA\n // the contracts is imported in one piece, the rest is cut under the $limit\n var sliced contracts array\n i = 0\n while i < lenArrData {\n var items array l int item map\n while l < $limit && (i + l < lenArrData) {\n item = arrData[i + l]\n if item[\"Type\"] == \"contracts\" {\n contracts = Append(contracts, item)\n } else {\n items = Append(items, item)\n }\n l = l + 1\n }\n var batch map\n batch[\"Data\"] = JSONEncode(items)\n sliced = Append(sliced, batch)\n i = i + $limit\n }\n if Len(contracts) > 0 {\n var batch map\n batch[\"Data\"] = JSONEncode(contracts)\n sliced = Append(sliced, batch)\n }\n input[\"data\"] = sliced\n\n // storing\n @1BufferManager(\"Action,Key,Val\", \"set\", \"import\", JSONEncode(input))\n @1BufferManager(\"Action,Key,Val\", \"set\", \"import_info\", JSONEncode(inf))\n\n var name string\n name = Str(input[\"name\"])\n var cndns string\n cndns = Str(input[\"conditions\"])\n\n if !DBFind(\"@1applications\").Where({\"name\": name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n DBInsert(\"@1applications\", {\"name\": name, \"conditions\": cndns, \"ecosystem\": $ecosystem_id})\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "ItemChangeAppId",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract ItemChangeAppId {\n data {\n Table string\n AppId int\n Id int\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind($Table).Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row() {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n }\n\n action {\n DBUpdate($Table, $Id, {\"app_id\": $AppId})\n }\n}",
"Type": "contracts"
},
{
"Name": "MainCondition",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "// This contract is used to set \"Founder\" rights.\n\ncontract MainCondition {\n conditions {\n // check for Founder\n if EcosysParam(\"founder_account\") != AddressToId($account_id) {\n warning \"MainCondition: Sorry, you do not have access to this action\"\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "NewAppParam",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewAppParam {\n data {\n ApplicationId int\n Name string\n Value string\n Conditions string\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions, $ecosystem_id)\n\n if $ApplicationId == 0 {\n warning LangRes(\"@1aid_cannot_zero\", \"en\")\n }\n\n if DBFind(\"@1app_params\").Where({\"name\": $Name, \"ecosystem\": $ecosystem_id, \"app_id\": $ApplicationId}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_appparam_exists\", \"en\"), $Name)\n }\n }\n\n action {\n DBInsert(\"@1app_params\", {\"app_id\": $ApplicationId, \"name\": $Name, \"value\": $Value, \"conditions\": $Conditions, \"ecosystem\": $ecosystem_id})\n }\n}",
"Type": "contracts"
},
{
"Name": "AppInstall",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract AppInstall {\n data {\n ApplicationId int\n }\n\n conditions {\n DeveloperCondition()\n\n $check_app = DBFind(\"@1applications\").Columns(\"id,ecosystem,name,conditions\").Where({\"id\": $ApplicationId, \"ecosystem\": 1}).Row()\n if !$check_app[\"id\"] {\n warning LangRes(\"@1item_not_found\", \"en\")\n }\n\n $check_config = DBFind(\"@1app_params\").Where({\"app_id\": $ApplicationId, \"ecosystem\": 1, \"name\": \"config\"}).Row()\n if !$check_config[\"id\"] {\n warning LangRes(\"@1config_not_find\", \"en\")\n }\n $application_config = Str($check_config[\"value\"])\n\n var config_map map\n config_map = JSONDecode($application_config)\n $app_name = Str(config_map[\"name\"])\n $app_condition = Str(config_map[\"conditions\"])\n $app_data = config_map[\"data\"]\n }\n\n action {\n //new_app\n if !DBFind(\"@1applications\").Columns(\"id,ecosystem,name\").Where({\"name\": $app_name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n @1NewApplication(\"Name,Conditions\", $app_name, $app_condition)\n }\n\n //buffer data for import contract\n var app_ins map\n app_ins[\"app_name\"] = $app_name\n\n @1BufferManager(\"Action,Key,Val\", \"set\", \"import_info\", JSONEncode(app_ins))\n\n //import\n var i int\n while i < Len($app_data) {\n $one_item = $app_data[i]\n $one_item_arr = \"[\" + JSONEncode($one_item) + \"]\"\n Import(\"Data\", $one_item_arr)\n i = i + 1\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "NewBadBlock",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewBadBlock {\n data {\n ProducerNodeID int\n ConsumerNodeID int\n BlockID int\n Timestamp int\n Reason string\n }\n\n action {\n DBInsert(\"@1bad_blocks\", {\"producer_node_id\": $ProducerNodeID, \"consumer_node_id\": $ConsumerNodeID, \"block_id\": $BlockID, \"timestamp block_time\": $Timestamp, \"reason\": $Reason})\n }\n}",
"Type": "contracts"
},
{
"Name": "NewBlock",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewBlock {\n data {\n ApplicationId int\n Name string\n Value string\n Conditions string\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions, $ecosystem_id)\n\n if $ApplicationId == 0 {\n warning LangRes(\"@1aid_cannot_zero\", \"en\")\n }\n\n if DBFind(\"@1blocks\").Where({\"name\": $Name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_block_exists\", \"en\"), $Name)\n }\n }\n\n action {\n DBInsert(\"@1blocks\", {\"name\": $Name, \"value\": $Value, \"conditions\": $Conditions, \"app_id\": $ApplicationId, \"ecosystem\": $ecosystem_id})\n }\n}",
"Type": "contracts"
},
{
"Name": "NewColumn",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewColumn {\n data {\n TableName string\n Name string\n Type string\n UpdatePerm string\n ReadPerm string\n }\n\n conditions {\n DeveloperCondition()\n\n var permissions map\n permissions[\"update\"] = $UpdatePerm\n permissions[\"read\"] = $ReadPerm\n $Permissions = permissions\n ColumnCondition($TableName, $Name, $Type, JSONEncode($Permissions))\n }\n\n action {\n CreateColumn($TableName, $Name, $Type, JSONEncode($Permissions))\n }\n}",
"Type": "contracts"
},
{
"Name": "NewContract",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewContract {\n data {\n ApplicationId int\n Value string\n Conditions string\n TokenEcosystem int \"optional\"\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions,$ecosystem_id)\n\n if $ApplicationId == 0 {\n warning LangRes(\"@1aid_cannot_zero\", \"en\")\n }\n\n $contract_name = ContractName($Value)\n\n if !$contract_name {\n warning LangRes(\"@1contract_name_missing\", \"en\")\n }\n\n if !$TokenEcosystem {\n $TokenEcosystem = 1\n } else {\n if !SysFuel($TokenEcosystem) {\n warning Sprintf(LangRes(\"@1template_eco_isnot_system\", \"en\"), $TokenEcosystem)\n }\n }\n }\n\n action {\n $result = CreateContract($contract_name, $Value, $Conditions, $TokenEcosystem, $ApplicationId)\n }\n}",
"Type": "contracts"
},
{
"Name": "NewDelayedContract",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewDelayedContract {\n data {\n Contract string\n EveryBlock int\n Conditions string\n BlockID int \"optional\"\n Limit int \"optional\"\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions, $ecosystem_id)\n\n if !HasPrefix($Contract, \"@\") {\n $Contract = \"@\" + Str($ecosystem_id) + $Contract\n }\n\n if GetContractByName($Contract) == 0 {\n warning Sprintf(LangRes(\"@1template_unknown_contract\", \"en\"), $Contract)\n }\n\n if $BlockID == 0 {\n $BlockID = $block + $EveryBlock\n }\n\n if $BlockID <= $block {\n warning LangRes(\"@1blockid_must_greater\", \"en\")\n }\n }\n\n action {\n var account_key int\n account_key = AddressToId($account_id)\n DBInsert(\"@1delayed_contracts\", {\"contract\": $Contract, \"key_id\": account_key, \"block_id\": $BlockID, \"every_block\": $EveryBlock, \"limit\": $Limit, \"conditions\": $Conditions})\n }\n}",
"Type": "contracts"
},
{
"Name": "NewEcosystem",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewEcosystem {\n data {\n Name string\n }\n\n conditions {\n DeveloperCondition()\n\n if !$Name {\n warning LangRes(\"@1ecosystem_name_empty\", \"en\")\n }\n }\n\n action {\n var account_key int\n account_key = AddressToId($account_id)\n $result = CreateEcosystem(account_key, $Name)\n }\n}",
"Type": "contracts"
},
{
"Name": "NewLang",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewLang {\n data {\n Name string\n Trans string\n }\n\n conditions {\n DeveloperCondition()\n\n EvalCondition(\"@1parameters\", \"changing_language\", \"value\")\n if DBFind(\"@1languages\").Where({\"name\": $Name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_langres_exists\", \"en\"), $Name)\n }\n }\n\n action {\n CreateLanguage($Name, $Trans)\n }\n}",
"Type": "contracts"
},
{
"Name": "NewLangJoint",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewLangJoint {\n data {\n Name string\n ValueArr array\n LocaleArr array\n }\n\n conditions {\n var i int\n while i < Len($LocaleArr) {\n if Size($LocaleArr[i]) == 0 {\n info LangRes(\"@1locale_empty\", \"en\")\n }\n if Size($ValueArr[i]) == 0 {\n info LangRes(\"@1value_empty\", \"en\")\n }\n i = i + 1\n }\n }\n\n action {\n var i int\n var Trans map\n while i < Len($LocaleArr) {\n Trans[$LocaleArr[i]] = $ValueArr[i]\n i = i + 1\n }\n var params map\n params[\"Name\"] = $Name\n params[\"Trans\"] = JSONEncode(Trans)\n CallContract(\"NewLang\", params)\n }\n}",
"Type": "contracts"
},
{
"Name": "NewMenu",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewMenu {\n data {\n Name string\n Value string\n Title string \"optional\"\n Conditions string\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions,$ecosystem_id)\n\n if DBFind(\"@1menu\").Where({\"name\": $Name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_menu_exists\", \"en\"), $Name)\n }\n }\n\n action {\n DBInsert(\"@1menu\", {\"name\": $Name, \"value\": $Value, \"title\": $Title, \"conditions\": $Conditions, \"ecosystem\": $ecosystem_id})\n }\n}",
"Type": "contracts"
},
{
"Name": "NewPage",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewPage {\n data {\n ApplicationId int\n Name string\n Value string\n Menu string\n Conditions string\n ValidateCount int \"optional\"\n ValidateMode string \"optional\"\n }\n\n func preparePageValidateCount(count int) int {\n var min, max int\n min = Int(EcosysParam(\"min_page_validate_count\"))\n max = Int(EcosysParam(\"max_page_validate_count\"))\n\n if count < min {\n count = min\n } else {\n if count > max {\n count = max\n }\n }\n return count\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions,$ecosystem_id)\n\n if $ApplicationId == 0 {\n warning LangRes(\"@1aid_cannot_zero\", \"en\")\n }\n\n if DBFind(\"@1pages\").Where({\"name\": $Name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_page_exists\", \"en\"), $Name)\n }\n\n $ValidateCount = preparePageValidateCount($ValidateCount)\n\n if $ValidateMode {\n if $ValidateMode != \"1\" {\n $ValidateMode = \"0\"\n }\n }\n }\n\n action {\n DBInsert(\"@1pages\", {\"name\": $Name,\"value\": $Value, \"menu\": $Menu,\n \"validate_count\": $ValidateCount, \"validate_mode\": $ValidateMode, \"conditions\": $Conditions, \"app_id\": $ApplicationId, \"ecosystem\": $ecosystem_id})\n }\n}",
"Type": "contracts"
},
{
"Name": "NewParameter",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewParameter {\n data {\n Name string\n Value string\n Conditions string\n }\n\n conditions {\n DeveloperCondition()\n\n ValidateCondition($Conditions, $ecosystem_id)\n\n if DBFind(\"@1parameters\").Where({\"name\": $Name, \"ecosystem\": $ecosystem_id}).One(\"id\") {\n warning Sprintf(LangRes(\"@1template_parameter_exists\", \"en\"), $Name)\n }\n }\n\n action {\n DBInsert(\"@1parameters\", {\"name\": $Name, \"value\": $Value, \"conditions\": $Conditions, \"ecosystem\": $ecosystem_id})\n }\n}",
"Type": "contracts"
},
{
"Name": "NewSection",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewSection {\n data {\n Title string\n Status int\n Urlname string\n Page string\n }\n\n conditions {\n DeveloperCondition()\n\n if $Status < 0 || $Status > 2 {\n warning LangRes(\"@1status_must_0_2\", \"en\")\n }\n if DBFind(\"@1sections\").Where({\"urlname\": $Urlname, \"ecosystem\": $ecosystem_id}) {\n warning LangRes(\"@1section_exist\", \"en\")\n }\n }\n\n action {\n if $Status == 2 {\n var status_check map\n var curr_id int\n status_check = DBFind(\"@1sections\").Where({\"status\": $Status}).Columns(\"id,status\").Row()\n curr_id = Int(JSONDecode(status_check[\"id\"]))\n DBUpdate(\"@1sections\", curr_id, {\"status\":1})\n }\n var roles_access array\n roles_access = JSONEncode(roles_access)\n DBInsert(\"@1sections\", {\"title\": $Title, \"status\": $Status, \"urlname\": $Urlname, \"page\": $Page, \"roles_access\": roles_access, \"ecosystem\": $ecosystem_id})\n }\n}",
"Type": "contracts"
},
{
"Name": "NewTable",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewTable {\n data {\n ApplicationId int\n Name string\n Columns string\n Permissions string\n }\n\n conditions {\n DeveloperCondition()\n\n if $ApplicationId == 0 {\n warning LangRes(\"@1aid_cannot_zero\", \"en\")\n }\n TableConditions($Name, $Columns, $Permissions)\n }\n\n action {\n CreateTable($Name, $Columns, $Permissions, $ApplicationId)\n }\n}",
"Type": "contracts"
},
{
"Name": "NewTableJoint",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewTableJoint {\n data {\n ApplicationId int\n Name string\n ColumnsArr array\n TypesArr array\n InsertPerm string\n UpdatePerm string\n ReadPerm string\n NewColumnPerm string\n }\n\n conditions {\n var i int\n while i < Len($ColumnsArr) {\n if Size($ColumnsArr[i]) == 0 {\n info LangRes(\"@1columns_empty\", \"en\")\n }\n if Size($TypesArr[i]) == 0 {\n info LangRes(\"@1type_empty\", \"en\")\n }\n i = i + 1\n }\n }\n\n action {\n var i int\n var col_arr array\n while i < Len($ColumnsArr) {\n var col_map map\n col_map[\"name\"] = $ColumnsArr[i]\n col_map[\"type\"] = $TypesArr[i]\n col_map[\"conditions\"] = \"true\"\n col_arr[i] = JSONEncode(col_map)\n i = i + 1\n }\n\n var Permissions map\n Permissions[\"insert\"] = $InsertPerm\n Permissions[\"update\"] = $UpdatePerm\n Permissions[\"read\"] = $ReadPerm\n Permissions[\"new_column\"] = $NewColumnPerm\n\n var params map\n params[\"ApplicationId\"] = $ApplicationId\n params[\"Name\"] = $Name\n params[\"Columns\"] = JSONEncode(col_arr)\n params[\"Permissions\"] = JSONEncode(Permissions)\n CallContract(\"NewTable\", params)\n }\n}",
"Type": "contracts"
},
{
"Name": "NewUser",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NewUser {\n data {\n NewPubkey string \"optional\"\n Account string \"optional\"\n }\n\n conditions {\n $newId = PubToID($NewPubkey)\n \n if $newId == 0 {\n warning LangRes(\"@1wrong_pub\", \"en\")\n }\n if DBFind(\"@1keys\").Where({\"id\": $newId, \"ecosystem\": $ecosystem_id}).One(\"id\") != nil {\n warning Sprintf(LangRes(\"@1template_user_exists\", \"en\"), IdToAddress($newId))\n }\n\n if Size($NewPubkey) == 0 {\n warning \"You did not enter the public key\"\n }\n\n $pub = HexToPub($NewPubkey)\n $amount = Money(1000) * Money(1000000000000000000)\n\n if Size($Account) > 0 {\n $k_id = DBFind(\"@1keys\").Where({\"account\": $Account, \"ecosystem\": $ecosystem_id, \"deleted\": 0}).One(\"id\") \n if $k_id == nil {\n warning \"Account not found\"\n }\n }\n }\n\n action {\n if Size($Account) > 0 {\n $account = $Account\n DBInsert(\"keys\", {\"id\": $newId, \"account\": $account, \"pub\": $pub, \"amount\": $amount, \"ecosystem\": 1})\n $result = $account\n\n DBUpdate(\"@1keys\", Int($k_id), {\"deleted\": 1})\n } else {\n $account = IdToAddress($newId)\n DBInsert(\"keys\", {\"id\": $newId, \"account\": $account, \"pub\": $pub, \"amount\": $amount, \"ecosystem\": 1})\n $result = $account\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "NodeOwnerCondition",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract NodeOwnerCondition {\n conditions {\n $raw_full_nodes = SysParamString(\"full_nodes\")\n if Size($raw_full_nodes) == 0 {\n ContractConditions(\"MainCondition\")\n } else {\n $full_nodes = JSONDecode($raw_full_nodes)\n var i int\n while i < Len($full_nodes) {\n $fn = $full_nodes[i]\n if $fn[\"key_id\"] == AddressToId($account_id) {\n return true\n }\n i = i + 1\n }\n warning \"Sorry, you do not have access to this action.\"\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "PlatformAppsInstall",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract PlatformAppsInstall {\n data {}\n\n conditions {\n DeveloperCondition()\n\n $basic_id = DBFind(\"@1applications\").Where({\"ecosystem\": 1, \"name\": \"Basic\", \"deleted\": 0}).One(\"id\")\n $system_id = DBFind(\"@1applications\").Where({\"ecosystem\": 1, \"name\": \"System\", \"deleted\": 0}).One(\"id\")\n }\n\n action {\n if $ecosystem_id != 1 {\n @1AppInstall(\"ApplicationId\", $system_id)\n @1AppInstall(\"ApplicationId\", $basic_id)\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "SectionLevelDown",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract SectionLevelDown {\n data {\n Id int\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1sections\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Columns(\"id\") {\n warning Sprintf(LangRes(\"@1template_section_not_exist\", \"en\"), $Id)\n }\n $next = DBFind(\"@1sections\").Where({\"id\": {\"$gt\": $Id}, \"ecosystem\": $ecosystem_id}).Columns(\"id\")\n if !$next {\n warning LangRes(\"@1section_already_bottom\", \"en\")\n }\n }\n\n action {\n var next_id int\n var last_id int\n next_id = $Id + 1\n $max_id = DBFind(\"@1sections\").Order({\"id\": \"-1\"}).One(\"id\")\n last_id = $max_id + 1\n DBUpdate(\"@1sections\", next_id, {\"id\":last_id})\n DBUpdate(\"@1sections\", $Id, {\"id\":next_id})\n DBUpdate(\"@1sections\", last_id, {\"id\":$Id})\n }\n}",
"Type": "contracts"
},
{
"Name": "SectionLevelUp",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract SectionLevelUp {\n data {\n Id int\n }\n\n conditions {\n DeveloperCondition()\n\n if !DBFind(\"@1sections\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Columns(\"id\") {\n warning Sprintf(LangRes(\"@1template_section_not_exist\", \"en\"), $Id)\n }\n $next = DBFind(\"@1sections\").Where({\"id\": {\"$lt\": $Id}, \"ecosystem\": $ecosystem_id}).Columns(\"id\")\n if !$next {\n warning LangRes(\"@1section_already_top\", \"en\")\n }\n }\n\n action {\n var next_id int\n var last_id int\n next_id = $Id - 1\n $max_id = DBFind(\"@1sections\").Order({\"id\": \"-1\"}).One(\"id\")\n last_id = $max_id + 1\n DBUpdate(\"@1sections\", next_id, {\"id\":last_id})\n DBUpdate(\"@1sections\", $Id, {\"id\":next_id})\n DBUpdate(\"@1sections\", last_id, {\"id\":$Id})\n }\n}",
"Type": "contracts"
},
{
"Name": "SectionRoles",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract SectionRoles {\n data {\n Id int\n Rid int\n Operation string\n }\n\n conditions {\n DeveloperCondition()\n\n if $Operation == \"add\" {\n var roles_id map json array i int\n roles_id = DBFind(\"@1sections\").Columns(\"roles_access\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n json = JSONDecode(roles_id[\"roles_access\"])\n while i < Len(json) {\n if json[i] == $Rid {\n warning LangRes(\"@1role_already_permission\", \"en\")\n }\n i = i + 1\n }\n }\n }\n\n action {\n var roles_array array\n roles_array = DBFind(\"@1sections\").Columns(\"roles_access\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).One(\"roles_access\")\n if $Operation == \"add\" {\n if roles_array == \"[]\" {\n var roles_id array\n roles_id[0] = $Rid\n roles_id = JSONEncode(roles_id)\n DBUpdate(\"@1sections\", $Id, {\"roles_access\":roles_id})\n } else {\n var roles_id map\n var json array\n roles_id = DBFind(\"@1sections\").Columns(\"roles_access\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n json = JSONDecode(roles_id[\"roles_access\"])\n json = Append(json, $Rid)\n json = JSONEncode(json)\n DBUpdate(\"@1sections\", $Id, {\"roles_access\":json})\n }\n }\n if $Operation == \"remove\" {\n var json array\n var roles_id map\n roles_id = DBFind(\"@1sections\").Columns(\"roles_access\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n json = JSONDecode(roles_id[\"roles_access\"])\n if Len(json) == 1 {\n var roles_access array\n roles_access = JSONEncode(roles_access)\n DBUpdate(\"@1sections\", $Id, {\"roles_access\":roles_access})\n } else {\n var buffer string\n buffer = Join(json, \",\")\n if Contains(buffer, Str($Rid)) {\n buffer = Replace(buffer, `,` + Str($Rid), ``)\n }\n if HasPrefix(buffer, Str($Rid)) {\n buffer = Replace(buffer, Str($Rid) + `,`, ``)\n }\n json = Split(buffer, \",\")\n json = JSONEncode(json)\n DBUpdate(\"@1sections\", $Id, {\"roles_access\":json})\n }\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "SelectApp",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract SelectApp {\n data {\n ApplicationId int\n }\n\n conditions {\n DeveloperCondition()\n\n $app = DBFind(\"@1applications\").Columns(\"id,name\").Where({\"id\": $ApplicationId, \"ecosystem\": $ecosystem_id}).Row()\n if !$app {\n LangRes(\"@1app_not_found\", \"en\")\n }\n }\n\n action {\n var value map\n value[\"app_id\"] = Str($ApplicationId)\n value[\"app_name\"] = $app[\"name\"]\n\n @1BufferManager(\"Action,Key,Val\", \"set\", \"export\", JSONEncode(value))\n }\n}",
"Type": "contracts"
},
{
"Name": "UnbindWallet",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract UnbindWallet {\n data {\n Id int\n }\n\n conditions {\n DeveloperCondition()\n\n $cur = DBFind(\"@1contracts\").Columns(\"id,conditions,wallet_id\").Where({\"id\": $Id, \"ecosystem\": $ecosystem_id}).Row()\n if !$cur {\n warning Sprintf(LangRes(\"@1contract_x_not_exist\", \"en\"), $Id)\n }\n if Int($cur[\"wallet_id\"]) == 0 {\n warning Sprintf(LangRes(\"@1contract_x_unbinded_already\", \"en\"), $Id)\n }\n if AddressToId($account_id) != Int($cur[\"wallet_id\"]) {\n warning LangRes(\"@1contract_cannot_unbind\", \"en\")\n }\n RowConditions(\"@1contracts\", $Id, false)\n }\n\n action {\n UnbndWallet($Id, $ecosystem_id)\n }\n}",
"Type": "contracts"
},
{
"Name": "UpdateMetrics",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract UpdateMetrics {\n conditions {\n ContractConditions(\"MainCondition\")\n }\n\n action {\n var values array\n values = DBCollectMetrics()\n\n var i, id int\n var v map\n while (i < Len(values)) {\n var inmap map\n\n v = values[i]\n inmap[\"time\"] = v[\"time\"]\n inmap[\"key\"] = v[\"key\"]\n inmap[\"metric\"] = v[\"metric\"]\n\n id = Int(DBFind(\"@1metrics\").Where(inmap).One(\"id\"))\n var ival int\n if id != 0 {\n ival = Int(v[\"value\"])\n DBUpdate(\"@1metrics\", id, {\"value\": ival})\n } else {\n inmap[\"value\"] = Int(v[\"value\"])\n DBInsert(\"@1metrics\", inmap )\n }\n i = i + 1\n }\n }\n}",
"Type": "contracts"
},
{
"Name": "UpdateSysParam",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract UpdateSysParam {\n data {\n Name string\n Value string\n VotingId int\n Conditions string \"optional\"\n }\n\n conditions {\n if GetContractByName($Name) == 0{\n warning LangRes(\"@1system_parameter_not_found\", \"en\")\n }\n\n var prev string\n prev = $stack[0]\n if Len($stack) > 2{\n prev = $stack[Len($stack) - 2]\n }\n if prev != \"@1VotingDecisionCheck\" {\n warning LangRes(\"@1contract_start_votingdecisioncheck_only\", \"en\")\n }\n $voting = DBFind(\"@1votings\").Where({\"ecosystem\": $ecosystem_id, \"id\": $VotingId}).Columns(\"voting->type_decision,flags->success,voting->type\").Row()\n if Int($voting[\"voting.type\"]) != 2 {\n warning LangRes(\"@1voting_type_invalid\", \"en\")\n }\n if Int($voting[\"voting.type_decision\"]) != 4 {\n warning LangRes(\"@1voting_error_decision\", \"en\")\n }\n if Int($voting[\"flags.success\"]) != 1 {\n warning LangRes(\"@1voting_error_success\", \"en\")\n }\n }\n\n action {\n var params map\n params[\"Value\"] = $Value\n CallContract($Name, params)\n DBUpdateSysParam($Name, $Value, $Conditions)\n }\n}",
"Type": "contracts"
},
{
"Name": "Export",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract Export {\n data {}\n\n func createExport(items array) string {\n var res map\n res[\"name\"] = $AppName\n res[\"conditions\"] = $AppConditions\n res[\"data\"] = items\n return JSONEncodeIndent(res, \" \")\n }\n\n func mapping(res map, resKey string, item map itemKey string){\n if item[itemKey] {\n res[resKey] = Str(item[itemKey])\n }\n }\n\n func prepareItem(item map, type string) string {\n var res map\n res[\"Type\"] = type\n mapping(res, \"Name\", item, \"name\")\n mapping(res, \"Value\", item, \"value\")\n mapping(res, \"Conditions\", item, \"conditions\")\n mapping(res, \"Menu\", item, \"menu\")\n mapping(res, \"Title\", item, \"title\")\n mapping(res, \"Trans\", item, \"res\")\n mapping(res, \"Columns\", item, \"columns\")\n mapping(res, \"Permissions\", item, \"permissions\")\n mapping(res, \"Confirmation\", item, \"confirmation\")\n return res\n }\n\n func getColumnsWithType(table_name string, columnsJSON string) string {\n var colsMap map result columns array\n colsMap = JSONDecode(columnsJSON)\n columns = GetMapKeys(colsMap)\n var i int\n while i < Len(columns) {\n if Size(columns[i]) > 0 {\n var col map\n col[\"name\"] = columns[i]\n col[\"conditions\"] = colsMap[col[\"name\"]]\n col[\"type\"] = GetColumnType(table_name, col[\"name\"])\n result = Append(result, col)\n }\n i = i + 1\n }\n return JSONEncode(result)\n }\n\n func exportTable(type string, result array) array {\n var items array limit offset i lenItems int item map\n limit = 250\n while true {\n var rows array where map\n if type == \"menu\" {\n if Len($menus_names) > 0 {\n where[\"name\"] = {\"$in\": $menus_names}\n where[\"ecosystem\"] = $ecosystem_id\n }\n } else {\n where[\"app_id\"] = $AppID\n where[\"ecosystem\"] = $ecosystem_id\n }\n if where {\n var tbl string\n tbl = \"@1\" + Str(type)\n if tbl == \"@1languages\" {\n rows = DBFind(tbl).Limit(limit).Offset(offset).Where({\"ecosystem\": $ecosystem_id})\n } else {\n rows = DBFind(tbl).Limit(limit).Offset(offset).Where(where)\n }\n }\n if Len(rows) > 0{\n i = 0\n while i < Len(rows){\n items = Append(items, rows[i])\n i = i + 1\n }\n } else {\n break\n }\n offset = offset + limit\n }\n i = 0\n lenItems = Len(items)\n while i < lenItems {\n item = items[i]\n if type == \"tables\" {\n item[\"columns\"] = getColumnsWithType(item[\"name\"], item[\"columns\"])\n }\n result = Append(result, prepareItem(item, type))\n if type == \"pages\" {\n $menus_names = Append($menus_names, Sprintf(\"'%v'\", item[\"menu\"]))\n }\n i = i + 1\n }\n return result\n }\n\n conditions {\n DeveloperCondition()\n\n var buf app map\n buf = DBFind(\"@1buffer_data\").Columns(\"id,value->app_id,value->app_name\").Where({\"account\": $account_id, \"key\": \"export\", \"ecosystem\": $ecosystem_id}).Row()\n if !buf {\n warning LangRes(\"@1app_not_selected\", \"en\")\n }\n $AppID = Int(buf[\"value.app_id\"])\n $AppName = Str(buf[\"value.app_name\"])\n\n app = DBFind(\"@1applications\").Columns(\"id,conditions\").Where({\"id\": $AppID, \"ecosystem\": $ecosystem_id}).Row()\n if !app {\n warning LangRes(\"@1app_not_found\", \"en\")\n }\n $AppConditions = app[\"conditions\"]\n\n $menus_names = []\n }\n\n action {\n var exportJSON string items array\n items = exportTable(\"pages\", items)\n items = exportTable(\"contracts\", items)\n items = exportTable(\"blocks\", items)\n items = exportTable(\"app_params\", items)\n items = exportTable(\"tables\", items)\n items = exportTable(\"menu\", items)\n\n exportJSON = createExport(items)\n UploadBinary(\"Name,Data,ApplicationId,DataMimeType\", \"export\", exportJSON, $AppID, \"application/json\")\n }\n}",
"Type": "contracts"
},
{
"Name": "BufferFileUpload",
"Conditions": "ContractConditions(\"@1DeveloperCondition\")",
"Value": "contract BufferFileUpload {\n data {\n AppId int\n BufferKey string\n FileName string \"optional\"\n FileData file\n }\n\n conditions {\n var app_id int\n app_id = DBFind(\"@1applications\").Where({\"id\": $AppId, \"deleted\": 0}).One(\"id\")\n if !app_id {\n warning LangRes(\"@1app_not_found\", \"en\")\n }\n if $BufferKey == \"\" {\n warning LangRes(\"@1buffer_key_empty\", \"en\")\n }\n }\n\n action {\n var buffer_data map\n if $FileName != \"\" {\n buffer_data[\"binary_id\"] = @1UploadFile(\"Name,Data,ApplicationId\", $FileName, $FileData, Int($AppId))\n } else {\n buffer_data[\"binary_id\"] = @1UploadFile(\"Data,ApplicationId\", $FileData, Int($AppId))\n }\n @1BufferManager(\"Action,Key,Val\", \"set\", $BufferKey, JSONEncode(buffer_data))\n }\n}",
"Type": "contracts"
}
]
}