From 0cee834f11b3cba9822849a47ada924f060ce963 Mon Sep 17 00:00:00 2001 From: syypoo Date: Fri, 16 Nov 2018 22:06:12 +1000 Subject: [PATCH] Release v1.2.0 --- basic.json | 90 ++++-- lang_res.json | 207 ++++++++++++- other/tokens_sale.json | 60 ++-- .../blocks/ts_contract_investors.ptl | 18 +- other/tokens_sale/config.json | 20 +- .../tokens_sale/contracts/TsFreeWalletAdd.sim | 32 ++ .../contracts/TsFreeWalletDelete.sim | 23 ++ other/tokens_sale/contracts/TsKeyApprove.sim | 30 +- .../tokens_sale/contracts/TsTransferAdmin.sim | 63 ++-- other/tokens_sale/menus/default_menu.ptl | 9 +- .../pages/ts_buyer_congratulation.ptl | 274 ++++++++---------- other/tokens_sale/pages/ts_buyer_contract.ptl | 52 ++-- .../tokens_sale/pages/ts_commercial_terms.ptl | 16 +- .../pages/ts_consensus_contract.ptl | 110 ++++--- .../tokens_sale/pages/ts_free_wallet_add.ptl | 26 ++ other/tokens_sale/pages/ts_free_wallets.ptl | 51 ++++ other/tokens_sale/pages/ts_notification.ptl | 22 +- other/tokens_sale/pages/ts_sales.ptl | 30 +- other/tokens_sale/pages/ts_transfer_admin.ptl | 65 +++-- .../tokens_sale/pages/ts_transfer_manager.ptl | 199 +++++++------ .../tokens_sale/pages/ts_transfer_seller.ptl | 205 +++++++------ other/tokens_sale/pages/ts_transfer_view.ptl | 11 +- other/tokens_sale/pages/ts_wallets.ptl | 24 +- other/tokens_sale/struct.dot | 23 +- other/tokens_sale/tables/ts_wallets.json | 29 +- src/basic/blocks/notifications_roles.ptl | 27 +- src/basic/blocks/notifications_single.ptl | 14 +- src/basic/blocks/profile.ptl | 2 +- src/basic/config.json | 25 ++ src/basic/contracts/DeleteMember.sim | 40 +++ src/basic/contracts/MembershipRequest.sim | 53 +++- src/basic/contracts/NodeRemoveByKey.sim | 2 +- .../contracts/NotificationsBroadcast.sim | 14 +- src/basic/contracts/NotificationsSend.sim | 6 + src/basic/contracts/TokensSend.sim | 2 +- src/basic/contracts/TokensTransfer.sim | 27 +- src/basic/menus/admin_menu.ptl | 4 +- src/basic/menus/default_menu.ptl | 2 + src/basic/pages/members_list.ptl | 4 +- src/basic/pages/members_list_admin.ptl | 24 +- src/basic/pages/membership_user_view.ptl | 2 +- src/basic/pages/message_create.ptl | 76 +++++ src/basic/pages/message_view.ptl | 194 +++++++++++++ src/basic/pages/messages_list.ptl | 114 ++++++++ src/basic/pages/notifications.ptl | 76 +++-- src/basic/pages/notifications_broadcast.ptl | 107 ++++--- src/basic/pages/notifications_roles_send.ptl | 25 +- src/basic/pages/notifications_show.ptl | 8 +- src/basic/pages/notifications_single_send.ptl | 27 +- src/basic/pages/notifications_testpage.ptl | 120 ++++---- .../pages/notifications_testpage_popup.ptl | 65 +++++ src/basic/pages/profile_transactions.ptl | 2 +- .../pages/profile_transactions_filter.ptl | 2 +- src/basic/pages/roles_list.ptl | 2 +- src/basic/pages/sysparams_list.ptl | 4 +- .../pages/sysparams_validator_resign.ptl | 39 +-- src/basic/pages/sysparams_voting.ptl | 10 - src/basic/pages/tokenrefund_list.ptl | 2 - src/basic/pages/voting_templates_list.ptl | 4 +- src/basic/struct.dot | 29 +- src/conditions/struct.dot | 2 +- src/lang_res/languages/amount_apl.json | 2 +- src/lang_res/languages/broadcast.json | 1 + .../languages/ecosystem_not_found.json | 1 + src/lang_res/languages/guest.json | 1 + src/lang_res/languages/mark_read.json | 1 + .../languages/message_active_threads.json | 1 + src/lang_res/languages/message_create.json | 1 + src/lang_res/languages/message_from.json | 1 + src/lang_res/languages/message_from_you.json | 1 + src/lang_res/languages/message_subject.json | 1 + .../languages/message_subject_empty.json | 1 + .../languages/message_subject_type_here.json | 1 + src/lang_res/languages/message_text.json | 1 + .../languages/message_thread_history.json | 1 + .../languages/message_thread_show.json | 1 + src/lang_res/languages/message_type_here.json | 1 + src/lang_res/languages/message_view.json | 1 + src/lang_res/languages/messages_empty.json | 1 + src/lang_res/languages/messenger.json | 1 + src/lang_res/languages/need_fuel.json | 2 +- src/lang_res/languages/not_need_fuel.json | 2 +- .../languages/notifications_view.json | 2 +- src/lang_res/languages/only_admin_action.json | 2 +- .../only_first_ecosystem_action.json | 2 +- .../languages/poa_not_rights_to_change.json | 1 + src/lang_res/languages/popup.json | 1 + src/lang_res/languages/reply.json | 1 + src/lang_res/languages/reply_text.json | 1 + .../languages/ts_free_wallet_add.json | 1 + .../languages/ts_free_wallet_not_found.json | 1 + src/lang_res/languages/ts_free_wallets.json | 1 + .../languages/ts_free_wallets_emptied.json | 1 + .../languages/ts_free_wallets_need.json | 1 + src/lang_res/languages/ts_investor_key.json | 2 +- .../languages/ts_settings_description.json | 2 +- .../languages/ts_transfer_seller.json | 2 +- src/lang_res/languages/ts_wallet_btc.json | 1 + src/lang_res/languages/ts_wallet_eth.json | 1 + src/lang_res/languages/understood.json | 1 + src/lang_res/languages/unread.json | 1 + .../languages/validate_wallet_btc.json | 1 + .../languages/validate_wallet_eth.json | 1 + src/lang_res/languages/vde_form_desc.json | 2 +- src/lang_res/languages/wallet_btc_exists.json | 1 + src/lang_res/languages/wallet_eth_exists.json | 1 + src/lang_res/languages/want_delete_key.json | 1 + src/lang_res/languages/web_form_desc.json | 2 +- src/lang_res/languages/you.json | 1 + src/lang_res/struct.dot | 2 +- src/system/blocks/pager.ptl | 8 +- src/system/contracts/EditColumn.sim | 3 +- src/system/pages/table_edit.ptl | 63 ++-- src/system/struct.dot | 4 +- system.json | 6 +- 115 files changed, 2133 insertions(+), 857 deletions(-) create mode 100644 other/tokens_sale/contracts/TsFreeWalletAdd.sim create mode 100644 other/tokens_sale/contracts/TsFreeWalletDelete.sim create mode 100644 other/tokens_sale/pages/ts_free_wallet_add.ptl create mode 100644 other/tokens_sale/pages/ts_free_wallets.ptl create mode 100644 src/basic/contracts/DeleteMember.sim create mode 100644 src/basic/pages/message_create.ptl create mode 100644 src/basic/pages/message_view.ptl create mode 100644 src/basic/pages/messages_list.ptl create mode 100644 src/basic/pages/notifications_testpage_popup.ptl create mode 100644 src/lang_res/languages/broadcast.json create mode 100644 src/lang_res/languages/ecosystem_not_found.json create mode 100644 src/lang_res/languages/guest.json create mode 100644 src/lang_res/languages/mark_read.json create mode 100644 src/lang_res/languages/message_active_threads.json create mode 100644 src/lang_res/languages/message_create.json create mode 100644 src/lang_res/languages/message_from.json create mode 100644 src/lang_res/languages/message_from_you.json create mode 100644 src/lang_res/languages/message_subject.json create mode 100644 src/lang_res/languages/message_subject_empty.json create mode 100644 src/lang_res/languages/message_subject_type_here.json create mode 100644 src/lang_res/languages/message_text.json create mode 100644 src/lang_res/languages/message_thread_history.json create mode 100644 src/lang_res/languages/message_thread_show.json create mode 100644 src/lang_res/languages/message_type_here.json create mode 100644 src/lang_res/languages/message_view.json create mode 100644 src/lang_res/languages/messages_empty.json create mode 100644 src/lang_res/languages/messenger.json create mode 100644 src/lang_res/languages/poa_not_rights_to_change.json create mode 100644 src/lang_res/languages/popup.json create mode 100644 src/lang_res/languages/reply.json create mode 100644 src/lang_res/languages/reply_text.json create mode 100644 src/lang_res/languages/ts_free_wallet_add.json create mode 100644 src/lang_res/languages/ts_free_wallet_not_found.json create mode 100644 src/lang_res/languages/ts_free_wallets.json create mode 100644 src/lang_res/languages/ts_free_wallets_emptied.json create mode 100644 src/lang_res/languages/ts_free_wallets_need.json create mode 100644 src/lang_res/languages/ts_wallet_btc.json create mode 100644 src/lang_res/languages/ts_wallet_eth.json create mode 100644 src/lang_res/languages/understood.json create mode 100644 src/lang_res/languages/unread.json create mode 100644 src/lang_res/languages/validate_wallet_btc.json create mode 100644 src/lang_res/languages/validate_wallet_eth.json create mode 100644 src/lang_res/languages/wallet_btc_exists.json create mode 100644 src/lang_res/languages/wallet_eth_exists.json create mode 100644 src/lang_res/languages/want_delete_key.json create mode 100644 src/lang_res/languages/you.json diff --git a/basic.json b/basic.json index 6bb41de9e..3e78f88b9 100644 --- a/basic.json +++ b/basic.json @@ -11,19 +11,19 @@ { "Name": "notifications_roles", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1notifications_list).(this_table, @1notifications)\r\nInclude(@1pager_header)\r\n\r\nIf(#role_id#>0){\r\n DBFind(@1roles).Where({id:#role_id#}).Vars(my)\r\n SetTitle($@1role_notifics$ (#my_role_name#))\r\n}.Else{\r\n SetTitle($@1role_notifics$)\r\n}\r\nSetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin))\r\nIf(And(#role_id#==#role_admin#,#ecosystem_id#==1)){\r\n DBFind(@1ecosystems).Count(ecos_count)\r\n If(#ecos_count#>1){\r\n AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus)\r\n }\r\n}\r\nAddToolButton(Title: $@1send$, Page: @1notifications_roles_send, Icon: icon-plus).Popup(Header: $@1send$, Width: \"50\")\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"recipient->role_id\":#role_id#, {$and: [{\"notification->type\":2}, {$or: [{\"sender->member_name\":{$like: #search#}},{\"sender->role_name\":{$like: #search#}}]}]}})\r\n}.Else{\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"notification->type\":2, \"recipient->role_id\":#role_id#}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1sender)).(page_par, #type#)\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order([{closed:\"1\"},{id:\"-1\"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns(\"id,recipient->role_id,recipient->role_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,page_name,page_params,date_created,date_closed,date_start_processing,processing_info->member_name,closed\").Custom(_id){\r\n If(#closed# == 0){\r\n SetVar(style_text,\"text-normal\").(style_link,\"text-primary\")\r\n }.Else{\r\n SetVar(style_text,\"text-muted\").(style_link,\"text-muted\")\r\n }\r\n Span(Class: #style_text#, Body: #id#)\r\n}.Custom(_recipient){\r\n LinkPage(Class: #style_link# t5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#recipient.role_id#\"){\r\n If(#recipient.image_id#>0){\r\n Image(Src: Binary().ById(#recipient.image_id#) \"#img_data#\", Class: mr-sm).Style(width: 30px; border: 1px solid #5A5D63;)\r\n #recipient.role_name#\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-settings fa-2x)).Style(margin-right:10px;)\r\n Span(#recipient.role_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Custom(custom_arrow){\r\n Em(Class: fa fa-long-arrow-right fa-1x #style_text#)\r\n}.Custom(_sender){\r\n If(#sender.type#==1){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sender.member_id#\"){#sender.member_name#}\r\n }\r\n If(#sender.type#==2){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#sender.role_id#\"){#sender.role_name#}\r\n }\r\n}.Custom(_icon){\r\n Span(Class: fa #notification.icon# fa-2x #style_text#)\r\n}.Custom(_page){\r\n LinkPage(Class: #style_link# t5 text-bold, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n #page_name#\r\n }\r\n}.Custom(_date){\r\n Div(#style_text# t6){DateTime(DateTime: #date_created#, Format: \"DD.MM.YYYY HH:MI\")}\r\n Div(#style_text# t6){DateTime(DateTime: #date_closed#, Format: \"DD.MM.YYYY HH:MI\")}\r\n}.Custom(_processing){\r\n Div(Class: #style_text# t6){\r\n If(#date_start_processing# == NULL){\r\n $@1not_started$\r\n }.Else{\r\n Span(LangRes(@1started), mr-sm) #processing_info.member_name#\r\n Span(LangRes(@1at), mr-sm)\r\n DateTime(DateTime: #date_start_processing#, Format: \"DD.MM.YYYY HH:MI\")\r\n }\r\n }\r\n}.Custom(_status){\r\n If(#closed# == 0){\r\n Span(Class: #style_text#){\r\n If(#date_start_processing# == NULL){\r\n LangRes(@1active)\r\n }.Else{\r\n LangRes(@1processing)\r\n }\r\n }\r\n }.Else{\r\n Span(Class: #style_text#, Body: LangRes(@1closed))\r\n }\r\n}.Custom(_actions){\r\n Div(text-right){\r\n If(#closed# == 0){\r\n If(#date_start_processing# == NULL){\r\n Button(Class: btn btn-default fa fa-play, Contract: @1NotificationsProcess, Params: \"notific_id=#id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_start_processing_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.Else{\r\n Button(Class: btn btn-default fa fa-trash, Contract: @1NotificationsClose, Params: \"notific_id=#id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_close_notification$\", ConfirmButton:$@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1icon$=_icon,$@1page$=_page,$@1sender$=_sender,=custom_arrow,$@1recipient$=_recipient,$@1processing$=_processing,$@1sent$ / $@1closed$=_date,$@1status$=_status,=_actions\")\r\n }.ElseIf(#role_id#>0){\r\n Div(Class: text-center h4 text-muted, Body: \"$@1role_notifics$ $@1not_founded$\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1role_not_selected$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1notifications_list).(this_table, @1notifications)\r\nInclude(@1pager_header)\r\n\r\nIf(#role_id#>0){\r\n DBFind(@1roles).Where({id:#role_id#}).Vars(my)\r\n SetTitle($@1role_notifics$ (#my_role_name#))\r\n}.Else{\r\n SetTitle($@1role_notifics$)\r\n}\r\nSetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin))\r\nIf(And(#role_id#==#role_admin#,#ecosystem_id#==1)){\r\n DBFind(@1ecosystems).Count(ecos_count)\r\n If(#ecos_count#>1){\r\n AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus).Popup(Header: $@1notifications_broadcast$, Width: \"50\")\r\n }\r\n}\r\nAddToolButton(Title: $@1send$, Page: @1notifications_roles_send, Icon: icon-plus).Popup(Header: $@1send$, Width: \"50\")\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"recipient->role_id\":#role_id#, {$and: [{\"notification->type\":2}, {$or: [{\"sender->member_name\":{$like: #search#}},{\"sender->role_name\":{$like: #search#}}]}]}})\r\n}.Else{\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"notification->type\":2, \"recipient->role_id\":#role_id#}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1sender)).(page_par, #type#)\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order([{closed:\"1\"},{id:\"-1\"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns(\"id,recipient->role_id,recipient->role_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,notification->popup,page_name,page_params,date_created,date_closed,date_start_processing,processing_info->member_name,closed\").Custom(_id){\r\n If(#closed# == 0){\r\n SetVar(style_text,\"text-normal\").(style_link,\"text-primary\")\r\n }.Else{\r\n SetVar(style_text,\"text-muted\").(style_link,\"text-muted\")\r\n }\r\n Span(Class: #style_text#, Body: #id#)\r\n}.Custom(_recipient){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#recipient.role_id#\"){\r\n If(#recipient.image_id#>0){\r\n Image(Src: Binary().ById(#recipient.image_id#) \"#img_data#\", Class: mr-sm).Style(width: 30px; border: 1px solid #5A5D63;)\r\n #recipient.role_name#\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-settings fa-2x)).Style(margin-right:10px;)\r\n Span(#recipient.role_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Custom(custom_arrow){\r\n Em(Class: fa fa-long-arrow-right fa-1x #style_text#)\r\n}.Custom(_sender){\r\n If(#sender.type#==1){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sender.member_id#\"){#sender.member_name#}\r\n }\r\n If(#sender.type#==2){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#sender.role_id#\"){#sender.role_name#}\r\n }\r\n}.Custom(_icon){\r\n Span(Class: fa #notification.icon# fa-2x #style_text#)\r\n}.Custom(_page){\r\n If(#notification.popup#==1){\r\n Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Span(Class: #style_link#, Body: #page_name#)\r\n }.Popup(Header: $@1notifications_view$, Width: \"40\")\r\n }.Else{\r\n Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Span(Class: #style_link#, Body: #page_name#)\r\n }\r\n }\r\n}.Custom(_date){\r\n Div(#style_text# h6 m0){DateTime(DateTime: #date_created#, Format: \"DD.MM.YYYY HH:MI\")}\r\n Div(#style_text# h6 m0){DateTime(DateTime: #date_closed#, Format: \"DD.MM.YYYY HH:MI\")}\r\n}.Custom(_processing){\r\n Div(Class: #style_text# h6 m0){\r\n If(#date_start_processing# == NULL){\r\n $@1not_started$\r\n }.Else{\r\n Span(LangRes(@1started_by) #processing_info.member_name#)\r\n Div(){DateTime(DateTime: #date_start_processing#, Format: \"DD.MM.YYYY HH:MI\")}\r\n }\r\n }\r\n}.Custom(_status){\r\n If(#closed# == 0){\r\n Span(Class: #style_text#){\r\n If(#date_start_processing# == NULL){\r\n LangRes(@1active)\r\n }.Else{\r\n LangRes(@1processing)\r\n }\r\n }\r\n }.Else{\r\n Span(Class: #style_text#, Body: LangRes(@1closed))\r\n }\r\n}.Custom(_actions){\r\n Div(text-right){\r\n If(#closed# == 0){\r\n If(#date_start_processing# == NULL){\r\n Button(Class: btn btn-default fa fa-play, Contract: @1NotificationsProcess, Params: \"notific_id=#id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_start_processing_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.Else{\r\n Button(Class: btn btn-default fa fa-trash, Contract: @1NotificationsClose, Params: \"notific_id=#id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_close_notification$\", ConfirmButton:$@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1icon$=_icon,$@1page$=_page,$@1sender$=_sender,=custom_arrow,$@1recipient$=_recipient,$@1processing$=_processing,$@1sent$ / $@1closed$=_date,$@1status$=_status,=_actions\")\r\n }.ElseIf(#role_id#>0){\r\n Div(Class: text-center h4 text-muted, Body: \"$@1role_notifics$ $@1not_founded$\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1role_not_selected$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Type": "blocks" }, { "Name": "notifications_single", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1notifications_list).(this_table, @1notifications)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1single_notifics$\")\r\nSetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin))\r\nIf(And(#role_id#==#role_admin#,#ecosystem_id#==1)){\r\n DBFind(@1ecosystems).Count(ecos_count)\r\n If(#ecos_count#>1){\r\n AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus)\r\n }\r\n}\r\nAddToolButton(Title: $@1send$, Page: @1notifications_single_send, Icon: icon-plus).Popup(Header: $@1send$, Width: \"50\")\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"recipient->member_id\":#key_id#, {$and: [{\"notification->type\":1}, {$or: [{\"sender->member_name\":{$like: #search#}},{\"sender->role_name\":{$like: #search#}}]}]}})\r\n}.Else{\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"notification->type\":1, \"recipient->member_id\":#key_id#}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1sender)).(page_par, #type#)\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order([{closed:\"1\"}, {id:\"-1\"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns(\"id,recipient->member_id,recipient->member_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,page_name,page_params,date_created,date_closed,closed\").Custom(custom_id){\r\n If(#closed# == 0){\r\n SetVar(Name: style_text, Value: \"text-normal\")\r\n SetVar(Name: style_link, Value: \"text-primary\")\r\n }.Else{\r\n SetVar(Name: style_text, Value: \"text-muted\")\r\n SetVar(Name: style_link, Value: \"text-muted\")\r\n }\r\n Span(Class: #style_text#, Body: #id#)\r\n}.Custom(custom_recipient){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#recipient.member_id#\"){\r\n If(#recipient.image_id#>0){\r\n Image(Src: Binary().ById(#recipient.image_id#), Class: img-circle).Style(width: 30px; border: 1px solid #5A5D63; margin-right: 10px;)\r\n Span(#recipient.member_name#)\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-user fa-2x)).Style(margin-right:10px;)\r\n Span(#recipient.member_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Custom(custom_arrow){\r\n Em(Class: fa fa-long-arrow-right fa-1x #style_text#)\r\n}.Custom(custom_sender){\r\n If(#sender.type#==1){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sender.member_id#\"){\r\n Span(Body: #sender.member_name#)\r\n }\r\n }\r\n If(#sender.type#==2){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#sender.role_id#\"){\r\n Span(Body: #sender.role_name#)\r\n }\r\n }\r\n}.Custom(custom_icon){\r\n Em(Class: fa #notification.icon# fa-2x #style_text#)\r\n}.Custom(custom_page){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Span(Body: #page_name#)\r\n }\r\n}.Custom(custom_date){\r\n Div(Class: #style_text# h6 m0, Body: DateTime(DateTime: #date_created#, Format: \"DD.MM.YYYY HH:MI\"))\r\n Div(Class: #style_text# h6 m0, Body: DateTime(DateTime: #date_closed#, Format: \"DD.MM.YYYY HH:MI\"))\r\n}.Custom(custom_status){\r\n If(#closed# == 0){\r\n Span(Class: #style_text#, Body: LangRes(@1active))\r\n }.Else{\r\n Span(Class: #style_text#, Body: LangRes(@1closed))\r\n }\r\n}.Custom(actions){\r\n Div(pull-right){\r\n If(#closed# == 0){\r\n Button(Body: Em(Class: fa fa-trash), Class: btn btn-default, Contract: @1NotificationsClose, Params: \"notific_id=#id#\", Page: @1notifications_list).Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1icon$=custom_icon,$@1page$=custom_page,$@1sender$=custom_sender,=custom_arrow,$@1recipient$=custom_recipient,$@1sent$ / $@1closed$=custom_date,$@1status$=custom_status,=actions\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1single_notifics$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1notifications_list).(this_table, @1notifications)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1single_notifics$\")\r\nSetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin))\r\nIf(And(#role_id#==#role_admin#,#ecosystem_id#==1)){\r\n DBFind(@1ecosystems).Count(ecos_count)\r\n If(#ecos_count#>1){\r\n AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus).Popup(Header: $@1notifications_broadcast$, Width: \"50\")\r\n }\r\n}\r\nAddToolButton(Title: $@1send$, Page: @1notifications_single_send, Icon: icon-plus).Popup(Header: $@1send$, Width: \"50\")\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"recipient->member_id\":#key_id#, {$and: [{\"notification->type\":1}, {$or: [{\"sender->member_name\":{$like: #search#}},{\"sender->role_name\":{$like: #search#}}]}]}})\r\n}.Else{\r\n SetVar(where, {\"ecosystem\":#ecosystem_id#, \"notification->type\":1, \"recipient->member_id\":#key_id#}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1sender)).(page_par, #type#)\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order([{closed:\"1\"}, {id:\"-1\"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns(\"id,recipient->member_id,recipient->member_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,notification->popup,page_name,page_params,date_created,date_closed,closed\").Custom(custom_id){\r\n If(#closed# == 0){\r\n SetVar(Name: style_text, Value: \"text-normal\")\r\n SetVar(Name: style_link, Value: \"text-primary\")\r\n }.Else{\r\n SetVar(Name: style_text, Value: \"text-muted\")\r\n SetVar(Name: style_link, Value: \"text-muted\")\r\n }\r\n Span(Class: #style_text#, Body: #id#)\r\n}.Custom(custom_recipient){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#recipient.member_id#\"){\r\n If(#recipient.image_id#>0){\r\n Image(Src: Binary().ById(#recipient.image_id#), Class: img-circle).Style(width: 30px; border: 1px solid #5A5D63; margin-right: 10px;)\r\n Span(#recipient.member_name#)\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-user fa-2x)).Style(margin-right:10px;)\r\n Span(#recipient.member_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Custom(custom_arrow){\r\n Em(Class: fa fa-long-arrow-right fa-1x #style_text#)\r\n}.Custom(custom_sender){\r\n If(#sender.type#==1){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sender.member_id#\"){\r\n Span(Body: #sender.member_name#)\r\n }\r\n }\r\n If(#sender.type#==2){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#sender.role_id#\"){\r\n Span(Body: #sender.role_name#)\r\n }\r\n }\r\n}.Custom(custom_icon){\r\n Em(Class: fa #notification.icon# fa-2x #style_text#)\r\n}.Custom(custom_page){\r\n If(#notification.popup#==1){\r\n Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Span(Class: #style_link#, Body: #page_name#)\r\n }.Popup(Header: $@1notifications_view$, Width: \"40\")\r\n }.Else{\r\n Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Span(Class: #style_link#, Body: #page_name#)\r\n }\r\n }\r\n}.Custom(custom_date){\r\n Div(Class: #style_text# h6 m0, Body: DateTime(DateTime: #date_created#, Format: \"DD.MM.YYYY HH:MI\"))\r\n Div(Class: #style_text# h6 m0, Body: DateTime(DateTime: #date_closed#, Format: \"DD.MM.YYYY HH:MI\"))\r\n}.Custom(custom_status){\r\n If(#closed# == 0){\r\n Span(Class: #style_text#, Body: LangRes(@1active))\r\n }.Else{\r\n Span(Class: #style_text#, Body: LangRes(@1closed))\r\n }\r\n}.Custom(actions){\r\n Div(pull-right){\r\n If(#closed# == 0){\r\n Button(Body: Em(Class: fa fa-trash), Class: btn btn-default, Contract: @1NotificationsClose, Params: \"notific_id=#id#\", Page: @1notifications_list).Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1icon$=custom_icon,$@1page$=custom_page,$@1sender$=custom_sender,=custom_arrow,$@1recipient$=custom_recipient,$@1sent$ / $@1closed$=custom_date,$@1status$=custom_status,=actions\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1single_notifics$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Type": "blocks" }, { "Name": "profile", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Div(content-wrapper){\r\n If(Or(#v_key_id#>0,#v_key_id#<0)){\r\n }.Else{\r\n SetVar(v_key_id,#key_id#)\r\n }\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#v_key_id#}).Columns(\"id,image_id,member_name,member_info->information\").Vars(member)\r\n\r\n If(Or(#member_id#>0,#member_id#<0)){\r\n SetVar(member_name, #member_member_name#).(member_info, #member_member_info_information#)\r\n }.Else{\r\n SetVar(member_name,).(member_info,)\r\n }\r\n\r\n Div(row){\r\n Div(col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3){\r\n Form(panel panel-primary){\r\n Div(panel-body){\r\n Div(text-center text-bold h4 m0){\r\n LangRes(@1user_info)\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-12 text-center){\r\n If(Or(#member_id#>0,#member_id#<0)){\r\n If(#member_id# == #key_id#){\r\n Button(Class: btn btn-link, Page: @1profile_edit){\r\n If(#member_image_id#>0){\r\n Image(Src: Binary().ById(#member_image_id#), Class: img-thumbnail).Style(width: 120px; border: 1px solid #5A5D63;)\r\n }.Else{\r\n Span(Class: fa icon-user fa-5x text-primary)\r\n }\r\n Div(m0 h4 text-bold){\r\n #member_name#\r\n If(#role_id# > 0){\r\n DBFind(@1roles).Where({ecosystem:#ecosystem_id#, id:#role_id#}).Columns(\"role_name\").Vars(role)\r\n Span(Body: \" (#role_role_name#)\")\r\n }\r\n }\r\n }\r\n }.Else{\r\n If(#member_image_id#>0){\r\n Image(Src: Binary().ById(#member_image_id#), Class: img-thumbnail).Style(width: 120px; border: 1px solid #5A5D63;)\r\n }.Else{\r\n Span(Class: fa icon-user fa-5x)\r\n }\r\n Div(m0 h4 text-bold){#member_name#}\r\n }\r\n Div(Class: h5 text-muted m0, Body: #member_info#)\r\n }.Else{\r\n If(#v_key_id# == #key_id#){\r\n Button(Class: btn btn-link, Page: @1profile_edit){\r\n Div(Class: h4 m0, Body: LangRes(@1editing_profile))\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-12 text-center){\r\n Div(text-bold m0 h5, Body: LangRes(@1wallet_address))\r\n Span(Class: h5, Body: Address(#v_key_id#))\r\n }\r\n }\r\n If(#v_key_id# == #key_id#){\r\n Div(row){\r\n Div(col-md-12 mt text-center){\r\n DBFind(@1keys).Where({ecosystem:1, id:#v_key_id#}).Vars(apl)\r\n If(#ecosystem_id#>1){\r\n DBFind(@1keys).Where({ecosystem:#ecosystem_id#, id:#v_key_id#}).Vars(tokens)\r\n }\r\n Div(text-bold m0 h5, Body: LangRes(@1balance))\r\n Div(Class: m0 h5, Body: Money(#apl_amount#) APL)\r\n If(#ecosystem_id#>1){\r\n If(#tokens_amount#>0){\r\n Div(Class: m0 h5, Body: Money(#tokens_amount#) ecosystem tokens)\r\n }.Else{\r\n Div(Class: m0 h5, Body: 0 ecosystem tokens)\r\n }\r\n }\r\n Button(Class: btn-xs btn-link, Page: @1profile_transactions, Body: LangRes(@1transactions_history))\r\n Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: \"back_page=@1profile_view\", Body: LangRes(@1tokens_send)).Popup(Header: $@1tokens_send$, Width: \"50\")\r\n }\r\n }\r\n }\r\n Div(list-group-item text-center mt-lg){\r\n Div(text-bold m0 h5, Body: LangRes(@1roles))\r\n DBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#v_key_id#, deleted:0}).Columns(\"id\").Vars(check)\r\n If(#check_id#>0){\r\n DBFind(@1roles_participants,src_roles).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#v_key_id#, deleted:0}).Columns(\"role->id,role->name\").Order(\"id\")\r\n ForList(src_roles){\r\n Span(){\r\n LinkPage(Class: h6 m0 text-primary, Page: @1roles_view, PageParams: \"v_role_id=#role.id#\", Body: \"#role.name#\")\r\n }.Style(margin-right: 5px; margin-left: 5px;)\r\n }\r\n }.Else{\r\n Span(LangRes(@1role_none))\r\n }\r\n If(#v_key_id# == #key_id#){\r\n SetVar(founder_account, EcosysParam(\"founder_account\"))\r\n If(#founder_account# != #key_id#){\r\n Div(row){\r\n Div(col-md-12 text-center){ \r\n Button(Class: btn-xs btn-link, Page: @1roles_request, Body: LangRes(@1request)).Popup(Header: $@1request_to_role$, Width: \"50\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "Div(content-wrapper){\r\n If(Or(#v_key_id#>0,#v_key_id#<0)){\r\n }.Else{\r\n SetVar(v_key_id,#key_id#)\r\n }\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#v_key_id#}).Columns(\"id,image_id,member_name,member_info->information\").Vars(member)\r\n\r\n If(Or(#member_id#>0,#member_id#<0)){\r\n SetVar(member_name, #member_member_name#).(member_info, #member_member_info_information#)\r\n }.Else{\r\n SetVar(member_name,).(member_info,)\r\n }\r\n\r\n Div(row){\r\n Div(col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3){\r\n Form(panel panel-primary){\r\n Div(panel-body){\r\n Div(text-center text-bold h4 m0){\r\n LangRes(@1user_info)\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-12 text-center){\r\n If(Or(#member_id#>0,#member_id#<0)){\r\n If(#member_id# == #key_id#){\r\n Button(Class: btn btn-link, Page: @1profile_edit){\r\n If(#member_image_id#>0){\r\n Image(Src: Binary().ById(#member_image_id#), Class: img-thumbnail).Style(width: 120px; border: 1px solid #5A5D63;)\r\n }.Else{\r\n Span(Class: fa icon-user fa-5x text-primary)\r\n }\r\n Div(m0 h4 text-bold){\r\n #member_name#\r\n If(#role_id# > 0){\r\n DBFind(@1roles).Where({ecosystem:#ecosystem_id#, id:#role_id#}).Columns(\"role_name\").Vars(role)\r\n Span(Body: \" (#role_role_name#)\")\r\n }\r\n }\r\n }\r\n }.Else{\r\n If(#member_image_id#>0){\r\n Image(Src: Binary().ById(#member_image_id#), Class: img-thumbnail).Style(width: 120px; border: 1px solid #5A5D63;)\r\n }.Else{\r\n Span(Class: fa icon-user fa-5x)\r\n }\r\n Div(m0 h4 text-bold){#member_name#}\r\n }\r\n Div(Class: h5 text-muted m0, Body: #member_info#)\r\n }.Else{\r\n If(#v_key_id# == #key_id#){\r\n Button(Class: btn btn-link, Page: @1profile_edit){\r\n Div(Class: h4 m0, Body: LangRes(@1editing_profile))\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-12 text-center){\r\n Div(text-bold m0 h5, Body: LangRes(@1wallet_address))\r\n Span(Class: h5, Body: Address(#v_key_id#))\r\n }\r\n }\r\n If(#v_key_id# == #key_id#){\r\n Div(row){\r\n Div(col-md-12 mt text-center){\r\n DBFind(@1keys).Where({ecosystem:1, id:#v_key_id#}).Vars(apl)\r\n If(#ecosystem_id#>1){\r\n DBFind(@1keys).Where({ecosystem:#ecosystem_id#, id:#v_key_id#}).Vars(tokens)\r\n }\r\n Div(text-bold m0 h5, Body: LangRes(@1balance))\r\n Div(Class: m0 h5, Body: Money(#apl_amount#) APLA)\r\n If(#ecosystem_id#>1){\r\n If(#tokens_amount#>0){\r\n Div(Class: m0 h5, Body: Money(#tokens_amount#) ecosystem tokens)\r\n }.Else{\r\n Div(Class: m0 h5, Body: 0 ecosystem tokens)\r\n }\r\n }\r\n Button(Class: btn-xs btn-link, Page: @1profile_transactions, Body: LangRes(@1transactions_history))\r\n Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: \"back_page=@1profile_view\", Body: LangRes(@1tokens_send)).Popup(Header: $@1tokens_send$, Width: \"50\")\r\n }\r\n }\r\n }\r\n Div(list-group-item text-center mt-lg){\r\n Div(text-bold m0 h5, Body: LangRes(@1roles))\r\n DBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#v_key_id#, deleted:0}).Columns(\"id\").Vars(check)\r\n If(#check_id#>0){\r\n DBFind(@1roles_participants,src_roles).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#v_key_id#, deleted:0}).Columns(\"role->id,role->name\").Order(\"id\")\r\n ForList(src_roles){\r\n Span(){\r\n LinkPage(Class: h6 m0 text-primary, Page: @1roles_view, PageParams: \"v_role_id=#role.id#\", Body: \"#role.name#\")\r\n }.Style(margin-right: 5px; margin-left: 5px;)\r\n }\r\n }.Else{\r\n Span(LangRes(@1role_none))\r\n }\r\n If(#v_key_id# == #key_id#){\r\n SetVar(founder_account, EcosysParam(\"founder_account\"))\r\n If(#founder_account# != #key_id#){\r\n Div(row){\r\n Div(col-md-12 text-center){ \r\n Button(Class: btn-xs btn-link, Page: @1roles_request, Body: LangRes(@1request)).Popup(Header: $@1request_to_role$, Width: \"50\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "Type": "blocks" }, { @@ -35,13 +35,13 @@ { "Name": "admin_menu", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "If(#ecosystem_id# == 1){\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:\"fa icon-people\")\r\n MenuItem(Title:$@1ecosystems$, Page:@1ecosystems_list, Icon:\"icon-layers\")\r\n MenuItem(Title:$@1platform_parameters$, Page:@1sysparams_list, Icon:\"icon-settings\")\r\n MenuItem(Title:$@1roles$, Page:@1roles_list, Icon:\"icon-pie-chart\")\r\n MenuItem(Title:$@1tokens_refund$, Page:@1tokenrefund_list, Icon:\"icon-shuffle\")\r\n}.ElseIf(#ecosystem_id# > 1){\r\n DBFind(@1roles).Where({\"ecosystem\": #ecosystem_id#}).Count(roles_count)\r\n If(#roles_count# > 0){\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:\"fa icon-people\")\r\n MenuItem(Title:$@1roles$, Page:@1roles_list, Icon:\"icon-pie-chart\")\r\n }\r\n}", + "Value": "If(#ecosystem_id# == 1){\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:\"icon-people\")\r\n MenuItem(Title:$@1ecosystems$, Page:@1ecosystems_list, Icon:\"icon-layers\")\r\n MenuItem(Title:$@1platform_parameters$, Page:@1sysparams_list, Icon:\"icon-settings\")\r\n MenuItem(Title:$@1roles$, Page:@1roles_list, Icon:\"icon-pie-chart\")\r\n MenuItem(Title:$@1tokens_refund$, Page:@1tokenrefund_list, Icon:\"icon-shuffle\")\r\n}.ElseIf(#ecosystem_id# > 1){\r\n DBFind(@1roles).Where({\"ecosystem\": #ecosystem_id#}).Count(roles_count)\r\n If(#roles_count# > 0){\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:\"icon-people\")\r\n MenuItem(Title:$@1roles$, Page:@1roles_list, Icon:\"icon-pie-chart\")\r\n }\r\n}", "Type": "menu" }, { "Name": "default_menu", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "If(#ecosystem_id# == 1){\r\n MenuItem(Title:$@1profile$, Page:@1profile_view, Icon:\"icon-wallet\")\r\n MenuItem(Title:$@1notifications$, Page:@1notifications_list, Icon:\"icon-flag\")\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list, Icon:\"icon-people\")\r\n MenuItem(Title:$@1votings$, Page:@1voting_list, Icon:\"icon-note\")\r\n MenuItem(Title:$@1sysparams_candidates$, Page:@1sysparams_candidates_list, Icon:\"icon-graduation\")\r\n}.ElseIf(#ecosystem_id# > 1){\r\n DBFind(@1roles).Where({\"ecosystem\": #ecosystem_id#}).Count(roles_count)\r\n If(#roles_count# > 0){\r\n MenuItem(Title:$@1profile$, Page:@1profile_view, Icon:\"icon-wallet\")\r\n MenuItem(Title:$@1notifications$, Page:@1notifications_list, Icon:\"icon-flag\")\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list, Icon:\"icon-people\")\r\n MenuItem(Title:$@1votings$, Page:@1voting_list, Icon:\"icon-note\")\r\n }\r\n}", + "Value": "If(#ecosystem_id# == 1){\r\n MenuItem(Title:$@1profile$, Page:@1profile_view, Icon:\"icon-wallet\")\r\n MenuItem(Title:$@1messenger$, Page:@1messages_list, Icon:\"icon-speech\")\r\n MenuItem(Title:$@1notifications$, Page:@1notifications_list, Icon:\"icon-flag\")\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list, Icon:\"icon-people\")\r\n MenuItem(Title:$@1votings$, Page:@1voting_list, Icon:\"icon-note\")\r\n MenuItem(Title:$@1sysparams_candidates$, Page:@1sysparams_candidates_list, Icon:\"icon-graduation\")\r\n}.ElseIf(#ecosystem_id# > 1){\r\n DBFind(@1roles).Where({\"ecosystem\": #ecosystem_id#}).Count(roles_count)\r\n If(#roles_count# > 0){\r\n MenuItem(Title:$@1profile$, Page:@1profile_view, Icon:\"icon-wallet\")\r\n MenuItem(Title:$@1messenger$, Page:@1messages_list, Icon:\"icon-speech\")\r\n MenuItem(Title:$@1notifications$, Page:@1notifications_list, Icon:\"icon-flag\")\r\n MenuItem(Title:$@1ecosystem_members$, Page:@1members_list, Icon:\"icon-people\")\r\n MenuItem(Title:$@1votings$, Page:@1voting_list, Icon:\"icon-note\")\r\n }\r\n}", "Type": "menu" }, { @@ -257,14 +257,14 @@ { "Name": "members_list", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1members_list).(this_table, @1keys)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1ecosystem_members$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1ecosystem_members_list_desc$\"))\r\nIf(And(#role_id# == EcosysParam(role_admin),#ecosystem_id# != 1)){\r\n AddToolButton(Title: Add members, Page:@1ecosystem_add_members, Icon: icon-plus).Popup(50, $@1ecosystem_add_members$)\r\n}\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {ecosystem:#ecosystem_id#, id:#search#})\r\n}.Else{\r\n SetVar(where, {ecosystem:#ecosystem_id#, id:{\"$neq\":0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1id))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(custom_id){\r\n SetVar(Name: style_text, Value: \"text-normal\")\r\n SetVar(Name: style_link, Value: \"text-primary\")\r\n Span(Class: h6 text-muted, Body: #id#)\r\n SetVar(m_id, 0)\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#id#}).Vars(m)\r\n If(Or(#m_id#>0,#m_id#<0)){\r\n SetVar(image_id, #m_image_id#)\r\n SetVar(member_name, #m_member_name#)\r\n }.Else{\r\n SetVar(image_id, 0)\r\n SetVar(member_name, Address(#id#))\r\n }\r\n}.Custom(custom_member_id){\r\n Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: \"v_key_id=#id#\"){\r\n Span(Class: h5, Body: Address(#id#))\r\n }.Popup(Header: $@1tokens_send$, Width: \"50\")\r\n}.Custom(custom_username){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#id#\"){\r\n If(#image_id#>0){\r\n Image(Src: Binary().ById(#image_id#), Class: img-circle).Style(height: 30px;width: 30px; border: 1px solid #5A5D63; margin-right: 10px;)\r\n Span(#member_name#)\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-user fa-2x)).Style(margin-right:10px;)\r\n Span(#member_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1name$=custom_username,$@1wallet$=custom_member_id\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1members$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1members_list).(this_table, @1keys)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1ecosystem_members$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1ecosystem_members_list_desc$\"))\r\nIf(And(#role_id# == EcosysParam(role_admin),#ecosystem_id# != 1)){\r\n AddToolButton(Title: Add members, Page:@1ecosystem_add_members, Icon: icon-plus).Popup(50, $@1ecosystem_add_members$)\r\n}\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {deleted:0, ecosystem:#ecosystem_id#, id:#search#})\r\n}.Else{\r\n SetVar(where, {deleted:0, ecosystem:#ecosystem_id#, id:{\"$neq\":0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1id))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(custom_id){\r\n SetVar(Name: style_text, Value: \"text-normal\")\r\n SetVar(Name: style_link, Value: \"text-primary\")\r\n Span(Class: h6 text-muted, Body: #id#)\r\n SetVar(m_id, 0)\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#id#}).Vars(m)\r\n If(Or(#m_id#>0,#m_id#<0)){\r\n SetVar(image_id, #m_image_id#)\r\n SetVar(member_name, #m_member_name#)\r\n }.Else{\r\n SetVar(image_id, 0)\r\n SetVar(member_name, Address(#id#))\r\n }\r\n}.Custom(custom_member_id){\r\n Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: \"v_key_id=#id#\"){\r\n Span(Class: h5, Body: Address(#id#))\r\n }.Popup(Header: $@1tokens_send$, Width: \"50\")\r\n}.Custom(custom_username){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#id#\"){\r\n If(#image_id#>0){\r\n Image(Src: Binary().ById(#image_id#), Class: img-circle).Style(height: 30px;width: 30px; border: 1px solid #5A5D63; margin-right: 10px;)\r\n Span(#member_name#)\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-user fa-2x)).Style(margin-right:10px;)\r\n Span(#member_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1name$=custom_username,$@1wallet$=custom_member_id\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1members$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "members_list_admin", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1members_list_admin).(this_table, @1keys)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1ecosystem_members$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1ecosystem_members_list_desc$\"))\r\nIf(And(#role_id# == EcosysParam(role_admin),#ecosystem_id# != 1)){\r\n AddToolButton(Title: Add members, Page:@1ecosystem_add_members, Icon: icon-plus).Popup(50, $@1ecosystem_add_members$)\r\n}\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {ecosystem:#ecosystem_id#, id:#search#})\r\n}.Else{\r\n SetVar(where, {ecosystem:#ecosystem_id#, id:{\"$neq\":0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1id))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(custom_id){\r\n SetVar(Name: style_text, Value: \"text-normal\")\r\n SetVar(Name: style_link, Value: \"text-primary\")\r\n Span(Class: h6 text-muted, Body: #id#)\r\n SetVar(m_id, 0)\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#id#}).Vars(m)\r\n If(Or(#m_id#>0,#m_id#<0)){\r\n SetVar(image_id, #m_image_id#)\r\n SetVar(member_name, #m_member_name#)\r\n }.Else{\r\n SetVar(image_id, 0)\r\n SetVar(member_name, Address(#id#))\r\n }\r\n}.Custom(custom_member_id){\r\n Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: \"v_key_id=#id#\"){\r\n Span(Class: h5, Body: Address(#id#))\r\n }.Popup(Header: $@1tokens_send$, Width: \"50\")\r\n}.Custom(custom_username){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#id#\"){\r\n If(#image_id#>0){\r\n Image(Src: Binary().ById(#image_id#), Class: img-circle).Style(height: 30px;width: 30px; border: 1px solid #5A5D63; margin-right: 10px;)\r\n Span(#member_name#)\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-user fa-2x)).Style(margin-right:10px;)\r\n Span(#member_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Custom(actions){\r\n If(#blocked#==0){\r\n Button(Body: LangRes(@1block_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:\"KeyId=#id#,Value=1\", Contract: @1BlockMember).Alert(Text: \"$@1want_block_key$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.Else{\r\n Button(Body: LangRes(@1unblock_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:\"KeyId=#id#,Value=0\", Contract: @1BlockMember).Alert(Text: \"$@1want_unblock_key$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1name$=custom_username,$@1id$=custom_id,$@1wallet$=custom_member_id,=actions\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1members$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1members_list_admin).(this_table, @1keys)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1ecosystem_members$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1ecosystem_members_list_desc$\"))\r\nIf(And(#role_id# == EcosysParam(role_admin),#ecosystem_id# != 1)){\r\n AddToolButton(Title: Add members, Page:@1ecosystem_add_members, Icon: icon-plus).Popup(50, $@1ecosystem_add_members$)\r\n}\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, {ecosystem:#ecosystem_id#, id:#search#})\r\n}.Else{\r\n SetVar(where, {ecosystem:#ecosystem_id#, id:{\"$neq\":0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1id))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({deleted:\"1\", id:\"1\"}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(custom_id){\r\n If(#deleted# == 0){\r\n SetVar(style_text, \"text-normal\").(style_link, \"text-primary\")\r\n }.Else{\r\n SetVar(style_text,\"text-muted\").(style_link,\"text-muted\")\r\n }\r\n Span(Class: h6 text-muted, Body: #id#)\r\n SetVar(m_id, 0)\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#id#}).Vars(m)\r\n If(Or(#m_id#>0,#m_id#<0)){\r\n SetVar(image_id, #m_image_id#)\r\n SetVar(member_name, #m_member_name#)\r\n }.Else{\r\n SetVar(image_id, 0)\r\n SetVar(member_name, Address(#id#))\r\n }\r\n}.Custom(custom_member_id){\r\n Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: \"v_key_id=#id#,back_page=#this_page#\"){\r\n Span(Class: h5 #style_text#, Body: Address(#id#))\r\n }.Popup(Header: $@1tokens_send$, Width: \"50\")\r\n}.Custom(custom_username){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#id#\"){\r\n If(#image_id#>0){\r\n Image(Src: Binary().ById(#image_id#), Class: img-circle).Style(height: 30px;width: 30px; border: 1px solid #5A5D63; margin-right: 10px;)\r\n Span(#member_name#)\r\n }.Else{\r\n Div(){\r\n Span(Em(Class: fa icon-user fa-2x)).Style(margin-right:10px;)\r\n Span(#member_name#)\r\n }.Style(display:flex; align-items:center;)\r\n }\r\n }\r\n}.Custom(actions){\r\n If(#deleted#==0){\r\n Button(Body: LangRes(@1delete), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:\"KeyId=#id#\", Contract: @1DeleteMember).Alert(Text: \"$@1want_delete_key$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n If(#blocked#==0){\r\n Button(Body: LangRes(@1block_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:\"KeyId=#id#,Value=1\", Contract: @1BlockMember).Alert(Text: \"$@1want_block_key$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.Else{\r\n Button(Body: LangRes(@1unblock_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:\"KeyId=#id#,Value=0\", Contract: @1BlockMember).Alert(Text: \"$@1want_unblock_key$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }.Else{\r\n Span(Class: h6 text-muted pull-right, Body: $@1deleted$)\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1name$=custom_username,$@1id$=custom_id,$@1wallet$=custom_member_id,=actions\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1members$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "admin_menu", "Type": "pages" }, @@ -278,21 +278,42 @@ { "Name": "membership_user_view", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Div(content-wrapper){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->ecosystem_id,page_params->status,recipient->image_id,recipient->member_name,closed\").Vars(notific)\r\n DBFind(@1ecosystems).Where({id: #notific_page_params_ecosystem_id#}).Vars(ecosystem)\r\n\r\n Div(row){\r\n Div(col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3){\r\n Form(panel panel-default){\r\n Div(panel-heading text-center){\r\n Span(Class: h3, Body: $@1membership_request$)\r\n }\r\n Div(panel-body){\r\n Div(form-group){\r\n Div(row){\r\n Div(col-md-12 mt-sm text-center){\r\n If(#notific_recipient_image_id#>0){\r\n Image(Src: Binary().ById(#notific_recipient_image_id#), Class: img-thumbnail).Style(width: 120px; border: 1px solid #5A5D63;)\r\n }.Else{\r\n Span(Class: fa icon-user fa-5x)\r\n }\r\n Div(m0 h4 text-bold){#notific_recipient_member_name#}\r\n }\r\n }\r\n }\r\n If(#notific_page_params_status# == 1){\r\n Div(list-group-item text-center){\r\n Div(Class: m0 h5 text-bold, Body: $@1request_to_membership$:)\r\n Div(Class: m0 h5 text-normal, Body: \"#ecosystem_name#\" (#ecosystem_id#))\r\n Div(Class: m0 h5 text-bold, Body: $@1is_accepted$!)\r\n }\r\n If(#notific_closed# == 0){\r\n Div(row){\r\n Div(col-md-12 mt-lg text-center){\r\n Button(Class: btn btn-success, Body: $@1add_ecosystem_to_list$, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: \"@invite\", PageParams: \"ecosystem=#notific_page_params_ecosystem_id#,page=@1default_page\")\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(list-group-item text-center){\r\n Div(Class: m0 h5 text-bold, Body: $@1request_to_membership$:)\r\n Div(Class: m0 h5 text-normal, Body: \"#ecosystem_name#\" (#ecosystem_id#))\r\n Div(Class: m0 h5 text-bold, Body: $@1is_rejected$!)\r\n }\r\n If(#notific_closed# == 0){\r\n Div(row){\r\n Div(col-md-12 mt-lg text-center){\r\n Button(Class: btn btn-danger, Body: $@1close$, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1default_page)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "Div(content-wrapper){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->ecosystem_id,page_params->status,recipient->image_id,recipient->member_name,closed\").Vars(notific)\r\n DBFind(@1ecosystems).Where({id: #notific_page_params_ecosystem_id#}).Vars(ecosystem)\r\n\r\n Div(row){\r\n Div(col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3){\r\n Form(panel panel-default){\r\n Div(panel-heading text-center){\r\n Span(Class: h3, Body: $@1membership_request$)\r\n }\r\n Div(panel-body){\r\n Div(form-group){\r\n Div(row){\r\n Div(col-md-12 mt-sm text-center){\r\n If(#notific_recipient_image_id#>0){\r\n Image(Src: Binary().ById(#notific_recipient_image_id#), Class: img-thumbnail).Style(width: 120px; border: 1px solid #5A5D63;)\r\n }.Else{\r\n Span(Class: fa icon-user fa-5x)\r\n }\r\n Div(m0 h4 text-bold){#notific_recipient_member_name#}\r\n }\r\n }\r\n }\r\n If(#notific_page_params_status# == 1){\r\n Div(list-group-item text-center){\r\n Div(Class: m0 h5 text-bold, Body: $@1request_to_membership$:)\r\n Div(Class: m0 h5 text-normal, Body: \"#ecosystem_name#\" (#ecosystem_id#))\r\n Div(Class: m0 h5 text-bold, Body: $@1is_accepted$!)\r\n }\r\n If(#notific_closed# == 0){\r\n Div(row){\r\n Div(col-md-12 mt-lg text-center){\r\n Button(Class: btn btn-success, Body: $@1close$, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: \"@1default_page\")\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(list-group-item text-center){\r\n Div(Class: m0 h5 text-bold, Body: $@1request_to_membership$:)\r\n Div(Class: m0 h5 text-normal, Body: \"#ecosystem_name#\" (#ecosystem_id#))\r\n Div(Class: m0 h5 text-bold, Body: $@1is_rejected$!)\r\n }\r\n If(#notific_closed# == 0){\r\n Div(row){\r\n Div(col-md-12 mt-lg text-center){\r\n Button(Class: btn btn-danger, Body: $@1close$, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1default_page)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Menu": "default_menu", + "Type": "pages" + }, + { + "Name": "message_create", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "Form(){\r\n Div(row){\r\n Div(col-md-3 mt text-right){\r\n Label(){\r\n Span(Body: LangRes(@1broadcast))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: \"broadcast\", Type: \"checkbox\", Value: \"false\")\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n DBFind(@1keys,src_keys).Where({ecosystem:#ecosystem_id#}).Columns(\"id\").Custom(_name){\r\n SetVar(m_member_name, \"\")\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#id#}).Columns(\"id,member_name\").Vars(m)\r\n Address(#id#)\r\n If(GetVar(m_member_name)!=\"\"){\r\n \" (#m_member_name#)\"\r\n }\r\n }\r\n Select(Name: member_id, Source: src_keys, NameColumn: _name, ValueColumn: id)\r\n }.Show(\"broadcast=false\")\r\n Div(col-md-9 text-left){\r\n DBFind(@1roles,source_roles).Where({ecosystem:#ecosystem_id#, deleted:0}).Columns(\"id,role_name\").Count(roles_count)\r\n If(#roles_count#>0){\r\n Select(Name: rid, Source: source_roles, NameColumn: role_name, ValueColumn: id)\r\n }.Else{\r\n Div(mt-sm){\r\n $@1roles$ $@1not_founded$\r\n }\r\n }\r\n }.Show(\"broadcast=true\")\r\n }\r\n Div(row mt){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1message_subject)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_header, Value: \"\", Placeholder: $@1message_subject_type_here$)\r\n }\r\n }\r\n Div(row mt){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1message_text)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Type: Hidden, Name: eco_id, Value: \"#ecosystem_id#\")\r\n Input(Type: Hidden, Name: sender, Value: \"1\")\r\n Input(Type: Hidden, Name: icon_name, Value: \"icon-speech\")\r\n Input(Type: Hidden, Name: params_map, Value: `{\"type\": \"message\"}`)\r\n Input(Type: Hidden, Name: page_name, Value: \"@1message_view\")\r\n Input(Type: textarea, Name: text_body, Value: \"\", Placeholder: $@1message_type_here$).Style(resize: vertical; min-height: 6em;)\r\n }\r\n }\r\n Div(row mt){\r\n Div(col-md-12){\r\n Div(){\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right, Page: @1messages_list, Contract: @1NotificationsSend, Params: \"rid=0,current_role_id=#role_id#\")\r\n }.Show(\"broadcast=false\")\r\n Div(){\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right, Page: @1messages_list, Contract: @1NotificationsSend, Params: \"member_id=0,current_role_id=#role_id#,closure_type=2\")\r\n }.Show(\"broadcast=true\")\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right, Page: @1messages_list)\r\n }\r\n }\r\n}", + "Menu": "default_menu", + "Type": "pages" + }, + { + "Name": "message_view", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "If(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"id,sender->member_id,sender->member_name,sender->image_id,recipient->member_name,notification->body,notification->header,page_params->thread,date_created,closed\").Vars(message)\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#message_sender_member_id#}).Vars(highlighted)\r\n If(GetVar(highlighted_id)){\r\n SetVar(message_sender_member_name,#highlighted_member_name#)\r\n SetVar(message_sender_image_id,#highlighted_image_id#)\r\n }\r\n\r\n If(#message_page_params_thread#>0){\r\n SetVar(thread,#message_page_params_thread#)\r\n DBFind(@1notifications,src_thread).Where({ecosystem:#ecosystem_id#, page_params->thread:#message_page_params_thread#}).Order(\"id\").Count(\"thread_quantity\").Columns(\"id,sender->member_id,sender->member_name,sender->image_id,notification->body,date_created\")\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#message_page_params_thread#}).Columns(\"id,sender->member_id,sender->member_name,sender->image_id,recipient->member_id,notification->body,date_created\").Vars(init_message)\r\n }.Else{\r\n SetVar(thread,#message_id#)\r\n DBFind(@1notifications,src_thread).Where({ecosystem:#ecosystem_id#, page_params->thread:#message_id#}).Order(\"id\").Count(\"thread_quantity\").Columns(\"id,sender->member_id,sender->member_name,sender->image_id,notification->body,date_created\")\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#message_id#}).Columns(\"id,sender->member_id,sender->member_name,sender->image_id,recipient->member_id,notification->body,date_created\").Vars(init_message)\r\n }\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#init_message_sender_member_id#}).Vars(starter)\r\n If(GetVar(starter_id)){\r\n SetVar(init_message_sender_member_name,#starter_member_name#)\r\n SetVar(init_message_sender_image_id,#starter_image_id#)\r\n }\r\n\r\n If(#init_message_sender_member_id#!=#key_id#){\r\n SetVar(reply_recipient,#init_message_sender_member_id#)\r\n }.Else{\r\n SetVar(reply_recipient,#init_message_recipient_member_id#)\r\n }\r\n If(#message_notification_header#==\"\"){\r\n SetVar(thread_name,$@1message_subject_empty$)\r\n }.Else{\r\n SetVar(thread_name,#message_notification_header#)\r\n }\r\n\r\n SetTitle($@1messenger$)\r\n Span(Class: h5 m0 ml-lg){\r\n LinkPage(Class: ml-sm, Body: $@1messenger$, Page: @1messages_list)\r\n Span(Class: text-muted mh, Body: /)\r\n Span(Class: text-muted, Body: $@1message_view$)\r\n }.Style(\r\n display: inline-block;\r\n )\r\n\r\n Form(){\r\n Div(content-wrapper){\r\n Div(row){\r\n Div(col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1){\r\n Form(panel panel-primary){\r\n Div(text-center pt){\r\n If(#message_sender_member_id#==#key_id#){\r\n Span(Class: h4 text-bold, Body: LangRes(@1message_from_you))\r\n }.Else{\r\n Span(Class: h4 text-bold, Body: LangRes(@1message_from) #message_sender_member_name#)\r\n }\r\n }\r\n Div(panel-body pt pb){\r\n Div(list-group-item wrapper-block){\r\n Div(avatar-block text-center){\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#message_sender_member_id#\"){\r\n If(#message_sender_image_id#>0){\r\n Image(Src: Binary().ById(#message_sender_image_id#), Class: img-circle avatar)\r\n }.Else{\r\n Span(Class: fa icon-user fa-3x)\r\n }\r\n Div(preview m0 h5){#message_sender_member_name#}\r\n }\r\n }\r\n Div(message-block){\r\n Span(Class: h5, Body: #message_notification_body#)\r\n }\r\n Div(datetime-block text-muted){\r\n Span(Class: mb-sm h6, Body: DateTime(#message_date_created#,HH:MI DD.MM.YYYY))\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-12 text-left){\r\n Label(){\r\n If(#message_sender_member_id#!=#key_id#){\r\n Span(Body: LangRes(@1reply_text))\r\n }.Else{\r\n Span(Body: LangRes(@1message_text))\r\n }\r\n }\r\n Input(Type: Hidden, Name: member_id, Value: \"#reply_recipient#\")\r\n Input(Type: Hidden, Name: eco_id, Value: \"#ecosystem_id#\")\r\n Input(Type: Hidden, Name: sender, Value: \"1\")\r\n Input(Type: Hidden, Name: icon_name, Value: \"icon-speech\")\r\n Input(Type: Hidden, Name: params_map, Value: `{\"type\":\"message\",\"thread\":\"#thread#\"}`)\r\n Input(Type: Hidden, Name: page_name, Value: \"@1message_view\")\r\n Input(Type: Hidden, Name: text_header, Value: \"#thread_name#\")\r\n Input(Type: textarea, Name: text_body, Value: \"\", Placeholder: $@1message_type_here$).Style(resize: vertical; min-height: 6em;)\r\n }\r\n }\r\n If(And(#message_closed#==0,#message_sender_member_id#!=#key_id#)){\r\n Div(mt text-right){\r\n Button(Body: LangRes(@1mark_read), Class: btn btn-default, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1messages_list)\r\n Button(Body: LangRes(@1reply), Class: btn btn-primary, Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#\", Page: @1message_view, PageParams: \"notific_id=#message_id#\")\r\n }\r\n }.Else{\r\n Div(mt text-right){\r\n Button(Body: LangRes(@1send), Class: btn btn-primary, Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#\", Page: @1message_view, PageParams: \"notific_id=#message_id#\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n If(#thread_quantity#>0){\r\n Div(row){\r\n Div(col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1){\r\n Div(list-group-item text-center){\r\n Span(Class: h4 text-bold, Body: #thread_name#)\r\n }\r\n Div(list-group-item wrapper-block){\r\n Div(avatar-block text-center){\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#init_message_sender_member_id#\"){\r\n If(#init_message_sender_image_id#>0){\r\n Image(Src: Binary().ById(#init_message_sender_image_id#), Class: img-circle avatar)\r\n }.Else{\r\n Span(Class: fa icon-user fa-3x)\r\n }\r\n Div(preview m0 h5){#init_message_sender_member_name#}\r\n }\r\n }\r\n Div(message-block){\r\n Span(Class: h5, Body: #init_message_notification_body#)\r\n }\r\n Div(datetime-block text-muted){\r\n Span(Class: badge mr, Body: 1)\r\n Span(Class: mb-sm h6, Body: DateTime(#init_message_date_created#,HH:MI DD.MM.YYYY))\r\n }\r\n }\r\n ForList(src_thread){\r\n Div(list-group-item wrapper-block){\r\n Div(avatar-block text-center){\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#sender.member_id#}).Vars(thread_message)\r\n If(GetVar(thread_message_id)==\"\"){\r\n SetVar(thread_message_member_name,#sender.member_name#)\r\n SetVar(thread_message_image_id,#sender.image_id#)\r\n }\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#sender.member_id#\"){\r\n If(#thread_message_image_id#>0){\r\n Image(Src: Binary().ById(#thread_message_image_id#), Class: img-circle avatar)\r\n }.Else{\r\n Span(Class: fa icon-user fa-3x)\r\n }\r\n Div(preview m0 h5){#thread_message_member_name#}\r\n }\r\n }\r\n Div(message-block){\r\n Span(Class: h5, Body: #notification.body#)\r\n }\r\n Div(datetime-block text-muted){\r\n Span(Class: badge mr, Body: Calculate(#src_thread_index#+1))\r\n Span(Class: mb-sm h6, Body: DateTime(#date_created#,HH:MI DD.MM.YYYY))\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }.Style(\r\n .preview {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n }\r\n .wrapper-block {min-height: 80px;}\r\n .avatar-block {\r\n position: absolute;\r\n width: 70px;\r\n }\r\n .message-block {\r\n margin-left: 85px;\r\n margin-bottom: 15px;\r\n }\r\n .datetime-block {\r\n position: absolute;\r\n bottom: 5px;\r\n right: 10px;\r\n }\r\n .avatar {\r\n max-width: 42px;\r\n max-height: 42px;\r\n border: 1px solid #bbb;\r\n }\r\n .badge {margin-top: -2px;}\r\n )\r\n}.Else{\r\n Div(col-md-12 alert alert-danger text-center){\r\n Span(Body: LangRes(@1attention))\r\n }\r\n}", + "Menu": "default_menu", + "Type": "pages" + }, + { + "Name": "messages_list", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "DBFind(@1notifications,threads).Where({ecosystem:#ecosystem_id#, \"page_params->type\":\"message\",{\"$or\": [{\"sender->member_id\":#key_id#}, {\"recipient->member_id\":#key_id#}]}}).Order({\"id\":\"-1\"}).Limit(250).Count(threads_count).Columns(\"id,sender->member_id,sender->member_name,sender->image_id,recipient->member_name,notification->body,notification->header,page_params->thread,date_created,closed\")\r\n\r\nDiv(content-wrapper){\r\n Div(row){\r\n Div(col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1){\r\n Div(list-group-item text-center p0){\r\n Span(Class: h4 text-bold vc, Body: LangRes(@1message_active_threads))\r\n Button(Class: btn-xs btn-link plus-button p0 b0, Page: @1message_create){\r\n Span(Class: fa fa-2x icon-plus vc)\r\n }.Popup(50, $@1message_create$)\r\n }.Style(\r\n .plus-button {\r\n position: absolute;\r\n right: 10px;\r\n }\r\n )\r\n If(#threads_count#>0){\r\n ForList(threads){\r\n If(#page_params.thread#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, \"page_params->thread\": #page_params.thread#}).Order({\"id\":\"-1\"}).Limit(1).Columns(\"id\").Vars(last)\r\n }.Else{\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, \"page_params->thread\": #id#}).Count(thread_depth)\r\n }\r\n If(Or(#id#==#last_id#,#thread_depth#==0)){\r\n If(Or(#closed#==1,#sender.member_id#==#key_id#)){SetVar(status,\"read\")}.Else{SetVar(status,\"unread\")}\r\n Div(list-group-item col-sm-12 thread-block #status#){\r\n Div(avatar-block text-center){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#id#}).Columns(\"sender->member_id,recipient->member_id,sender->member_name,recipient->member_name,sender->image_id,recipient->image_id\").Vars(init_message)\r\n If(#init_message_sender_member_id#!=#key_id#){\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#init_message_sender_member_id#}).Vars(talker)\r\n If(GetVar(talker_id)){\r\n SetVar(talker_name,#talker_member_name#)\r\n SetVar(talker_picture,#talker_image_id#)\r\n }.Else{\r\n SetVar(talker_id,#init_message_sender_member_id#)\r\n SetVar(talker_name,#init_message_sender_member_name#)\r\n SetVar(talker_picture,#init_message_sender_image_id#)\r\n }\r\n }.Else{\r\n DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#init_message_recipient_member_id#}).Vars(talker)\r\n If(GetVar(talker_id)){\r\n SetVar(talker_name,#talker_member_name#)\r\n SetVar(talker_picture,#talker_image_id#)\r\n }.Else{\r\n SetVar(talker_id,#init_message_recipient_member_id#)\r\n SetVar(talker_name,#init_message_recipient_member_name#)\r\n SetVar(talker_picture,#init_message_recipient_image_id#)\r\n }\r\n }\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#talker_id#\"){\r\n If(#talker_picture#>0){\r\n Image(Src: Binary().ById(#talker_picture#), Class: img-circle avatar)\r\n }.Else{\r\n Span(Class: fa icon-user fa-3x)\r\n }\r\n Div(preview m0 h5){#talker_name#}\r\n }\r\n }\r\n Div(message-block){\r\n LinkPage(Page: @1message_view, PageParams: \"notific_id=#id#\"){\r\n If(#notification.header#==\"\"){\r\n Div(Class: preview h4 m0, Body: LangRes(@1message_subject_empty))\r\n }.Else{\r\n Div(Class: preview h4 m0, Body: #notification.header#)\r\n }\r\n If(#sender.member_id#==#key_id#){\r\n Div(Class: preview text-muted, Body: $@1you$: #notification.body#)\r\n }.Else{\r\n Div(Class: preview text-muted, Body: #notification.body#)\r\n }\r\n }\r\n }\r\n Div(datetime-block text-muted){\r\n If(GetVar(status)==\"unread\"){\r\n Span(Class: badge mr, Body: LangRes(@1unread))\r\n }\r\n Span(Class: h6, Body: DateTime(#date_created#, HH:MI DD.MM.YYYY))\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(list-group-item text-center text-muted){\r\n $@1messages_empty$\r\n }\r\n }\r\n }\r\n }.Style(\r\n .thread-block {height: 80px;}\r\n .avatar-block {\r\n position: absolute;\r\n width: 70px;\r\n }\r\n .message-block {margin-left: 85px;}\r\n .datetime-block {\r\n position: absolute;\r\n bottom: 5px;\r\n right: 10px;\r\n }\r\n .preview {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n }\r\n .avatar {\r\n max-width: 42px;\r\n max-height: 42px;\r\n border: 1px solid #bbb;\r\n }\r\n .badge {margin-top: -2px;}\r\n .unread {background-color: #f7fafe;}\r\n .vc {line-height: 44px;}\r\n )\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "notifications", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1notifications,notification_singles).Where({ecosystem:#ecosystem_id#, closed:0,\"notification->type\": 1, \"recipient->member_id\": #key_id#}).Columns(\"id,page_name,notification->icon,notification->header,notification->body\").Count(count_singles)\r\n\r\nDBFind(@1notifications,notification_roles).Where({ecosystem:#ecosystem_id#, closed:0, \"notification->type\": 2, \"recipient->role_id\":#role_id#, {\"$or\":[{date_start_processing: $isnull}, {\"processing_info->member_id\": #key_id#}]}}).Columns(\"id,page_name,notification->icon,notification->header,notification->body,recipient->role_id\").Count(count_current_role)\r\n\r\nSetVar(limit,10).(limit_count,#limit#)\r\nSetVar(remaining,Calculate(#count_singles#+#count_current_role#-#limit#))\r\n\r\nIf(And(#limit_count#>0,#count_singles#>0)){\r\n ForList(notification_singles){\r\n If(#limit_count#>0){\r\n SetVar(limit_count,Calculate(#limit_count#-1))\r\n Div(list-group-item){\r\n LinkPage(Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Div(media-box clearfix){\r\n Div(pull-left){\r\n Em(Class: fa #notification.icon# fa-1x text-primary)\r\n }\r\n Div(media-box-body){\r\n Div(Class: m0 text-normal h6, Body: #notification.header#)\r\n Div(Class: m0 text-muted h6, Body: #notification.body#)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nIf(And(#limit_count#>0,#count_current_role#>0)){\r\n DBFind(@1roles).Where({ecosystem:#ecosystem_id#, id:#role_id#}).Columns(\"role_name\").Vars(role)\r\n Div(h6 mb-sm mt-lg ml-lg text-muted){\r\n $@1role_notifics$ (#role_role_name#):\r\n }\r\n ForList(notification_roles){\r\n If(#limit_count#>0){\r\n SetVar(limit_count,Calculate(#limit_count#-1))\r\n Div(list-group-item){\r\n LinkPage(Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Div(media-box clearfix){\r\n Div(pull-left){\r\n Em(Class: fa #notification.icon# fa-1x text-primary)\r\n }\r\n Div(media-box-body){\r\n Div(Class: m0 text-normal h6, Body: #notification.header#)\r\n Div(Class: m0 text-muted h6, Body: #notification.body#)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nIf(#remaining#>0){\r\n Button(Class: btn btn-block btn-default, Page: @1notifications_list){\r\n $@1notifications_show_all$ (#remaining# $@1more$)\r\n }\r\n}", + "Value": "DBFind(@1notifications,notification_singles).Where({ecosystem:#ecosystem_id#, closed:0,\"notification->type\": 1, \"recipient->member_id\": #key_id#}).Columns(\"id,page_name,notification->icon,notification->header,notification->popup,notification->body\").Count(count_singles)\r\n\r\nDBFind(@1notifications,notification_roles).Where({ecosystem:#ecosystem_id#, closed:0, \"notification->type\": 2, \"recipient->role_id\":#role_id#, {\"$or\":[{date_start_processing: $isnull}, {\"processing_info->member_id\": #key_id#}]}}).Columns(\"id,page_name,notification->icon,notification->header,notification->popup,notification->body,recipient->role_id\").Count(count_current_role)\r\n\r\nSetVar(limit,10).(limit_count,#limit#)\r\nSetVar(remaining,Calculate(#count_singles#+#count_current_role#-#limit#))\r\n\r\nIf(And(#limit_count#>0,#count_singles#>0)){\r\n ForList(notification_singles){\r\n If(#limit_count#>0){\r\n SetVar(limit_count,Calculate(#limit_count#-1))\r\n If(#notification.popup#==1){\r\n Div(list-group-item){\r\n Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Div(media-box clearfix){\r\n Div(pull-left){\r\n Em(Class: fa #notification.icon# fa-1x text-primary)\r\n }\r\n Div(media-box-body){\r\n Div(Class: m0 text-normal h6, Body: #notification.header#)\r\n Div(Class: m0 text-muted h6, Body: #notification.body#)\r\n }\r\n }\r\n }.Popup(Header: $@1notifications_view$, Width: \"40\")\r\n }.Style(.vm{vertical-align: middle;})\r\n }.Else{\r\n Div(list-group-item){\r\n Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Div(media-box clearfix){\r\n Div(pull-left){\r\n Em(Class: fa #notification.icon# fa-1x text-primary)\r\n }\r\n Div(media-box-body){\r\n Div(Class: m0 text-normal h6, Body: #notification.header#)\r\n Div(Class: m0 text-muted h6, Body: #notification.body#)\r\n }\r\n }\r\n }\r\n }.Style(.vm{vertical-align: middle;})\r\n }\r\n }\r\n }\r\n}\r\n\r\nIf(And(#limit_count#>0,#count_current_role#>0)){\r\n DBFind(@1roles).Where({ecosystem:#ecosystem_id#, id:#role_id#}).Columns(\"role_name\").Vars(role)\r\n Div(dropdown-heading b0){\r\n $@1role_notifics$ (#role_role_name#)\r\n }\r\n ForList(notification_roles){\r\n If(#limit_count#>0){\r\n SetVar(limit_count,Calculate(#limit_count#-1))\r\n If(#notification.popup#==1){\r\n Div(list-group-item){\r\n Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Div(media-box clearfix){\r\n Div(pull-left){\r\n Em(Class: fa #notification.icon# fa-1x text-primary)\r\n }\r\n Div(media-box-body){\r\n Div(Class: m0 text-normal h6, Body: #notification.header#)\r\n Div(Class: m0 text-muted h6, Body: #notification.body#)\r\n }\r\n }\r\n }.Popup(Header: $@1notifications_view$, Width: \"40\")\r\n }.Style(.vm{vertical-align: middle;})\r\n }.Else{\r\n Div(list-group-item){\r\n Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: \"notific_id=#id#\"){\r\n Div(media-box clearfix){\r\n Div(pull-left){\r\n Em(Class: fa #notification.icon# fa-1x text-primary)\r\n }\r\n Div(media-box-body){\r\n Div(Class: m0 text-normal h6, Body: #notification.header#)\r\n Div(Class: m0 text-muted h6, Body: #notification.body#)\r\n }\r\n }\r\n }\r\n }.Style(.vm{vertical-align: middle;})\r\n }\r\n }\r\n }\r\n}\r\n\r\nIf(#remaining#>0){\r\n Button(Class: btn btn-block btn-default, Page: @1notifications_list){\r\n $@1notifications_show_all$ (#remaining# $@1more$)\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "notifications_broadcast", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin))\r\nSetTitle($@1notifications_broadcast$)\r\nDBFind(@1ecosystems).Count(ecos_count)\r\nSetVar(left_col,\"col-sm-3 mt text-right\").(right_col,\"col-sm-9\")\r\nDiv(content-wrapper){\r\n Div(breadcrumb){\r\n LinkPage($@1notifications$, @1notifications_list)\r\n Span(/,mh)\r\n Span($@1broadcast_send$,text-muted)\r\n }\r\n\r\n Div(row){\r\n Div(col-sm-6 col-sm-offset-3){\r\n If(And(#role_id#==#role_admin#,#ecosystem_id#==1,#ecos_count#>1)){\r\n DBFind(@1roles,src_roles).Where({role_type:3, ecosystem:2}).Columns(\"id,role_name\")\r\n Form(panel panel-primary){\r\n Div(panel-body){\r\n Div(row mt){\r\n Div(#left_col#){\r\n LangRes(@1header)\r\n }\r\n Div(#right_col#){\r\n Input(Name: Header, Type: textarea)\r\n }\r\n }\r\n Div(row mt){\r\n Div(#left_col#){\r\n LangRes(@1body_text)\r\n }\r\n Div(#right_col#){\r\n Input(Name: Body, Type: textarea)\r\n }\r\n }\r\n Div(row mt){\r\n Div(#left_col#){\r\n LangRes(@1recipient)\r\n }\r\n Div(#right_col# mt){\r\n LangRes(@1ecosystems_administrators)\r\n }\r\n }\r\n }\r\n Div(panel-footer text-left){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1notifications_list)\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right, Contract: @1NotificationsBroadcast, Params: \"RoleId=#role_id#\", Page: @1notifications_list)\r\n }\r\n }\r\n }.Else{\r\n Div(col-sm-12 alert alert-warning text-center){\r\n If(#role_id#!=#role_admin#){\r\n LangRes(@1only_admin_action)\r\n }\r\n If(#ecosystem_id#!=1){\r\n LangRes(@1only_first_ecosystem_action)\r\n }\r\n If(#ecos_count#==1){\r\n LangRes(@1other_ecosystems_not_found)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "SetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin))\r\nDBFind(@1ecosystems).Count(ecos_count)\r\nForm(){\r\n If(And(#role_id#==#role_admin#,#ecosystem_id#==1,#ecos_count#>1)){\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Value: $@1ecosystems_administrators$, Disabled: true)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1header)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: Header)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1body_text)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: Body, Type: textarea).Style(resize: vertical;)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1popup))\r\n }\r\n }.Style(line-height: 18px;)\r\n Div(col-md-9 text-left){\r\n Input(Name: Popup, Type: checkbox, Value: false, Class: mt-sm)\r\n }\r\n }\r\n }.Else{\r\n Div(col-sm-12 alert alert-warning text-center){\r\n If(#role_id#!=#role_admin#){\r\n LangRes(@1only_admin_action)\r\n }\r\n If(#ecosystem_id#!=1){\r\n LangRes(@1only_first_ecosystem_action)\r\n }\r\n If(#ecos_count#==1){\r\n LangRes(@1other_ecosystems_not_found)\r\n }\r\n }\r\n }\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: @1notifications_list, Contract: @1NotificationsBroadcast, Params: \"RoleId=#role_id#\")\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list)\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -306,28 +327,35 @@ { "Name": "notifications_roles_send", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page,@1notifications_roles_send).(back_page,@1notifications_list)\r\nIf(GetVar(SelectedId)==\"\"){\r\n SetVar(SelectedId,#ecosystem_id#)\r\n}\r\nDBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\nDBFind(@1ecosystems).Columns(\"id,name\").WhereId(#SelectedId#).Vars(eco)\r\nForm(){\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1ecosystem)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: eco_id, Type:hidden, Value: #eco_id#)\r\n Div(input-group){\r\n Input(Name: eco_id_v, Disabled: 1, Value: #eco_name#)\r\n Div(input-group-btn){\r\n Button(Body: LangRes(@1select), Page: @1select_page, PageParams: \"Type=ecosystem,back_page=#this_page#,Header=$@1send$\", Class:btn btn-primary).Popup(Header: $@1ecosystem$, Width: \"50\")\r\n }\r\n } \r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n DBFind(@1roles,source_roles).Where({ecosystem:#SelectedId#, deleted:0}).Columns(\"id,role_name\").Count(roles_count)\r\n If(#roles_count#>0){\r\n Select(Name: rid, Source: source_roles, NameColumn: role_name, ValueColumn: id)\r\n }.Else{\r\n Div(mt-sm){\r\n $@1roles$ $@1not_founded$\r\n }\r\n }\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1closure_type)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_closure, Source: src_closure_type)\r\n Select(Name: closure_type, Source: src_closure_type, NameColumn: name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1sender)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_sender, Source: src_sender)\r\n Select(Name: sender, Source: src_sender, NameColumn: name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1icon)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_icon, Source: src_icon)\r\n Select(Name: icon_name, Source: src_icon, NameColumn: name, ValueColumn: name)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1header)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_header, Value: \"Header text\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: text_header, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1body_text))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_body, Value: \"Body text\")\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1page)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: page_name, Value: \"@1notifications_testpage\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: page_name, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1params))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: params_map, Value: `{\"param_int\":\"10\",\"param_str\":\"my_string\"}`)\r\n }\r\n }\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, PageParams: \"type=1\", Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#\")\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#, PageParams: \"type=1\")\r\n}", + "Value": "SetVar(this_page,@1notifications_roles_send).(back_page,@1notifications_list)\r\nIf(GetVar(SelectedId)==\"\"){\r\n SetVar(SelectedId,#ecosystem_id#)\r\n}\r\nDBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\nDBFind(@1ecosystems).Columns(\"id,name\").WhereId(#SelectedId#).Vars(eco)\r\nForm(){\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1ecosystem)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: eco_id, Type:hidden, Value: #eco_id#)\r\n Div(input-group){\r\n Input(Name: eco_id_v, Disabled: 1, Value: #eco_name#)\r\n Div(input-group-btn){\r\n Button(Body: LangRes(@1select), Page: @1select_page, PageParams: \"Type=ecosystem,back_page=#this_page#,Header=$@1send$\", Class:btn btn-primary).Popup(Header: $@1ecosystem$, Width: \"50\")\r\n }\r\n } \r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n DBFind(@1roles,source_roles).Where({ecosystem:#SelectedId#, deleted:0}).Columns(\"id,role_name\").Count(roles_count)\r\n If(#roles_count#>0){\r\n Select(Name: rid, Source: source_roles, NameColumn: role_name, ValueColumn: id)\r\n }.Else{\r\n Div(mt-sm){\r\n $@1roles$ $@1not_founded$\r\n }\r\n }\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1closure_type)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_closure, Source: src_closure_type)\r\n Select(Name: closure_type, Source: src_closure_type, NameColumn: name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1sender)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_sender, Source: src_sender)\r\n Select(Name: sender, Source: src_sender, NameColumn: name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1icon)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_icon, Source: src_icon)\r\n Select(Name: icon_name, Source: src_icon, NameColumn: name, ValueColumn: name)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1header)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_header, Value: \"Header text\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: text_header, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1body_text))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_body, Type: textarea, Value: \"Body text\").Style(resize: vertical;)\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1page)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: page_name, Value: \"@1notifications_testpage\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: page_name, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }.Show(\"popup=false\")\r\n Div(col-md-9 text-left){\r\n Input(Name: page_name_popup, Value: \"@1notifications_testpage_popup\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: page_name_popup, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }.Show(\"popup=true\")\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1params))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: params_map, Value: `{\"param_int\":\"10\",\"param_str\":\"my_string\"}`)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1popup))\r\n }\r\n }.Style(line-height: 18px;)\r\n Div(col-md-9 text-left){\r\n Input(Name: popup, Type: checkbox, Value: false, Class: mt-sm)\r\n }\r\n }\r\n Div(){\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, PageParams: \"type=1\", Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#,page_name=Val(page_name)\")\r\n }.Show(\"popup=false\")\r\n Div(){\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, PageParams: \"type=1\", Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#,page_name=Val(page_name_popup)\")\r\n }.Show(\"popup=true\")\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#, PageParams: \"type=1\")\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "notifications_show", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\nSetTitle($@1notifications_view$)\r\n\r\nSetVar(type,0).(header,).(body,)\r\nDiv(content-wrapper){\r\n\r\n If(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"id,sender->type,notification->header,notification->body,date_start_processing,closed\").Vars(note)\r\n SetVar(type,#note_sender_type#)\r\n SetVar(header,#note_notification_header#)\r\n SetVar(body,#note_notification_body#)\r\n\r\n\r\n Div(row){\r\n Div(col-md-6 col-md-offset-3){\r\n Form(panel panel-primary){\r\n Div(panel-heading text-center){\r\n #header#\r\n }\r\n Div(panel-body){\r\n #body#\r\n }\r\n Div(panel-footer text-right){\r\n If(#type# == 1){\r\n If(#note_closed# == 0){\r\n Button(Body: LangRes(@1understand), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1default_page)\r\n }\r\n }.ElseIf(#type# == 2){\r\n If(#note_closed#==0){\r\n If(#note_date_start_processing#==\"\"){\r\n Button(Body: LangRes(@1understand), Class: btn btn-primary, Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\", Page: @1notifications_show)\r\n }.Else{\r\n Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1default_page)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(md-12 alert alert-danger text-center){\r\n LangRes(@1attention)\r\n }\r\n }\r\n}", + "Value": "DBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\nSetTitle($@1notifications_view$)\r\n\r\nSetVar(type,0).(header,).(body,)\r\nDiv(content-wrapper){\r\n\r\n If(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"id,sender->type,notification->header,notification->body,date_start_processing,closed\").Vars(note)\r\n SetVar(type,#note_sender_type#)\r\n SetVar(header,#note_notification_header#)\r\n SetVar(body,#note_notification_body#)\r\n\r\n\r\n Div(row){\r\n Div(col-md-6 col-md-offset-3){\r\n Form(panel panel-primary){\r\n Div(panel-heading text-center){\r\n #header#\r\n }\r\n Div(panel-body){\r\n #body#\r\n }\r\n Div(panel-footer text-right){\r\n If(#type# == 1){\r\n If(#note_closed# == 0){\r\n Button(Body: LangRes(@1understood), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1default_page)\r\n }.Else{\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1default_page)\r\n }\r\n }.ElseIf(#type# == 2){\r\n If(#note_closed#==0){\r\n If(#note_date_start_processing#==\"\"){\r\n Button(Body: LangRes(@1understood), Class: btn btn-primary, Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\", Page: @1notifications_show)\r\n }.Else{\r\n Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1default_page)\r\n }\r\n }.Else{\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1default_page)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(md-12 alert alert-danger text-center){\r\n LangRes(@1attention)\r\n }\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "notifications_single_send", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page,@1notifications_single_send).(back_page,@1notifications_list)\r\nIf(GetVar(SelectedId)==\"\"){\r\n SetVar(SelectedId,#ecosystem_id#)\r\n}\r\nDBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\nDBFind(@1ecosystems).Columns(\"id,name\").WhereId(#SelectedId#).Vars(eco)\r\nForm(){\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1ecosystem)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: eco_id, Type:hidden, Value: #eco_id#)\r\n Div(input-group){\r\n Input(Name: eco_id_v, Disabled: 1, Value: #eco_name#)\r\n Div(input-group-btn){\r\n Button(Body: LangRes(@1select), Page: @1select_page, PageParams: \"Type=ecosystem,back_page=#this_page#,Header=$@1send$\", Class:btn btn-primary).Popup(Header: $@1ecosystem$, Width: \"50\")\r\n }\r\n } \r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n DBFind(@1keys,src_keys).Where({ecosystem:#SelectedId#}).Columns(\"id\").Custom(_name){\r\n SetVar(m_member_name, \"\")\r\n DBFind(@1members).Where({ecosystem:#SelectedId#, id:#id#}).Columns(\"id,member_name\").Vars(m)\r\n Address(#id#)\r\n If(GetVar(m_member_name)!=\"\"){\r\n \" (#m_member_name#)\"\r\n }\r\n }\r\n Select(Name: member_id, Source: src_keys, NameColumn: _name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1sender)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_sender, Source: src_sender)\r\n Select(Name: sender, Source: src_sender, NameColumn: name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1icon)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_icon, Source: src_icon)\r\n Select(Name: icon_name, Source: src_icon, NameColumn: name, ValueColumn: name)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1header)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_header, Value: \"Header text\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: text_header, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1body_text))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_body, Value: \"Body text\")\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1page)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: page_name, Value: \"@1notifications_testpage\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: page_name, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1params))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: params_map, Value: `{\"param_int\":\"10\",\"param_str\":\"my_string\"}`)\r\n }\r\n }\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: @1notifications_list, Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#\")\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list)\r\n}", + "Value": "SetVar(this_page,@1notifications_single_send).(back_page,@1notifications_list)\r\nIf(GetVar(SelectedId)==\"\"){\r\n SetVar(SelectedId,#ecosystem_id#)\r\n}\r\nDBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\nDBFind(@1ecosystems).Columns(\"id,name\").WhereId(#SelectedId#).Vars(eco)\r\nForm(){\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1ecosystem)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: eco_id, Type:hidden, Value: #eco_id#)\r\n Div(input-group){\r\n Input(Name: eco_id_v, Disabled: 1, Value: #eco_name#)\r\n Div(input-group-btn){\r\n Button(Body: LangRes(@1select), Page: @1select_page, PageParams: \"Type=ecosystem,back_page=#this_page#,Header=$@1send$\", Class:btn btn-primary).Popup(Header: $@1ecosystem$, Width: \"50\")\r\n }\r\n } \r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n DBFind(@1keys,src_keys).Where({ecosystem:#SelectedId#}).Columns(\"id\").Custom(_name){\r\n SetVar(m_member_name, \"\")\r\n DBFind(@1members).Where({ecosystem:#SelectedId#, id:#id#}).Columns(\"id,member_name\").Vars(m)\r\n Address(#id#)\r\n If(GetVar(m_member_name)!=\"\"){\r\n \" (#m_member_name#)\"\r\n }\r\n }\r\n Select(Name: member_id, Source: src_keys, NameColumn: _name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1sender)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_sender, Source: src_sender)\r\n Select(Name: sender, Source: src_sender, NameColumn: name, ValueColumn: id)\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1icon)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n AppParam(Ecosystem: 1, App: #application_id#, Name: notification_icon, Source: src_icon)\r\n Select(Name: icon_name, Source: src_icon, NameColumn: name, ValueColumn: name)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1header)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_header, Value: \"Header text\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: text_header, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1body_text))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: text_body, Type: textarea, Value: \"Body text\").Style(resize: vertical;)\r\n }\r\n }\r\n Div(row mt-lg){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1page)).(Class: text-danger, Body:*)\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: page_name, Value: \"@1notifications_testpage\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: page_name, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }.Show(\"popup=false\")\r\n Div(col-md-9 text-left){\r\n Input(Name: page_name_popup, Value: \"@1notifications_testpage_popup\").Validate(minLength:3, maxLength:255)\r\n InputErr(Name: page_name_popup, minLength: $@1validate_name$, maxLength: $@1validate_role_name$)\r\n }.Show(\"popup=true\")\r\n }\r\n Div(row mt-sm){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1params))\r\n }\r\n }\r\n Div(col-md-9 text-left){\r\n Input(Name: params_map, Value: `{\"param_int\":\"10\",\"param_str\":\"my_string\"}`)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1popup))\r\n }\r\n }.Style(line-height: 18px;)\r\n Div(col-md-9 text-left){\r\n Input(Name: popup, Type: checkbox, Value: false, Class: mt-sm)\r\n }\r\n }\r\n Div(){\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#,page_name=Val(page_name)\")\r\n }.Show(\"popup=false\")\r\n Div(){\r\n Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, Contract: @1NotificationsSend, Params: \"current_role_id=#role_id#,page_name=Val(page_name_popup)\")\r\n }.Show(\"popup=true\")\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#)\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "notifications_testpage", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Div(content-wrapper){\r\n DBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\n SetTitle($@1test_page$)\r\n\r\n If(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"id,sender->type,notification->type,notification->header,page_params->param_int,page_params->param_str,date_start_processing,closed\").Vars(prefix)\r\n SetVar(sender_type,#prefix_sender_type#).(notification_type,#prefix_notification_type#).(notific_header,#prefix_notification_header#).(notific_val_int,#prefix_page_params_param_int#).(notific_val_str,#prefix_page_params_param_str#)\r\n }.Else{\r\n Div(md-12 alert alert-danger text-center){\r\n Span(Body: LangRes(@1attention))\r\n }\r\n SetVar(notific_id,\"0\").SetVar(sender_type,\"0\").(notification_type,\"0\").(notific_header,\"null\").(notific_val_int,\"null\").(notific_val_str,\"null\")\r\n }\r\n\r\n Div(row){\r\n Div(col-md-6 col-md-offset-3){\r\n Form(panel panel-default){\r\n Div(panel-body){\r\n Div(list-group-item text-center){\r\n Span(Class: h3, Body: #notific_header#)\r\n }\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1id))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n Span(Class: h4, Body: #notific_id#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1type))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n If(#notification_type# > 0){\r\n Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_type, Index: #notification_type#))\r\n }.Else{\r\n Span(Class: h4, Body: #notification_type#)\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1sender))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n If(#sender_type# > 0){\r\n Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_sender, Index: #sender_type#))\r\n }.Else{\r\n Span(Class: h4, Body: #sender_type#)\r\n }\r\n }\r\n }\r\n }\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1value_number))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n Span(Class: h4, Body: #notific_val_int#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1value_string))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n Span(Class: h4, Body: #notific_val_str#)\r\n }\r\n }\r\n }\r\n }\r\n If(#notification_type# == 1){\r\n If(#prefix_closed# == 0){\r\n Div(panel-footer text-right){\r\n Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1notifications_list).Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n }\r\n If(#notification_type# == 2){\r\n If(#prefix_closed# == 0){\r\n Div(panel-footer text-right){\r\n If(#prefix_date_start_processing# == \"\"){\r\n Button(Body: LangRes(@1begin), Class: btn btn-primary, Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_start_processing_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.Else{\r\n Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "Div(content-wrapper){\r\n DBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\n\r\n If(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"id,sender->type,notification->type,notification->header,notification->body,page_params->param_int,page_params->param_str,date_start_processing,closed\").Vars(prefix)\r\n SetVar(sender_type,#prefix_sender_type#).(notification_type,#prefix_notification_type#).(notific_header,#prefix_notification_header#).(notific_body,#prefix_notification_body#).(notific_val_int,#prefix_page_params_param_int#).(notific_val_str,#prefix_page_params_param_str#)\r\n }.Else{\r\n Div(md-12 alert alert-danger text-center){\r\n Span(Body: LangRes(@1attention))\r\n }\r\n SetVar(notific_id,\"0\").SetVar(sender_type,\"0\").(notification_type,\"0\").(notific_header,\"null\").(notific_body,\"null\").(notific_val_int,\"null\").(notific_val_str,\"null\")\r\n }\r\n\r\n Div(row){\r\n Div(col-md-6 col-md-offset-3){\r\n Form(){\r\n Div(list-group-item text-center){\r\n Span(Class: h3, Body: #notific_header#)\r\n }\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1id))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n Span(Class: h4, Body: #notific_id#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1type))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n If(#notification_type# > 0){\r\n Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_type, Index: #notification_type#))\r\n }.Else{\r\n Span(Class: h4, Body: #notification_type#)\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1sender))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n If(#sender_type# > 0){\r\n Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_sender, Index: #sender_type#))\r\n }.Else{\r\n Span(Class: h4, Body: #sender_type#)\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1body_text))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n Span(Class: h4, Body: #notific_body#)\r\n }\r\n }\r\n }\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1value_number))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n Span(Class: h4, Body: #notific_val_int#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-6 mt-sm text-right){\r\n Span(Class: h4, Body: LangRes(@1value_string))\r\n }\r\n Div(col-md-6 mt-sm text-left){\r\n Span(Class: h4, Body: #notific_val_str#)\r\n }\r\n }\r\n }\r\n Div(list-group-item text-right){\r\n If(#prefix_closed# == 0){\r\n If(#notification_type# == 1){\r\n Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1notifications_list).Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.ElseIf(#notification_type# == 2){\r\n If(#prefix_date_start_processing# == \"\"){\r\n Button(Body: LangRes(@1begin), Class: btn btn-primary, Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_start_processing_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.Else{\r\n Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1notifications_list, PageParams: \"type=1\").Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n }.Else{\r\n If(#notification_type# == 1){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1notifications_list, PageParams: \"type=0\")\r\n }.ElseIf(#notification_type# == 2){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1notifications_list, PageParams: \"type=1\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Menu": "default_menu", + "Type": "pages" + }, + { + "Name": "notifications_testpage_popup", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "DBFind(@1applications).Columns(\"name,id\").Where({ecosystem:1, name:\"Basic\"}).Vars(application)\r\nForm(){\r\n If(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"id,sender->type,sender->member_name,sender->role_name,notification->body,notification->type,notification->header,date_start_processing,closed\").Vars(n)\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(LangRes(@1sender))\r\n }\r\n }\r\n Div(col-md-9 mt-sm text-left){\r\n If(#n_sender_type#==1){\r\n Span(Class: text-normal, Body: #n_sender_member_name#)\r\n }.ElseIf(#n_sender_type#==2){\r\n Span(Class: text-normal, Body: #n_sender_role_name#)\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(LangRes(@1header))\r\n }\r\n }\r\n Div(col-md-9 mt-sm text-left){\r\n Span(Class: text-normal, Body: #n_notification_header#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-3 mt-sm text-right){\r\n Label(){\r\n Span(LangRes(@1body_text))\r\n }\r\n }\r\n Div(col-md-9 mt-sm text-left){\r\n Span(Class: text-normal, Body: #n_notification_body#)\r\n }\r\n }\r\n }.Else{\r\n Div(md-12 alert alert-danger text-center){\r\n Span(Body: LangRes(@1attention))\r\n }\r\n }\r\n If(#n_notification_type# == 1){\r\n SetVar(page_type,0)\r\n }.ElseIf(#n_notification_type# == 2){\r\n SetVar(page_type,1)\r\n }\r\n If(#n_closed# == 0){\r\n If(#n_notification_type# == 1){\r\n Button(Body: LangRes(@1close), Class: btn btn-primary pull-right mt, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1notifications_list, PageParams: \"type=#page_type#\").Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: \"type=#page_type#\")\r\n }.ElseIf(#n_notification_type# == 2){\r\n If(#n_date_start_processing# == \"\"){\r\n Button(Body: LangRes(@1begin), Class: btn btn-primary pull-right mt, Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\", Page: @1notifications_list, PageParams: \"type=#page_type#\").Alert(Text: \"$@1want_start_processing_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: \"type=#page_type#\")\r\n }.Else{\r\n Button(Body: LangRes(@1close), Class: btn btn-primary pull-right mt, Contract: @1NotificationsClose, Params: \"notific_id=#notific_id#\", Page: @1notifications_list, PageParams: \"type=#page_type#\").Alert(Text: \"$@1want_close_notification$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: \"type=#page_type#\")\r\n }\r\n }\r\n }.Else{\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: \"type=#page_type#\")\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -348,14 +376,14 @@ { "Name": "profile_transactions", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1profile_transactions).(this_table, @1history)\r\nInclude(@1pager_header)\r\n\r\nSetTitle($@1transactions_history$)\r\n\r\nIf(GetVar(new_filter)){\r\n If(#show_fees#!=\"true\"){\r\n SetVar(filter1, {\"type\": {$neq: 1}})\r\n }\r\n If(Or(#wallet#<0,#wallet#>0)){\r\n SetVar(filter2, {$or: [{$and: [{\"sender_id\":#key_id#}, {\"recipient_id\":#wallet#}]}, {$and: [{\"sender_id\":#wallet#}, {\"recipient_id\":#key_id#}]}]})\r\n }.Else{\r\n SetVar(filter2, {$or: [{\"sender_id\":#key_id#}, {\"recipient_id\":#key_id#}]})\r\n }\r\n If(#lower_limit#>0){\r\n If(#upper_limit#>0){\r\n SetVar(filter3, {\"amount\": [{$gte: Calculate(Exp: #lower_limit#*1000000000000000000, Type: money)}, {$lte: Calculate(Exp: #upper_limit#*1000000000000000000, Type: money)}]})\r\n }.Else{\r\n SetVar(filter3, {\"amount\": {$gte: Calculate(Exp: #lower_limit#*1000000000000000000, Type: money)}})\r\n }\r\n }.ElseIf(#upper_limit#>0){\r\n SetVar(filter3, {\"amount\": {$lte: Calculate(Exp: #upper_limit#*1000000000000000000, Type: money)}})\r\n }\r\n SetVar(filters, {$and: [{\"ecosystem\":#ecosystem_id#}, GetVar(filter1), GetVar(filter2), GetVar(filter3)]})\r\n SetVar(page_par, #filters#)\r\n}.ElseIf(GetVar(page_par)){\r\n SetVar(filters, #page_par#)\r\n}.Else{\r\n SetVar(filters, {$and: [{\"ecosystem\":#ecosystem_id#}, {\"type\": {$neq: 1}}, {$or: [{\"sender_id\":#key_id#}, {\"recipient_id\":#key_id#}]}]})\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, {$and: [GetVar(filters), {\"comment\": {$like: #search#}}]})\r\n}.Else{\r\n SetVar(where, GetVar(filters)).(search,)\r\n}\r\n\r\nDiv(mr-lg text-right){\r\n Button(Page: @1profile_transactions_filter, Class: btn bg-gray-lighter mr-sm, PageParams: \"show_fees=#show_fees#,wallet=#wallet#,lower_limit=#lower_limit#,upper_limit=#upper_limit#\", Body: Em(Class: fa fa-filter) $@1filter$).Popup(Header: $@1filter$, Width: \"45\")\r\n If(GetVar(page_par)){\r\n Button(Page: #this_page#, Class: btn bg-gray-lighter mr-sm, Body: Em(Class: fa fa-close))\r\n }\r\n}.Style(margin-top: -33px; z-index: 1001;)\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1comment))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(appication)\r\n\r\nDBFind(@1history, src_history).Where(#where#).Order({\"id\": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(sender_wallet){\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#sender_id#\"){\r\n Address(#sender_id#)\r\n }\r\n}.Custom(recipient_wallet){\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#recipient_id#\"){\r\n Address(#recipient_id#)\r\n }\r\n}.Custom(amount_apl){\r\n Money(#amount#) APL\r\n}.Custom(_type){\r\n AppParam(Ecosystem:1, App:#appication_id#, Name: type_tokens_transfer, Index: #type#)\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src_history, \"$@1block$=block_id,$@1sender$=sender_wallet,$@1recipient$=recipient_wallet,$@1amount$=amount_apl,$@1comment$=comment,$@1type$=_type\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1transactions_history_empty$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1profile_transactions).(this_table, @1history)\r\nInclude(@1pager_header)\r\n\r\nSetTitle($@1transactions_history$)\r\n\r\nIf(GetVar(new_filter)){\r\n If(#show_fees#!=\"true\"){\r\n SetVar(filter1, {\"type\": {$neq: 1}})\r\n }\r\n If(Or(#wallet#<0,#wallet#>0)){\r\n SetVar(filter2, {$or: [{$and: [{\"sender_id\":#key_id#}, {\"recipient_id\":#wallet#}]}, {$and: [{\"sender_id\":#wallet#}, {\"recipient_id\":#key_id#}]}]})\r\n }.Else{\r\n SetVar(filter2, {$or: [{\"sender_id\":#key_id#}, {\"recipient_id\":#key_id#}]})\r\n }\r\n If(#lower_limit#>0){\r\n If(#upper_limit#>0){\r\n SetVar(filter3, {\"amount\": [{$gte: Calculate(Exp: #lower_limit#*1000000000000000000, Type: money)}, {$lte: Calculate(Exp: #upper_limit#*1000000000000000000, Type: money)}]})\r\n }.Else{\r\n SetVar(filter3, {\"amount\": {$gte: Calculate(Exp: #lower_limit#*1000000000000000000, Type: money)}})\r\n }\r\n }.ElseIf(#upper_limit#>0){\r\n SetVar(filter3, {\"amount\": {$lte: Calculate(Exp: #upper_limit#*1000000000000000000, Type: money)}})\r\n }\r\n SetVar(filters, {$and: [{\"ecosystem\":#ecosystem_id#}, GetVar(filter1), GetVar(filter2), GetVar(filter3)]})\r\n SetVar(page_par, #filters#)\r\n}.ElseIf(GetVar(page_par)){\r\n SetVar(filters, #page_par#)\r\n}.Else{\r\n SetVar(filters, {$and: [{\"ecosystem\":#ecosystem_id#}, {\"type\": {$neq: 1}}, {$or: [{\"sender_id\":#key_id#}, {\"recipient_id\":#key_id#}]}]})\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, {$and: [GetVar(filters), {\"comment\": {$like: #search#}}]})\r\n}.Else{\r\n SetVar(where, GetVar(filters)).(search,)\r\n}\r\n\r\nDiv(mr-lg text-right){\r\n Button(Page: @1profile_transactions_filter, Class: btn bg-gray-lighter mr-sm, PageParams: \"show_fees=#show_fees#,wallet=#wallet#,lower_limit=#lower_limit#,upper_limit=#upper_limit#\", Body: Em(Class: fa fa-filter) $@1filter$).Popup(Header: $@1filter$, Width: \"45\")\r\n If(GetVar(page_par)){\r\n Button(Page: #this_page#, Class: btn bg-gray-lighter mr-sm, Body: Em(Class: fa fa-close))\r\n }\r\n}.Style(margin-top: -33px; z-index: 1001;)\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1comment))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(appication)\r\n\r\nDBFind(@1history, src_history).Where(#where#).Order({\"id\": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(sender_wallet){\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#sender_id#\"){\r\n Address(#sender_id#)\r\n }\r\n}.Custom(recipient_wallet){\r\n LinkPage(Page: @1profile_view, PageParams: \"v_key_id=#recipient_id#\"){\r\n Address(#recipient_id#)\r\n }\r\n}.Custom(amount_apl){\r\n Money(#amount#) APLA\r\n}.Custom(_type){\r\n AppParam(Ecosystem:1, App:#appication_id#, Name: type_tokens_transfer, Index: #type#)\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src_history, \"$@1block$=block_id,$@1sender$=sender_wallet,$@1recipient$=recipient_wallet,$@1amount$=amount_apl,$@1comment$=comment,$@1type$=_type\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1transactions_history_empty$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "profile_transactions_filter", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Form(){\r\n Div(row){\r\n Div(col-md-4 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1key_id))\r\n }\r\n }\r\n Div(col-md-8){\r\n If(Or(#wallet#<0,#wallet#>0)){\r\n Input(Name: wallet, Value: #wallet#)\r\n }.Else{\r\n Input(Name: wallet)\r\n }\r\n Div(Class: m0 h6 text-muted, Body: LangRes(@1transactions_filter_wallet_desc))\r\n }\r\n }\r\n Div(row mt){\r\n Div(col-md-4 mt-sm text-right){\r\n Label(){\r\n Span(Body: \"$@1amount_range$ (APL)\")\r\n }\r\n }\r\n Div(col-sm-3 pr0){\r\n If(#lower_limit#>0){\r\n Input(Name: lower_limit, Placeholder: \"$@1for_example$: 0.1\", Value: #lower_limit#)\r\n }.Else{\r\n Input(Name: lower_limit, Placeholder: \"$@1for_example$: 0.1\")\r\n }\r\n Div(Class: m0 h6 text-muted, Body: LangRes(@1transactions_filter_lower_desc))\r\n }\r\n Div(col-sm-2 ph0 mt-sm text-center){\r\n Label(Body: \"< $@1amount$ <\")\r\n }\r\n Div(col-sm-3 pl0){\r\n If(#upper_limit#>0){\r\n Input(Name: upper_limit, Placeholder: \"$@1for_example$: 100\", Value: #upper_limit#)\r\n }.Else{\r\n Input(Name: upper_limit, Placeholder: \"$@1for_example$: 100\")\r\n }\r\n Div(Class: m0 h6 text-muted, Body: LangRes(@1transactions_filter_upper_desc))\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-4 mt text-right){\r\n Label(){\r\n Span(Body: LangRes(@1resources_fees_show))\r\n }\r\n }\r\n Div(col-md-8){\r\n If(#show_fees#==\"true\"){\r\n Input(Name: show_fees, Type: \"checkbox\", Value: \"true\")\r\n }.Else{\r\n Input(Name: show_fees, Type: \"checkbox\", Value: \"false\")\r\n }\r\n }\r\n }\r\n Button(Body: LangRes(@1filter), Class: btn btn-primary pull-right, Page: @1profile_transactions, PageParams: \"new_filter=1,show_fees=Val(show_fees),wallet=Val(wallet),lower_limit=Val(lower_limit),upper_limit=Val(upper_limit)\")\r\n Button(Body: LangRes(@1clear), Class: btn btn-default pull-right, Page: @1profile_transactions)\r\n}", + "Value": "Form(){\r\n Div(row){\r\n Div(col-md-4 mt-sm text-right){\r\n Label(){\r\n Span(Body: LangRes(@1key_id))\r\n }\r\n }\r\n Div(col-md-8){\r\n If(Or(#wallet#<0,#wallet#>0)){\r\n Input(Name: wallet, Value: #wallet#)\r\n }.Else{\r\n Input(Name: wallet)\r\n }\r\n Div(Class: m0 h6 text-muted, Body: LangRes(@1transactions_filter_wallet_desc))\r\n }\r\n }\r\n Div(row mt){\r\n Div(col-md-4 mt-sm text-right){\r\n Label(){\r\n Span(Body: \"$@1amount_range$ (APLA)\")\r\n }\r\n }\r\n Div(col-sm-3 pr0){\r\n If(#lower_limit#>0){\r\n Input(Name: lower_limit, Placeholder: \"$@1for_example$: 0.1\", Value: #lower_limit#)\r\n }.Else{\r\n Input(Name: lower_limit, Placeholder: \"$@1for_example$: 0.1\")\r\n }\r\n Div(Class: m0 h6 text-muted, Body: LangRes(@1transactions_filter_lower_desc))\r\n }\r\n Div(col-sm-2 ph0 mt-sm text-center){\r\n Label(Body: \"< $@1amount$ <\")\r\n }\r\n Div(col-sm-3 pl0){\r\n If(#upper_limit#>0){\r\n Input(Name: upper_limit, Placeholder: \"$@1for_example$: 100\", Value: #upper_limit#)\r\n }.Else{\r\n Input(Name: upper_limit, Placeholder: \"$@1for_example$: 100\")\r\n }\r\n Div(Class: m0 h6 text-muted, Body: LangRes(@1transactions_filter_upper_desc))\r\n }\r\n }\r\n Div(row){\r\n Div(col-md-4 mt text-right){\r\n Label(){\r\n Span(Body: LangRes(@1resources_fees_show))\r\n }\r\n }\r\n Div(col-md-8){\r\n If(#show_fees#==\"true\"){\r\n Input(Name: show_fees, Type: \"checkbox\", Value: \"true\")\r\n }.Else{\r\n Input(Name: show_fees, Type: \"checkbox\", Value: \"false\")\r\n }\r\n }\r\n }\r\n Button(Body: LangRes(@1filter), Class: btn btn-primary pull-right, Page: @1profile_transactions, PageParams: \"new_filter=1,show_fees=Val(show_fees),wallet=Val(wallet),lower_limit=Val(lower_limit),upper_limit=Val(upper_limit)\")\r\n Button(Body: LangRes(@1clear), Class: btn btn-default pull-right, Page: @1profile_transactions)\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -383,7 +411,7 @@ { "Name": "roles_list", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1roles_list).(this_table, @1roles)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1roles$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1roles_list_desc$\"))\r\nAddToolButton(Page: @1roles_create, Icon: icon-plus, Title: $@1create$).Popup(50, $@1new_role$)\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, \"{role_name:{$like:#search#}, ecosystem:#ecosystem_id#}\")\r\n}.Else{\r\n SetVar(where, \"{id:{$neq:0}, ecosystem:#ecosystem_id#}\").(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1role))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#).Count(all_roles_count)\r\nDBFind(#this_table#, src_roles).Where(#where#).Order({deleted:\"1\", id:\"1\"}).Limit(#pager_limit#).Offset(#pager_offset#).Columns(\"id,role_name,role_type,image_id,creator->member_id,creator->member_name,date_created,date_deleted,deleted,roles_access\").Custom(_id){\r\n If(#deleted# == 0){\r\n SetVar(style_text,).(style_link,\"text-primary\")\r\n }.Else{\r\n SetVar(style_text,\"text-muted\").(style_link,\"text-muted\")\r\n }\r\n Span(Class: #style_text#, Body: #id#)\r\n}.Custom(_creator){\r\n If(And(#creator.member_name#!=NULL,#creator.member_name#!=\"\")){\r\n LinkPage(Class: #style_link# text-bold, Page: @1profile_view, PageParams: \"v_key_id=#creator.member_id#\"){\r\n #creator.member_name#\r\n }\r\n }\r\n}.Custom(_name){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#id#\"){\r\n If(#image_id#>0){\r\n Image(Src: Binary().ById(#image_id#), Class: mr-sm).Style(width: 30px; border: 1px solid #5A5D63;)\r\n #role_name#\r\n }.Else{\r\n Div(Class: text-primary){\r\n Span(Class: fa icon-settings fa-2x mr-sm)\r\n }.Style(\r\n display: inline-block;\r\n )\r\n Div(Class: text-primary){\r\n Span(Class: btn-link text-bold pb-sm, Body: #role_name#)\r\n }.Style(\r\n display: inline-block;\r\n vertical-align: top;\r\n padding-top: 7px;\r\n padding-left: 4px;\r\n )\r\n }\r\n }\r\n}.Custom(_date){\r\n Div(#style_text# small){\r\n Div(text-nowrap){DateTime(DateTime: #date_created#, Format: \"DD.MM.YYYY HH:MI\")}\r\n Div(text-nowrap){DateTime(DateTime: #date_deleted#, Format: \"DD.MM.YYYY HH:MI\")}\r\n }\r\n}.Custom(_type){\r\n DBFind(@1applications).Where({name:\"Basic\", ecosystem:1}).Columns(\"name,id\").Vars(application)\r\n Span(Class: #style_text#, Body: AppParam(Ecosystem: 1, App: #application_id#, Name: roles_types, Index: #role_type#))\r\n}.Custom(_status){\r\n Span(Class:#style_text#){\r\n If(#deleted# == 0){\r\n LangRes(@1active)\r\n }.Else{\r\n LangRes(@1deleted)\r\n }\r\n }\r\n}.Custom(_access){\r\n If(#creator.member_id#==#key_id#){\r\n SetVar(access,done)\r\n }.Else{\r\n SetVar(access,)\r\n }\r\n\r\n If(And(#roles_access#!=\"NULL\",#roles_access#!=\"\",#roles_access#!=\"[]\")){\r\n DBFind(@1roles,src_access_list).Where({id:{\"$in\":#roles_access#}}).Columns(\"id,role_name\").Count(access_count).Order(role_name)\r\n Div(#style_text# breaker){\r\n ForList(src_access_list){\r\n If(And(#role_id#==#id#)){\r\n SetVar(access,done)\r\n }\r\n\r\n If(#access_count#!=#src_access_list_index#){\r\n Span(\"#role_name#,\",mr-sm)\r\n }.Else{\r\n #role_name#\r\n }\r\n }\r\n }\r\n }\r\n}.Custom(_actions){\r\n Div(text-right button-group text-nowrap){\r\n If(#access#==\"done\"){\r\n If(And(#deleted#==0,#role_type#!=3)){\r\n Button(Class: fa fa-trash btn btn-danger mh-sm, Contract: @1RolesDelete, Params: \"ops=D,rid=#id#\", Page: @1roles_list).Alert(Text: \"$@1sure_want_delete$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.ElseIf(#deleted#==1){\r\n Button(Class: fa fa-recycle btn btn-info mh-sm, Contract: @1RolesDelete, Params: \"ops=R,rid=#id#\", Page: @1roles_list)\r\n }\r\n Button(Class: fa fa-edit btn btn-default mh-sm, PageParams: \"rid=#id#\", Page: @1roles_create).Popup(50, $@1edit_role$)\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src_roles, \"$@1role$=_name,$@1type$=_type,$@1id$=id,$@1creator$=_creator,$@1role_created_deleted$=_date,$@1status$=_status,$@1roles_access$=_access,=_actions\")\r\n }.ElseIf(#all_roles_count# > 0){\r\n Div(Class: text-center h4 text-muted){\r\n Div(Class: text-center h4 text-muted, Body: \"$@1roles$ $@1not_founded$\")\r\n }\r\n }.Else{\r\n Div(Class: text-center h4 text-muted){\r\n Button(Body: $@1install_default_roles$, Class: btn btn-primary, Page: @1roles_list, Contract: @1RolesInstall)\r\n }\r\n }\r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1roles_list).(this_table, @1roles)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1roles$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1roles_list_desc$\"))\r\nAddToolButton(Page: @1roles_create, Icon: icon-plus, Title: $@1create$).Popup(50, $@1new_role$)\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, \"{role_name:{$like:#search#}, ecosystem:#ecosystem_id#}\")\r\n}.Else{\r\n SetVar(where, \"{id:{$neq:0}, ecosystem:#ecosystem_id#}\").(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1role))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#).Where({ecosystem:#ecosystem_id#}).Count(all_roles_count)\r\nDBFind(#this_table#, src_roles).Where(#where#).Order({deleted:\"1\", id:\"1\"}).Limit(#pager_limit#).Offset(#pager_offset#).Columns(\"id,role_name,role_type,image_id,creator->member_id,creator->member_name,date_created,date_deleted,deleted,roles_access\").Custom(_id){\r\n If(#deleted# == 0){\r\n SetVar(style_text,).(style_link,\"text-primary\")\r\n }.Else{\r\n SetVar(style_text,\"text-muted\").(style_link,\"text-muted\")\r\n }\r\n Span(Class: #style_text#, Body: #id#)\r\n}.Custom(_creator){\r\n If(And(#creator.member_name#!=NULL,#creator.member_name#!=\"\")){\r\n LinkPage(Class: #style_link# text-bold, Page: @1profile_view, PageParams: \"v_key_id=#creator.member_id#\"){\r\n #creator.member_name#\r\n }\r\n }\r\n}.Custom(_name){\r\n LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: \"v_role_id=#id#\"){\r\n If(#image_id#>0){\r\n Image(Src: Binary().ById(#image_id#), Class: mr-sm).Style(width: 30px; border: 1px solid #5A5D63;)\r\n #role_name#\r\n }.Else{\r\n Div(Class: text-primary){\r\n Span(Class: fa icon-settings fa-2x mr-sm)\r\n }.Style(\r\n display: inline-block;\r\n )\r\n Div(Class: text-primary){\r\n Span(Class: btn-link text-bold pb-sm, Body: #role_name#)\r\n }.Style(\r\n display: inline-block;\r\n vertical-align: top;\r\n padding-top: 7px;\r\n padding-left: 4px;\r\n )\r\n }\r\n }\r\n}.Custom(_date){\r\n Div(#style_text# small){\r\n Div(text-nowrap){DateTime(DateTime: #date_created#, Format: \"DD.MM.YYYY HH:MI\")}\r\n Div(text-nowrap){DateTime(DateTime: #date_deleted#, Format: \"DD.MM.YYYY HH:MI\")}\r\n }\r\n}.Custom(_type){\r\n DBFind(@1applications).Where({name:\"Basic\", ecosystem:1}).Columns(\"name,id\").Vars(application)\r\n Span(Class: #style_text#, Body: AppParam(Ecosystem: 1, App: #application_id#, Name: roles_types, Index: #role_type#))\r\n}.Custom(_status){\r\n Span(Class:#style_text#){\r\n If(#deleted# == 0){\r\n LangRes(@1active)\r\n }.Else{\r\n LangRes(@1deleted)\r\n }\r\n }\r\n}.Custom(_access){\r\n If(#creator.member_id#==#key_id#){\r\n SetVar(access,done)\r\n }.Else{\r\n SetVar(access,)\r\n }\r\n\r\n If(And(#roles_access#!=\"NULL\",#roles_access#!=\"\",#roles_access#!=\"[]\")){\r\n DBFind(@1roles,src_access_list).Where({id:{\"$in\":#roles_access#}}).Columns(\"id,role_name\").Count(access_count).Order(role_name)\r\n Div(#style_text# breaker){\r\n ForList(src_access_list){\r\n If(And(#role_id#==#id#)){\r\n SetVar(access,done)\r\n }\r\n\r\n If(#access_count#!=#src_access_list_index#){\r\n Span(\"#role_name#,\",mr-sm)\r\n }.Else{\r\n #role_name#\r\n }\r\n }\r\n }\r\n }\r\n}.Custom(_actions){\r\n Div(text-right button-group text-nowrap){\r\n If(#access#==\"done\"){\r\n If(And(#deleted#==0,#role_type#!=3)){\r\n Button(Class: fa fa-trash btn btn-danger mh-sm, Contract: @1RolesDelete, Params: \"ops=D,rid=#id#\", Page: @1roles_list).Alert(Text: \"$@1sure_want_delete$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }.ElseIf(#deleted#==1){\r\n Button(Class: fa fa-recycle btn btn-info mh-sm, Contract: @1RolesDelete, Params: \"ops=R,rid=#id#\", Page: @1roles_list)\r\n }\r\n Button(Class: fa fa-edit btn btn-default mh-sm, PageParams: \"rid=#id#\", Page: @1roles_create).Popup(50, $@1edit_role$)\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src_roles, \"$@1role$=_name,$@1type$=_type,$@1id$=id,$@1creator$=_creator,$@1role_created_deleted$=_date,$@1status$=_status,$@1roles_access$=_access,=_actions\")\r\n }.ElseIf(#all_roles_count# > 0){\r\n Div(Class: text-center h4 text-muted){\r\n Div(Class: text-center h4 text-muted, Body: \"$@1roles$ $@1not_founded$\")\r\n }\r\n }.Else{\r\n Div(Class: text-center h4 text-muted){\r\n Button(Body: $@1install_default_roles$, Class: btn btn-primary, Page: @1roles_list, Contract: @1RolesInstall)\r\n }\r\n }\r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "admin_menu", "Type": "pages" }, @@ -432,7 +460,7 @@ { "Name": "sysparams_list", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1sysparams_list).(this_table, @1system_parameters)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1platform_parameters$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1platform_params_desc$\"))\r\nSetVar(role_validator, EcosysParam(Ecosystem:1, Name: role_validator))\r\nDBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#key_id#, \"role->id\":#role_validator#, deleted:0}).Columns(\"id\").Vars(validator)\r\nIf(#validator_id#==0){\r\n AddToolButton(Title: $@1sysparams_validator_resign$, Icon: icon-pin, Page: @1sysparams_validator_resign)\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, \"{name:{$like:#search#}}\")\r\n}.Else{\r\n SetVar(where, \"{id:{$gt:0}}\").(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1name))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_actions){\r\n SetVar(sp_id,0)\r\n DBFind(@1contracts).Where({ecosystem:1, name:#name#}).Columns(id).Vars(sp)\r\n If(#sp_id#>0){\r\n Span(Class: pull-right){\r\n LinkPage(Class: text-primary h4, Body: Em(Class: fa fa-cogs), Page: @1sysparams_voting, PageParams: \"param_index=#id#,param_name=#name#\")\r\n }\r\n }.Else{\r\n Span(Class: pull-right){\r\n $@1contract_404$\r\n }\r\n }\r\n}.Custom(_name){\r\n Div(){\r\n #name#\r\n }.Style(min-width:200px;)\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1name$=_name,$@1value$=value,=_actions\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1platform_parameters$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1sysparams_list).(this_table, @1system_parameters)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1platform_parameters$\")\r\nSpan(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: \"$@1platform_params_desc$\"))\r\nSetVar(role_validator, EcosysParam(Ecosystem:1, Name: role_validator))\r\nDBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#key_id#, \"role->id\":#role_validator#, deleted:0}).Columns(\"id\").Vars(validator)\r\nIf(#validator_id#>0){\r\n AddToolButton(Title: $@1sysparams_validator_resign$, Icon: icon-pin, Page: @1sysparams_validator_resign).Popup(50, $@1sysparams_validator_resign$)\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, \"{name:{$like:#search#}}\")\r\n}.Else{\r\n SetVar(where, \"{id:{$gt:0}}\").(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1name))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_actions){\r\n SetVar(sp_id,0)\r\n DBFind(@1contracts).Where({ecosystem:1, name:#name#}).Columns(id).Vars(sp)\r\n If(#sp_id#>0){\r\n Span(Class: pull-right){\r\n LinkPage(Class: text-primary h4, Body: Em(Class: fa fa-cogs), Page: @1sysparams_voting, PageParams: \"param_index=#id#,param_name=#name#\")\r\n }\r\n }.Else{\r\n Span(Class: pull-right){\r\n $@1contract_404$\r\n }\r\n }\r\n}.Custom(_name){\r\n Div(){\r\n #name#\r\n }.Style(min-width:200px;)\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1name$=_name,$@1value$=value,=_actions\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1platform_parameters$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "admin_menu", "Type": "pages" }, @@ -446,14 +474,14 @@ { "Name": "sysparams_validator_resign", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(role_validator, EcosysParam(Ecosystem:1, Name: role_validator))\r\nDBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#key_id#, \"role->id\":#role_validator#, deleted:0}).Columns(\"id\").Vars(validator)\r\nSetTitle($@1sysparams_validator_resign$)\r\n\r\nDiv(content-wrapper){\r\n Div(breadcrumb){\r\n LinkPage(Body:$system_params$, Page: @1sysparams_list)\r\n Span(/,mh)\r\n Span(Class: text-muted, Body: $@1sysparams_validator_resign$)\r\n }\r\n If(#validator_id#>0){\r\n Div(row){\r\n Div(col-md-6 col-md-offset-3){\r\n Div(panel panel-primary text-center){\r\n Div(panel-heading){\r\n $@1validator_removing$\r\n }\r\n Div(panel-body text-center){\r\n $@1validator_removing_desc$\r\n }\r\n Div(panel-footer text-left){\r\n Button(Body: $@1back$, Class: btn btn-default, Page: @1sysparams_list)\r\n Button(Body: $@1resign$, Class: btn btn-danger pull-right, Page: @1sysparams_list, Contract: @1ValidatorResign).Alert(Text: \"$@1want_resign$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(text-danger text-center text-bold){\r\n LangRes(@1attention_not_validator)\r\n }\r\n }\r\n\r\n}", + "Value": "Form(){\r\n Div(row){\r\n Div(col-sm-12 text-center h4){\r\n $@1validator_removing_desc$\r\n }\r\n }\r\n SetVar(role_validator, EcosysParam(Ecosystem:1, Name: role_validator))\r\n DBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, \"member->member_id\":#key_id#, \"role->id\":#role_validator#, deleted:0}).Columns(\"id\").Vars(validator)\r\n If(#validator_id#>0){\r\n Button(Body: $@1resign$, Class: btn btn-danger pull-right mt-lg, Page: @1sysparams_list, Contract: @1ValidatorResign).Alert(Text: \"$@1want_resign$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n Button(Body: $@1back$, Class: btn btn-default pull-right mt-lg, Page: @1sysparams_list)\r\n}", "Menu": "admin_menu", "Type": "pages" }, { "Name": "sysparams_voting", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(application)\r\nSetVar(tid, AppParam(Ecosystem:1, App:#application_id#, Name: voting_sysparams_template_id))\r\nDBFind(@1voting_templates,temps).WhereId(#tid#).Vars(template)\r\nSetVar(role_asbl,EcosysParam(Name:role_apla_consensus_asbl, Ecosystem:1))\r\nSetTitle($@1voting$)\r\n\r\nDiv(content-wrapper){\r\n Div(breadcrumb){\r\n LinkPage($@1system_params$, @1sysparams_list)\r\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\r\n Span(Class: text-muted, Body: $@1voting$)\r\n }\r\n\r\n If(And(#template_id#>0,#param_index#>0,#param_name#!=\"\")){\r\n DBFind(@1system_parameters).Where({name:#param_name#}).Vars(param)\r\n DBFind(@1voting_templates).WhereId(#template_id#).Columns(\"title,id\").Vars(template)\r\n SetTitle(#template_title#)\r\n If(#param_name#!=\"full_nodes\"){\r\n Form(){\r\n Div(form-group){\r\n Label(For: ColumnName){\r\n LangRes(@1name)\r\n }\r\n Input(Name: ColumnName, Value: #param_name#, Disabled: true)\r\n }\r\n Div(form-group){\r\n Label(For: Value){\r\n LangRes(@1value)\r\n }\r\n Input(Name: Value, Value: #param_value#, Disabled: true)\r\n }\r\n Div(form-group){\r\n Label(){\r\n LangRes(@1new_value)\r\n }\r\n Input(Name: NewValue, Type: textarea)\r\n }\r\n Div(text-left){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1sysparams_list)\r\n Button(Body: LangRes(@1voting), Class: btn btn-primary pull-right, Contract: @1VotingParamCreate, Page: @1voting_list)\r\n }\r\n }\r\n }.Else{\r\n SetVar(full_nodes,SysParam(full_nodes)).(first_node,AppParam(Ecosystem:1, App:#application_id#, Name: first_node)).(first_node_set,)\r\n SetTitle(\"#param_name#: $@1add$ $@1new_value$\")\r\n Form(){\r\n If(`#full_nodes#`==\"\"){\r\n JsonToSource(src_first_node,#first_node#)\r\n ForList(src_first_node){\r\n If(#value#==\"\"){\r\n SetVar(first_node_set,error)\r\n }\r\n }\r\n If(#first_node_set#==error){\r\n Div(text-center){\r\n ForList(src_first_node){\r\n If(#value#==\"\"){\r\n Div(){first node: '#key#' empty}\r\n }\r\n }\r\n }\r\n Div(text-center){\r\n DBFind(@1app_params).Where({ecosystem:#ecosystem_id#, name:first_node}).Vars(first_node_param)\r\n Button(Page: @1app_params_edit, Class: btn btn-info, PageParams: \"id=#first_node_param_id#,back_page=@1sysparams_list\"){\r\n Install the first node before adding the new\r\n }\r\n }\r\n }\r\n }\r\n If(#first_node_set#!=error){\r\n Div(form-group){\r\n Label(For: Duration){\r\n LangRes(@1duration)\r\n }\r\n Input(Name:Duration, Value:21, Disabled: true)\r\n }\r\n Div(form-group){\r\n Label(For: TcpAddress){\r\n LangRes(@1tcp_address)\r\n }\r\n Input(Name: TcpAddress, Placeholder: \"#.#.#.#:#\")\r\n }\r\n Div(form-group){\r\n Label(For: ApiAddress){\r\n LangRes(@1api_address)\r\n }\r\n Input(Name: ApiAddress, Placeholder: \"#://#.#.#.#:#\")\r\n }\r\n Div(form-group){\r\n Label(For: KeyId){\r\n LangRes(@1node_founder_key_id)\r\n }\r\n Input(Name: KeyId,Type: number, Value: #key_id#)\r\n }\r\n Div(form-group){\r\n Label(For: PubKey){\r\n LangRes(@1node_pub_key)\r\n }\r\n Input(Name: PubKey, Type: textarea)\r\n }\r\n\r\n Div(text-left mb-lg){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1sysparams_list)\r\n Button(Body: LangRes(@1voting), Class: btn btn-primary pull-right, Contract: @1VotingNodeAdd, Page: @1voting_list)\r\n }\r\n }\r\n }\r\n AppParam(Ecosystem:1, App:#application_id#, Name:full_nodes_keys, Source:nodes_keys)\r\n SetVar(node_owner,)\r\n ForList(nodes_keys){\r\n If(#name#==\"key_id\"){\r\n SetVar(node_owner, 1)\r\n }\r\n }\r\n\r\n If(#node_owner#==1){\r\n Form(text-center){\r\n Div(h3){$delete_node$}\r\n Div(){$delete_node_desc$}\r\n Div(text-right){\r\n Button(Body: LangRes(@1delete), Class: btn btn-danger, Page: @1sysparams_list, Contract: @1NodeRemoveByKey)\r\n }\r\n }\r\n }\r\n If(`#full_nodes#`!=\"\"){\r\n SetVar(nodes_count,0)\r\n ArrayToSource(src_full_nodes,`#full_nodes#`)\r\n Div(mt-lg form-group text-left text-muted){\r\n Label(){Nodes list}\r\n ForList(src_full_nodes){\r\n SetVar(nodes_count,#src_full_nodes_index#)\r\n JsonToSource(src_node,`#value#`)\r\n Div(list-group-item){\r\n Label(){node #key#}\r\n ForList(src_node){\r\n Div(){\r\n Strong(#key#:) #value#\r\n }\r\n }\r\n }\r\n }\r\n }.Style(word-break: break-all;)\r\n\r\n If(#role_id#==#role_asbl#){\r\n Div(panel panel-primary){\r\n Form(){\r\n Div(panel-heading text-center h3){\r\n Span(#param_name#, text-uppercase): Span(LangRes(delete) $value$, text-lowercase)\r\n }\r\n Input(Name:Duration, Type:hidden, Value:21)\r\n Div(panel-body text-left text-break){\r\n RadioGroup(Name:Index, Source:src_full_nodes, NameColumn: value, ValueColumn: key)\r\n }\r\n Div(panel-footer text-right){\r\n If(#nodes_count#>2){\r\n Button(Body: $@1voting$, Class: btn btn-danger, Contract: @1VotingNodeRemove, Page: @1voting_list)\r\n }.Else{\r\n Button(Body: $@1voting$, Class: btn btn-danger disabled)\r\n }\r\n }\r\n }\r\n }.Style(\r\n .text-break label,.text-break td {word-break: break-all;}\r\n )\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(text-danger text-center text-bold){\r\n If(#param_index#>0){}.Else{\r\n Div(){LangRes(@1attention)}\r\n }\r\n If(#tid#>0){\r\n If(#template_id#>0){}.Else{\r\n Div(mb-sm){\r\n LangRes(@1voting_template_not_found)\r\n }\r\n LinkPage(Page: @1voting_templates_list, Class: btn btn-info){\r\n LangRes(@1template_set)\r\n }\r\n }\r\n }.Else{\r\n Div(mb-sm){\r\n LangRes(@1voting_template_id_not_found)\r\n }\r\n DBFind(@1app_params).Where({ecosystem:#ecosystem_id#, name:voting_sysparams_template_id}).Vars(template_param)\r\n LinkPage(Page: @1app_params_edit, Class: btn btn-info, PageParams: \"back_page=@1sysparams_list,id=#template_param_id#\"){\r\n LangRes(@1template_id_set)\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "DBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(application)\r\nSetVar(tid, AppParam(Ecosystem:1, App:#application_id#, Name: voting_sysparams_template_id))\r\nDBFind(@1voting_templates,temps).WhereId(#tid#).Vars(template)\r\nSetVar(role_asbl,EcosysParam(Name:role_apla_consensus_asbl, Ecosystem:1))\r\nSetTitle($@1voting$)\r\n\r\nDiv(content-wrapper){\r\n Div(breadcrumb){\r\n LinkPage($@1system_params$, @1sysparams_list)\r\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\r\n Span(Class: text-muted, Body: $@1voting$)\r\n }\r\n\r\n If(And(#template_id#>0,#param_index#>0,#param_name#!=\"\")){\r\n DBFind(@1system_parameters).Where({name:#param_name#}).Vars(param)\r\n DBFind(@1voting_templates).WhereId(#template_id#).Columns(\"title,id\").Vars(template)\r\n SetTitle(#template_title#)\r\n If(#param_name#!=\"full_nodes\"){\r\n Form(){\r\n Div(form-group){\r\n Label(For: ColumnName){\r\n LangRes(@1name)\r\n }\r\n Input(Name: ColumnName, Value: #param_name#, Disabled: true)\r\n }\r\n Div(form-group){\r\n Label(For: Value){\r\n LangRes(@1value)\r\n }\r\n Input(Name: Value, Value: #param_value#, Disabled: true)\r\n }\r\n Div(form-group){\r\n Label(){\r\n LangRes(@1new_value)\r\n }\r\n Input(Name: NewValue, Type: textarea)\r\n }\r\n Div(text-left){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1sysparams_list)\r\n Button(Body: LangRes(@1voting), Class: btn btn-primary pull-right, Contract: @1VotingParamCreate, Page: @1voting_list)\r\n }\r\n }\r\n }.Else{\r\n SetVar(full_nodes,SysParam(full_nodes)).(first_node,AppParam(Ecosystem:1, App:#application_id#, Name: first_node)).(first_node_set,)\r\n SetTitle(\"#param_name#: $@1add$ $@1new_value$\")\r\n Form(){\r\n If(`#full_nodes#`==\"\"){\r\n JsonToSource(src_first_node,#first_node#)\r\n ForList(src_first_node){\r\n If(#value#==\"\"){\r\n SetVar(first_node_set,error)\r\n }\r\n }\r\n If(#first_node_set#==error){\r\n Div(text-center){\r\n ForList(src_first_node){\r\n If(#value#==\"\"){\r\n Div(){first node: '#key#' empty}\r\n }\r\n }\r\n }\r\n Div(text-center){\r\n DBFind(@1app_params).Where({ecosystem:#ecosystem_id#, name:first_node}).Vars(first_node_param)\r\n Button(Page: @1app_params_edit, Class: btn btn-info, PageParams: \"id=#first_node_param_id#,back_page=@1sysparams_list\"){\r\n Install the first node before adding the new\r\n }\r\n }\r\n }\r\n }\r\n If(#first_node_set#!=error){\r\n Div(form-group){\r\n Label(For: Duration){\r\n LangRes(@1duration)\r\n }\r\n Input(Name:Duration, Value:21, Disabled: true)\r\n }\r\n Div(form-group){\r\n Label(For: TcpAddress){\r\n LangRes(@1tcp_address)\r\n }\r\n Input(Name: TcpAddress, Placeholder: \"#.#.#.#:#\")\r\n }\r\n Div(form-group){\r\n Label(For: ApiAddress){\r\n LangRes(@1api_address)\r\n }\r\n Input(Name: ApiAddress, Placeholder: \"#://#.#.#.#:#\")\r\n }\r\n Div(form-group){\r\n Label(For: KeyId){\r\n LangRes(@1node_founder_key_id)\r\n }\r\n Input(Name: KeyId,Type: number, Value: #key_id#)\r\n }\r\n Div(form-group){\r\n Label(For: PubKey){\r\n LangRes(@1node_pub_key)\r\n }\r\n Input(Name: PubKey, Type: textarea)\r\n }\r\n\r\n Div(text-left mb-lg){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1sysparams_list)\r\n Button(Body: LangRes(@1voting), Class: btn btn-primary pull-right, Contract: @1VotingNodeAdd, Page: @1voting_list)\r\n }\r\n }\r\n }\r\n AppParam(Ecosystem:1, App:#application_id#, Name:full_nodes_keys, Source:nodes_keys)\r\n SetVar(node_owner,)\r\n ForList(nodes_keys){\r\n If(#name#==\"key_id\"){\r\n SetVar(node_owner, 1)\r\n }\r\n }\r\n If(`#full_nodes#`!=\"\"){\r\n SetVar(nodes_count,0)\r\n ArrayToSource(src_full_nodes,`#full_nodes#`)\r\n Div(mt-lg form-group text-left text-muted){\r\n Label(){Nodes list}\r\n ForList(src_full_nodes){\r\n SetVar(nodes_count,#src_full_nodes_index#)\r\n JsonToSource(src_node,`#value#`)\r\n Div(list-group-item){\r\n Label(){node #key#}\r\n ForList(src_node){\r\n Div(){\r\n Strong(#key#:) #value#\r\n }\r\n }\r\n }\r\n }\r\n }.Style(word-break: break-all;)\r\n\r\n If(#role_id#==#role_asbl#){\r\n Div(panel panel-primary){\r\n Form(){\r\n Div(panel-heading text-center h3){\r\n Span(#param_name#, text-uppercase): Span(LangRes(delete) $value$, text-lowercase)\r\n }\r\n Input(Name:Duration, Type:hidden, Value:21)\r\n Div(panel-body text-left text-break){\r\n RadioGroup(Name:Index, Source:src_full_nodes, NameColumn: value, ValueColumn: key)\r\n }\r\n Div(panel-footer text-right){\r\n If(#nodes_count#>2){\r\n Button(Body: $@1voting$, Class: btn btn-danger, Contract: @1VotingNodeRemove, Page: @1voting_list)\r\n }.Else{\r\n Button(Body: $@1voting$, Class: btn btn-danger disabled)\r\n }\r\n }\r\n }\r\n }.Style(\r\n .text-break label,.text-break td {word-break: break-all;}\r\n )\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(text-danger text-center text-bold){\r\n If(#param_index#>0){}.Else{\r\n Div(){LangRes(@1attention)}\r\n }\r\n If(#tid#>0){\r\n If(#template_id#>0){}.Else{\r\n Div(mb-sm){\r\n LangRes(@1voting_template_not_found)\r\n }\r\n LinkPage(Page: @1voting_templates_list, Class: btn btn-info){\r\n LangRes(@1template_set)\r\n }\r\n }\r\n }.Else{\r\n Div(mb-sm){\r\n LangRes(@1voting_template_id_not_found)\r\n }\r\n DBFind(@1app_params).Where({ecosystem:#ecosystem_id#, name:voting_sysparams_template_id}).Vars(template_param)\r\n LinkPage(Page: @1app_params_edit, Class: btn btn-info, PageParams: \"back_page=@1sysparams_list,id=#template_param_id#\"){\r\n LangRes(@1template_id_set)\r\n }\r\n }\r\n }\r\n }\r\n}", "Menu": "admin_menu", "Type": "pages" }, @@ -467,7 +495,7 @@ { "Name": "tokenrefund_list", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1tokenrefund_list).(this_table, @1tokens_refund)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1tokens_refunds_list$\")\r\nDBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(application)\r\nSetVar(tid,AppParam(App:#application_id#, Name:voting_tokenrefund_template_id, Ecosystem:1))\r\nIf(#tid#>0){\r\n DBFind(@1voting_templates).Where({ecosystem:#ecosystem_id#, id:#tid#}).Columns(\"voters\").Vars(template)\r\n If(#template_voters#>0){\r\n DBFind(@1roles).Where({ecosystem:1, id:#template_voters#}).Columns(\"id,role_name\").Vars(voters)\r\n }\r\n}\r\nIf(And(#template_voters#>0,#template_voters#==#role_id#)){\r\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: $@1tokens_refunds_list_desc$))\r\n AddToolButton(Title: $@1create_request$, Icon: icon-plus, Page: @1tokenrefund_create).Popup(50, $@1create_request$)\r\n}.Else{\r\n If(#voters_id#>0){\r\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: $@1tokens_refunds_list_allowed_role$ #voters_role_name#))\r\n }.Else{\r\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: $@1template_id_not_found$))\r\n }\r\n}\r\n\r\nAddToolButton(Title: $@1create_request$, Icon: icon-plus, Page: @1tokenrefund_create).Popup(50, $@1create_request$)\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, \"{note:{$like:#search#}}\")\r\n}.Else{\r\n SetVar(where, \"{id:{$gt:0}}\").(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1description))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src_refunds_list).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_status){\r\n If(#status#>0){\r\n SetVar(sta,AppParam(Ecosystem:1, App:#application_id#, Name: tokenrefund_status, Index: #status#))\r\n LangRes(#sta#)\r\n }.Else{\r\n $@1tokenrefund_status0$\r\n }\r\n}.Custom(_result){\r\n If(#result#>0){\r\n SetVar(res,AppParam(Ecosystem:1, App:#application_id#, Name: tokenrefund_result, Index: #result#))\r\n LangRes(#res#)\r\n }.Else{\r\n $@1tokenrefund_result0$\r\n }\r\n}.Custom(_blocked){\r\n DateTime(Format: YYYY-MM-DD HH:MI:SS, DateTime: #blocked_at#)\r\n}.Custom(_closed){\r\n DateTime(Format: YYYY-MM-DD HH:MI:SS, DateTime: #closed_at#)\r\n}.Custom(_accounts){\r\n Div(){$@1tokens_refund_victim$: #victim_key_id#}\r\n Div(){$@1tokens_refund_attacker$: #attacker_key_id#}\r\n}.Custom(_amount){\r\n Money(#amount#)\r\n}.Custom(_voting){\r\n LinkPage(Page: @1voting_view, PageParams: \"vID=#voting_id#\", Body: $@1voting$ ##voting_id#)\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src_refunds_list, \"$@1voting$=_voting,$@1accounts$=_accounts,$@1description$=note,$@1validator_id$=validator_id,$@1blocked_at$=_blocked,$@1closed$=_closed,$@1result$=_result,$@1amount$=_amount,$@1status$=_status\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1tokens_refunds$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1tokenrefund_list).(this_table, @1tokens_refund)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1tokens_refunds_list$\")\r\nDBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(application)\r\nSetVar(tid,AppParam(App:#application_id#, Name:voting_tokenrefund_template_id, Ecosystem:1))\r\nIf(#tid#>0){\r\n DBFind(@1voting_templates).Where({ecosystem:#ecosystem_id#, id:#tid#}).Columns(\"voters\").Vars(template)\r\n If(#template_voters#>0){\r\n DBFind(@1roles).Where({ecosystem:1, id:#template_voters#}).Columns(\"id,role_name\").Vars(voters)\r\n }\r\n}\r\nIf(And(#template_voters#>0,#template_voters#==#role_id#)){\r\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: $@1tokens_refunds_list_desc$))\r\n AddToolButton(Title: $@1create_request$, Icon: icon-plus, Page: @1tokenrefund_create).Popup(50, $@1create_request$)\r\n}.Else{\r\n If(#voters_id#>0){\r\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: $@1tokens_refunds_list_allowed_role$ #voters_role_name#))\r\n }.Else{\r\n Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: $@1template_id_not_found$))\r\n }\r\n}\r\n\r\nIf(GetVar(search)){\r\n SetVar(where, \"{note:{$like:#search#}}\")\r\n}.Else{\r\n SetVar(where, \"{id:{$gt:0}}\").(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1description))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src_refunds_list).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_status){\r\n If(#status#>0){\r\n SetVar(sta,AppParam(Ecosystem:1, App:#application_id#, Name: tokenrefund_status, Index: #status#))\r\n LangRes(#sta#)\r\n }.Else{\r\n $@1tokenrefund_status0$\r\n }\r\n}.Custom(_result){\r\n If(#result#>0){\r\n SetVar(res,AppParam(Ecosystem:1, App:#application_id#, Name: tokenrefund_result, Index: #result#))\r\n LangRes(#res#)\r\n }.Else{\r\n $@1tokenrefund_result0$\r\n }\r\n}.Custom(_blocked){\r\n DateTime(Format: YYYY-MM-DD HH:MI:SS, DateTime: #blocked_at#)\r\n}.Custom(_closed){\r\n DateTime(Format: YYYY-MM-DD HH:MI:SS, DateTime: #closed_at#)\r\n}.Custom(_accounts){\r\n Div(){$@1tokens_refund_victim$: #victim_key_id#}\r\n Div(){$@1tokens_refund_attacker$: #attacker_key_id#}\r\n}.Custom(_amount){\r\n Money(#amount#)\r\n}.Custom(_voting){\r\n LinkPage(Page: @1voting_view, PageParams: \"vID=#voting_id#\", Body: $@1voting$ ##voting_id#)\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src_refunds_list, \"$@1voting$=_voting,$@1accounts$=_accounts,$@1description$=note,$@1validator_id$=validator_id,$@1blocked_at$=_blocked,$@1closed$=_closed,$@1result$=_result,$@1amount$=_amount,$@1status$=_status\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1tokens_refunds$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "admin_menu", "Type": "pages" }, @@ -551,7 +579,7 @@ { "Name": "voting_templates_list", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1voting_templates_list).(this_table, @1voting_templates)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1voting_templates$\")\r\nSpan(Class: h5 m0 mb ml-lg){\r\n LinkPage(Class: ml-sm, Body: $@1votings$, Page: @1voting_list)\r\n Span(Class: text-muted mh, Body: /)\r\n Span(Class: text-muted, Body: $@1voting_templates$)\r\n}.Style(\r\n display: inline-block;\r\n)\r\n\r\nIf(GetVar(search)){\r\n SetVar(where,{ecosystem:#ecosystem_id#, \"title\":{\"$like\":#search#}})\r\n}.Else{\r\n SetVar(where,{ecosystem:#ecosystem_id#, \"id\":{\"$gt\":0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1template))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(application)\r\nDBFind(#this_table#).Count(all_templates_count)\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_participants){\r\n AppParam(Ecosystem:1, App:#application_id#, Name:type_voting_participants, Index: #type_participants#)\r\n}.Custom(_decision){\r\n AppParam(Ecosystem:1, App:#application_id#, Name:type_voting_decisions, Index: #type_decision#)\r\n}.Custom(_type){\r\n AppParam(Ecosystem:1, App:#application_id#, Name:type_voting, Index: #type_voting#)\r\n}.Custom(_actions){\r\n Div(text-right){\r\n Button(Class: btn btn-default fa fa-eye, Page: @1voting_template_start, PageParams: \"TemplateId=#id#\")\r\n }\r\n}.Custom(_contracts){\r\n If(And(#init_contract#!=\"\",#init_contract#!=\"NULL\")){\r\n Div(){#init_contract#}\r\n }\r\n If(And(#contract_accept#!=\"\",#contract_accept#!=\"NULL\")){\r\n Div(){#contract_accept#}\r\n }\r\n If(And(#contract_reject#!=\"\",#contract_reject#!=\"NULL\")){\r\n Div(){#contract_reject#}\r\n }\r\n}.Custom(_vq){\r\n #volume#/#quorum#\r\n}.Custom(_vacancies){\r\n If(#vacancies#>0){\r\n #vacancies#\r\n }\r\n}.Count(count)\r\n\r\nIf(Or(#count#>0,#ecosystem_id#>1)){\r\n AddToolButton(Title: $@1create$, Page: @1voting_template_create, Icon: icon-plus).Popup(50, $@1voting_template_create$)\r\n}\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1template$=title,$@1voting_subject$=subject,$@1voting_volume$ / $@1voting_quorum$=_vq,$@1voting_type$=_type,$@1participants$=_participants,$@1decision$=_decision,$@1vacancies$=_vacancies,$@1contracts$=_contracts,=_actions\")\r\n }.ElseIf(#all_templates_count# > 0){\r\n Div(Class: text-center h4 text-muted, Body: \"$@1voting_templates_not_found$\")\r\n }.ElseIf(#ecosystem_id# == 1){\r\n Form(Class: text-center h6){\r\n Data(autofill, \"value,description\"){\r\n yes,$@1use_default_voting_templates$\r\n no,$@1select_default_templates_manually$\r\n }\r\n RadioGroup(Name: fill_ids, Source: autofill, NameColumn: description, ValueColumn: value)\r\n Button(Body: $@1install_default_templates$, Class: btn btn-primary, Page: @1voting_templates_list, Contract: @1VotingTemplatesInstall)\r\n }\r\n }\r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1voting_templates_list).(this_table, @1voting_templates)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1voting_templates$\")\r\nSpan(Class: h5 m0 mb ml-lg){\r\n LinkPage(Class: ml-sm, Body: $@1votings$, Page: @1voting_list)\r\n Span(Class: text-muted mh, Body: /)\r\n Span(Class: text-muted, Body: $@1voting_templates$)\r\n}.Style(\r\n display: inline-block;\r\n)\r\n\r\nIf(GetVar(search)){\r\n SetVar(where,{ecosystem:#ecosystem_id#, \"title\":{\"$like\":#search#}})\r\n}.Else{\r\n SetVar(where,{ecosystem:#ecosystem_id#, \"id\":{\"$gt\":0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1template))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(@1applications).Where({ecosystem:1, name:\"Basic\"}).Columns(\"name,id\").Vars(application)\r\nDBFind(#this_table#).Where({ecosystem:#ecosystem_id#}).Count(all_templates_count)\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_participants){\r\n AppParam(Ecosystem:1, App:#application_id#, Name:type_voting_participants, Index: #type_participants#)\r\n}.Custom(_decision){\r\n AppParam(Ecosystem:1, App:#application_id#, Name:type_voting_decisions, Index: #type_decision#)\r\n}.Custom(_type){\r\n AppParam(Ecosystem:1, App:#application_id#, Name:type_voting, Index: #type_voting#)\r\n}.Custom(_actions){\r\n Div(text-right){\r\n Button(Class: btn btn-default fa fa-eye, Page: @1voting_template_start, PageParams: \"TemplateId=#id#\")\r\n }\r\n}.Custom(_contracts){\r\n If(And(#init_contract#!=\"\",#init_contract#!=\"NULL\")){\r\n Div(){#init_contract#}\r\n }\r\n If(And(#contract_accept#!=\"\",#contract_accept#!=\"NULL\")){\r\n Div(){#contract_accept#}\r\n }\r\n If(And(#contract_reject#!=\"\",#contract_reject#!=\"NULL\")){\r\n Div(){#contract_reject#}\r\n }\r\n}.Custom(_vq){\r\n #volume#/#quorum#\r\n}.Custom(_vacancies){\r\n If(#vacancies#>0){\r\n #vacancies#\r\n }\r\n}.Count(count)\r\n\r\nIf(Or(#count#>0,#ecosystem_id#>1)){\r\n AddToolButton(Title: $@1create$, Page: @1voting_template_create, Icon: icon-plus).Popup(50, $@1voting_template_create$)\r\n}\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1template$=title,$@1voting_subject$=subject,$@1voting_volume$ / $@1voting_quorum$=_vq,$@1voting_type$=_type,$@1participants$=_participants,$@1decision$=_decision,$@1vacancies$=_vacancies,$@1contracts$=_contracts,=_actions\")\r\n }.ElseIf(#all_templates_count# > 0){\r\n Div(Class: text-center h4 text-muted, Body: \"$@1voting_templates_not_found$\")\r\n }.ElseIf(#ecosystem_id# == 1){\r\n Form(Class: text-center h6){\r\n Data(autofill, \"value,description\"){\r\n yes,$@1use_default_voting_templates$\r\n no,$@1select_default_templates_manually$\r\n }\r\n RadioGroup(Name: fill_ids, Source: autofill, NameColumn: description, ValueColumn: value).Style(line-height: 20px;)\r\n Button(Body: $@1install_default_templates$, Class: btn btn-primary, Page: @1voting_templates_list, Contract: @1VotingTemplatesInstall)\r\n }\r\n }\r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -592,6 +620,12 @@ "Value": "contract RolesAssign {\r\n data {\r\n rid int\r\n member_id int\r\n }\r\n\r\n func getMemberInfo(kid int) map {\r\n var res member map\r\n member = DBFind(\"@1members\").Where({ecosystem:$ecosystem_id, id:kid}).Row()\r\n if member {\r\n res[\"member_id\"] = member[\"id\"]\r\n res[\"member_name\"] = member[\"member_name\"]\r\n res[\"image_id\"] = member[\"image_id\"]\r\n }else{\r\n member = DBFind(\"@1keys\").Where({ecosystem:$ecosystem_id, id:kid}).Row()\r\n if member {\r\n res[\"member_id\"] = member[\"id\"]\r\n res[\"member_name\"] = IdToAddress(Int(member[\"id\"]))\r\n res[\"image_id\"] = 0\r\n }\r\n }\r\n return res\r\n }\r\n\r\n conditions {\r\n $role = DBFind(\"@1roles\").Where({id:$rid}).Columns(\"id,deleted,role_type,role_name,image_id,creator->member_id\").Row()\r\n if (Int($role[\"role_type\"]) == 2){\r\n warning LangRes(\"@1elective_role_voting_only\", \"en\")\r\n }\r\n if !$role {\r\n warning LangRes(\"@1role_not_found\", \"en\")\r\n }\r\n\r\n if !DBFind(\"@1keys\").Where({ecosystem:$ecosystem_id, id:$member_id}).Row() {\r\n warning LangRes(\"@1key_not_found\", \"en\")\r\n }\r\n\r\n if $role[\"deleted\"] == 1 {\r\n warning LangRes(\"@1role_deleted_request_impossible\", \"en\")\r\n }\r\n\r\n var specRules map prev_contract string\r\n prev_contract = $stack[0]\r\n if Len($stack) > 2{\r\n prev_contract = $stack[Len($stack) - 2]\r\n }\r\n specRules[\"@1VotingValidatorAccept\"] = 1\r\n specRules[\"@1DelegateRefresh\"] = 1\r\n specRules[\"@1CandidateValidatorRequest\"] = 1\r\n specRules[\"@1VotingTemplateRun\"] = 1\r\n specRules[\"@1VotingTokensRefundCreate\"] = 1\r\n specRules[\"@1VotingValidatorCreate\"] = 1\r\n specRules[\"@1VotingParamCreate\"] = 1\r\n if specRules[prev_contract] != 1 {\r\n @1RolesAccessCheck(\"rid\", $rid)\r\n }\r\n }\r\n\r\n action {\r\n if DBFind(\"@1roles_participants\").Where({ecosystem:$ecosystem_id, \"role->id\":$rid, \"member->member_id\":$member_id, deleted:0}).One(\"id\") {\r\n // do not re-assign and do not warning because this contract may be called for other\r\n return\r\n }\r\n var role member appointer map\r\n role[\"id\"] = $role[\"id\"]\r\n role[\"type\"] = $role[\"role_type\"]\r\n role[\"name\"] = $role[\"role_name\"]\r\n role[\"image_id\"] = $role[\"image_id\"]\r\n\r\n member = getMemberInfo($member_id)\r\n appointer = getMemberInfo($key_id)\r\n var m map\r\n m[\"role\"] = role\r\n m[\"member\"] = member\r\n m[\"appointed\"] = appointer\r\n m[\"date_created\"] = BlockTime()\r\n m[\"ecosystem\"] = $ecosystem_id\r\n DBInsert(\"@1roles_participants\", m)\r\n }\r\n}", "Type": "contracts" }, + { + "Name": "DeleteMember", + "Conditions": "ContractConditions(\"MainCondition\")", + "Value": "contract DeleteMember {\r\n data {\r\n KeyId int\r\n }\r\n func getPermission() {\r\n var array_permissions array result i int prevContract string\r\n array_permissions = [\"@1DeleteMember\"]\r\n\r\n prevContract = $stack[0]\r\n if Len($stack) > 2 {\r\n prevContract = $stack[Len($stack) - 2]\r\n }\r\n while i < Len(array_permissions) {\r\n var contract_name string\r\n contract_name = array_permissions[i]\r\n if contract_name==prevContract {\r\n result = 1\r\n }\r\n i = i + 1\r\n }\r\n\r\n if result == 0 {\r\n error LangRes(\"@1contract_chain_distorted\", \"en\")\r\n }\r\n }\r\n\r\n conditions {\r\n ContractConditions(\"@1AdminCondition\")\r\n\r\n getPermission()\r\n \r\n if !DBFind(\"@1keys\").Where({ecosystem:1, id:$KeyId}).One(\"id\"){\r\n error LangRes(\"@1key_not_found\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n DBUpdate(\"@1keys\", $KeyId, {\"deleted\": 1})\r\n }\r\n}", + "Type": "contracts" + }, { "Name": "CandidateValidatorRequest", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", @@ -613,7 +647,7 @@ { "Name": "NotificationsSend", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract NotificationsSend {\r\n data {\r\n member_id int \"optional\"\r\n rid int \"optional\"\r\n closure_type int \"optional\"\r\n\r\n sender int\r\n icon_name string \"optional\"\r\n text_header string\r\n text_body string \"optional\"\r\n page_name string\r\n params_map string // json encoded expected\r\n current_role_id string \"optional\"\r\n eco_id string \"optional\"\r\n }\r\n\r\n func getMemberInfo(kid, ecoId int) map {\r\n var res member map\r\n member = DBFind(\"@1members\").Where({ecosystem:ecoId, id:kid}).Row()\r\n if member {\r\n res[\"member_id\"] = member[\"id\"]\r\n res[\"member_name\"] = member[\"member_name\"]\r\n res[\"image_id\"] = member[\"image_id\"]\r\n }else{\r\n if DBFind(\"@1keys\").Where({ecosystem:ecoId, id:kid}).Columns(\"id\").Row() {\r\n res[\"member_id\"] = Str(kid)\r\n res[\"member_name\"] = IdToAddress(kid)\r\n res[\"image_id\"] = \"0\"\r\n }\r\n }\r\n return res\r\n }\r\n\r\n func sendNotify(recipient map) {\r\n var notification map\r\n notification[\"header\"] = $text_header\r\n notification[\"type\"] = $notify_type\r\n notification[\"icon\"] = $icon_name\r\n notification[\"body\"] = $text_body\r\n var sender map\r\n if $sender == 1 && $senderMember {\r\n // send from member\r\n sender[\"type\"] = $sender\r\n sender[\"member_id\"] = $senderMember[\"member_id\"]\r\n sender[\"member_name\"] = $senderMember[\"member_name\"]\r\n sender[\"image_id\"] = $senderMember[\"image_id\"]\r\n }else{\r\n if $sender == 2 && $senderRole{\r\n // send from role\r\n sender[\"type\"] = $sender\r\n sender[\"role_id\"] = $senderRole[\"id\"]\r\n sender[\"role_name\"] = $senderRole[\"role_name\"]\r\n sender[\"image_id\"] = $senderRole[\"image_id\"]\r\n }\r\n }\r\n var model map\r\n model[\"recipient\"] = recipient\r\n model[\"sender\"] = sender\r\n model[\"notification\"] = notification\r\n model[\"page_name\"] = $page_name\r\n model[\"page_params\"] = $params_map\r\n model[\"date_created\"] = BlockTime()\r\n model[\"ecosystem\"] = $eco_id\r\n DBInsert(\"@1notifications\", model)\r\n }\r\n\r\n func sendToRole(roleId, ecoId int) {\r\n var role recipient map\r\n role = DBFind(\"@1roles\").Where({ecosystem:ecoId, id:roleId}).Row()\r\n recipient[\"role_id\"] = role[\"id\"]\r\n recipient[\"role_name\"] = role[\"role_name\"]\r\n recipient[\"image_id\"] = role[\"image_id\"]\r\n sendNotify(recipient)\r\n }\r\n\r\n conditions {\r\n $member_id = Int($member_id)\r\n $rid = Int($rid)\r\n $current_role_id = Int($current_role_id)\r\n $eco_id = Int($eco_id)\r\n if $eco_id == 0{\r\n $eco_id = $ecosystem_id\r\n }\r\n if Size($icon_name) < 1{\r\n $icon_name = \"icon-envelope\"\r\n }\r\n if $member_id != 0 {\r\n if !DBFind(\"@1keys\").Where({ecosystem:$eco_id, id:$member_id}).Row(){\r\n warning LangRes(\"@1key_not_found\", \"en\")\r\n }\r\n $notify_type = 1 // is \"member\"\r\n }elif $rid > 0{\r\n $notify_type = 2 // is \"role\"\r\n if !DBFind(\"@1roles\").Where({ecosystem:$eco_id, id:$rid}).One(\"id\") {\r\n warning $this_contract + \": \" + LangRes(\"@1recipient_role_not_found\", \"en\")\r\n }\r\n if !DBFind(\"@1roles_participants\").Where({ecosystem:$eco_id, \"role->id\":$rid, deleted:0}).One(\"id\") {\r\n warning $this_contract + \": \" + LangRes(\"@1recipient_role_no_members\", \"en\")\r\n }\r\n } else{\r\n warning $this_contract + \": \" + LangRes(\"@1notification_type_not_defined\", \"en\")\r\n }\r\n $senderMember = nil\r\n $senderRole = nil\r\n if $sender == 1 {\r\n $senderMember = getMemberInfo($key_id, $ecosystem_id)\r\n }elif $sender == 2 {\r\n $senderRole = DBFind(\"@1roles\").Where({ecosystem:$ecosystem_id, id:$current_role_id}).Row()\r\n if !$senderRole {\r\n warning $this_contract + \": \" + LangRes(\"@1sender_role_not_found\", \"en\")\r\n }\r\n }else{\r\n warning $this_contract + \": \" + LangRes(\"@1sender_invalid\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n if $member_id != 0 {\r\n sendNotify(getMemberInfo($member_id, $eco_id))\r\n UpdateNotifications($eco_id, Int($member_id))\r\n }elif $rid > 0 {\r\n if $closure_type == 1 {\r\n // Single closure: one begins the process - the others do not see\r\n sendToRole($rid, $eco_id)\r\n UpdateRolesNotifications($eco_id, Int($rid))\r\n } else {\r\n // Multiple closure: to each his own notification\r\n $notify_type = 1\r\n var participants array\r\n participants = DBFind(\"@1roles_participants\").Where({ecosystem:$eco_id, \"role->id\":$rid, deleted:0}).Columns(\"member->member_id\")\r\n var i int\r\n while i < Len(participants) {\r\n var p map\r\n p = participants[i]\r\n sendNotify(getMemberInfo(Int(p[\"member.member_id\"]), $eco_id))\r\n UpdateNotifications($eco_id, Int(p[\"member.member_id\"]))\r\n i = i + 1\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "contract NotificationsSend {\r\n data {\r\n member_id int \"optional\"\r\n rid int \"optional\"\r\n closure_type int \"optional\"\r\n\r\n sender int\r\n icon_name string \"optional\"\r\n text_header string\r\n text_body string \"optional\"\r\n page_name string\r\n params_map string // json encoded expected\r\n current_role_id string \"optional\"\r\n eco_id string \"optional\"\r\n popup string \"optional\"\r\n }\r\n\r\n func getMemberInfo(kid, ecoId int) map {\r\n var res member map\r\n member = DBFind(\"@1members\").Where({ecosystem:ecoId, id:kid}).Row()\r\n if member {\r\n res[\"member_id\"] = member[\"id\"]\r\n res[\"member_name\"] = member[\"member_name\"]\r\n res[\"image_id\"] = member[\"image_id\"]\r\n }else{\r\n if DBFind(\"@1keys\").Where({ecosystem:ecoId, id:kid}).Columns(\"id\").Row() {\r\n res[\"member_id\"] = Str(kid)\r\n res[\"member_name\"] = IdToAddress(kid)\r\n res[\"image_id\"] = \"0\"\r\n }\r\n }\r\n return res\r\n }\r\n\r\n func sendNotify(recipient map) {\r\n var notification map\r\n notification[\"header\"] = $text_header\r\n notification[\"type\"] = $notify_type\r\n notification[\"icon\"] = $icon_name\r\n notification[\"body\"] = $text_body\r\n if $popup == \"true\" || $popup == \"1\" {\r\n notification[\"popup\"] = 1\r\n }else{\r\n notification[\"popup\"] = 0\r\n }\r\n var sender map\r\n if $sender == 1 && $senderMember {\r\n // send from member\r\n sender[\"type\"] = $sender\r\n sender[\"member_id\"] = $senderMember[\"member_id\"]\r\n sender[\"member_name\"] = $senderMember[\"member_name\"]\r\n sender[\"image_id\"] = $senderMember[\"image_id\"]\r\n }else{\r\n if $sender == 2 && $senderRole{\r\n // send from role\r\n sender[\"type\"] = $sender\r\n sender[\"role_id\"] = $senderRole[\"id\"]\r\n sender[\"role_name\"] = $senderRole[\"role_name\"]\r\n sender[\"image_id\"] = $senderRole[\"image_id\"]\r\n }\r\n }\r\n var model map\r\n model[\"recipient\"] = recipient\r\n model[\"sender\"] = sender\r\n model[\"notification\"] = notification\r\n model[\"page_name\"] = $page_name\r\n model[\"page_params\"] = $params_map\r\n model[\"date_created\"] = BlockTime()\r\n model[\"ecosystem\"] = $eco_id\r\n DBInsert(\"@1notifications\", model)\r\n }\r\n\r\n func sendToRole(roleId, ecoId int) {\r\n var role recipient map\r\n role = DBFind(\"@1roles\").Where({ecosystem:ecoId, id:roleId}).Row()\r\n recipient[\"role_id\"] = role[\"id\"]\r\n recipient[\"role_name\"] = role[\"role_name\"]\r\n recipient[\"image_id\"] = role[\"image_id\"]\r\n sendNotify(recipient)\r\n }\r\n\r\n conditions {\r\n $member_id = Int($member_id)\r\n $rid = Int($rid)\r\n $current_role_id = Int($current_role_id)\r\n $eco_id = Int($eco_id)\r\n if $eco_id == 0{\r\n $eco_id = $ecosystem_id\r\n }\r\n if Size($icon_name) < 1{\r\n $icon_name = \"icon-envelope\"\r\n }\r\n if $member_id != 0 {\r\n if !DBFind(\"@1keys\").Where({ecosystem:$eco_id, id:$member_id}).Row(){\r\n warning LangRes(\"@1key_not_found\", \"en\")\r\n }\r\n $notify_type = 1 // is \"member\"\r\n }elif $rid > 0{\r\n $notify_type = 2 // is \"role\"\r\n if !DBFind(\"@1roles\").Where({ecosystem:$eco_id, id:$rid}).One(\"id\") {\r\n warning $this_contract + \": \" + LangRes(\"@1recipient_role_not_found\", \"en\")\r\n }\r\n if !DBFind(\"@1roles_participants\").Where({ecosystem:$eco_id, \"role->id\":$rid, deleted:0}).One(\"id\") {\r\n warning $this_contract + \": \" + LangRes(\"@1recipient_role_no_members\", \"en\")\r\n }\r\n } else{\r\n warning $this_contract + \": \" + LangRes(\"@1notification_type_not_defined\", \"en\")\r\n }\r\n $senderMember = nil\r\n $senderRole = nil\r\n if $sender == 1 {\r\n $senderMember = getMemberInfo($key_id, $ecosystem_id)\r\n }elif $sender == 2 {\r\n $senderRole = DBFind(\"@1roles\").Where({ecosystem:$ecosystem_id, id:$current_role_id}).Row()\r\n if !$senderRole {\r\n warning $this_contract + \": \" + LangRes(\"@1sender_role_not_found\", \"en\")\r\n }\r\n }else{\r\n warning $this_contract + \": \" + LangRes(\"@1sender_invalid\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n if $member_id != 0 {\r\n sendNotify(getMemberInfo($member_id, $eco_id))\r\n UpdateNotifications($eco_id, Int($member_id))\r\n }elif $rid > 0 {\r\n if $closure_type == 1 {\r\n // Single closure: one begins the process - the others do not see\r\n sendToRole($rid, $eco_id)\r\n UpdateRolesNotifications($eco_id, Int($rid))\r\n } else {\r\n // Multiple closure: to each his own notification\r\n $notify_type = 1\r\n var participants array\r\n participants = DBFind(\"@1roles_participants\").Where({ecosystem:$eco_id, \"role->id\":$rid, deleted:0}).Columns(\"member->member_id\")\r\n var i int\r\n while i < Len(participants) {\r\n var p map\r\n p = participants[i]\r\n sendNotify(getMemberInfo(Int(p[\"member.member_id\"]), $eco_id))\r\n UpdateNotifications($eco_id, Int(p[\"member.member_id\"]))\r\n i = i + 1\r\n }\r\n }\r\n }\r\n }\r\n}", "Type": "contracts" }, { @@ -625,13 +659,13 @@ { "Name": "NodeRemoveByKey", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract NodeRemoveByKey {\r\n data {}\r\n \r\n func nodesRemove(keyId int) array {\r\n var nodesJSON string nodes res array\r\n nodesJSON = SysParamString(\"full_nodes\")\r\n if !HasPrefix(nodesJSON, \"[\") {\r\n // empty string nodes\r\n return res\r\n }\r\n nodes = JSONDecode(nodesJSON)\r\n var i int\r\n while i < Len(nodes){\r\n var node map\r\n node = nodes[i]\r\n if node[\"key_id\"] != keyId {\r\n res = Append(res, node)\r\n }\r\n i = i + 1\r\n }\r\n return res\r\n }\r\n \r\n conditions {\r\n if $original_contract != \"ValidatorResign\"{\r\n warning LangRes(\"@1contract_unknown\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n var nodes array fullNodes string\r\n nodes = nodesRemove($key_id)\r\n fullNodes = JSONEncode(nodes)\r\n DBUpdateSysParam(\"full_nodes\", fullNodes, \"\")\r\n }\r\n}", + "Value": "contract NodeRemoveByKey {\r\n data {}\r\n \r\n func nodesRemove(keyId int) array {\r\n var nodesJSON string nodes res array\r\n nodesJSON = SysParamString(\"full_nodes\")\r\n if !HasPrefix(nodesJSON, \"[\") {\r\n // empty string nodes\r\n return res\r\n }\r\n nodes = JSONDecode(nodesJSON)\r\n var i int\r\n while i < Len(nodes){\r\n var node map\r\n node = nodes[i]\r\n if node[\"key_id\"] != keyId {\r\n res = Append(res, node)\r\n }\r\n i = i + 1\r\n }\r\n return res\r\n }\r\n \r\n conditions {\r\n if $original_contract != \"ValidatorResign\"{\r\n warning LangRes(\"@1contract_chain_distorted\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n var nodes array fullNodes string\r\n nodes = nodesRemove($key_id)\r\n fullNodes = JSONEncode(nodes)\r\n DBUpdateSysParam(\"full_nodes\", fullNodes, \"\")\r\n }\r\n}", "Type": "contracts" }, { "Name": "NotificationsBroadcast", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract NotificationsBroadcast {\r\n data {\r\n RoleId int\r\n Header string\r\n Body string\r\n }\r\n \r\n func getMemberInfo(kid int) map {\r\n var res member map\r\n member = DBFind(\"@1members\").Where({ecosystem:$ecosystem_id, id:kid}).Row()\r\n if member {\r\n res[\"member_id\"] = member[\"id\"]\r\n res[\"member_name\"] = member[\"member_name\"]\r\n res[\"image_id\"] = member[\"image_id\"]\r\n }else{\r\n if DBFind(\"@1keys\").Columns(\"id\").Where({ecosystem:$ecosystem_id, id:kid}).Row() {\r\n res[\"member_id\"] = Str(kid)\r\n res[\"member_name\"] = IdToAddress(kid)\r\n res[\"image_id\"] = \"0\"\r\n }\r\n }\r\n return res\r\n }\r\n \r\n conditions {\r\n if $RoleId !=1 {\r\n error LangRes(\"@1admin_only_action\", \"en\")\r\n }\r\n if $ecosystem_id != 1 {\r\n error LangRes(\"@1first_ecosystem_admin_only_action\", \"en\")\r\n }\r\n $ecos = DBFind(\"@1ecosystems\").Columns(\"id\")\r\n $lenEcos = Len($ecos)\r\n if $lenEcos == 1{\r\n error LangRes(\"@1other_ecosystems_not_found\", \"en\")\r\n }\r\n }\r\n \r\n action {\r\n var i lenIds int eco map ids array bt string sender recipient params note map\r\n bt = BlockTime()\r\n sender = getMemberInfo($key_id)\r\n sender[\"type\"] = \"1\"\r\n note[\"header\"] = $Header\r\n note[\"type\"] = \"1\"\r\n note[\"icon\"] = \"icon-envelope\"\r\n note[\"body\"] = $Body\r\n\r\n while i < $lenEcos{\r\n eco = $ecos[i]\r\n var ecoId int\r\n ecoId = Int(eco[\"id\"])\r\n if ecoId != 1 {\r\n var adminRoleId int\r\n adminRoleId = Int(DBFind(\"@1parameters\").Where({ecosystem:ecoId, name:\"role_admin\"}).One(\"value\"))\r\n ids = DBFind(\"@1roles_participants\").Where({ecosystem:ecoId, \"role->id\":adminRoleId, \"role->type\":3}).Columns(\"member->member_id\")\r\n lenIds = Len(ids)\r\n var i_ids int\r\n while i_ids < lenIds{\r\n recipient = ids[i_ids]\r\n recipient = getMemberInfo(Int(recipient[\"member.member_id\"]))\r\n var m map\r\n m[\"recipient\"] = recipient\r\n m[\"sender\"] = sender\r\n m[\"notification\"] = note\r\n m[\"page_name\"] = \"@1notifications_show\"\r\n m[\"page_params\"] = params\r\n m[\"date_created\"] = bt\r\n m[\"ecosystem\"] = ecoId\r\n DBInsert(\"@1notifications\", m)\r\n i_ids = i_ids + 1\r\n }\r\n }\r\n i = i + 1\r\n }\r\n }\r\n}", + "Value": "contract NotificationsBroadcast {\r\n data {\r\n RoleId int\r\n Header string\r\n Body string\r\n Popup string \"optional\"\r\n }\r\n \r\n func getMemberInfo(kid int) map {\r\n var res member map\r\n member = DBFind(\"@1members\").Where({ecosystem:$ecosystem_id, id:kid}).Row()\r\n if member {\r\n res[\"member_id\"] = member[\"id\"]\r\n res[\"member_name\"] = member[\"member_name\"]\r\n res[\"image_id\"] = member[\"image_id\"]\r\n }else{\r\n if DBFind(\"@1keys\").Columns(\"id\").Where({ecosystem:$ecosystem_id, id:kid}).Row() {\r\n res[\"member_id\"] = Str(kid)\r\n res[\"member_name\"] = IdToAddress(kid)\r\n res[\"image_id\"] = \"0\"\r\n }\r\n }\r\n return res\r\n }\r\n \r\n conditions {\r\n if $RoleId !=1 {\r\n error LangRes(\"@1admin_only_action\", \"en\")\r\n }\r\n if $ecosystem_id != 1 {\r\n error LangRes(\"@1first_ecosystem_admin_only_action\", \"en\")\r\n }\r\n $ecos = DBFind(\"@1ecosystems\").Columns(\"id\")\r\n $lenEcos = Len($ecos)\r\n if $lenEcos == 1 {\r\n error LangRes(\"@1other_ecosystems_not_found\", \"en\")\r\n }\r\n }\r\n \r\n action {\r\n var i lenIds int eco map ids array bt string sender recipient params note map\r\n bt = BlockTime()\r\n sender = getMemberInfo($key_id)\r\n sender[\"type\"] = 1\r\n note[\"header\"] = $Header\r\n note[\"type\"] = 1\r\n note[\"icon\"] = \"icon-envelope\"\r\n note[\"body\"] = $Body\r\n if $Popup == \"true\" || $Popup == \"1\" {\r\n note[\"popup\"] = 1\r\n }else{\r\n note[\"popup\"] = 0\r\n }\r\n \r\n while i < $lenEcos{\r\n eco = $ecos[i]\r\n var ecoId int\r\n ecoId = Int(eco[\"id\"])\r\n if ecoId != 1 {\r\n var adminRoleId int\r\n adminRoleId = Int(DBFind(\"@1parameters\").Where({ecosystem:ecoId, name:\"role_admin\"}).One(\"value\"))\r\n ids = DBFind(\"@1roles_participants\").Where({ecosystem:ecoId, \"role->id\":adminRoleId, \"role->type\":3}).Columns(\"member->member_id\")\r\n lenIds = Len(ids)\r\n var i_ids int\r\n while i_ids < lenIds{\r\n recipient = ids[i_ids]\r\n recipient = getMemberInfo(Int(recipient[\"member.member_id\"]))\r\n var m map\r\n m[\"recipient\"] = recipient\r\n m[\"sender\"] = sender\r\n m[\"notification\"] = note\r\n m[\"page_name\"] = \"@1notifications_show\"\r\n m[\"page_params\"] = params\r\n m[\"date_created\"] = bt\r\n m[\"ecosystem\"] = ecoId\r\n DBInsert(\"@1notifications\", m)\r\n i_ids = i_ids + 1\r\n }\r\n }\r\n i = i + 1\r\n }\r\n }\r\n}", "Type": "contracts" }, { @@ -649,7 +683,7 @@ { "Name": "MembershipRequest", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract MembershipRequest {\r\n data {\r\n ecosystem_num int\r\n }\r\n\r\n conditions {\r\n if $ecosystem_id != 1{\r\n warning LangRes(\"@1contract_first_ecosystem_only\", \"en\")\r\n }\r\n \r\n if DBFind(\"@1notifications\").Where({ecosystem:$ecosystem_num, \"page_params->ecosystem_id\":$ecosystem_num, \"sender->member_id\":$key_id, closed:0, page_name:\"@1membership_admin_view\"}).Row(){\r\n warning LangRes(\"@1request_sent_already\", \"en\")\r\n }\r\n\r\n if !DBFind(\"@1ecosystems\").Where({id:$ecosystem_num}).One(\"id\"){\r\n error Sprintf(LangRes(\"@1template_eco_not_exist\", \"en\"), $ecosystem_num)\r\n }\r\n\r\n $admin_id = Int(DBFind(\"@1parameters\").Where({ecosystem:$ecosystem_num,name:\"role_admin\"}).One(\"value\"))\r\n if $admin_id == 0 { \r\n LangRes(\"@1recipient_role_not_found\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n var notific_params map\r\n notific_params[\"ecosystem_id\"] = $ecosystem_num\r\n notific_params[\"ecosystem_sender\"] = $ecosystem_id\r\n\r\n @1NotificationsSend(\"rid,sender,icon_name,text_header,text_body,page_name,params_map,closure_type,eco_id\", $admin_id, 1, \"icon icon-user-follow\", LangRes(\"@1membership_request_new\", \"en\"), LangRes(\"@1details_view\", \"en\"), \"@1membership_admin_view\", notific_params,1,$ecosystem_num)\r\n }\r\n}", + "Value": "contract MembershipRequest {\r\n data {\r\n ecosystem_num int\r\n }\r\n\r\n conditions {\r\n if $ecosystem_id != 1 {\r\n warning LangRes(\"@1contract_first_ecosystem_only\", \"en\")\r\n }\r\n\r\n if $ecosystem_num == 1 {\r\n warning LangRes(\"@1impossible_for_platform_ecosystem\", \"en\")\r\n }\r\n\r\n if !DBFind(\"@1ecosystems\").Where({id:$ecosystem_num}).One(\"id\"){\r\n error Sprintf(LangRes(\"@1template_eco_not_exist\", \"en\"), $ecosystem_num)\r\n }\r\n\r\n if DBFind(\"@1keys\").Where({id:$key_id, ecosystem:$ecosystem_num}) {\r\n warning LangRes(\"@1member_added_before\", \"en\")\r\n }\r\n\r\n $free_membership = Int(DBFind(\"@1parameters\").Where({ecosystem:$ecosystem_num, name:\"free_membership\"}).One(\"value\"))\r\n if $free_membership == 0 {\r\n if DBFind(\"@1notifications\").Where({ecosystem:$ecosystem_num, \"page_params->ecosystem_id\":$ecosystem_num, \"sender->member_id\":$key_id, closed:0, page_name:\"@1membership_admin_view\"}).Row(){\r\n warning LangRes(\"@1request_sent_already\", \"en\")\r\n }\r\n\r\n $admin_id = Int(DBFind(\"@1parameters\").Where({ecosystem:$ecosystem_num, name:\"role_admin\"}).One(\"value\"))\r\n if $admin_id == 0 { \r\n warning LangRes(\"@1recipient_role_not_found\", \"en\")\r\n }\r\n }\r\n }\r\n\r\n action {\r\n if $free_membership == 0 {\r\n var notific_params map\r\n notific_params[\"ecosystem_id\"] = $ecosystem_num\r\n notific_params[\"ecosystem_sender\"] = $ecosystem_id\r\n\r\n @1NotificationsSend(\"rid,sender,icon_name,text_header,text_body,page_name,params_map,closure_type,eco_id\", $admin_id, 1, \"icon icon-user-follow\", LangRes(\"@1membership_request_new\", \"en\"), LangRes(\"@1details_view\", \"en\"), \"@1membership_admin_view\", notific_params,1,$ecosystem_num)\r\n }\r\n if $free_membership == 1 {\r\n var pub string\r\n pub = DBFind(\"@1keys\").Where({ecosystem:1, id:$key_id}).One(\"pub\") \r\n DBInsert(\"@1keys\", {id:$key_id, pub:pub, ecosystem:$ecosystem_num})\r\n\r\n var params map\r\n params[\"ecosystem_id\"] = $ecosystem_num\r\n params[\"status\"] = 1\r\n\r\n var icon header body page ecoName string\r\n ecoName = DBFind(\"@1ecosystems\").Where({id:$ecosystem_num}).One(\"name\")\r\n icon = \"icon icon-user-follow\"\r\n header = LangRes(\"@1request_approved\", \"en\")\r\n body = Sprintf(LangRes(\"@1ecosystem_request_approved\", \"en\"), ecoName, $ecosystem_num)\r\n page = \"@1membership_user_view\"\r\n\r\n @1NotificationsSend(\"member_id,sender,icon_name,text_header,text_body,page_name,params_map,eco_id\", $key_id, 1, icon, header, body, page, params, $ecosystem_id)\r\n }\r\n }\r\n}", "Type": "contracts" }, { @@ -739,7 +773,7 @@ { "Name": "TokensTransfer", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract TokensTransfer {\r\n data {\r\n Amount money\r\n SenderId int\r\n RecipientId int\r\n Comment string \"optional\"\r\n }\r\n\r\n func getPermission() {\r\n var array_permissions array result i int prevContract string\r\n array_permissions = [\"@1TokensSend\", \"@1PoaTokensSend\", \"@1TokensRefund\"]\r\n\r\n prevContract = $stack[0]\r\n if Len($stack) > 2 {\r\n prevContract = $stack[Len($stack) - 2]\r\n }\r\n while i < Len(array_permissions) {\r\n var contract_name string\r\n contract_name = array_permissions[i]\r\n if contract_name==prevContract {\r\n result = 1\r\n }\r\n i = i + 1\r\n }\r\n\r\n if result == 0 {\r\n error LangRes(\"@1tokens_transfer_cannot_be_made\", \"en\")\r\n }\r\n }\r\n\r\n func checkSender() {\r\n var sender_map map\r\n sender_map = DBFind(\"@1keys\").Where({ecosystem:$ecosystem_id, id:$SenderId}).Row()\r\n\r\n if !sender_map {\r\n error Sprintf(LangRes(\"@1sender_x_invalid\", \"en\"), $SenderId)\r\n }\r\n if Int(sender_map[\"blocked\"]) != 0 {\r\n error LangRes(\"@1sender_blocked\", \"en\")\r\n }\r\n if Int(sender_map[\"deleted\"]) != 0 {\r\n error LangRes(\"@1sender_deleted\", \"en\")\r\n }\r\n if Money(sender_map[\"amount\"]) < $Amount {\r\n error LangRes(\"@1amount_less_than_needed\", \"en\")\r\n }\r\n }\r\n\r\n func checkRecipient() {\r\n var recipient_map map\r\n recipient_map = DBFind(\"@1keys\").Where({ecosystem:$ecosystem_id, id:$RecipientId}).Row()\r\n\r\n if !recipient_map {\r\n error Sprintf(LangRes(\"@1recipient_x_invalid\", \"en\"), $RecipientId)\r\n }\r\n if Int(recipient_map[\"blocked\"]) != 0 {\r\n error LangRes(\"@1recipient_blocked\", \"en\")\r\n }\r\n if Int(recipient_map[\"deleted\"]) != 0 {\r\n error LangRes(\"@1recipient_deleted\", \"en\")\r\n }\r\n }\r\n\r\n conditions {\r\n getPermission() //getting permission to run\r\n checkSender() //check the sender\r\n checkRecipient() //check the recipient\r\n \r\n //check amount\r\n if $Amount == 0 {\r\n error LangRes(\"@1amount_zero\", \"en\")\r\n }\r\n if $Amount < 0 {\r\n error LangRes(\"@1amount_less_zero\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n DBUpdate(\"@1keys\", $SenderId, {\"-amount\": $Amount})\r\n DBUpdate(\"@1keys\", $RecipientId, {\"+amount\": $Amount})\r\n var m map\r\n m[\"sender_id\"] = $SenderId\r\n m[\"recipient_id\"] = $RecipientId\r\n m[\"amount\"] = $Amount\r\n m[\"comment\"] = $Comment\r\n m[\"block_id\"] = $block\r\n m[\"txhash\"] = $txhash\r\n m[\"ecosystem\"] = $ecosystem_id\r\n m[\"type\"] = 3\r\n DBInsert(\"@1history\", m)\r\n }\r\n}", + "Value": "contract TokensTransfer {\r\n data {\r\n Amount money\r\n SenderId int\r\n RecipientId int\r\n Comment string \"optional\"\r\n Ecosystem int \"optional\"\r\n }\r\n\r\n func getEcosystem() {\r\n $e_id = Int($Ecosystem)\r\n if $e_id == 0 {\r\n $e_id = $ecosystem_id\r\n } else {\r\n if !DBFind(\"@1ecosystems\").Where({id:$e_id}).One(\"id\") {\r\n error Sprintf(LangRes(\"@1ecosystem_not_found\", \"en\"), $e_id)\r\n }\r\n } \r\n }\r\n\r\n func getPermission() {\r\n var array_permissions array result i int prevContract string\r\n array_permissions = [\"@1TokensSend\", \"@1PoaTokensSend\", \"@1TokensRefund\"]\r\n\r\n prevContract = $stack[0]\r\n if Len($stack) > 2 {\r\n prevContract = $stack[Len($stack) - 2]\r\n }\r\n while i < Len(array_permissions) {\r\n var contract_name string\r\n contract_name = array_permissions[i]\r\n if contract_name==prevContract {\r\n result = 1\r\n }\r\n i = i + 1\r\n }\r\n\r\n if result == 0 {\r\n error LangRes(\"@1tokens_transfer_cannot_be_made\", \"en\")\r\n }\r\n }\r\n\r\n func checkSender() {\r\n var sender_map map\r\n sender_map = DBFind(\"@1keys\").Where({ecosystem:$e_id, id:$SenderId}).Row()\r\n\r\n if !sender_map {\r\n error Sprintf(LangRes(\"@1sender_x_invalid\", \"en\"), $SenderId)\r\n }\r\n if Int(sender_map[\"blocked\"]) != 0 {\r\n error LangRes(\"@1sender_blocked\", \"en\")\r\n }\r\n if Int(sender_map[\"deleted\"]) != 0 {\r\n error LangRes(\"@1sender_deleted\", \"en\")\r\n }\r\n if Money(sender_map[\"amount\"]) < $Amount {\r\n error LangRes(\"@1amount_less_than_needed\", \"en\")\r\n }\r\n }\r\n\r\n func checkRecipient() {\r\n var recipient_map map\r\n recipient_map = DBFind(\"@1keys\").Where({ecosystem:$e_id, id:$RecipientId}).Row()\r\n\r\n if !recipient_map {\r\n error Sprintf(LangRes(\"@1recipient_x_invalid\", \"en\"), $RecipientId)\r\n }\r\n if Int(recipient_map[\"blocked\"]) != 0 {\r\n error LangRes(\"@1recipient_blocked\", \"en\")\r\n }\r\n if Int(recipient_map[\"deleted\"]) != 0 {\r\n error LangRes(\"@1recipient_deleted\", \"en\")\r\n }\r\n }\r\n\r\n conditions {\r\n getEcosystem() //getting an ecosystem number\r\n getPermission() //getting permission to run\r\n checkSender() //check the sender\r\n checkRecipient() //check the recipient\r\n \r\n //check amount\r\n if $Amount == 0 {\r\n error LangRes(\"@1amount_zero\", \"en\")\r\n }\r\n if $Amount < 0 {\r\n error LangRes(\"@1amount_less_zero\", \"en\")\r\n }\r\n }\r\n\r\n action {\r\n var table_name string\r\n table_name = \"@\" + Str($e_id) + \"keys\"\r\n DBUpdate(table_name, $SenderId, {\"-amount\": $Amount})\r\n DBUpdate(table_name, $RecipientId, {\"+amount\": $Amount})\r\n\r\n var m map\r\n m[\"sender_id\"] = $SenderId\r\n m[\"recipient_id\"] = $RecipientId\r\n m[\"amount\"] = $Amount\r\n m[\"comment\"] = $Comment\r\n m[\"block_id\"] = $block\r\n m[\"txhash\"] = $txhash\r\n m[\"ecosystem\"] = $e_id\r\n m[\"type\"] = 3\r\n //m[\"created_at\"] = $block_time\r\n DBInsert(\"@1history\", m)\r\n }\r\n}", "Type": "contracts" }, { @@ -763,7 +797,7 @@ { "Name": "TokensSend", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract TokensSend {\r\n data {\r\n Amount money\r\n Recipient string\r\n Comment string \"optional\"\r\n }\r\n func getPermission() {\r\n var array_permissions array result i int prevContract string\r\n array_permissions = [\"@1TokensSend\", \"@1TsKeyApprove\", \"@1TsTransferSeller\"]\r\n\r\n prevContract = $stack[0]\r\n if Len($stack) > 2 {\r\n prevContract = $stack[Len($stack) - 2]\r\n }\r\n while i < Len(array_permissions) {\r\n var contract_name string\r\n contract_name = array_permissions[i]\r\n if contract_name==prevContract {\r\n result = 1\r\n }\r\n i = i + 1\r\n }\r\n\r\n if result == 0 {\r\n error LangRes(\"@1tokens_transfer_cannot_be_made\", \"en\")\r\n }\r\n }\r\n\r\n conditions {\r\n getPermission()\r\n\r\n $recipient_id = AddressToId($Recipient)\r\n if $recipient_id == 0 {\r\n error Sprintf(LangRes(\"@1recipient_x_invalid\", \"en\"), $Recipient)\r\n }\r\n }\r\n\r\n action {\r\n @1TokensTransfer(\"Amount,SenderId,RecipientId\", $Amount, $key_id, $recipient_id)\r\n }\r\n}", + "Value": "contract TokensSend {\r\n data {\r\n Amount money\r\n Recipient string\r\n Comment string \"optional\"\r\n }\r\n func getPermission() {\r\n var array_permissions array result i int prevContract string\r\n array_permissions = [\"@1TokensSend\", \"@1TsKeyApprove\", \"@1TsTransferSeller\"]\r\n\r\n prevContract = $stack[0]\r\n if Len($stack) > 2 {\r\n prevContract = $stack[Len($stack) - 2]\r\n }\r\n while i < Len(array_permissions) {\r\n var contract_name string\r\n contract_name = array_permissions[i]\r\n if contract_name==prevContract {\r\n result = 1\r\n }\r\n i = i + 1\r\n }\r\n\r\n if result == 0 {\r\n error LangRes(\"@1tokens_transfer_cannot_be_made\", \"en\")\r\n }\r\n }\r\n\r\n conditions {\r\n getPermission()\r\n\r\n $recipient_id = AddressToId($Recipient)\r\n if $recipient_id == 0 {\r\n error Sprintf(LangRes(\"@1recipient_x_invalid\", \"en\"), $Recipient)\r\n }\r\n }\r\n\r\n action {\r\n @1TokensTransfer(\"Amount,SenderId,RecipientId,Comment,Ecosystem\", $Amount, $key_id, $recipient_id, $Comment, $ecosystem_id)\r\n }\r\n}", "Type": "contracts" }, { diff --git a/lang_res.json b/lang_res.json index 6d47ca441..4c160f527 100644 --- a/lang_res.json +++ b/lang_res.json @@ -149,7 +149,7 @@ }, { "Name": "amount_apl", - "Trans": "{\"en\": \"APL amount\", \"ru\": \"Сумма APL\"}", + "Trans": "{\"en\": \"APLA amount\", \"ru\": \"Сумма APLA\"}", "Type": "languages" }, { @@ -462,6 +462,11 @@ "Trans": "{\"en\": \"Text\", \"ru\": \"Текст\"}", "Type": "languages" }, + { + "Name": "broadcast", + "Trans": "{\"en\": \"Broadcast\", \"ru\": \"Рассылка\"}", + "Type": "languages" + }, { "Name": "broadcast_send", "Trans": "{\"en\": \"Broadcast send\", \"ru\": \"Отправить во все экосистемы\"}", @@ -1092,6 +1097,11 @@ "Trans": "{\"en\": \"Ecosystem name\", \"ru\": \"Имя экосистемы\"}", "Type": "languages" }, + { + "Name": "ecosystem_not_found", + "Trans": "{\"en\": \"Ecosystem %v not found\", \"ru\": \"Экосистема %v не найдена\"}", + "Type": "languages" + }, { "Name": "ecosystem_not_founder", "Trans": "{\"en\": \"You are not a founder of this ecosystem\", \"ru\": \"Вы не являетесь создателем этой экосистемы\"}", @@ -1357,6 +1367,11 @@ "Trans": "{\"en\": \"Group of persons\", \"ru\": \"Группа лиц\"}", "Type": "languages" }, + { + "Name": "guest", + "Trans": "{\"en\": \"Guest\", \"ru\": \"Гость\"}", + "Type": "languages" + }, { "Name": "header", "Trans": "{\"en\": \"Header\", \"ru\": \"Заголовок\"}", @@ -1702,6 +1717,11 @@ "Trans": "{\"en\": \"Manual adding\", \"ru\": \"Ручное добавление\"}", "Type": "languages" }, + { + "Name": "mark_read", + "Trans": "{\"en\": \"Mark as read\", \"ru\": \"Прочитано\"}", + "Type": "languages" + }, { "Name": "maximum", "Trans": "{\"en\": \"Maximum\", \"ru\": \"Максимум\"}", @@ -1802,6 +1822,76 @@ "Trans": "{\"en\": \"Menu title\", \"ru\": \"Заголовок меню\"}", "Type": "languages" }, + { + "Name": "message_active_threads", + "Trans": "{\"en\": \"Active threads\", \"ru\": \"Активные переписки\"}", + "Type": "languages" + }, + { + "Name": "message_create", + "Trans": "{\"en\": \"Create message\", \"ru\": \"Создать сообщение\"}", + "Type": "languages" + }, + { + "Name": "message_from", + "Trans": "{\"en\": \"Message from\", \"ru\": \"Сообщение от\"}", + "Type": "languages" + }, + { + "Name": "message_from_you", + "Trans": "{\"en\": \"Message from you\", \"ru\": \"Сообщение от вас\"}", + "Type": "languages" + }, + { + "Name": "message_subject", + "Trans": "{\"en\": \"Subject\", \"ru\": \"Тема\"}", + "Type": "languages" + }, + { + "Name": "message_subject_empty", + "Trans": "{\"en\": \"No subject\", \"ru\": \"Без темы\"}", + "Type": "languages" + }, + { + "Name": "message_subject_type_here", + "Trans": "{\"en\": \"Describe the subject of your message\", \"ru\": \"Опишите тему сообщения\"}", + "Type": "languages" + }, + { + "Name": "message_text", + "Trans": "{\"en\": \"Message text\", \"ru\": \"Текст сообщения\"}", + "Type": "languages" + }, + { + "Name": "message_thread_history", + "Trans": "{\"en\": \"Thread history\", \"ru\": \"История переписки\"}", + "Type": "languages" + }, + { + "Name": "message_thread_show", + "Trans": "{\"en\": \"Show thread\", \"ru\": \"Показать переписку\"}", + "Type": "languages" + }, + { + "Name": "message_type_here", + "Trans": "{\"en\": \"Type your message here\", \"ru\": \"Введите текст сообщения\"}", + "Type": "languages" + }, + { + "Name": "message_view", + "Trans": "{\"en\": \"Message view\", \"ru\": \"Просмотр сообщения\"}", + "Type": "languages" + }, + { + "Name": "messages_empty", + "Trans": "{\"en\": \"There are no messages yet. You can create your first message using the Plus button at the top right corner\", \"ru\": \"Сообщений нет. Вы можете написать первое сообщение, нажав на кнопку создания справа вверху\"}", + "Type": "languages" + }, + { + "Name": "messenger", + "Trans": "{\"en\": \"Messenger\", \"ru\": \"Мессенджер\"}", + "Type": "languages" + }, { "Name": "metrics", "Trans": "{\"en\": \"Metrics\", \"ru\": \"Метрики\"}", @@ -1849,7 +1939,7 @@ }, { "Name": "need_fuel", - "Trans": "{\"en\": \"APL needed\", \"ru\": \"Нужно APL\"}", + "Trans": "{\"en\": \"APLA needed\", \"ru\": \"Нужно APLA\"}", "Type": "languages" }, { @@ -1964,7 +2054,7 @@ }, { "Name": "not_need_fuel", - "Trans": "{\"en\": \"Not need APL\", \"ru\": \"Не нужно APL\"}", + "Trans": "{\"en\": \"Not need APLA\", \"ru\": \"Не нужно APLA\"}", "Type": "languages" }, { @@ -2074,7 +2164,7 @@ }, { "Name": "notifications_view", - "Trans": "{\"en\": \"View notification\", \"ru\": \"Просмотр уведомления\"}", + "Trans": "{\"en\": \"Notification view\", \"ru\": \"Просмотр уведомления\"}", "Type": "languages" }, { @@ -2099,12 +2189,12 @@ }, { "Name": "only_admin_action", - "Trans": "{\"en\": \"Actions on this page are available to administrators only\", \"ru\": \"Действия на данной странице доступны только администраторам\"}", + "Trans": "{\"en\": \"Any actions on this page are available to administrators only\", \"ru\": \"Действия на данной странице доступны только администраторам\"}", "Type": "languages" }, { "Name": "only_first_ecosystem_action", - "Trans": "{\"en\": \"Work on this page is available only in first ecosystem\", \"ru\": \"Работа на данной странице доступна только в первой экосистеме\"}", + "Trans": "{\"en\": \"Any actions on this page are available in the first ecosystem only\", \"ru\": \"Действия на данной странице доступны только в первой экосистеме\"}", "Type": "languages" }, { @@ -2262,6 +2352,11 @@ "Trans": "{\"en\": \"Power of attorney not found\", \"ru\": \"Доверенность не найдена\"}", "Type": "languages" }, + { + "Name": "poa_not_rights_to_change", + "Trans": "{\"en\": \"Not enough rights to change the parameters of this power of attorney\", \"ru\": \"Не достаточно прав для изменения параметров этой доверенности.\"}", + "Type": "languages" + }, { "Name": "poa_not_rights_to_create", "Trans": "{\"en\": \"Not enough rights to create. You are not the admin of this ecosystem.\", \"ru\": \"Недостаточно прав на создание. Вы не админ этой экосистемы.\"}", @@ -2287,6 +2382,11 @@ "Trans": "{\"en\": \"Power of attorney Template not found\", \"ru\": \"Шаблон доверенности не найден\"}", "Type": "languages" }, + { + "Name": "popup", + "Trans": "{\"en\": \"Popup window\", \"ru\": \"Всплывающее окно\"}", + "Type": "languages" + }, { "Name": "possible", "Trans": "{\"en\": \"Possible\", \"ru\": \"Возможно\"}", @@ -2442,6 +2542,16 @@ "Trans": "{\"en\": \"The minimum number of nodes. Node deleting is impossible\", \"ru\": \"Минимальное количество узлов. Удаление узла невозможно\"}", "Type": "languages" }, + { + "Name": "reply", + "Trans": "{\"en\": \"Reply\", \"ru\": \"Ответить\"}", + "Type": "languages" + }, + { + "Name": "reply_text", + "Trans": "{\"en\": \"Reply text\", \"ru\": \"Текст ответа\"}", + "Type": "languages" + }, { "Name": "request", "Trans": "{\"en\": \"Request\", \"ru\": \"Запрос\"}", @@ -3497,6 +3607,31 @@ "Trans": "{\"en\": \"The contract of the investor\", \"ru\": \"Контракт инвестора\"}", "Type": "languages" }, + { + "Name": "ts_free_wallet_add", + "Trans": "{\"en\": \"Add a free wallet\", \"ru\": \"Добавить свободный кошелек\"}", + "Type": "languages" + }, + { + "Name": "ts_free_wallet_not_found", + "Trans": "{\"en\": \"Free wallet not found\", \"ru\": \"Свободный кошелек не найден\"}", + "Type": "languages" + }, + { + "Name": "ts_free_wallets", + "Trans": "{\"en\": \"Free wallets\", \"ru\": \"Свободные кошельки\"}", + "Type": "languages" + }, + { + "Name": "ts_free_wallets_emptied", + "Trans": "{\"en\": \"Free wallet emptied\", \"ru\": \"Свободные кошелеки закончились\"}", + "Type": "languages" + }, + { + "Name": "ts_free_wallets_need", + "Trans": "{\"en\": \"Need to add free wallets\", \"ru\": \"Необходимо добавить свободные кошельки\"}", + "Type": "languages" + }, { "Name": "ts_hello_user_description", "Trans": "{\"en\": \"Welcome to the Apla blockchain\", \"ru\": \"Добро пожаловать в блокчейн Apla\"}", @@ -3504,7 +3639,7 @@ }, { "Name": "ts_investor_key", - "Trans": "{\"en\": \"Investor key. Add the public key and transfer APL tokens\", \"ru\": \"Ключ инвестора. Добавить публичный ключ и перевести токены APL\"}", + "Trans": "{\"en\": \"Investor key. Add the public key and transfer APLA tokens\", \"ru\": \"Ключ инвестора. Добавить публичный ключ и перевести токены APLA\"}", "Type": "languages" }, { @@ -3529,7 +3664,7 @@ }, { "Name": "ts_settings_description", - "Trans": "{\"en\": \"Ecosystem's and Trade APL application roles compliance\", \"ru\": \"Соответствие ролей приложения Trade APL ролям экосистемы\"}", + "Trans": "{\"en\": \"Ecosystem's and Trade APLA application roles compliance\", \"ru\": \"Соответствие ролей приложения Trade APLA ролям экосистемы\"}", "Type": "languages" }, { @@ -3539,7 +3674,7 @@ }, { "Name": "ts_transfer_seller", - "Trans": "{\"en\": \"Selling APL: the transfer of funds\", \"ru\": \"Продажа APL: перевод средств\"}", + "Trans": "{\"en\": \"Selling APLA: the transfer of funds\", \"ru\": \"Продажа APLA: перевод средств\"}", "Type": "languages" }, { @@ -3547,6 +3682,16 @@ "Trans": "{\"en\": \"User key. Add the public key only\", \"ru\": \"Ключ пользователя. Только добавить публичный ключ\"}", "Type": "languages" }, + { + "Name": "ts_wallet_btc", + "Trans": "{\"en\": \"BTC wallet\", \"ru\": \"BTC кошелек\"}", + "Type": "languages" + }, + { + "Name": "ts_wallet_eth", + "Trans": "{\"en\": \"ETH wallet\", \"ru\": \"ETH кошелек\"}", + "Type": "languages" + }, { "Name": "ts_wallets", "Trans": "{\"en\": \"Investor wallets\", \"ru\": \"Кошельки инвесторов\"}", @@ -3592,11 +3737,21 @@ "Trans": "{\"en\": \"Understand\", \"ru\": \"Ознакомился\"}", "Type": "languages" }, + { + "Name": "understood", + "Trans": "{\"en\": \"Understood\", \"ru\": \"Ознакомился\"}", + "Type": "languages" + }, { "Name": "unlimited", "Trans": "{\"en\": \"Unlimited\", \"ru\": \"Не ограничены\"}", "Type": "languages" }, + { + "Name": "unread", + "Trans": "{\"en\": \"unread\", \"ru\": \"не прочитано\"}", + "Type": "languages" + }, { "Name": "update", "Trans": "{\"en\": \"Update\", \"ru\": \"Обновить\"}", @@ -3677,6 +3832,16 @@ "Trans": "{\"en\": \"must be between 3 and 30 characters\", \"ru\": \"должно быть от 3 до 30 символов\"}", "Type": "languages" }, + { + "Name": "validate_wallet_btc", + "Trans": "{\"en\": \"must be between 27 and 34 characters\", \"ru\": \"должно быть от 27 до 34 символов\"}", + "Type": "languages" + }, + { + "Name": "validate_wallet_eth", + "Trans": "{\"en\": \"must be between 40 and 44 characters\", \"ru\": \"должно быть от 40 до 44 символов\"}", + "Type": "languages" + }, { "Name": "validator_removing", "Trans": "{\"en\": \"Validator's removing\", \"ru\": \"Удаление валидатора\"}", @@ -3744,7 +3909,7 @@ }, { "Name": "vde_form_desc", - "Trans": "{\"en\": \"Address of the VDE form in VDE system for applying for the membership (for someones without APL)\", \"ru\": \"Адрес VDE-формы для подачи заявки на членство (для тех, у кого ещё нет APL)\"}", + "Trans": "{\"en\": \"Address of the VDE form in VDE system for applying for the membership (for someones without APLA)\", \"ru\": \"Адрес VDE-формы для подачи заявки на членство (для тех, у кого ещё нет APLA)\"}", "Type": "languages" }, { @@ -4162,6 +4327,16 @@ "Trans": "{\"en\": \"Wallet Address\", \"ru\": \"Адрес кошелька\"}", "Type": "languages" }, + { + "Name": "wallet_btc_exists", + "Trans": "{\"en\":\"%s BTC wallet already exists\", \"ru\":\"%s BTC кошелек уже существует\"}", + "Type": "languages" + }, + { + "Name": "wallet_eth_exists", + "Trans": "{\"en\":\"%s ETH wallet already exists\", \"ru\":\"%s ETH кошелек уже существует\"}", + "Type": "languages" + }, { "Name": "wallet_not_found", "Trans": "{\"en\": \"Wallet is not found\", \"ru\": \"Адрес кошелька не найден\"}", @@ -4267,6 +4442,11 @@ "Trans": "{\"en\": \"Do you really want to delete this member from the role?\", \"ru\": \"Вы уверены, что хотите удалить этого члена из роли?\"}", "Type": "languages" }, + { + "Name": "want_delete_key", + "Trans": "{\"en\": \"Do you want to delete this key?\", \"ru\": \"Вы хотите удалить этот ключ?\"}", + "Type": "languages" + }, { "Name": "want_delete_member", "Trans": "{\"en\": \"Do you really want to delete this member?\", \"ru\": \"Вы уверены, что хотите удалить этого члена?\"}", @@ -4394,7 +4574,7 @@ }, { "Name": "web_form_desc", - "Trans": "{\"en\": \"Web address of the form for applying for the membership (for someones without APL)\", \"ru\": \"Адрес web-формы для подачи заявки на членство (для тех, у кого ещё нет APL)\"}", + "Trans": "{\"en\": \"Web address of the form for applying for the membership (for someones without APLA)\", \"ru\": \"Адрес web-формы для подачи заявки на членство (для тех, у кого ещё нет APLA)\"}", "Type": "languages" }, { @@ -4461,6 +4641,11 @@ "Name": "yes", "Trans": "{\"en\": \"Yes\", \"ru\": \"Да\"}", "Type": "languages" + }, + { + "Name": "you", + "Trans": "{\"en\": \"You\", \"ru\": \"Вы\"}", + "Type": "languages" } ] } \ No newline at end of file diff --git a/other/tokens_sale.json b/other/tokens_sale.json index caa54bcb7..5475e3b85 100644 --- a/other/tokens_sale.json +++ b/other/tokens_sale.json @@ -5,7 +5,7 @@ { "Name": "ts_contract_investors", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Div(list-group-item mt-lg mb-lg ml-lg mr-lg){\r\n Div(Class: h3 text-bold m0 text-center, Body: To Apla Users who have passed)\r\n Div(Class: h3 text-bold m0 text-center, Body: the KYC screening at SnapSwap International S.A.)\r\n\r\n Div(Class: h4 mt-xl, Body: Em(Date: 1st of November 2018))\r\n Div(Class: h4, Body: Em(Re: Invitation to submit purchase orders to buy APL Tokens))\r\n\r\n Div(Class: h4 mt-xl, Body: Dear Apla User,)\r\n Div(Class: h4, Body: We are very delighted that you have chosen the Apla blockchain platform to build decentralised applications, create ecosystems and accommodate your other business needs.)\r\n Div(Class: h4, Body: According to Article 8.1 of the Apla General Terms and Conditions (link to the site), EGAAS S.A. will be charging a license fee for each transaction signed by Apla users on the platform. The license fee is payable in the internal virtual currency of the Apla platform ecosystem named APL tokens. Hence, in order to use the platform, you will need to have APL tokens on your APL Wallet prior to signing each transaction.)\r\n Div(Class: h4, Body: EGAAS S.A. will be conducting an initial sale of APL Tokens from November 2018 until July 2019. The commercial terms of the sale are summarised below:)\r\n Div(row){\r\n Div(col-sm-12 text-center){\r\n Button(Class: btn-xs btn-link, Page: ts_commercial_terms){\r\n Span(Class: h4, Body: The commercial terms)\r\n }.Popup(70, The commercial terms)\r\n }\r\n }\r\n\r\n Div(Class: h4, Body: Please submit your purchase order to buy APL tokens after you have reviewed and agreed with the legal terms of sale.)\r\n Div(Class: h4, Body: After we have received your purchase order, we will send you an invoice for making the payment of the purchase price.)\r\n Div(Class: h4, Body: Please reach out to us via the email Span(Class: text-primary, Body: luxembourg@apla.io) if you have any questions or require any clarification of the above terms. We’ll also give you an access to the online data room with all information and legal documents concerning the Apla project, if you require so.)\r\n\r\n Div(Class: h4 mt-xl, Body: Kind regards,)\r\n Div(row){\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Oleg Strelenko)\r\n }\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Vitaly Bondar)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Director)\r\n }\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Director)\r\n }\r\n }\r\n\r\n Div(Class: h4 mt-xl, Body: Annexes:)\r\n Div(Class: h4 m0, Body: Annex 1. Purchase Order)\r\n Div(Class: h4 m0, Body: Annex 2. Standard Terms & Conditions of Sale)\r\n\r\n Div(row mt-xl pull-right){\r\n Div(col-sm-12){\r\n Button(Class: btn btn-primary h4, Page: ts_buyer_contract, Body: Standard terms and conditions of sale)\r\n }\r\n }\r\n}.Style(\r\n padding-left: 60px!important; \r\n padding-right: 60px!important;\r\n)", + "Value": "Div(list-group-item mt-lg mb-lg ml-lg mr-lg){\r\n Div(Class: h3 text-bold m0 text-center, Body: To Apla Users who have passed)\r\n Div(Class: h3 text-bold m0 text-center, Body: the KYC screening at SnapSwap International S.A.)\r\n\r\n Div(Class: h4 mt-xl, Body: Em(Date: 1st of November 2018))\r\n Div(Class: h4, Body: Em(Re: Invitation to submit purchase orders to buy APLA Tokens))\r\n\r\n Div(Class: h4 mt-xl, Body: Dear Apla User,)\r\n Div(Class: h4, Body: We are very delighted that you have chosen the Apla blockchain platform to build decentralised applications, create ecosystems and accommodate your other business needs.)\r\n Div(Class: h4, Body: According to Article 8.1 of the Apla General Terms and Conditions (Span(Class: text-primary, Body: www.apla.io)), EGAAS S.A. will be charging a license fee for each transaction signed by Apla users on the platform. The license fee is payable in the internal virtual currency of the Apla platform ecosystem named APLA tokens. Hence, in order to use the platform, you will need to have APLA tokens on your APLA Wallet prior to signing each transaction.)\r\n Div(Class: h4){\r\n Span(EGAAS S.A. will be conducting an initial sale of APLA Tokens from November 2018 until July 2019. The commercial terms of the sale are summarised below:)\r\n Button(Class: btn-xs btn-link, Page: ts_commercial_terms){\r\n Span(Class: h4, Body: The commercial terms)\r\n }.Popup(70, The commercial terms)\r\n }\r\n\r\n Div(Class: h4, Body: Please submit your purchase order to buy APLA tokens after you have reviewed and agreed with the legal terms of sale.)\r\n Div(Class: h4, Body: After we have received your purchase order, we will send you an invoice for making the payment of the purchase price.)\r\n Div(Class: h4, Body: Please reach out to us via the email Span(Class: text-primary, Body: luxembourg@apla.io) if you have any questions or require any clarification of the above terms. We’ll also give you an access to the online data room with all information and legal documents concerning the Apla project, if you require so.)\r\n\r\n Div(Class: h4 mt-xl, Body: Kind regards,)\r\n Div(row){\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Oleg Strelenko)\r\n }\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Vitaly Bondar)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Director)\r\n }\r\n Div(col-sm-6){\r\n Div(Class: h4 m0, Body: Director)\r\n }\r\n }\r\n\r\n Div(Class: h4 mt-xl, Body: Annexes:)\r\n Div(Class: h4 m0, Body: Annex 1. Purchase Order)\r\n Div(Class: h4 m0, Body: Annex 2. Standard Terms & Conditions of Sale)\r\n\r\n Div(row mt-xl pull-right){\r\n Div(col-sm-12){\r\n Button(Class: btn btn-primary h4, Page: ts_buyer_contract, Body: Standard terms and conditions of sale)\r\n }\r\n }\r\n}.Style(\r\n padding-left: 60px!important; \r\n padding-right: 60px!important;\r\n)", "Type": "blocks" }, { @@ -17,7 +17,7 @@ { "Name": "default_menu", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "If(#ecosystem_id# == 1){\r\n SetVar(is_allowed, 0).(k_id, 0).(unreaded_wallet_id,0).(exist_wallet_id,0)\r\n DBFind(@1keys).Where({id:#key_id#}).Vars(k)\r\n DBFind(@1ts_wallets).Where({key_id_buyer:#key_id#}).Vars(exist_wallet)\r\n DBFind(@1ts_wallets).Where({key_id_buyer:#key_id#, rejected_at:0, signed_at:0}).Vars(unreaded_wallet)\r\n If(#k_id#!=0){\r\n If(#exist_wallet_id#>0){\r\n If(#unreaded_wallet_id#==0){\r\n SetVar(is_allowed, 1)\r\n }\r\n }.Else{\r\n SetVar(is_allowed, 1)\r\n }\r\n }\r\n If(#is_allowed#==1){\r\n SetVar(snapswap_role_id,0).(admin_role_id,0).(manager_role_id,0).(seller_role_id,0)\r\n SetVar(snapswap_role_id, EcosysParam(Name:role_snapswap))\r\n SetVar(admin_role_id, EcosysParam(Name:role_sale_admin))\r\n SetVar(manager_role_id, EcosysParam(Name:role_sale_manager))\r\n SetVar(seller_role_id, EcosysParam(Name:role_sale_seller))\r\n\r\n Span(\"Set here the menu of the first ecosystem\")\r\n If(And(#admin_role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#))){\r\n MenuItem(Title:$@1ts_sales$, Page:@1ts_sales, Icon:\"icon-credit-card\")\r\n }\r\n If(And(#snapswap_role_id#>0,#role_id#==#snapswap_role_id#)){\r\n MenuItem(Title:$@1ts_wallets$, Page:@1ts_wallets, Icon:\"icon-credit-card\")\r\n }\r\n }\r\n}", + "Value": "If(#ecosystem_id# == 1){\r\n SetVar(is_allowed, 0).(k_id, 0).(unreaded_wallet_id,0).(exist_wallet_id,0)\r\n DBFind(@1keys).Where({id:#key_id#}).Vars(k)\r\n DBFind(@1ts_wallets).Where({key_id_buyer:#key_id#}).Vars(exist_wallet)\r\n DBFind(@1ts_wallets).Where({key_id_buyer:#key_id#, rejected_at:0, signed_at:0}).Vars(unreaded_wallet)\r\n If(#k_id#!=0){\r\n If(#exist_wallet_id#>0){\r\n If(#unreaded_wallet_id#==0){\r\n SetVar(is_allowed, 1)\r\n }\r\n }.Else{\r\n SetVar(is_allowed, 1)\r\n }\r\n }\r\n If(#is_allowed#==1){\r\n SetVar(snapswap_role_id,0).(admin_role_id,0).(manager_role_id,0).(seller_role_id,0)\r\n SetVar(snapswap_role_id, EcosysParam(Name:role_snapswap))\r\n SetVar(admin_role_id, EcosysParam(Name:role_sale_admin))\r\n SetVar(manager_role_id, EcosysParam(Name:role_sale_manager))\r\n SetVar(seller_role_id, EcosysParam(Name:role_sale_seller))\r\n\r\n Span(\"Set here the menu of the first ecosystem\")\r\n If(And(#role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#,#role_id#==#snapswap_role_id#))){\r\n MenuItem(Title:$@1ts_free_wallets$, Page:@1ts_free_wallets, Icon:\"icon-credit-card\")\r\n }\r\n If(And(#role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#,#role_id#==#snapswap_role_id#))){\r\n MenuItem(Title:$@1ts_wallets$, Page:@1ts_wallets, Icon:\"icon-credit-card\")\r\n }\r\n If(And(#role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#,#role_id#==#snapswap_role_id#))){\r\n MenuItem(Title:$@1ts_sales$, Page:@1ts_sales, Icon:\"icon-credit-card\")\r\n }\r\n }\r\n}", "Type": "menu" }, { @@ -28,8 +28,8 @@ }, { "Name": "ts_wallets", - "Columns": "[\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsBuyerAction\\\",\\\"@1TsConsensusAction\\\")\",\r\n \"name\":\"rejected_at\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsBuyerAction\\\")\",\r\n \"name\":\"key_id_buyer\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsConsensusAction\\\")\",\r\n \"name\":\"key_id_signer\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"false\",\r\n \"name\":\"btc\",\r\n \"type\":\"money\"\r\n },\r\n {\r\n \"conditions\":\"false\",\r\n \"name\":\"eth\",\r\n \"type\":\"money\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsBuyerAction\\\")\",\r\n \"name\":\"signed_at\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"false\",\r\n \"name\":\"created_at\",\r\n \"type\":\"number\"\r\n }\r\n]", - "Permissions": "{\"insert\": \"ContractAccess(\\\"@1TsKeyApprove\\\")\", \"update\": \"ContractAccess(\\\"@1TsBuyerAction\\\",\\\"@1TsConsensusAction\\\")\", \"new_column\": \"ContractConditions(\\\"@1AdminCondition\\\")\"}", + "Columns": "[\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsBuyerAction\\\",\\\"@1TsConsensusAction\\\")\",\r\n \"name\":\"rejected_at\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsKeyApprove\\\")\",\r\n \"name\":\"key_id_buyer\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsConsensusAction\\\")\",\r\n \"name\":\"key_id_signer\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"false\",\r\n \"name\":\"btc\",\r\n \"type\":\"money\"\r\n },\r\n {\r\n \"conditions\":\"false\",\r\n \"name\":\"eth\",\r\n \"type\":\"money\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsBuyerAction\\\")\",\r\n \"name\":\"signed_at\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsKeyApprove\\\")\",\r\n \"name\":\"created_at\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\": \"false\",\r\n \"name\": \"wallet_eth\",\r\n \"type\": \"text\"\r\n },\r\n {\r\n \"conditions\": \"false\",\r\n \"name\": \"wallet_btc\",\r\n \"type\": \"text\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsFreeWalletDelete\\\")\",\r\n \"name\":\"deleted\",\r\n \"type\":\"number\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsKeyApprove\\\")\",\r\n \"name\": \"pub_buyer\",\r\n \"type\": \"text\"\r\n },\r\n {\r\n \"conditions\":\"ContractAccess(\\\"@1TsKeyApprove\\\")\",\r\n \"name\": \"pub_short_buyer\",\r\n \"type\": \"text\"\r\n }\r\n]", + "Permissions": "{\"insert\": \"ContractAccess(\\\"@1TsFreeWalletAdd\\\")\", \"update\": \"ContractAccess(\\\"@1TsBuyerAction\\\",\\\"@1TsConsensusAction\\\",\\\"@1TsKeyApprove\\\",\\\"@1TsFreeWalletDelete\\\")\", \"new_column\": \"ContractConditions(\\\"@1AdminCondition\\\")\"}", "Type": "tables" }, { @@ -60,28 +60,42 @@ { "Name": "ts_buyer_congratulation", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Div(list-group-item mt-lg mb-lg ml-lg mr-lg){\r\n Div(Class: h3 text-bold text-center pb-xl, Body: Purchase Order)\r\n\r\n Div(Class: h4 pb-lg, Body: In response to your invitation to submit a purchase order as of 1s tof November 2018, we would like to submit the below purchase order to buy APL Tokens: )\r\n Div(){\r\n Div(row){\r\n Div(col-md-12){\r\n Div(table tablez){\r\n Div(table__row){\r\n Div(table__cell table__cell_10){APL Wallet Number}\r\n Div(table__cell table__cell_10){}\r\n }\r\n Div(table__row){\r\n Div(table__cell table__cell_10){Number of APL Tokens to buy}\r\n Div(table__cell table__cell_10){}\r\n }\r\n Div(table__row){\r\n Div(table__cell table__cell_10 tborder){Payment means}\r\n Div(table__cell table__cell_10 tborder){[EUR/BTC/ETH]}\r\n }\r\n }\r\n }\r\n }\r\n }.Style(\r\n .row-flex {\r\n display: flex;\r\n flex-flow: row wrap;\r\n }\r\n\r\n .table {\r\n display: table;\r\n border: solid 1px #000000;\r\n }\r\n\r\n .tablez {\r\n border: solid 1px #000000;\r\n }\r\n\r\n .table .table__head {\r\n display: table-header-group;\r\n background: blue;\r\n color: #fff;\r\n }\r\n\r\n .table .table__head .table__cell {\r\n font-size: 15px;\r\n color: #000000;\r\n background: #B7B7B7;\r\n\r\n }\r\n\r\n .table > div:not(.table__body) {\r\n display: table-row-group;\r\n }\r\n\r\n .table .table__body:last-child .table__row:last-child .table__cell {\r\n border-bottom: none;\r\n }\r\n\r\n .table .table__row {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n }\r\n\r\n .table .table__row:nth-child(2n) {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n border-left: solid 1px red;\r\n }\r\n\r\n .table .table__row .table__cell {\r\n border-bottom: solid 1px #000000;\r\n }\r\n\r\n .table .table__cell {\r\n display: table-cell;\r\n padding: 8px 10px;\r\n font-size: 14px;\r\n color: #000000;\r\n border-right: solid 1px #000000;\r\n }\r\n\r\n .tborder {\r\n border-bottom: 0!important;\r\n }\r\n\r\n .table .table__cell:last-child {\r\n border-right: none;\r\n }\r\n\r\n .table .table__cell.table__cell_collapse {\r\n width: 1px;\r\n }\r\n\r\n .table .table__cell.table__cell_10 {\r\n width: 10%;\r\n }\r\n\r\n .table .table__cell.table__cell_20 {\r\n width: 20%;\r\n }\r\n\r\n .table .table__cell.table__cell_25 {\r\n width: 25%;\r\n }\r\n\r\n .table .table__cell.table__cell_30 {\r\n width: 30%;\r\n }\r\n\r\n .table .table__cell.table__cell_40 {\r\n width: 40%;\r\n }\r\n\r\n .table .table__cell.table__cell_50 {\r\n width: 50%;\r\n }\r\n\r\n .table .table__cell.table__cell_60 {\r\n width: 60%;\r\n }\r\n\r\n .table .table__cell.table__cell_70 {\r\n width: 70%;\r\n }\r\n\r\n .table .table__cell.table__cell_80 {\r\n width: 80%;\r\n }\r\n\r\n .table .table__cell.table__cell_18 {\r\n width: 18%;\r\n }\r\n\r\n .table .table__cell.table__cell_90 {\r\n width: 90%;\r\n }\r\n\r\n .table .table__cell.table__cell_stretch {\r\n width: 100%;\r\n }\r\n )\r\n Div(Class: h4, Body: We hereby acknowledge the receipt of and agree with the Standard Terms & Conditions of Sale. )\r\n\r\n Div(){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"closed\").Vars(note)\r\n If(#note_closed# == 0){\r\n Button(Body: $@1readed$, Class: btn btn-primary pull-right, Page: default_page, Contract: NotificationsClose, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n}", + "Value": "DBFind(@1ts_wallets).Where({\"key_id_buyer\":#key_id#}).Vars(w)\r\nIf(#w_id# > 0){\r\n Div(list-group-item mt-lg mb-lg ml-lg mr-lg){\r\n Div(Class: h3 text-bold text-center pb-xl, Body: Purchase Order)\r\n Div(Class: h4 pb-lg, Body: In response to your invitation to submit a purchase order as of 1s tof November 2018, we would like to submit the below purchase order to buy APLA Tokens: )\r\n Div(){\r\n Div(row){\r\n Div(col-md-12){\r\n Div(table tablez){\r\n Div(table__row){\r\n Div(table__cell table__cell_10){APLA Wallet Number}\r\n Div(table__cell table__cell_10){Address(#key_id#)}\r\n }\r\n Div(table__row){\r\n Div(table__cell table__cell_10){Number of APLA Tokens to buy}\r\n Div(table__cell table__cell_10){}\r\n }\r\n Div(table__row){\r\n Div(table__cell table__cell_10 tborder){Payment means}\r\n Div(table__cell table__cell_10 tborder){\r\n Div(Class: text-normal, Body: BTC: #w_wallet_btc#)\r\n Div(Class: text-normal, Body: ETH: #w_wallet_eth#)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }.Style(\r\n .row-flex {\r\n display: flex;\r\n flex-flow: row wrap;\r\n }\r\n .table {\r\n display: table;\r\n border: solid 1px #000000;\r\n }\r\n .tablez {\r\n border: solid 1px #000000;\r\n }\r\n .table .table__head {\r\n display: table-header-group;\r\n background: blue;\r\n color: #fff;\r\n }\r\n .table .table__head .table__cell {\r\n font-size: 15px;\r\n color: #000000;\r\n background: #B7B7B7;\r\n }\r\n .table > div:not(.table__body) {\r\n display: table-row-group;\r\n }\r\n .table .table__body:last-child .table__row:last-child .table__cell {\r\n border-bottom: none;\r\n }\r\n .table .table__row {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n }\r\n .table .table__row:nth-child(2n) {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n border-left: solid 1px red;\r\n }\r\n .table .table__row .table__cell {\r\n border-bottom: solid 1px #000000;\r\n }\r\n .table .table__cell {\r\n display: table-cell;\r\n padding: 8px 10px;\r\n font-size: 14px;\r\n color: #000000;\r\n border-right: solid 1px #000000;\r\n }\r\n .tborder {\r\n border-bottom: 0!important;\r\n }\r\n .table .table__cell:last-child {\r\n border-right: none;\r\n }\r\n .table .table__cell.table__cell_collapse {\r\n width: 1px;\r\n }\r\n .table .table__cell.table__cell_10 {\r\n width: 10%;\r\n }\r\n .table .table__cell.table__cell_20 {\r\n width: 20%;\r\n }\r\n .table .table__cell.table__cell_25 {\r\n width: 25%;\r\n }\r\n .table .table__cell.table__cell_30 {\r\n width: 30%;\r\n }\r\n .table .table__cell.table__cell_40 {\r\n width: 40%;\r\n }\r\n .table .table__cell.table__cell_50 {\r\n width: 50%;\r\n }\r\n .table .table__cell.table__cell_60 {\r\n width: 60%;\r\n }\r\n .table .table__cell.table__cell_70 {\r\n width: 70%;\r\n }\r\n .table .table__cell.table__cell_80 {\r\n width: 80%;\r\n }\r\n .table .table__cell.table__cell_18 {\r\n width: 18%;\r\n }\r\n .table .table__cell.table__cell_90 {\r\n width: 90%;\r\n }\r\n .table .table__cell.table__cell_stretch {\r\n width: 100%;\r\n }\r\n )\r\n Div(Class: h4, Body: We hereby acknowledge the receipt of and agree with the Standard Terms & Conditions of Sale. )\r\n Div(){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"closed\").Vars(note)\r\n If(#note_closed# == 0){\r\n Button(Body: $@1readed$, Class: btn btn-primary pull-right, Page: default_page, Contract: NotificationsClose, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n }\r\n}.Else{\r\n Div(list-group-item text-center h4 ml mr mt-lg){\r\n $@1wallet$ $@1not_found$\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "ts_buyer_contract", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1ts_wallets).Where({key_id_buyer:#key_id#, key_id_signer:0, rejected_at:0}).Vars(unconfirmed_wallet)\r\nIf(#unconfirmed_wallet_id#>0){\r\n Div(list-group-item mt-lg mb-lg ml-lg mr-lg){\r\n Div(Class: h3 text-bold m0 text-center, Body: APL Tokens)\r\n Div(Class: h3 text-bold m0 text-center, Body: Standard Terms and Conditions of Sale)\r\n\r\n Div(Class: h4 mt-xl text-bold, Body: 1. Introduction)\r\n Div(Class: h4, Body: The present standard terms and conditions of sale (T&Cs) govern the relationship between the Seller and Buyer in connection with the sale and purchase of the APL Tokens as per the EGAAS S.A. letter to the Apla Users as of 1st of November 2018.).Style(padding-right: 60px!important;)\r\n Div(Class: h4 mt-xl text-bold, Body: Glossary of Terms)\r\n\r\n Div(){\r\n Div(Class: h4, Body: Strong(Body: 1.1) Unless the context requires otherwise, the following terms of this Article 1 shall be used in this Agreement:)\r\n Div(Class: h4, Body: Strong(Body: APL Wallet) means a software application for storing, holding and transferring APL Tokens;)\r\n Div(Class: h4, Body: Strong(Body: APL Tokens) means a digital representation of value generated by the source code of the Apla platform ecosystem that is used by Apla users to pay a license fee for the execution of smart contracts, creation of tables, and adding new columns and rows to them in all Apla ecosystems;)\r\n Div(Class: h4, Body: Strong(Body: Apla Contractual Documentation) means the Terms & Conditions and Apla policies, as amended from time to time, that can be downloaded from Span(Class: text-primary, Body: www.apla.io) website; )\r\n Div(Class: h4, Body: Strong(Body: Apla platform) means a software program for executing smart laws and smart contracts based on the distributed ledger technology, the source code of which is stored at GitHub.com/AplaProject. The program operates on the basis of peer to peer (P2P) architecture that is a system of peer client-side programs installed on users' computers and participating in data exchange via peer to peer (P2P) computer network; )\r\n Div(Class: h4, Body: Strong(Body: Apla Software) means the Apla platform software the source code of which is published at GitHub.com/AplaProject; )\r\n Div(Class: h4, Body: Strong(Body: Buyer) means a legal entity or individual that has signed the Commercial Terms with the Seller; )\r\n Div(Class: h4, Body: Strong(Body: Commercial Terms) means the price, payment, delivery and other terms of sale of APL Tokens indicated in the Seller’s letter to the potential Buyers as of 1st of November 2018;)\r\n Div(Class: h4, Body: Strong(Body: Laws) means the civil law in general, any constitution, legislation, decree, order, instruction, rule, regulation, ordinance, code, directive, by-law, judgment, international treaty or any other legislative or quasi-legislative measure related, in each case, to the respective jurisdiction that may be applicable to any transaction closed or to the circumstances existing as of the respective date and, in each case (if any liability is stipulated by or may arise in accordance with them) including any former provision (that may be statutorily amended or re-enacted from time to time) that was directly or indirectly replaced by such provision;)\r\n Div(Class: h4, Body: Strong(Body: Luxembourg) means the Grand Duchy of Luxembourg;)\r\n Div(Class: h4, Body: Strong(Body: Parties) means both the Seller and Buyer;)\r\n Div(Class: h4, Body: Strong(Body: Party) means either the Seller or Buyer as the context suggests; )\r\n Div(Class: h4, Body: Strong(Body: Public Authority) means any supranational, national, municipal, local or foreign public authority or organisation, or any department, commission, administration, bureau, agency, court or instrumentality, subdivision or any other authority thereof, or any quasi-public or private authority having any regulatory, tax, financial regulation and any other public or quasi-public authority)\r\n Div(Class: h4, Body: Strong(Body: Purchase Order) means an order to purchase APL Tokens submitted by the Buyer to the Seller in accordance with the Commercial Terms; )\r\n Div(Class: h4, Body: Strong(Body: Seller) means Strong(Body: EGAAS S.A.,) a legal entity incorporated under the laws of the Grand Duchy of Luxembourg, registered at RCS Luxembourg under the number B216 352 and having its registered office at L-1273 Luxembourg, 20, rue de Bitbourg; )\r\n Div(Class: h4, Body: Strong(Body: SnapSwap) means SnapSwap International S.A., a legal entity incorporated under the laws of the Grand Duchy of Luxembourg, having its registered office at 59, Boulevard Royal L-2449 Luxembourg and authorised as an electronic money institution by the Ministry of Finance. )\r\n Div(Class: h4, Body: Strong(Body: 1.2 In the context of this Agreement:) )\r\n Div(){\r\n Div(Class: h4, Body: Strong(Body: 1.2.1) A reference to this Agreement shall be interpreted as a reference to this document, including all amendments, supplements, appendices, novations or transfer of rights made from time to time;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.2) A reference to the article, clause, sub-clause or appendix, unless such reference is followed by the name of a particular document, shall be deemed the reference to an article, clause, section or appendix to this Agreement;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.3) A reference to the terms defined in this Agreement includes the singular and plural of those terms and denotes the masculine, feminine or neuter gender, as the context requires;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.4) It is understood that the words “including” and “includes” are followed by the expression “without limitation”, and such expressions shall be without prejudice to the generality of the foregoing;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.5) Headings are for the convenience only and shall not affect the interpretation of this Agreement; and)\r\n Div(Class: h4, Body: Strong(Body: 1.2.6) All terms that are written in capital letters and not defined in clause 1.1 shall have the meaning ascribed to those terms in the text of this Agreement or appendices hereto.)\r\n }.Style(padding-left: 50px!important;)\r\n\r\n Div(Class: h4, Body: Strong(Body: 2 Subject matter) )\r\n Div(Class: h4, Body: Strong(Body: 2.1) Subject to the terms and conditions set forth herein, Seller shall sell and Buyer shall buy the number of APL Tokens indicated in Purchase Order of Buyer to the extent such an order has been accepted by Seller. Seller shall be deemed accepted Purchase Order of Buyer by sending an invoice for making the payment of the purchase price to Buyer in response to the submitted Purchase Order.)\r\n Div(Class: h4, Body: Strong(Body: 2.2) No U.S. Buyers. APL Tokens during the initial sale are not being offered to U.S. persons. U.S. persons are strictly prohibited and restricted from purchasing APL Tokens and Seller is not soliciting purchases by U.S. persons in any way. )\r\n Div(Class: h4, Body: Strong(Body: 2.3) APL Tokens are not intended to be offered for investment purposes. The pure purpose of the legitimate use of APL Tokens is to pay for license fees in connection with the execution of transactions on Apla Platform. )\r\n Div(Class: h4, Body: Strong(Body: 2.4) Buyer acknowledges and agrees that Buyer is not purchasing APL Tokens for purposes of investment, speculation, as some type of arbitrage strategy, for immediate resale or other financial purposes. )\r\n\r\n Div(Class: h4, Body: Strong(Body: 3 Transfer of APL Tokens) )\r\n Div(Class: h4, Body: Strong(Body: 3.1) Buyer shall open APL Wallet in accordance with the rules set forth in the Apla Contractual Documentation and following the KYC (know-your-customer procedure) with SnapSwap. Buyer shall inform Seller about the public key of the opened APL Wallet in Purchase Order.)\r\n Div(Class: h4, Body: Strong(Body: 3.2) Seller shall transfer the number of APL Tokens, indicated in Purchase Order accepted by Seller, to the APL Wallet of Buyer within 2 business days following the receipt of the purchase price from the Buyer. )\r\n \r\n\r\n Div(Class: h4, Body: Strong(Body: 4 Representations and warranties of the Parties))\r\n Div(Class: h4, Body: Strong(Body: 4.1) Seller gives no guarantee and/or warrantee as regards the market value of APL Tokens throughout the term of this T&C and thereafter. )\r\n Div(Class: h4, Body: Strong(Body: 4.2) Buyer is made aware of the potential high volatility of APL Tokens on the market and other risks pretraining to crypto-currencies as further defined in the warning of the CSSF published on Span(Class: text-primary, Body: http://www.cssf.lu/fileadmin/files/Protection_consommateurs/Avertissements/W_virtual_currencies_140318_eng.pdf))\r\n Div(Class: h4, Body: Strong(Body: 4.3) Hereby Buyer gives to Seller the following true, correct and irrevocable representations and warranties that shall be true at the date of submitting Purchase Order to Seller: )\r\n Div(){\r\n Div(){\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.1) Span(Class: underline, Body: Legal Status of Buyer.) Buyer is not undergoing any liquidation and/or bankruptcy procedure.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.2) Span(Class: underline, Body: Powers and Authorities of Buyer.) Buyer has right, power and authority to enter into, execute and deliver these T&Cs, any other documents contemplated hereby and the transaction contemplated hereby and to perform its obligations hereunder and all corporate actions necessary for this has been undertaken by Buyer. The T&Cs are valid and legally binding for Buyer and can be lawfully enforced in accordance with their terms. The signatory of Buyer that has executed the T&Cs was duly granted with the relevant powers.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.3) Span(Class: underline, Body: No Conflict.) The execution of the T&Cs and the fulfilment of obligations by Buyer will not constitute any conflict with (i) the provisions of Buyer’s constituent documents and any other documents regulating Buyer’s status and activities, (ii) any laws, rules or regulations, arbitral awards, court rulings, official orders, resolutions, instructions etc. applicable to Buyer. Buyer obtained all applicable governmental, statutory, regulatory or other consents, licences, authorisations, waivers and exemptions required to enter into these T&Cs and any other documents contemplated hereby and to perform its obligations hereunder.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.4) Span(Class: underline, Body: Finance.) Buyer has and will have its own cash and/or fully available credit lines to fulfil its obligations hereunder.)\r\n }.Style(padding-left: 50px!important;)\r\n Div(Class: h4, Body: Strong(Body: 4.4) Hereby Seller gives to Buyer the following true, correct and irrevocable warranties and representations that shall be valid at the date of accepting Purchase Order:)\r\n Div(){\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.1) Span(Class: underline, Body: Legal Status of Seller.) Seller is a corporation duly established and acting on a legal basis in accordance with the legislation of Luxembourg. Seller is not undergoing any liquidation and/or bankruptcy procedure. )\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.2) Span(Class: underline, Body: Powers and Authorities of Seller.) Seller has right, power and authority to enter into, execute and deliver these T&Cs, any other documents contemplated hereby and the transaction contemplated hereby and to perform its obligations hereunderand all corporate actions necessary for this has been undertaken by Seller. The T&Cs are valid and legally binding for Seller and can be lawfully enforced in accordance with its terms. The signatory of Seller that has executed the T&Cs was duly granted with the relevant powers.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.3) Span(Class: underline, Body: No Conflict.) The execution of the T& and the fulfilment of obligations by Seller will not constitute any conflict with (i) the provisions of Seller’s constituent documents and any other documents regulating the Seller’s status and activities, (ii) any laws, rules or regulations, arbitral awards, court rulings, official orders, resolutions, instructions etc. applicable to Seller. Seller obtained all applicable governmental, statutory, regulatory or other consents, licences, authorisations, waivers and exemptions required to enter into these T&Cs and any other documents contemplated hereby and to perform its obligations hereunder.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.4) Span(Class: underline, Body: Title to APL Tokens.) As of the date of accepting Purchase Order, Seller will have legal and unrestricted title to the APL Tokens being the subject matter of these T&Cs, free from any pledge, lien, any other encumbrances and defects. )\r\n }.Style(padding-left: 50px!important;)\r\n }.Style(\r\n .underline {\r\n text-decoration: underline;\r\n }\r\n .wrap {\r\n padding-right: 8px!important;\r\n }\r\n )\r\n Div(Class: h4, Body: Strong(Body: 4.5) Unless otherwise specifically provided in these T&Cs, in the event that at any time it appears that any of the warranties and representations was not true and correct in any material respect when made, then the Party to whom these warranties and representations were given shall give prompt written notice of any such breach to the other Party and give this default Party the opportunity to eliminate (at the defaulting Party’s own cost and expense) any such breach and the Party to whom these warranties and representations were given shall be required (at the defaulting Party’s own cost and expense) to provide such assistance to the default Party with remedying any such breach as the defaulting party may reasonably request.)\r\n Div(Class: h4, Body: Strong(Body: 5 Liability))\r\n Div(Class: h4, Body: Strong(Body: 5.1 ) The Seller’s liability under these T&Cs may not exceed the amount of the purchase price received by Seller from Buyer for APL Tokens.)\r\n Div(Class: h4, Body: Strong(Body: 5.2) Seller shall in no case be liable for indirect or consequential damages incurred by Buyer. )\r\n Div(Class: h4, Body: Strong(Body: 5.3) None of the Parties shall be liable for a failure to properly perform their duties under these T&Cs if this non-performance or poor performance is resulted from force majeure events. Force majeure event means any event and/or circumstance, which is beyond the reasonable control of, and is not attributable to, the affected party resulting in the affected party being prevented from performing or being delayed in the performance of any of its obligations under the T&Cs. Force majeure event may include, but not limited to, an act of a Public Authority or court of any state, interruption or unavailability of power supplies and telecommunication networks in addition to the acts of God. )\r\n Div(Class: h4, Body: Strong(Body: 6 Entry into Force))\r\n Div(Class: h4, Body: Strong(Body: 6.1) These T&Cs shall come into force on the date when Seller has accepted Purchase Order of Buyer. )\r\n Div(Class: h4, Body: Strong(Body: 7 Termination of agreement))\r\n Div(Class: h4, Body: The agreement between the Parties shall be deemed terminated on the following grounds: )\r\n Div(Class: h4, Body: Strong(Body: 7.1) Buyer has not transferred the purchase price to Seller for APL Tokens indicated in Purchase Order accepted by Seller within 5 business days from the acceptance date. )\r\n Div(Class: h4, Body: Strong(Body: 8 Severability))\r\n Div(Class: h4, Body: If any part of this agreement is recognized invalid, unlawful, or unenforceable, the other part will continue to be valid and enforceable to the fullest extent permitted by applicable Law. The invalid, unlawful, or unenforceable part shall be construed and further negotiated by the parties concerned in a manner compliant with applicable Law and consistent with original intentions of the Parties. )\r\n Div(Class: h4, Body: Strong(Body: 9 Notices))\r\n Div(Class: h4, Body: All notices under this Agreement shall be sent by registered mail or private courier to the following addresses:)\r\n\t\t\t\tDiv(Class: h4, Body: If to Seller: L-1273 Luxembourg, 20, rue de Bitbourg)\r\n\t\t\t\tDiv(Class: h4, Body: If to the Buyer: address of APL Wallet of Buyer)\r\n\t\t\t\tDiv(Class: h4, Body: or to such other addresses as shall be indicated by the Parties hereto. All notices shall be deemed to have been received [7 (seven) calendar] days after posting by registered mail or upon confirmation of receipt if sent by private courier.)\r\n Div(Class: h4, Body: Strong(Body: 10 Dispute Resolution))\r\n Div(Class: h4, Body: All disputes arising out of or in connection with these T&Cs shall be referred to the Arbitration Centre at the Chamber of Commerce and Industry of Luxembourg for final resolution under the Rules of Arbitration established by such Centre by one arbitrator appointed in accordance with those Rules.)\r\n\t\t\t\tDiv(Class: h4, Body: The law applicable to the relations of the Parties under these T&Cs shall be the Law of Luxembourg.)\r\n }.Style(padding-left: 50px!important;)\r\n\r\n\t\tDiv(mt-xl mb-lg){\r\n\t\t\tButton(Body: $@1reject$, Class: btn btn-danger, Page: default_page, Contract: TsBuyerAction, Params: \"Action=reject\")\r\n\t\t\tButton(Body: $@1accept$, Class: btn btn-primary pull-right, Page: default_page, Contract: TsBuyerAction, Params: \"Action=accept\")\r\n\t\t}\r\n\r\n }.Style(\r\n padding-left: 60px!important; \r\n padding-right: 60px!important;\r\n )\r\n}", + "Value": "DBFind(@1ts_wallets).Where({key_id_buyer:#key_id#, key_id_signer:0, rejected_at:0}).Vars(unconfirmed_wallet)\r\nIf(#unconfirmed_wallet_id#>0){\r\n Div(list-group-item mt-lg mb-lg ml-lg mr-lg){\r\n Div(Class: h3 text-bold m0 text-center, Body: APLA Tokens)\r\n Div(Class: h3 text-bold m0 text-center, Body: Standard Terms and Conditions of Sale)\r\n\r\n Div(Class: h4 mt-xl text-bold, Body: 1. Introduction)\r\n Div(Class: h4, Body: The present standard terms and conditions of sale (T&Cs) govern the relationship between the Seller and Buyer in connection with the sale and purchase of the APLA Tokens as per the EGAAS S.A. letter to the Apla Users as of 1st of November 2018.).Style(padding-right: 60px!important;)\r\n Div(Class: h4 mt-xl text-bold, Body: Glossary of Terms)\r\n\r\n Div(){\r\n Div(Class: h4, Body: Strong(Body: 1.1) Unless the context requires otherwise, the following terms of this Article 1 shall be used in this Agreement:)\r\n Div(Class: h4, Body: Strong(Body: APLA Wallet) means a software application for storing, holding and transferring APLA Tokens;)\r\n Div(Class: h4, Body: Strong(Body: APLA Tokens) means a digital representation of value generated by the source code of the Apla platform ecosystem that is used by Apla users to pay a license fee for the execution of smart contracts, creation of tables, and adding new columns and rows to them in all Apla ecosystems;)\r\n Div(Class: h4, Body: Strong(Body: Apla Contractual Documentation) means the Terms & Conditions and Apla policies, as amended from time to time, that can be downloaded from Span(Class: text-primary, Body: www.apla.io) website; )\r\n Div(Class: h4, Body: Strong(Body: Apla platform) means a software program for executing smart laws and smart contracts based on the distributed ledger technology, the source code of which is stored at GitHub.com/AplaProject. The program operates on the basis of peer to peer (P2P) architecture that is a system of peer client-side programs installed on users' computers and participating in data exchange via peer to peer (P2P) computer network; )\r\n Div(Class: h4, Body: Strong(Body: Apla Software) means the Apla platform software the source code of which is published at GitHub.com/AplaProject; )\r\n Div(Class: h4, Body: Strong(Body: Buyer) means a legal entity or individual that has signed the Commercial Terms with the Seller; )\r\n Div(Class: h4, Body: Strong(Body: Commercial Terms) means the price, payment, delivery and other terms of sale of APLA Tokens indicated in the Seller’s letter to the potential Buyers as of 1st of November 2018;)\r\n Div(Class: h4, Body: Strong(Body: Laws) means the civil law in general, any constitution, legislation, decree, order, instruction, rule, regulation, ordinance, code, directive, by-law, judgment, international treaty or any other legislative or quasi-legislative measure related, in each case, to the respective jurisdiction that may be applicable to any transaction closed or to the circumstances existing as of the respective date and, in each case (if any liability is stipulated by or may arise in accordance with them) including any former provision (that may be statutorily amended or re-enacted from time to time) that was directly or indirectly replaced by such provision;)\r\n Div(Class: h4, Body: Strong(Body: Luxembourg) means the Grand Duchy of Luxembourg;)\r\n Div(Class: h4, Body: Strong(Body: Parties) means both the Seller and Buyer;)\r\n Div(Class: h4, Body: Strong(Body: Party) means either the Seller or Buyer as the context suggests; )\r\n Div(Class: h4, Body: Strong(Body: Public Authority) means any supranational, national, municipal, local or foreign public authority or organisation, or any department, commission, administration, bureau, agency, court or instrumentality, subdivision or any other authority thereof, or any quasi-public or private authority having any regulatory, tax, financial regulation and any other public or quasi-public authority)\r\n Div(Class: h4, Body: Strong(Body: Purchase Order) means an order to purchase APLA Tokens submitted by the Buyer to the Seller in accordance with the Commercial Terms; )\r\n Div(Class: h4, Body: Strong(Body: Seller) means Strong(Body: EGAAS S.A.,) a legal entity incorporated under the laws of the Grand Duchy of Luxembourg, registered at RCS Luxembourg under the number B216 352 and having its registered office at L-1273 Luxembourg, 20, rue de Bitbourg; )\r\n Div(Class: h4, Body: Strong(Body: SnapSwap) means SnapSwap International S.A., a legal entity incorporated under the laws of the Grand Duchy of Luxembourg, having its registered office at 59, Boulevard Royal L-2449 Luxembourg and authorised as an electronic money institution by the Ministry of Finance. )\r\n Div(Class: h4, Body: Strong(Body: 1.2 In the context of this Agreement:) )\r\n Div(){\r\n Div(Class: h4, Body: Strong(Body: 1.2.1) A reference to this Agreement shall be interpreted as a reference to this document, including all amendments, supplements, appendices, novations or transfer of rights made from time to time;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.2) A reference to the article, clause, sub-clause or appendix, unless such reference is followed by the name of a particular document, shall be deemed the reference to an article, clause, section or appendix to this Agreement;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.3) A reference to the terms defined in this Agreement includes the singular and plural of those terms and denotes the masculine, feminine or neuter gender, as the context requires;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.4) It is understood that the words “including” and “includes” are followed by the expression “without limitation”, and such expressions shall be without prejudice to the generality of the foregoing;)\r\n Div(Class: h4, Body: Strong(Body: 1.2.5) Headings are for the convenience only and shall not affect the interpretation of this Agreement; and)\r\n Div(Class: h4, Body: Strong(Body: 1.2.6) All terms that are written in capital letters and not defined in clause 1.1 shall have the meaning ascribed to those terms in the text of this Agreement or appendices hereto.)\r\n }.Style(padding-left: 50px!important;)\r\n\r\n Div(Class: h4, Body: Strong(Body: 2 Subject matter) )\r\n Div(Class: h4, Body: Strong(Body: 2.1) Subject to the terms and conditions set forth herein, Seller shall sell and Buyer shall buy the number of APLA Tokens indicated in Purchase Order of Buyer to the extent such an order has been accepted by Seller. Seller shall be deemed accepted Purchase Order of Buyer by sending an invoice for making the payment of the purchase price to Buyer in response to the submitted Purchase Order.)\r\n Div(Class: h4, Body: Strong(Body: 2.2) No U.S. Buyers. APLA Tokens during the initial sale are not being offered to U.S. persons. U.S. persons are strictly prohibited and restricted from purchasing APLA Tokens and Seller is not soliciting purchases by U.S. persons in any way. )\r\n Div(Class: h4, Body: Strong(Body: 2.3) APLA Tokens are not intended to be offered for investment purposes. The pure purpose of the legitimate use of APLA Tokens is to pay for license fees in connection with the execution of transactions on Apla Platform. )\r\n Div(Class: h4, Body: Strong(Body: 2.4) Buyer acknowledges and agrees that Buyer is not purchasing APLA Tokens for purposes of investment, speculation, as some type of arbitrage strategy, for immediate resale or other financial purposes. )\r\n\r\n Div(Class: h4, Body: Strong(Body: 3 Transfer of APLA Tokens) )\r\n Div(Class: h4, Body: Strong(Body: 3.1) Buyer shall open APLA Wallet in accordance with the rules set forth in the Apla Contractual Documentation and following the KYC (know-your-customer procedure) with SnapSwap. Buyer shall inform Seller about the public key of the opened APLA Wallet in Purchase Order.)\r\n Div(Class: h4, Body: Strong(Body: 3.2) Seller shall transfer the number of APLA Tokens, indicated in Purchase Order accepted by Seller, to the APLA Wallet of Buyer within 2 business days following the receipt of the purchase price from the Buyer. )\r\n \r\n\r\n Div(Class: h4, Body: Strong(Body: 4 Representations and warranties of the Parties))\r\n Div(Class: h4, Body: Strong(Body: 4.1) Seller gives no guarantee and/or warrantee as regards the market value of APLA Tokens throughout the term of this T&C and thereafter. )\r\n Div(Class: h4, Body: Strong(Body: 4.2) Buyer is made aware of the potential high volatility of APLA Tokens on the market and other risks pretraining to crypto-currencies as further defined in the warning of the CSSF published on Span(Class: text-primary, Body: http://www.cssf.lu/fileadmin/files/Protection_consommateurs/Avertissements/W_virtual_currencies_140318_eng.pdf))\r\n Div(Class: h4, Body: Strong(Body: 4.3) Hereby Buyer gives to Seller the following true, correct and irrevocable representations and warranties that shall be true at the date of submitting Purchase Order to Seller: )\r\n Div(){\r\n Div(){\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.1) Span(Class: underline, Body: Legal Status of Buyer.) Buyer is not undergoing any liquidation and/or bankruptcy procedure.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.2) Span(Class: underline, Body: Powers and Authorities of Buyer.) Buyer has right, power and authority to enter into, execute and deliver these T&Cs, any other documents contemplated hereby and the transaction contemplated hereby and to perform its obligations hereunder and all corporate actions necessary for this has been undertaken by Buyer. The T&Cs are valid and legally binding for Buyer and can be lawfully enforced in accordance with their terms. The signatory of Buyer that has executed the T&Cs was duly granted with the relevant powers.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.3) Span(Class: underline, Body: No Conflict.) The execution of the T&Cs and the fulfilment of obligations by Buyer will not constitute any conflict with (i) the provisions of Buyer’s constituent documents and any other documents regulating Buyer’s status and activities, (ii) any laws, rules or regulations, arbitral awards, court rulings, official orders, resolutions, instructions etc. applicable to Buyer. Buyer obtained all applicable governmental, statutory, regulatory or other consents, licences, authorisations, waivers and exemptions required to enter into these T&Cs and any other documents contemplated hereby and to perform its obligations hereunder.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.3.4) Span(Class: underline, Body: Finance.) Buyer has and will have its own cash and/or fully available credit lines to fulfil its obligations hereunder.)\r\n }.Style(padding-left: 50px!important;)\r\n Div(Class: h4, Body: Strong(Body: 4.4) Hereby Seller gives to Buyer the following true, correct and irrevocable warranties and representations that shall be valid at the date of accepting Purchase Order:)\r\n Div(){\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.1) Span(Class: underline, Body: Legal Status of Seller.) Seller is a corporation duly established and acting on a legal basis in accordance with the legislation of Luxembourg. Seller is not undergoing any liquidation and/or bankruptcy procedure. )\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.2) Span(Class: underline, Body: Powers and Authorities of Seller.) Seller has right, power and authority to enter into, execute and deliver these T&Cs, any other documents contemplated hereby and the transaction contemplated hereby and to perform its obligations hereunderand all corporate actions necessary for this has been undertaken by Seller. The T&Cs are valid and legally binding for Seller and can be lawfully enforced in accordance with its terms. The signatory of Seller that has executed the T&Cs was duly granted with the relevant powers.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.3) Span(Class: underline, Body: No Conflict.) The execution of the T& and the fulfilment of obligations by Seller will not constitute any conflict with (i) the provisions of Seller’s constituent documents and any other documents regulating the Seller’s status and activities, (ii) any laws, rules or regulations, arbitral awards, court rulings, official orders, resolutions, instructions etc. applicable to Seller. Seller obtained all applicable governmental, statutory, regulatory or other consents, licences, authorisations, waivers and exemptions required to enter into these T&Cs and any other documents contemplated hereby and to perform its obligations hereunder.)\r\n Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.4) Span(Class: underline, Body: Title to APLA Tokens.) As of the date of accepting Purchase Order, Seller will have legal and unrestricted title to the APLA Tokens being the subject matter of these T&Cs, free from any pledge, lien, any other encumbrances and defects. )\r\n }.Style(padding-left: 50px!important;)\r\n }.Style(\r\n .underline {\r\n text-decoration: underline;\r\n }\r\n .wrap {\r\n padding-right: 8px!important;\r\n }\r\n )\r\n Div(Class: h4, Body: Strong(Body: 4.5) Unless otherwise specifically provided in these T&Cs, in the event that at any time it appears that any of the warranties and representations was not true and correct in any material respect when made, then the Party to whom these warranties and representations were given shall give prompt written notice of any such breach to the other Party and give this default Party the opportunity to eliminate (at the defaulting Party’s own cost and expense) any such breach and the Party to whom these warranties and representations were given shall be required (at the defaulting Party’s own cost and expense) to provide such assistance to the default Party with remedying any such breach as the defaulting party may reasonably request.)\r\n Div(Class: h4, Body: Strong(Body: 5 Liability))\r\n Div(Class: h4, Body: Strong(Body: 5.1 ) The Seller’s liability under these T&Cs may not exceed the amount of the purchase price received by Seller from Buyer for APLA Tokens.)\r\n Div(Class: h4, Body: Strong(Body: 5.2) Seller shall in no case be liable for indirect or consequential damages incurred by Buyer. )\r\n Div(Class: h4, Body: Strong(Body: 5.3) None of the Parties shall be liable for a failure to properly perform their duties under these T&Cs if this non-performance or poor performance is resulted from force majeure events. Force majeure event means any event and/or circumstance, which is beyond the reasonable control of, and is not attributable to, the affected party resulting in the affected party being prevented from performing or being delayed in the performance of any of its obligations under the T&Cs. Force majeure event may include, but not limited to, an act of a Public Authority or court of any state, interruption or unavailability of power supplies and telecommunication networks in addition to the acts of God. )\r\n Div(Class: h4, Body: Strong(Body: 6 Entry into Force))\r\n Div(Class: h4, Body: Strong(Body: 6.1) These T&Cs shall come into force on the date when Seller has accepted Purchase Order of Buyer. )\r\n Div(Class: h4, Body: Strong(Body: 7 Termination of agreement))\r\n Div(Class: h4, Body: The agreement between the Parties shall be deemed terminated on the following grounds: )\r\n Div(Class: h4, Body: Strong(Body: 7.1) Buyer has not transferred the purchase price to Seller for APLA Tokens indicated in Purchase Order accepted by Seller within 5 business days from the acceptance date. )\r\n Div(Class: h4, Body: Strong(Body: 8 Severability))\r\n Div(Class: h4, Body: If any part of this agreement is recognized invalid, unlawful, or unenforceable, the other part will continue to be valid and enforceable to the fullest extent permitted by applicable Law. The invalid, unlawful, or unenforceable part shall be construed and further negotiated by the parties concerned in a manner compliant with applicable Law and consistent with original intentions of the Parties. )\r\n Div(Class: h4, Body: Strong(Body: 9 Notices))\r\n Div(Class: h4, Body: All notices under this Agreement shall be sent by registered mail or private courier to the following addresses:)\r\n Div(Class: h4, Body: If to Seller: L-1273 Luxembourg, 20, rue de Bitbourg)\r\n Div(Class: h4, Body: If to the Buyer: address of APLA Wallet of Buyer)\r\n Div(Class: h4, Body: or to such other addresses as shall be indicated by the Parties hereto. All notices shall be deemed to have been received [7 (seven) calendar] days after posting by registered mail or upon confirmation of receipt if sent by private courier.)\r\n Div(Class: h4, Body: Strong(Body: 10 Dispute Resolution))\r\n Div(Class: h4, Body: All disputes arising out of or in connection with these T&Cs shall be referred to the Arbitration Centre at the Chamber of Commerce and Industry of Luxembourg for final resolution under the Rules of Arbitration established by such Centre by one arbitrator appointed in accordance with those Rules.)\r\n Div(Class: h4, Body: The law applicable to the relations of the Parties under these T&Cs shall be the Law of Luxembourg.)\r\n }.Style(padding-left: 50px!important;)\r\n\r\n Div(mt-xl mb-lg){\r\n Button(Body: $@1reject$, Class: btn btn-danger, Page: default_page, Contract: TsBuyerAction, Params: \"Action=reject\")\r\n Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: default_page, Contract: TsBuyerAction, Params: \"Action=accept\")\r\n }\r\n\r\n }.Style(\r\n padding-left: 60px!important; \r\n padding-right: 60px!important;\r\n )\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "ts_commercial_terms", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Div(ml mr){\r\n Div(Class: h5 text-bold, Body: 1. Price, sale rounds and extra terms:)\r\n Div(row){\r\n Div(col-md-12){\r\n Div(table tablez){\r\n Div(table__head){\r\n Div(table__row){\r\n Div(table__cell table__cell_20){Round}\r\n Div(table__cell table__cell_10){Volume of APL Tokens}\r\n Div(table__cell table__cell_10){Price, EUR, excl. VAT}\r\n Div(table__cell table__cell_10){Discount}\r\n Div(table__cell){Extra terms}\r\n }\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 1 (01.11.18-20.12.18)}\r\n Div(table__cell){15 100 000}\r\n Div(table__cell){5}\r\n Div(table__cell){20%}\r\n Div(table__cell){25% of unsold APL tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers purchased the tokens during Round 1. \r\n This option becomes available only if the conditions for free distribution of APL Tokens to the buyers participating to the Rounds 2-7 have been fulfilled.\r\n If you acquire APL Tokens for the amount of at least 125,000 EUR, you will be entitled to additional benefits. Please reach out to us via email luxembourg@apla.io to get more details. \r\n }\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 2(20.12.18-01.02.19)}\r\n Div(table__cell){1 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){75% of unsold APL tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers participating to the respective round. This option becomes available only if at least 40% of APL tokens have been sold out during this round. In all other cases, the unsold tokens remain the property of the current owner.\r\n }\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 4 (01.03.19-01.04.19)}\r\n Div(table__cell){5 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){}\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 5 (01.04.19-01.05.19)}\r\n Div(table__cell){7 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){}\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 6 (01.05.19-01.06.19)}\r\n Div(table__cell){12 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){}\r\n }\r\n Div(table__row){\r\n Div(table__cell tborder){Round 7 (01.06.19-01.07.19)}\r\n Div(table__cell tborder){16 000 000}\r\n Div(table__cell tborder){5}\r\n Div(table__cell tborder){0%}\r\n Div(table__cell tborder){}\r\n }\r\n }\r\n }\r\n }\r\n Div(Class: h5 m0, Body: Each round starts at 11:01 am and ends at 11 am of the designated date)\r\n\r\n Div(row mt-xl){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 2. Delivery of APL Tokens)\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: The number of APL tokens you have paid for, will be delivered to your APL Wallet within 2 business days after EGAAS S.A. have received the payment of the purchase price.)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 3. Payment currency)\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: EUR/BTC/ETH)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 4. Payment terms )\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: If you make a payment in EUR, you will need to make a transfer of the purchase price from your EUR account with SnapSwap to the EUR account of EGAAS S.A. with the same financial institution. Please indicate in the payment order your APL Wallet number for the delivery of APL Tokens.)\r\n Div(Class: h5, Body: If you make a payment in BTC or ETH, the Bitstamp exchange rate of BTC/EUR or ETH/EUR shall be used to calculate the EUR equivalent. The Bitstamp rate shall be defined on the day EGAAS S.A. have received BTC or ETH into its wallet. )\r\n Div(Class: h5, Body: The details of the BTC or ETH wallets of EGAAS S.A. will be communicated to you for each transaction individually after we have received your purchase order. )\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 5. Legal terms)\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: Standard Terms & Conditions of Sale enclosed to these commercial terms. )\r\n }\r\n }\r\n\r\n Div(row mt-xl pull-right){\r\n Div(col-sm-12){\r\n Button(Class: btn btn-default, Page: default_page, Body: Back)\r\n }\r\n }\r\n}.Style(\r\n .row-flex {\r\n display: flex;\r\n flex-flow: row wrap;\r\n }\r\n .table {\r\n display: table;\r\n border: solid 1px #000000;\r\n }\r\n .tablez {\r\n border: solid 1px #000000;\r\n }\r\n .table .table__head {\r\n display: table-header-group;\r\n background: blue;\r\n color: #fff;\r\n }\r\n .table .table__head .table__cell {\r\n font-size: 15px;\r\n color: #000000;\r\n background: #B7B7B7;\r\n }\r\n .table > div:not(.table__body) {\r\n display: table-row-group;\r\n }\r\n .table .table__body:last-child .table__row:last-child .table__cell {\r\n border-bottom: none;\r\n }\r\n .table .table__row {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n }\r\n .table .table__row:nth-child(2n) {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n border-left: solid 1px red;\r\n }\r\n .table .table__row .table__cell {\r\n border-bottom: solid 1px #000000;\r\n }\r\n .table .table__cell {\r\n display: table-cell;\r\n padding: 8px 10px;\r\n font-size: 14px;\r\n color: #000000;\r\n border-right: solid 1px #000000;\r\n }\r\n .tborder {\r\n border-bottom: 0!important;\r\n }\r\n .table .table__cell:last-child {\r\n border-right: none;\r\n }\r\n .table .table__cell.table__cell_collapse {\r\n width: 1px;\r\n }\r\n .table .table__cell.table__cell_10 {\r\n width: 10%;\r\n }\r\n .table .table__cell.table__cell_20 {\r\n width: 20%;\r\n }\r\n .table .table__cell.table__cell_25 {\r\n width: 25%;\r\n }\r\n .table .table__cell.table__cell_30 {\r\n width: 30%;\r\n }\r\n .table .table__cell.table__cell_40 {\r\n width: 40%;\r\n }\r\n .table .table__cell.table__cell_50 {\r\n width: 50%;\r\n }\r\n .table .table__cell.table__cell_60 {\r\n width: 60%;\r\n }\r\n .table .table__cell.table__cell_70 {\r\n width: 70%;\r\n }\r\n .table .table__cell.table__cell_80 {\r\n width: 80%;\r\n }\r\n .table .table__cell.table__cell_18 {\r\n width: 18%;\r\n }\r\n .table .table__cell.table__cell_90 {\r\n width: 90%;\r\n }\r\n .table .table__cell.table__cell_stretch {\r\n width: 100%;\r\n }\r\n)", + "Value": "Div(ml mr){\r\n Div(Class: h5 text-bold, Body: 1. Price, sale rounds and extra terms:)\r\n Div(row){\r\n Div(col-md-12){\r\n Div(table tablez){\r\n Div(table__head){\r\n Div(table__row){\r\n Div(table__cell table__cell_20){Round}\r\n Div(table__cell table__cell_10){Volume of APLA Tokens}\r\n Div(table__cell table__cell_10){Price, EUR, excl. VAT}\r\n Div(table__cell table__cell_10){Discount}\r\n Div(table__cell){Extra terms}\r\n }\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 1 (01.11.18-20.12.18)}\r\n Div(table__cell){15 100 000}\r\n Div(table__cell){5}\r\n Div(table__cell){20%}\r\n Div(table__cell){25% of unsold APLA tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers purchased the tokens during Round 1. \r\n This option becomes available only if the conditions for free distribution of APLA Tokens to the buyers participating to the Rounds 2-7 have been fulfilled.\r\n If you acquire APLA Tokens for the amount of at least 125,000 EUR, you will be entitled to additional benefits. Please reach out to us via email luxembourg@apla.io to get more details. \r\n }\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 2(20.12.18-01.02.19)}\r\n Div(table__cell){1 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){75% of unsold APLA tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers participating to the respective round. This option becomes available only if at least 40% of APLA tokens have been sold out during this round. In all other cases, the unsold tokens remain the property of the current owner.\r\n }\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 4 (01.03.19-01.04.19)}\r\n Div(table__cell){5 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){}\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 5 (01.04.19-01.05.19)}\r\n Div(table__cell){7 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){}\r\n }\r\n Div(table__row){\r\n Div(table__cell){Round 6 (01.05.19-01.06.19)}\r\n Div(table__cell){12 000 000}\r\n Div(table__cell){5}\r\n Div(table__cell){0%}\r\n Div(table__cell tborder){}\r\n }\r\n Div(table__row){\r\n Div(table__cell tborder){Round 7 (01.06.19-01.07.19)}\r\n Div(table__cell tborder){16 000 000}\r\n Div(table__cell tborder){5}\r\n Div(table__cell tborder){0%}\r\n Div(table__cell tborder){}\r\n }\r\n }\r\n }\r\n }\r\n Div(Class: h5 m0, Body: Each round starts at 11:01 am and ends at 11 am of the designated date)\r\n\r\n Div(row mt-xl){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 2. Delivery of APLA Tokens)\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: The number of APLA tokens you have paid for, will be delivered to your APLA Wallet within 2 business days after EGAAS S.A. have received the payment of the purchase price.)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 3. Payment currency)\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: EUR/BTC/ETH)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 4. Payment terms )\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: If you make a payment in EUR, you will need to make a transfer of the purchase price from your EUR account with SnapSwap to the EUR account of EGAAS S.A. with the same financial institution. Please indicate in the payment order your APLA Wallet number for the delivery of APLA Tokens.)\r\n Div(Class: h5, Body: If you make a payment in BTC or ETH, the Bitstamp exchange rate of BTC/EUR or ETH/EUR shall be used to calculate the EUR equivalent. The Bitstamp rate shall be defined on the day EGAAS S.A. have received BTC or ETH into its wallet. )\r\n Div(Class: h5, Body: The details of the BTC or ETH wallets of EGAAS S.A. will be communicated to you for each transaction individually after we have received your purchase order. )\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3){\r\n Div(Class: h5 text-bold, Body: 5. Legal terms)\r\n }\r\n Div(col-sm-9){\r\n Div(Class: h5, Body: Standard Terms & Conditions of Sale enclosed to these commercial terms. )\r\n }\r\n }\r\n\r\n Div(row mt-xl pull-right){\r\n Div(col-sm-12){\r\n Button(Class: btn btn-default, Page: default_page, Body: Back)\r\n }\r\n }\r\n}.Style(\r\n .row-flex {\r\n display: flex;\r\n flex-flow: row wrap;\r\n }\r\n .table {\r\n display: table;\r\n border: solid 1px #000000;\r\n }\r\n .tablez {\r\n border: solid 1px #000000;\r\n }\r\n .table .table__head {\r\n display: table-header-group;\r\n background: blue;\r\n color: #fff;\r\n }\r\n .table .table__head .table__cell {\r\n font-size: 15px;\r\n color: #000000;\r\n background: #B7B7B7;\r\n }\r\n .table > div:not(.table__body) {\r\n display: table-row-group;\r\n }\r\n .table .table__body:last-child .table__row:last-child .table__cell {\r\n border-bottom: none;\r\n }\r\n .table .table__row {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n }\r\n .table .table__row:nth-child(2n) {\r\n display: table-row;\r\n flex-direction: row;\r\n flex-wrap: no-wrap;\r\n border-left: solid 1px red;\r\n }\r\n .table .table__row .table__cell {\r\n border-bottom: solid 1px #000000;\r\n }\r\n .table .table__cell {\r\n display: table-cell;\r\n padding: 8px 10px;\r\n font-size: 14px;\r\n color: #000000;\r\n border-right: solid 1px #000000;\r\n }\r\n .tborder {\r\n border-bottom: 0!important;\r\n }\r\n .table .table__cell:last-child {\r\n border-right: none;\r\n }\r\n .table .table__cell.table__cell_collapse {\r\n width: 1px;\r\n }\r\n .table .table__cell.table__cell_10 {\r\n width: 10%;\r\n }\r\n .table .table__cell.table__cell_20 {\r\n width: 20%;\r\n }\r\n .table .table__cell.table__cell_25 {\r\n width: 25%;\r\n }\r\n .table .table__cell.table__cell_30 {\r\n width: 30%;\r\n }\r\n .table .table__cell.table__cell_40 {\r\n width: 40%;\r\n }\r\n .table .table__cell.table__cell_50 {\r\n width: 50%;\r\n }\r\n .table .table__cell.table__cell_60 {\r\n width: 60%;\r\n }\r\n .table .table__cell.table__cell_70 {\r\n width: 70%;\r\n }\r\n .table .table__cell.table__cell_80 {\r\n width: 80%;\r\n }\r\n .table .table__cell.table__cell_18 {\r\n width: 18%;\r\n }\r\n .table .table__cell.table__cell_90 {\r\n width: 90%;\r\n }\r\n .table .table__cell.table__cell_stretch {\r\n width: 100%;\r\n }\r\n)", "Menu": "default_menu", "Type": "pages" }, { "Name": "ts_consensus_contract", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nSetVar(row,\"row mt-sm\").(col_left,\"col-sm-4 text-right\").(col_right,\"col-sm-8 text-left\")\r\nSetVar(isStartProcessing,0)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->wallet_id,date_start_processing,notification->type,processing_info->member_id\").Vars(note)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}\r\n\r\nSetVar(this_page, ts_consensus_contract)\r\nSetTitle($@1key_id_investor$)\r\nDiv(content-wrapper){\r\n Div(row mt-sm){\r\n Div(col-lg-10 col-lg-offset-1){\r\n Form(panel panel-primary){\r\n DBFind(@1ts_wallets).Where({id:#note_page_params_wallet_id#, rejected_at:0}).Vars(wallet)\r\n If(#wallet_id#>0){\r\n Div(panel-body){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_investor$\r\n }\r\n Div(#col_right#){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#wallet_key_id_buyer#\"){\r\n Address(#wallet_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1signed_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#wallet_signed_at#, \"YYYY-MM-DD HH:MI:SS\")\r\n }\r\n }\r\n }\r\n Div(panel-footer){\r\n If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){\r\n Button(Body: $@1reject$, Class: btn btn-default, Page: default_page, Contract: TsConsensusAction, Params: \"Action=reject,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#\")\r\n Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: default_page, Contract: TsConsensusAction, Params: \"Action=accept,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#\")\r\n }.ElseIf(#isStartProcessing#==1){\r\n Div(text-muted text-center){\r\n $@1notice_processing_started_another_member$\r\n }\r\n }.ElseIf(#isStartProcessing#==0){\r\n Div(text-center){\r\n Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n\r\n }\r\n }.Else{\r\n Div(panel-body){\r\n wallet $@1not_found$\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nSetVar(isStartProcessing,0)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->wallet_id,date_start_processing,notification->type,processing_info->member_id,closed\").Vars(note)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}\r\n\r\nSetVar(this_page, ts_consensus_contract)\r\nDiv(content-wrapper){\r\n Form(){\r\n DBFind(@1ts_wallets).Where({id:#note_page_params_wallet_id#, rejected_at:0}).Vars(wallet)\r\n If(#wallet_id#>0){\r\n Div(list-group-item){\r\n Div(text-center text-bold h4 m0){\r\n LangRes(@1key_id_investor)\r\n }\r\n }\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1key_id_investor$\r\n }\r\n Div(col-sm-9 text-left){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#wallet_key_id_buyer#\"){\r\n Address(#wallet_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1signed_at$\r\n }\r\n Div(col-sm-9 text-left){\r\n DateTime(#wallet_signed_at#, \"YYYY-MM-DD HH:MI:SS\")\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1pub_key$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_pub_buyer#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1ts_wallet_btc$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_wallet_btc#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1ts_wallet_eth$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_wallet_eth#)\r\n }\r\n }\r\n }\r\n If(#note_closed# == 0){\r\n Div(list-group-item){\r\n If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){\r\n Button(Body: $@1reject$, Class: btn btn-default, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: TsConsensusAction, Params: \"Action=reject,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#\")\r\n Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: TsConsensusAction, Params: \"Action=accept,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#\")\r\n }.ElseIf(#isStartProcessing#==1){\r\n Div(text-muted text-center){\r\n $@1notice_processing_started_another_member$\r\n }\r\n }.ElseIf(#isStartProcessing#==0){\r\n Div(text-right){\r\n Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(list-group-item text-center h4){\r\n $@1wallet$ $@1not_found$\r\n }\r\n }\r\n }\r\n}", + "Menu": "default_menu", + "Type": "pages" + }, + { + "Name": "ts_free_wallet_add", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "Form(){\r\n Div(row){\r\n Div(col-md-2 mt-lg text-right){\r\n Label(For: wallet_btc){\r\n LangRes(@1ts_wallet_btc)\r\n }\r\n }\r\n Div(col-md-10){\r\n Input(Name: wallet_btc, Type: textarea).Validate(minLength:27, maxLength:34)\r\n InputErr(Name: wallet_btc, minLength: $@1validate_wallet_btc$, maxLength: $@1validate_wallet_btc$)\r\n }\r\n }\r\n Div(row mt){\r\n Div(col-md-2 mt-lg text-right){\r\n Label(For: wallet_eth){\r\n LangRes(@1ts_wallet_eth)\r\n }\r\n }\r\n Div(col-md-10){\r\n Input(Name: wallet_eth, Type: textarea).Validate(minLength:40, maxLength:44)\r\n InputErr(Name: wallet_btc, minLength: $@1validate_wallet_eth$, maxLength: $@1validate_wallet_eth$)\r\n }\r\n }\r\n Button(Body: LangRes(@1add), Class: btn btn-primary pull-right mt, Page: @1ts_free_wallets, Contract: @1TsFreeWalletAdd)\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1ts_free_wallets)\r\n}", + "Menu": "default_menu", + "Type": "pages" + }, + { + "Name": "ts_free_wallets", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "SetVar(this_page, @1ts_free_wallets).(this_table, @1ts_wallets)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1ts_free_wallets$\")\r\nSetVar(admin_role_id, EcosysParam(Name:role_sale_admin))\r\nIf(And(#admin_role_id#>0,#role_id#==#admin_role_id#)){\r\n AddToolButton(Title:$@1ts_free_wallet_add$, Page: @1ts_free_wallet_add, Icon: icon-wallet).Popup(Header: $@1ts_free_wallet_add$, Width: \"50\")\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, {$and: [{\"deleted\":0}, {\"key_id_buyer\":0}, {$or:[{\"wallet_btc\": {$like: #search#}},{\"wallet_eth\": {$like: #search#}}]}]})\r\n}.Else{\r\n SetVar(where, {$and: [{\"deleted\":0}, {\"key_id_buyer\":0}]}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1wallet))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_btc){\r\n Span(#wallet_btc#)\r\n}.Custom(_eth){\r\n Span(#wallet_eth#)\r\n}.Custom(action){\r\n Div(pull-right){\r\n If(#deleted#==0){\r\n Button(Body: Em(Class: fa fa-trash), Class: btn btn-default, Contract: @1TsFreeWalletDelete, Params: \"wallet_id=#id#\", Page: @1ts_free_wallets).Alert(Text: \"$@1sure_want_delete$\", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question)\r\n }\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1id$=id,$@1ts_wallet_btc$=_btc,$@1ts_wallet_eth$=_eth,=action\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1ts_free_wallets$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -95,14 +109,14 @@ { "Name": "ts_notification", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"notification->header,notification->body,id\").Vars(note)\r\n}\r\n\r\nDiv(content-wrapper){\r\n Div(row mt-sm){\r\n Div(col-lg-10 col-lg-offset-1){\r\n Form(panel panel-primary){\r\n DBFind(@1ts_wallets).Where({key_id_signer:{$neq:0}, rejected_at:0}).Vars(wallet)\r\n If(#note_id#>0){\r\n Div(panel-body){\r\n Div(){\r\n #note_notification_header#\r\n }\r\n Div(){\r\n #note_notification_body#\r\n }\r\n }\r\n Div(panel-footer text-center){\r\n Button(Body: $@1readed$, Class: btn btn-primary, Page: @1default_page, Contract: NotificationsClose, Params: \"notific_id=#notific_id#\")\r\n }\r\n }.Else{\r\n Div(panel-body){\r\n Оповещение не найдено\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"notification->type,notification->header,notification->body,id,processing_info->member_id,closed\").Vars(note)\r\n}\r\n\r\nDiv(content-wrapper){\r\n Div(row mt-sm){\r\n Div(col-lg-10 col-lg-offset-1){\r\n Form(panel panel-primary){\r\n DBFind(@1ts_wallets).Where({key_id_signer:{$neq:0}, rejected_at:0}).Vars(wallet)\r\n If(#note_id#>0){\r\n Div(panel-body text-center){\r\n Div(h4 text-bold m0){\r\n #note_notification_header#\r\n }\r\n Div(m0){\r\n #note_notification_body#\r\n }\r\n }\r\n If(#note_closed# == 0){\r\n Div(panel-footer text-right){\r\n If(Or(#note_notification_type#==1,#note_processing_info_member_id# == #key_id#)){\r\n Button(Body: $@1readed$, Class: btn btn-primary, Page: @1default_page, Contract: NotificationsClose, Params: \"notific_id=#notific_id#\")\r\n }.ElseIf(#note_notification_type#==2){\r\n Button(Body: $@1processing$, Class: btn btn-primary, Page: @1ts_notification, PageParams: \"notific_id=#notific_id#\", Contract: NotificationsProcess, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "ts_sales", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1ts_sales).(this_table, @1ts_sales)\r\nInclude(@1pager_header)\r\n\r\nDBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nSetVar(admin_role_id, EcosysParam(Name:role_sale_admin))\r\nSetVar(manager_role_id, EcosysParam(Name:role_sale_manager))\r\nSetVar(seller_role_id, EcosysParam(Name:role_sale_seller))\r\nSetVar(STATUS_MANAGER,1).(STATUS_SELLER,2)\r\n\r\nSetTitle(\"$@1ts_sales$\")\r\nIf(And(#admin_role_id#>0,#role_id#==#admin_role_id#)){\r\n AddToolButton(Title:$@1ts_add_transfer$, Page: @1ts_transfer_admin, Icon: icon-wallet).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, {$or:[{\"key_id_buyer\":#search#},{\"key_id_sale_apl_manager\":#search#}, {\"key_id_sale_apl_admin\":#search#}, {\"key_id_seller\":#search#}]})\r\n}.Else{\r\n SetVar(where, {id:{$gt:0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1key_id))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_btat){\r\n Span(Class: text-muted, Body: DateTime(#buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS))\r\n}.Custom(_cat){\r\n Span(Class: text-muted, Body: DateTime(#created_at#, Format: YYYY-MM-DD HH:MI:SS))\r\n}.Custom(_amount){\r\n Div(text-right){\r\n Span(Class: text-bold, Body: #amount#).Style(margin-right:5px;)\r\n Span(Class: text-bold, Body: AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #currency_type#))\r\n }\r\n Div(text-right){\r\n Span(Class: text-bold, Body: Money(#amount_apl#)).Style(margin-right:5px;)\r\n Span(Class: text-bold, Body: APL)\r\n }\r\n}.Custom(_info){\r\n Button(Class: btn-xs btn-link, Page: @1ts_transfer_view, PageParams: \"Id=#id#\"){\r\n Span(Class: text-bold h5, Body: LangRes(@1information))\r\n }.Popup(Header: $@1information$, Width: 35)\r\n}.Custom(_status){\r\n SetVar(status_class, AppParam(App:#application_id#, Name:ts_statuses_classes, Index:#status#, Ecosystem: #ecosystem_id#))\r\n Div(#status_class#){\r\n AppParam(App:#application_id#, Name:ts_statuses, Index:#status#, Ecosystem: #ecosystem_id#)\r\n }\r\n}.Custom(_action){\r\n If(And(#status#==#STATUS_MANAGER#,#manager_role_id#>0,#role_id#==#manager_role_id#)){\r\n Button(Class: fa fa-play btn btn-primary, Page: @1ts_transfer_manager, PageParams: \"SaleId=#id#\")\r\n }\r\n If(And(#status#==#STATUS_SELLER#,#seller_role_id#>0,#role_id#==#seller_role_id#)){\r\n Button(Class: fa fa-play btn btn-primary, Page: @1ts_transfer_seller, PageParams: \"SaleId=#id#\")\r\n }\r\n}.Custom(_buyer){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#key_id_buyer#\"){\r\n Address(#key_id_buyer#)\r\n }\r\n Div(Class:text-muted m0 h6, Body:#key_id_buyer#)\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1id$=id,$@1key_id_investor$=_buyer,$@1information$=_info,$@1investor_funds_transfer_date$=_btat,$@1created_at$=_cat,$@1status$=_status,=_action,=_amount\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1sales$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1ts_sales).(this_table, @1ts_sales)\r\nInclude(@1pager_header)\r\n\r\nDBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nSetVar(admin_role_id, EcosysParam(Name:role_sale_admin))\r\nSetVar(manager_role_id, EcosysParam(Name:role_sale_manager))\r\nSetVar(seller_role_id, EcosysParam(Name:role_sale_seller))\r\nSetVar(STATUS_MANAGER,1).(STATUS_SELLER,2)\r\n\r\nSetTitle(\"$@1ts_sales$\")\r\nIf(And(#admin_role_id#>0,#role_id#==#admin_role_id#)){\r\n AddToolButton(Title:$@1ts_add_transfer$, Page: @1ts_transfer_admin, Icon: icon-wallet).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, {id:#search#})\r\n}.Else{\r\n SetVar(where, {id:{$gt:0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1key_id))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_id){\r\n Span(#id#)\r\n SetVar(w_wallet_btc,).(w_wallet_eth,).(w_pub_short_buyer,)\r\n DBFind(@1ts_wallets).Where({\"key_id_buyer\":#key_id_buyer#}).Vars(w)\r\n}.Custom(_btat){\r\n Span(Class: text-muted, Body: DateTime(#buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS))\r\n}.Custom(_cat){\r\n Span(Class: text-muted, Body: DateTime(#created_at#, Format: YYYY-MM-DD HH:MI:SS))\r\n}.Custom(_amount){\r\n Div(text-right){\r\n Span(Class: text-bold, Body: Money(#amount_apl#)).Style(margin-right:5px;)\r\n Span(Class: text-bold, Body: APLA)\r\n }\r\n}.Custom(_info){\r\n Button(Class: btn-xs btn-link, Page: @1ts_transfer_view, PageParams: \"Id=#id#\"){\r\n Span(Class: text-bold h5, Body: LangRes(@1information))\r\n }.Popup(Header: $@1information$, Width: 35)\r\n}.Custom(_status){\r\n SetVar(status_class, AppParam(App:#application_id#, Name:ts_statuses_classes, Index:#status#, Ecosystem: #ecosystem_id#))\r\n Div(#status_class#){\r\n AppParam(App:#application_id#, Name:ts_statuses, Index:#status#, Ecosystem: #ecosystem_id#)\r\n }\r\n}.Custom(_action){\r\n If(And(#status#==#STATUS_MANAGER#,#manager_role_id#>0,#role_id#==#manager_role_id#)){\r\n Button(Class: fa fa-play btn btn-primary, Page: @1ts_transfer_manager, PageParams: \"SaleId=#id#\")\r\n }\r\n If(And(#status#==#STATUS_SELLER#,#seller_role_id#>0,#role_id#==#seller_role_id#)){\r\n Button(Class: fa fa-play btn btn-primary, Page: @1ts_transfer_seller, PageParams: \"SaleId=#id#\")\r\n }\r\n}.Custom(_buyer){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#key_id_buyer#\"){\r\n Address(#key_id_buyer#)\r\n }\r\n Div(){\r\n Span(Class: h6 text-muted, Body: PUB:)\r\n Span(Class: h6 text-muted ml-sm, Body: #w_pub_short_buyer#)\r\n }\r\n}.Custom(_wlts){\r\n Div(){\r\n Span(Class: h6 text-muted, Body: BTC:)\r\n Span(Class: h6 ml-sm, Body: #w_wallet_btc#)\r\n }\r\n Div(){\r\n Span(Class: h6 text-muted, Body: ETH:)\r\n Span(Class: h6 ml-sm, Body: #w_wallet_eth#)\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1id$=_id,$@1key_id_investor$=_buyer,$@1wallets$=_wlts,$@1information$=_info,$@1investor_funds_transfer_date$=_btat,$@1created_at$=_cat,$@1status$=_status,=_action,=_amount\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1sales$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -116,14 +130,14 @@ { "Name": "ts_transfer_admin", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nSetVar(this_page, @1ts_transfer_admin).(back_page, @1ts_sales)\r\nAppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Source:currency_type)\r\n\r\nDBFind(@1ts_wallets, wallets).Where({key_id_buyer:{$neq:0}, key_id_signer:{$neq:0}, rejected_at:0}).Count(wallets_count).Custom(_name){\r\n Address(#key_id_buyer#) (#key_id_buyer#)\r\n}\r\nForm(){\r\n Div(row){\r\n Div(col-sm-4 mt-sm text-right){\r\n $@1wallet$\r\n }\r\n Div(col-sm-8 text-left){\r\n Input(Name: WalletStr, Placeholder: \"xxxx-xxxx-xxxx-xxxx-xxxx\")\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-4 mt-sm text-right){\r\n $@1investment_amount$\r\n }\r\n Div(col-sm-8 text-left){\r\n Div(row){\r\n Div(col-sm-8){\r\n Input(Name:Amount, Type:number)\r\n }\r\n Div(col-sm-4){\r\n Select(Name:CurrencyType, Source:currency_type, NameColumn: name, ValueColumn: id)\r\n }\r\n }\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-4 mt-sm text-right){\r\n $@1amount_apl$\r\n }\r\n Div(col-sm-8 text-left){\r\n Input(Name:AmountApl, Type:number)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-4 mt-sm text-right){\r\n $@1investor_funds_transfer_date$\r\n }\r\n Div(col-sm-8 text-left){\r\n Div(row){\r\n Div(col-sm-6){\r\n Input(Name:TransferredDate, Type:date)\r\n }\r\n Div(col-sm-6){\r\n Input(Name:TransferredTime, Type:time)\r\n }\r\n }\r\n }\r\n }\r\n Button(Body: $@1send_to_check$, Class: btn btn-primary pull-right mt, Page: #back_page#, Contract: TsTransferAdmin).Alert(Text: \"$@1want_add_investor$\", ConfirmButton: \"$@1yes$\", CancelButton: \"$@1no$\", Icon: question)\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#)\r\n}\r\n", + "Value": "SetVar(this_page, @1ts_transfer_admin).(back_page, @1ts_sales)\r\n\r\nIf(GetVar(type_currency)==\"\"){\r\n SetVar(type_currency,1)\r\n}\r\n\r\nForm(){\r\n Div(row mb-sm){\r\n Div(col-md-4 mt-sm text-right text-bold){\r\n LangRes(@1type)\r\n }\r\n Div(col-md-8 text-left){\r\n If(GetVar(type_currency)==1){\r\n Input(Name: CurrencyType, Type: hidden, Value: 1)\r\n Button(Body: BTC, Page: #this_page#, PageParams: \"type_currency=1\", Class: btn btn-primary disabled mr-lg).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n Button(Body: ETH, Page: #this_page#, PageParams: \"type_currency=2\", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n Button(Body: EUR, Page: #this_page#, PageParams: \"type_currency=3\", Class: btn btn-primary).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n }.ElseIf(GetVar(type_currency)==2){\r\n Input(Name: CurrencyType, Type: hidden, Value: 2)\r\n Button(Body: BTC, Page: #this_page#, PageParams: \"type_currency=1\", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n Button(Body: ETH, Page: #this_page#, PageParams: \"type_currency=2\", Class: btn btn-primary disabled mr-lg).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n Button(Body: EUR, Page: #this_page#, PageParams: \"type_currency=3\", Class: btn btn-primary).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n }.ElseIf(GetVar(type_currency)==3){\r\n Input(Name: CurrencyType, Type: hidden, Value: 3)\r\n Button(Body: BTC, Page: #this_page#, PageParams: \"type_currency=1\", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n Button(Body: ETH, Page: #this_page#, PageParams: \"type_currency=2\", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n Button(Body: EUR, Page: #this_page#, PageParams: \"type_currency=3\", Class: btn btn-primary disabled).Popup(Header: $@1ts_add_transfer$, Width: \"50\")\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-4 mt text-bold text-right){\r\n If(GetVar(type_currency)==1){\r\n LangRes(@1ts_wallet_btc)\r\n }.ElseIf(GetVar(type_currency)==2){\r\n LangRes(@1ts_wallet_eth)\r\n }.ElseIf(GetVar(type_currency)==3){\r\n LangRes(@1pub_key)\r\n }\r\n }\r\n Div(col-sm-8 text-left){\r\n Input(Name: WalletStr, Type: textarea)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-4 mt-sm text-right text-bold){\r\n LangRes(@1amount_apl)\r\n }\r\n Div(col-sm-8 text-left){\r\n Input(Name:AmountApl, Type:number)\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-4 mt-sm text-right text-bold){\r\n LangRes(@1investor_funds_transfer_date)\r\n }\r\n Div(col-sm-8 text-left){\r\n Div(row){\r\n Div(col-sm-6){\r\n Input(Name:TransferredDate, Type:date)\r\n }\r\n Div(col-sm-6){\r\n Input(Name:TransferredTime, Type:time, Value: \"00:00\")\r\n }\r\n }\r\n }\r\n }\r\n Button(Body: $@1send_to_check$, Class: btn btn-primary pull-right mt, Page: #back_page#, Contract: TsTransferAdmin).Alert(Text: \"$@1want_add_investor$\", ConfirmButton: \"$@1yes$\", CancelButton: \"$@1no$\", Icon: question)\r\n Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#)\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "ts_transfer_manager", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\n\r\nSetVar(this_page, ts_transfer_manager)\r\nSetVar(role_param, role_sale_manager)\r\nSetVar(row,\"row mt-sm\").(col_left,\"col-sm-4 text-right\").(col_right,\"col-sm-8 text-left\")\r\nSetVar(needed_role_id, EcosysParam(Name:#role_param#))\r\n\r\nSetVar(isStartProcessing,0)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id\").Vars(note)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}.ElseIf(GetVar(SaleId)!=\"\"){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, \"page_params->sale_id\":#SaleId#, closed:0}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,id\").Vars(note)\r\n SetVar(notific_id,#note_id#)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}\r\nSetVar(sale_id,0)\r\nIf(#note_page_params_sale_id#>0){\r\n DBFind(@1ts_sales).Where({id:#note_page_params_sale_id#}).Vars(sale)\r\n}\r\nSetTitle($@1ts_transfer_manager$)\r\nDiv(content-wrapper){\r\n Div(row mt-sm){\r\n Div(col-lg-10 col-lg-offset-1){\r\n Form(panel panel-primary){\r\n If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){\r\n Div(panel-body){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_investor$\r\n }\r\n Div(#col_right#){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sale_key_id_buyer#\"){\r\n Address(#sale_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1amount$\r\n }\r\n Div(#col_right#){\r\n #sale_amount# AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #sale_currency_type#)\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1tokens$\r\n }\r\n Div(#col_right#){\r\n Money(#sale_amount_apl#) APL\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1investor_funds_transfer_date$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1created_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1created_by$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_sale_apl_admin#)\r\n }\r\n }\r\n }\r\n Div(panel-footer){\r\n If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){\r\n Button(Body: $@1reject$, Class: btn btn-danger, Page: ts_transfer_reject, PageParams: \"RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#\").Popup(50,\"Rejected comment\")\r\n Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferManager, Params: \"SaleId=#sale_id#,NotificId=#notific_id#\")\r\n }.ElseIf(#isStartProcessing#==1){\r\n Div(text-muted text-center){\r\n process begin another manager\r\n }\r\n }.ElseIf(#isStartProcessing#==0){\r\n Div(text-center){\r\n Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(panel-body text-center){\r\n If(#needed_role_id#>0){\r\n If(#needed_role_id#!=#role_id#){\r\n DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param)\r\n Div(h4){\r\n this page only for role from parameter LinkPage(Page: @1params_edit, PageParams: \"id=#param_id#,back_page=#this_page#\", Body:#role_param#)\r\n }\r\n }\r\n }.Else{\r\n Div(h4){\r\n #role_param# not setted\r\n }\r\n Div(h4){\r\n LinkPage(Body:$@1ts_settings$, Page:ts_settings)\r\n }\r\n }\r\n\r\n If(#note_id_page_params_sale_id#>0){\r\n If(#sale_id#>0){}.Else{\r\n sale not found\r\n }\r\n }.Else{\r\n notification not found\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\n\r\nSetVar(this_page, ts_transfer_manager)\r\nSetVar(role_param, role_sale_manager)\r\nSetVar(needed_role_id, EcosysParam(Name:#role_param#))\r\n\r\nSetVar(isStartProcessing,0)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,closed\").Vars(note)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}.ElseIf(GetVar(SaleId)!=\"\"){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, \"page_params->sale_id\":#SaleId#, closed:0}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,id\").Vars(note)\r\n SetVar(notific_id,#note_id#)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}\r\nSetVar(sale_id,0)\r\nIf(#note_page_params_sale_id#>0){\r\n DBFind(@1ts_sales).Where({id:#note_page_params_sale_id#}).Vars(sale)\r\n DBFind(@1ts_wallets).Where({key_id_buyer:#sale_key_id_buyer#}).Vars(wallet)\r\n}\r\n\r\nDiv(content-wrapper){\r\n Form(){\r\n If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){\r\n Div(list-group-item){\r\n Div(text-center text-bold h4 m0){\r\n LangRes(@1ts_transfer_manager)\r\n }\r\n }\r\n Div(list-group-item){\r\n Div(row mt-sm){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1key_id_investor$\r\n }\r\n Div(col-sm-9 text-left){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sale_key_id_buyer#\"){\r\n Address(#sale_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1tokens$\r\n }\r\n Div(col-sm-9 text-left){\r\n Money(#sale_amount_apl#) APLA\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1pub_key$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_pub_buyer#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1ts_wallet_btc$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_wallet_btc#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1ts_wallet_eth$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_wallet_eth#)\r\n }\r\n }\r\n Div(row mt-sm text-muted ){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1investor_funds_transfer_date$\r\n }\r\n Div(col-sm-9 text-left){\r\n DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(row text-muted){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1created_at$\r\n }\r\n Div(col-sm-9 text-left){\r\n DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(row text-muted){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1created_by$\r\n }\r\n Div(col-sm-9 text-left){\r\n Address(#sale_key_id_sale_apl_admin#)\r\n }\r\n }\r\n }\r\n If(#sale_status# == 1){\r\n Div(list-group-item){\r\n If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){\r\n Button(Body: $@1reject$, Class: btn btn-default, Page: ts_transfer_reject, PageParams: \"RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#\").Popup(50,\"Rejected comment\")\r\n Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferManager, Params: \"SaleId=#sale_id#,NotificId=#notific_id#\")\r\n }.ElseIf(#isStartProcessing#==1){\r\n Div(text-muted text-center){\r\n process begin another manager\r\n }\r\n }.ElseIf(#isStartProcessing#==0){\r\n Div(text-right){\r\n Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(list-group-item text-center h4){\r\n If(#needed_role_id#>0){\r\n If(#needed_role_id#!=#role_id#){\r\n DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param)\r\n Div(h4){\r\n This page only for role from parameter LinkPage(Page: @1params_edit, PageParams: \"id=#param_id#,back_page=#this_page#\", Body:#role_param#)\r\n }\r\n }\r\n }.Else{\r\n Div(h4){\r\n #role_param# not setted\r\n }\r\n Div(h4){\r\n LinkPage(Body:$@1ts_settings$, Page:ts_settings)\r\n }\r\n }\r\n\r\n If(#note_id_page_params_sale_id#>0){\r\n If(#sale_id#>0){}.Else{\r\n Sale not found\r\n }\r\n }.Else{\r\n Notification not found\r\n }\r\n }\r\n }\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -137,21 +151,21 @@ { "Name": "ts_transfer_seller", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\n\r\nSetVar(this_page, ts_transfer_seller)\r\nSetVar(role_param, role_sale_seller)\r\nSetVar(row,\"row mt-sm\").(col_left,\"col-sm-4 text-right\").(col_right,\"col-sm-8 text-left\")\r\nSetVar(needed_role_id, EcosysParam(Name:#role_param#))\r\n\r\nAppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Source:currency_type)\r\nSetVar(isStartProcessing,0)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id\").Vars(note)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}.ElseIf(GetVar(SaleId)!=\"\"){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, \"page_params->sale_id\":#SaleId#, closed:0}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id\").Vars(note)\r\n SetVar(notific_id,#note_id#)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}\r\nSetVar(sale_id,0)\r\nIf(#note_page_params_sale_id#>0){\r\n DBFind(@1ts_sales).Where({id:#note_page_params_sale_id#}).Vars(sale)\r\n}\r\n\r\nSetTitle($@1ts_transfer_seller$)\r\nDiv(content-wrapper){\r\n Div(row mt-sm){\r\n Div(col-lg-10 col-lg-offset-1){\r\n Form(panel panel-primary){\r\n DBFind(@1ts_wallets, wallets).Where({key_id_buyer:{$neq:0}, key_id_signer:{$neq:0}, rejected_at:0}).Vars(wallet).Custom(_name){\r\n Address(#key_id_buyer#)\r\n }\r\n If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){\r\n Div(panel-body){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_investor$\r\n }\r\n Div(#col_right#){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sale_key_id_buyer#\"){\r\n Address(#sale_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1amount$\r\n }\r\n Div(#col_right#){\r\n #sale_amount# AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #sale_currency_type#)\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1tokens$\r\n }\r\n Div(#col_right#){\r\n Money(#sale_amount_apl#) APL\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1investor_funds_transfer_date$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1created_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1created_by$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_sale_apl_admin#)\r\n }\r\n }\r\n Div(#row# text-muted){\r\n Div(#col_left#){\r\n $@1checked_by$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_sale_apl_manager#)\r\n }\r\n }\r\n }\r\n Div(panel-footer){\r\n If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){\r\n Button(Body: $@1reject$, Class: btn btn-danger, Page: ts_transfer_reject, PageParams: \"RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#\").Popup(50,\"Rejected comment\")\r\n Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferSeller, Params: \"SaleId=#sale_id#,NotificId=#notific_id#\")\r\n }.ElseIf(#isStartProcessing#==1){\r\n Div(text-muted text-center){\r\n process begin another seller\r\n }\r\n }.ElseIf(#isStartProcessing#==0){\r\n Div(text-center){\r\n Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(panel-body){\r\n If(#needed_role_id#>0){\r\n If(#needed_role_id#!=#role_id#){\r\n DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param)\r\n Div(h4){\r\n this page only for role from parameter LinkPage(Page: @1params_edit, PageParams: \"id=#param_id#,back_page=#this_page#\", Body:#role_param#)\r\n }\r\n }\r\n }.Else{\r\n Div(h4){\r\n #role_param# not setted\r\n }\r\n Div(h4){\r\n LinkPage(Body:$@1ts_settings$, Page:ts_settings)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\n\r\nSetVar(this_page, ts_transfer_seller)\r\nSetVar(role_param, role_sale_seller)\r\nSetVar(needed_role_id, EcosysParam(Name:#role_param#))\r\n\r\nAppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Source:currency_type)\r\nSetVar(isStartProcessing,0)\r\nIf(#notific_id#>0){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,closed\").Vars(note)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}.ElseIf(GetVar(SaleId)!=\"\"){\r\n DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, \"page_params->sale_id\":#SaleId#, closed:0}).Columns(\"page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,closed\").Vars(note)\r\n SetVar(notific_id,#note_id#)\r\n If(#note_date_start_processing#!=\"\"){\r\n SetVar(isStartProcessing,1)\r\n }\r\n}\r\nSetVar(sale_id,0)\r\nIf(#note_page_params_sale_id#>0){\r\n DBFind(@1ts_sales).Where({id:#note_page_params_sale_id#}).Vars(sale)\r\n}\r\n\r\nDiv(content-wrapper){\r\n Form(){\r\n DBFind(@1ts_wallets, wallets).Where({key_id_buyer:{$neq:0}, key_id_signer:{$neq:0}, rejected_at:0}).Vars(wallet).Custom(_name){\r\n Address(#key_id_buyer#)\r\n }\r\n If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){\r\n Div(list-group-item){\r\n Div(text-center text-bold h4 m0){\r\n LangRes(@1ts_transfer_seller)\r\n }\r\n }\r\n Div(list-group-item){\r\n Div(row mt-sm){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1key_id_investor$\r\n }\r\n Div(col-sm-9 text-left){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sale_key_id_buyer#\"){\r\n Address(#sale_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1tokens$\r\n }\r\n Div(col-sm-9 text-left){\r\n Money(#sale_amount_apl#) APLA\r\n }\r\n }\r\n Div(row mt-sm){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1pub_key$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_pub_buyer#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1ts_wallet_btc$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_wallet_btc#)\r\n }\r\n }\r\n Div(row){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1ts_wallet_eth$\r\n }\r\n Div(col-sm-9 text-left){\r\n Span(Class: h6, Body: #wallet_wallet_eth#)\r\n }\r\n }\r\n Div(row mt-sm text-muted){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1investor_funds_transfer_date$\r\n }\r\n Div(col-sm-9 text-left){\r\n DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(row text-muted){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1created_at$\r\n }\r\n Div(col-sm-9 text-left){\r\n DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n Div(row text-muted){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1created_by$\r\n }\r\n Div(col-sm-9 text-left){\r\n Address(#sale_key_id_sale_apl_admin#)\r\n }\r\n }\r\n Div(row text-muted){\r\n Div(col-sm-3 text-right text-bold){\r\n $@1checked_by$\r\n }\r\n Div(col-sm-9 text-left){\r\n Address(#sale_key_id_sale_apl_manager#)\r\n }\r\n }\r\n }\r\n If(#sale_status# == 2){\r\n Div(list-group-item){\r\n If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){\r\n Button(Body: $@1reject$, Class: btn btn-default, Page: ts_transfer_reject, PageParams: \"RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#\").Popup(50,\"Rejected comment\")\r\n Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferSeller, Params: \"SaleId=#sale_id#,NotificId=#notific_id#\")\r\n }.ElseIf(#isStartProcessing#==1){\r\n Div(text-muted text-center){\r\n process begin another seller\r\n }\r\n }.ElseIf(#isStartProcessing#==0){\r\n Div(text-right){\r\n Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: \"notific_id=#notific_id#\", Contract: @1NotificationsProcess, Params: \"notific_id=#notific_id#\")\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(panel-body){\r\n If(#needed_role_id#>0){\r\n If(#needed_role_id#!=#role_id#){\r\n DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param)\r\n Div(h4){\r\n This page only for role from parameter LinkPage(Page: @1params_edit, PageParams: \"id=#param_id#,back_page=#this_page#\", Body:#role_param#)\r\n }\r\n }\r\n }.Else{\r\n Div(h4){\r\n #role_param# not setted\r\n }\r\n Div(h4){\r\n LinkPage(Body:$@1ts_settings$, Page:ts_settings)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "ts_transfer_view", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nSetVar(row,\"row mt-sm\").(col_left,\"col-sm-6 text-right text-bold\").(col-right,\"col-sm-6 text-left\")\r\nIf(GetVar(back_page)==\"\"){\r\n SetVar(back_page, @1ts_sales)\r\n}\r\nIf(GetVar(Id)){\r\n DBFind(@1ts_sales).Where({id:#Id#}).Vars(sale)\r\n}\r\n\r\nIf(#sale_id#>0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_investor$\r\n }\r\n Div(#col_right#){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sale_key_id_buyer#\"){\r\n Address(#sale_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1tokens$\r\n }\r\n Div(#col_right#){\r\n Money(#sale_amount_apl#) APL\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1amount$\r\n }\r\n Div(#col_right#){\r\n Span(#sale_amount#).Style(margin-right:5px;)\r\n Span(AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #sale_currency_type#))\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_sale_apl_admin$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_sale_apl_admin#) (#sale_key_id_sale_apl_admin#)\r\n }\r\n }\r\n If(#sale_key_id_sale_apl_manager#!=0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_sale_apl_manager$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_sale_apl_manager#) (#sale_key_id_sale_apl_manager#)\r\n }\r\n }\r\n If(#sale_manager_rejected_at#>0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1manager_rejected_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_manager_rejected_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1manager_reject_comment$\r\n }\r\n Div(#col_right#){\r\n #sale_manager_reject_comment#\r\n }\r\n }\r\n }\r\n }\r\n If(#sale_key_id_seller#!=0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_seller$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_seller#) (#sale_key_id_seller#)\r\n }\r\n }\r\n If(#sale_seller_rejected_at#>0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1seller_rejected_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_seller_rejected_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1seller_reject_comment$\r\n }\r\n Div(#col_right#){\r\n #sale_seller_reject_comment#\r\n }\r\n }\r\n }.Else{\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1seller_transferred_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_seller_transferred_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\nDiv(row mt){\r\n Div(col-md-12){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: #back_page#)\r\n }\r\n}", + "Value": "DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:\"Tokens sale\"}).Columns(\"id\").Vars(application)\r\nSetVar(row,\"row mt-sm\").(col_left,\"col-sm-6 text-right text-bold\").(col-right,\"col-sm-6 text-left\")\r\nIf(GetVar(back_page)==\"\"){\r\n SetVar(back_page, @1ts_sales)\r\n}\r\nIf(GetVar(Id)){\r\n DBFind(@1ts_sales).Where({id:#Id#}).Vars(sale)\r\n}\r\n\r\nIf(#sale_id#>0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_investor$\r\n }\r\n Div(#col_right#){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#sale_key_id_buyer#\"){\r\n Address(#sale_key_id_buyer#)\r\n }\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1tokens$\r\n }\r\n Div(#col_right#){\r\n Money(#sale_amount_apl#) APLA\r\n }\r\n }\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_sale_apl_admin$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_sale_apl_admin#) (#sale_key_id_sale_apl_admin#)\r\n }\r\n }\r\n If(#sale_key_id_sale_apl_manager#!=0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_sale_apl_manager$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_sale_apl_manager#) (#sale_key_id_sale_apl_manager#)\r\n }\r\n }\r\n If(#sale_manager_rejected_at#>0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1manager_rejected_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_manager_rejected_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1manager_reject_comment$\r\n }\r\n Div(#col_right#){\r\n #sale_manager_reject_comment#\r\n }\r\n }\r\n }\r\n }\r\n If(#sale_key_id_seller#!=0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1key_id_seller$\r\n }\r\n Div(#col_right#){\r\n Address(#sale_key_id_seller#) (#sale_key_id_seller#)\r\n }\r\n }\r\n If(#sale_seller_rejected_at#>0){\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1seller_rejected_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_seller_rejected_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1seller_reject_comment$\r\n }\r\n Div(#col_right#){\r\n #sale_seller_reject_comment#\r\n }\r\n }\r\n }.Else{\r\n Div(#row#){\r\n Div(#col_left#){\r\n $@1seller_transferred_at$\r\n }\r\n Div(#col_right#){\r\n DateTime(#sale_seller_transferred_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n }\r\n }\r\n }\r\n\r\n}\r\nDiv(row mt){\r\n Div(col-md-12){\r\n Button(Body: LangRes(@1back), Class: btn btn-default, Page: #back_page#)\r\n }\r\n}", "Menu": "default_menu", "Type": "pages" }, { "Name": "ts_wallets", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "SetVar(this_page, @1ts_wallets).(this_table, @1ts_wallets)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1ts_wallets$\")\r\nSetVar(snapswap_role_id, EcosysParam(Name:role_snapswap))\r\nIf(And(#snapswap_role_id#>0,#role_id#==#snapswap_role_id#)){\r\n AddToolButton(Title:$@1ts_add_public_key$, Page: @1ts_key_approve, Icon: icon-wallet).Popup(Header: $@1ts_add_public_key$, Width: \"50\")\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, {$or:[{\"key_id_buyer\":#search#},{\"key_id_signer\":#search#}]})\r\n}.Else{\r\n SetVar(where, {id:{$gt:0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1key_id))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_rat){\r\n If(#rejected_at#>0){\r\n DateTime(#rejected_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n}.Custom(_sat){\r\n If(#signed_at#>0){\r\n DateTime(#signed_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n}.Custom(_cat){\r\n If(#created_at#>0){\r\n Span(Class:text-muted, Body:DateTime(#created_at#, Format: YYYY-MM-DD HH:MI:SS))\r\n }\r\n}.Custom(_buyer){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#key_id_buyer#\"){\r\n Address(#key_id_buyer#)\r\n }\r\n Div(Class:text-muted m0 h6, Body:#key_id_buyer#)\r\n}.Custom(_signer){\r\n If(#key_id_signer#!=0){\r\n Span(Class:text-success, Body: Address(#key_id_signer#))\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1id$=id,$@1key_id_investor$=_buyer,$@1created_at$=_cat,$@1rejected_at$=_rat,$@1signed_at$=_sat,$@1key_id_consensus$=_signer\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1wallets$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", + "Value": "SetVar(this_page, @1ts_wallets).(this_table, @1ts_wallets)\r\nInclude(@1pager_header)\r\n\r\nSetTitle(\"$@1ts_wallets$\")\r\nSetVar(snapswap_role_id, EcosysParam(Name:role_snapswap))\r\nIf(And(#snapswap_role_id#>0,#role_id#==#snapswap_role_id#)){\r\n AddToolButton(Title:$@1ts_add_public_key$, Page: @1ts_key_approve, Icon: icon-wallet).Popup(Header: $@1ts_add_public_key$, Width: \"50\")\r\n}\r\n\r\nIf(GetVar(search)!=\"\"){\r\n SetVar(where, {$and: [{\"key_id_buyer\":{$neq:0}}, {$or:[{\"pub_buyer\": {$like: #search#}},{\"wallet_btc\": {$like: #search#}},{\"wallet_eth\": {$like: #search#}}]}]})\r\n}.Else{\r\n SetVar(where, {\"key_id_buyer\":{$neq:0}}).(search,)\r\n}\r\n\r\nDiv(list-group-item ml-lg mr-lg pt-lg){\r\n SetVar(search_name, LangRes(@1pub_key) \\ LangRes(@1wallet))\r\n Include(@1search)\r\n}\r\n\r\nDBFind(#this_table#, src).Where(#where#).Order({\"id\": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_rat){\r\n If(#rejected_at#>0){\r\n DateTime(#rejected_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }.Else{\r\n Span(Class: text-muted, Body: --)\r\n }\r\n}.Custom(_sat){\r\n If(#signed_at#>0){\r\n DateTime(#signed_at#, Format: YYYY-MM-DD HH:MI:SS)\r\n }\r\n}.Custom(_cat){\r\n If(#created_at#>0){\r\n Span(Class:text-muted, Body:DateTime(#created_at#, Format: YYYY-MM-DD HH:MI:SS))\r\n }\r\n}.Custom(_buyer){\r\n LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: \"v_key_id=#key_id_buyer#\"){\r\n Address(#key_id_buyer#)\r\n }\r\n Div(){\r\n Span(Class: h6 text-muted, Body: PUB:)\r\n Span(Class: h6 text-muted ml-sm, Body: #pub_short_buyer#)\r\n }\r\n}.Custom(_signer){\r\n If(#key_id_signer#!=0){\r\n Span(Class:text-success, Body: Address(#key_id_signer#))\r\n }\r\n}.Custom(_wlts){\r\n Div(){\r\n Span(Class: h6 text-muted, Body: BTC:)\r\n Span(Class: h6 ml-sm, Body: #wallet_btc#)\r\n }\r\n Div(){\r\n Span(Class: h6 text-muted, Body: ETH:)\r\n Span(Class: h6 ml-sm, Body: #wallet_eth#)\r\n }\r\n}.Count(count)\r\n\r\nDiv(fullscreen){\r\n Div(table-responsive ml-lg mr-lg){\r\n Div(list-group-item){\r\n If(#count# > 0){\r\n Table(src, \"$@1id$=id,$@1key_id_investor$=_buyer,$@1wallets$=_wlts,$@1created_at$=_cat,$@1signed_at$=_sat,$@1rejected_at$=_rat,$@1key_id_consensus$=_signer\")\r\n }.Else{\r\n Div(Class: text-center h4 text-muted, Body: \"$@1wallets$ $@1not_founded$\")\r\n } \r\n }.Style(\r\n margin-top:-15px;\r\n tbody > tr:nth-of-type(odd) {\r\n background-color: #f8f9fc;\r\n }\r\n )\r\n }\r\n}\r\nDiv(mt-sm ml-lg mr-sm mb-sm){\r\n Include(@1pager)\r\n}", "Menu": "default_menu", "Type": "pages" }, @@ -167,10 +181,22 @@ "Value": "contract TsConsensusAction {\r\n data {\r\n Action string\r\n WalletId int\r\n NotificId int\r\n }\r\n conditions{\r\n var basicAppId int\r\n basicAppId = Int(DBFind(\"@1applications\").Where({ecosystem:1, name:\"Basic\"}).One(\"id\"))\r\n if basicAppId == 0{\r\n warning LangRes(\"@1app_not_found\", \"en\")\r\n }\r\n $roleConsensus = Int(EcosysParam(\"role_apla_consensus_asbl\"))\r\n if $roleConsensus == 0{\r\n warning Sprintf(LangRes(\"@1role_not_set_application_parameter\", \"en\"), \"role_apla_consensus_asbl\")\r\n }\r\n if !RoleAccess($roleConsensus){\r\n warning \"this action allowed only for role id #\" + $roleConsensus\r\n }\r\n $wallet = DBFind(\"ts_wallets\").Where({id:$WalletId, rejected_at:0}).Row()\r\n if !$wallet{\r\n warning \"Buyer wallet not found\"\r\n }\r\n if Int($wallet[\"signed_at\"]) == 0{\r\n warning \"Buyer wallet not signed\"\r\n }\r\n if $wallet[\"key_id_signer\"] > 0{\r\n if $wallet[\"key_id_signer\"] != $key_id{\r\n warning \"This wallet was signed by asbl early\"\r\n }\r\n }\r\n }\r\n\r\n action {\r\n if $Action == \"accept\"{\r\n DBUpdate(\"ts_wallets\", Int($wallet[\"id\"]), {key_id_signer:$key_id})\r\n // buyer notification\r\n var params map\r\n params[\"wallet_id\"] = $wallet[\"id\"]\r\n @1NotificationsSend(\"member_id,sender,text_header,page_name,params_map,closure_type\", Int($wallet[\"key_id_buyer\"]), 1, \"Your wallet approved\", \"ts_buyer_congratulation\", params, 1)\r\n\r\n }elif $Action == \"reject\"{\r\n DBUpdate(\"ts_wallets\", Int($wallet[\"id\"]), {rejected_at:$time})\r\n }\r\n @1NotificationsClose(\"notific_id\", $NotificId)\r\n }\r\n}\r\n", "Type": "contracts" }, + { + "Name": "TsFreeWalletAdd", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "contract TsFreeWalletAdd {\r\n data {\r\n wallet_btc string\r\n wallet_eth string\r\n }\r\n\r\n conditions {\r\n var adminRoleId int adminRoleName string\r\n adminRoleId = Int(EcosysParam(\"role_sale_admin\"))\r\n adminRoleName = DBFind(\"@1roles\").Where({\"id\": adminRoleId}).One(\"role_name\")\r\n\r\n if adminRoleId == 0 {\r\n warning Sprintf(LangRes(\"@1role_not_set_application_parameter\", \"en\"), \"role_sale_admin\")\r\n }\r\n\r\n if !RoleAccess(adminRoleId) {\r\n warning Sprintf(LangRes(\"x_role_only_action\", \"en\"), adminRoleName)\r\n }\r\n\r\n if DBFind(\"ts_wallets\").Where({\"wallet_btc\": $wallet_btc}).One(\"id\") {\r\n warning Sprintf(LangRes(\"wallet_btc_exists\", \"en\"), $wallet_btc)\r\n }\r\n\r\n if DBFind(\"ts_wallets\").Where({\"wallet_eth\": $wallet_eth}).One(\"id\") {\r\n warning Sprintf(LangRes(\"wallet_eth_exists\", \"en\"), $wallet_eth)\r\n }\r\n }\r\n\r\n action {\r\n DBInsert(\"ts_wallets\", {\"wallet_btc\": $wallet_btc, \"wallet_eth\": $wallet_eth})\r\n }\r\n}", + "Type": "contracts" + }, + { + "Name": "TsFreeWalletDelete", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Value": "contract TsFreeWalletDelete {\r\n data {\r\n wallet_id int\r\n }\r\n\r\n conditions {\r\n var adminRoleId int adminRoleName string\r\n adminRoleId = Int(EcosysParam(\"role_sale_admin\"))\r\n adminRoleName = DBFind(\"@1roles\").Where({\"id\": adminRoleId}).One(\"role_name\")\r\n\r\n if adminRoleId == 0 {\r\n warning Sprintf(LangRes(\"@1role_not_set_application_parameter\", \"en\"), \"role_sale_admin\")\r\n }\r\n\r\n if !RoleAccess(adminRoleId) {\r\n warning Sprintf(LangRes(\"x_role_only_action\", \"en\"), adminRoleName)\r\n }\r\n }\r\n\r\n action {\r\n DBUpdate(\"ts_wallets\", $wallet_id, {\"deleted\": 1})\r\n }\r\n}", + "Type": "contracts" + }, { "Name": "TsKeyApprove", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract TsKeyApprove {\r\n data {\r\n public_key string\r\n key_type string\r\n current_role_id int\r\n }\r\n\r\n conditions {\r\n if $public_key == \"\" {\r\n warning LangRes(\"@1public_key_empty\", \"en\")\r\n }\r\n\r\n $public_key = Replace($public_key, \" \", \"\")\r\n if HasPrefix($public_key, \"04\") {\r\n $public_key = Substr($public_key, 2, Size($public_key) - 2)\r\n }\r\n $userKey = PubToID($public_key)\r\n\r\n if $userKey == 0 || Size($public_key) != 128 {\r\n warning LangRes(\"@1public_key_invalid\", \"en\")\r\n }\r\n\r\n if DBFind(\"ts_wallets\").Where({key_id_buyer: $userKey}).One(\"id\") {\r\n warning LangRes(\"@1investor_added_already\", \"en\")\r\n }\r\n\r\n if DBFind(\"@1keys\").Where({id: $userKey, ecosystem: 1}).One(\"id\") {\r\n warning LangRes(\"@1key_added_already\", \"en\")\r\n }\r\n\r\n var snapSwapRoleId int snapSwapRoleName string\r\n snapSwapRoleId = Int(EcosysParam(\"role_snapswap\"))\r\n snapSwapRoleName = DBFind(\"@1roles\").Where({\"id\": snapSwapRoleId}).One(\"role_name\")\r\n\r\n if snapSwapRoleId == 0 {\r\n warning Sprintf(LangRes(\"@1role_not_set_application_parameter\", \"en\"), \"role_snapswap\")\r\n }\r\n\r\n if !RoleAccess(snapSwapRoleId) {\r\n warning Sprintf(LangRes(\"x_role_only_action\", \"en\"), snapSwapRoleName)\r\n }\r\n }\r\n\r\n action {\r\n DBInsert(\"@1keys\", {\"id\": $userKey, \"pub\": $public_key, \"ecosystem\": 1})\r\n var start_balance money\r\n start_balance = Money(1000000000000000)\r\n @1TokensSend(\"Recipient,Amount\", IdToAddress($userKey), start_balance)\r\n\r\n if $key_type == \"investor\" {\r\n DBInsert(\"ts_wallets\", {\"key_id_buyer\": $userKey, \"created_at\": $block_time})\r\n\r\n // new user notification\r\n var params map title page body string\r\n title = LangRes(\"@1ts_hello_user_description\", \"en\")\r\n body = LangRes(\"@1ts_read_contract\", \"en\")\r\n page = \"@1ts_buyer_contract\"\r\n @1NotificationsSend(\"member_id,sender,text_header,text_body,page_name,params_map,closure_type,current_role_id\", $userKey, 2, title, body, page, params, 1, $current_role_id) \r\n }\r\n }\r\n}", + "Value": "contract TsKeyApprove {\r\n data {\r\n public_key string\r\n key_type string\r\n current_role_id int\r\n }\r\n\r\n func getFreeWallet() int {\r\n var count_wallets int wallet_map map wallet_arr array\r\n wallet_arr = DBFind(\"ts_wallets\").Where({\"key_id_buyer\": 0, \"deleted\":0}).Order({\"id\": 1})\r\n \r\n count_wallets = Len(wallet_arr)\r\n if count_wallets == 0 {\r\n warning LangRes(\"@1ts_free_wallet_not_found\", \"en\")\r\n }\r\n\r\n if count_wallets == 1 {\r\n var managerRoleId int\r\n managerRoleId = Int(EcosysParam(\"role_sale_manager\"))\r\n if managerRoleId > 0 {\r\n var params map title page body string\r\n title = LangRes(\"@1ts_free_wallets_emptied\", \"en\")\r\n body = LangRes(\"@1ts_free_wallets_need\", \"en\")\r\n page = \"@1ts_notification\"\r\n @1NotificationsSend(\"rid,sender,text_header,text_body,page_name,params_map,closure_type,current_role_id\", managerRoleId, 2, title, body, page, params, 1, $current_role_id) \r\n }\r\n }\r\n\r\n wallet_map = wallet_arr[0] \r\n return Int(wallet_map[\"id\"])\r\n }\r\n\r\n conditions {\r\n if $public_key == \"\" {\r\n warning LangRes(\"@1public_key_empty\", \"en\")\r\n }\r\n\r\n $public_key = Replace($public_key, \" \", \"\")\r\n if HasPrefix($public_key, \"04\") {\r\n $public_key = Substr($public_key, 2, Size($public_key) - 2)\r\n }\r\n $userKey = PubToID($public_key)\r\n\r\n if $userKey == 0 || Size($public_key) != 128 {\r\n warning LangRes(\"@1public_key_invalid\", \"en\")\r\n }\r\n\r\n if DBFind(\"ts_wallets\").Where({key_id_buyer: $userKey}).One(\"id\") {\r\n warning LangRes(\"@1investor_added_already\", \"en\")\r\n }\r\n\r\n if DBFind(\"@1keys\").Where({id: $userKey, ecosystem: 1}).One(\"id\") {\r\n warning LangRes(\"@1key_added_already\", \"en\")\r\n }\r\n\r\n var snapSwapRoleId int snapSwapRoleName string\r\n snapSwapRoleId = Int(EcosysParam(\"role_snapswap\"))\r\n snapSwapRoleName = DBFind(\"@1roles\").Where({\"id\": snapSwapRoleId}).One(\"role_name\")\r\n\r\n if snapSwapRoleId == 0 {\r\n warning Sprintf(LangRes(\"@1role_not_set_application_parameter\", \"en\"), \"role_snapswap\")\r\n }\r\n\r\n if !RoleAccess(snapSwapRoleId) {\r\n warning Sprintf(LangRes(\"x_role_only_action\", \"en\"), snapSwapRoleName)\r\n }\r\n }\r\n\r\n action {\r\n DBInsert(\"@1keys\", {\"id\": $userKey, \"pub\": $public_key, \"ecosystem\": 1})\r\n var start_balance money\r\n start_balance = Money(1000000000000000)\r\n @1TokensSend(\"Recipient,Amount\", IdToAddress($userKey), start_balance)\r\n\r\n if $key_type == \"investor\" {\r\n $wallet_id = getFreeWallet()\r\n $public_key = \"04\" + $public_key\r\n $pub_short_buyer = Substr($public_key, 0, 12) + \"...\" + Substr($public_key, Size($public_key)-12, 12)\r\n DBUpdate(\"ts_wallets\", $wallet_id, {\"key_id_buyer\": $userKey, \"created_at\": $block_time, \"pub_buyer\": $public_key, \"pub_short_buyer\": $pub_short_buyer})\r\n\r\n // new user notification\r\n var params map title page body string\r\n title = LangRes(\"@1ts_hello_user_description\", \"en\")\r\n body = LangRes(\"@1ts_read_contract\", \"en\")\r\n page = \"@1ts_buyer_contract\"\r\n @1NotificationsSend(\"member_id,sender,text_header,text_body,page_name,params_map,closure_type,current_role_id\", $userKey, 2, title, body, page, params, 1, $current_role_id) \r\n }\r\n }\r\n}", "Type": "contracts" }, { @@ -182,7 +208,7 @@ { "Name": "TsTransferAdmin", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract TsTransferAdmin {\r\n data {\r\n WalletStr string\r\n Amount string\r\n CurrencyType int\r\n AmountApl money\r\n TransferredDate string\r\n TransferredTime string\r\n }\r\n func getRoleId(name string) int{\r\n var rid int\r\n rid = Int(EcosysParam(name))\r\n if rid == 0{\r\n warning Sprintf(LangRes(\"@1role_not_set_application_parameter\", \"en\"), name)\r\n }\r\n return rid\r\n }\r\n func trimZeroTime(s string) string {\r\n if Contains(s, \"T00:00:00Z\") {\r\n s = s Replace(s, \"T00:00:00Z\", \"\")\r\n }\r\n return s\r\n }\r\n func dateAddTime(d, t string) string {\r\n var dt string\r\n if Size(t) == 5 {\r\n dt = Sprintf(\"%v %v:00\", trimZeroTime(d), t)\r\n }\r\n return dt\r\n }\r\n conditions{\r\n $WAITING_MANAGER = 1\r\n $WAITING_SELLER = 2\r\n $FINISHED = 3\r\n $REJECTED = 4\r\n if $AmountApl <= 0{\r\n warning \"invalid amount APL\"\r\n }\r\n if $Amount <= 0.0{\r\n warning \"invalid amount\"\r\n }\r\n\r\n $transferredAt = UnixDateTime(dateAddTime($TransferredDate, $TransferredTime))\r\n if $transferredAt == 0 {\r\n warning \"invalid transfer datetime\"\r\n }\r\n $appId = Int(DBFind(\"@1applications\").Where({ecosystem:$ecosystem_id, name:\"Tokens sale\"}).One(\"id\"))\r\n if $appId == 0{\r\n warning LangRes(\"@1app_not_found\", \"en\")\r\n }\r\n $roleAplManager = getRoleId(\"role_sale_manager\")\r\n $currentRole = getRoleId(\"role_sale_admin\")\r\n if !RoleAccess($currentRole){\r\n warning \"this action allowed only for role id #\" + $currentRole\r\n }\r\n\r\n $WalletId = AddressToId($WalletStr)\r\n $wallet = DBFind(\"ts_wallets\").Where({key_id_buyer:$WalletId}).Row()\r\n if !$wallet{\r\n warning \"Buyer wallet not found\"\r\n }\r\n if $CurrencyType <= 0 || $CurrencyType > 3{\r\n warning \"Invalid Currency Type\"\r\n }\r\n }\r\n\r\n action {\r\n var sale map saleId int\r\n sale[\"key_id_buyer\"] = $wallet[\"key_id_buyer\"]\r\n sale[\"currency_type\"] = $CurrencyType\r\n sale[\"amount\"] = $Amount\r\n sale[\"amount_apl\"] = $AmountApl\r\n sale[\"key_id_sale_apl_admin\"] = $key_id\r\n sale[\"created_at\"] = $time\r\n sale[\"buyer_transferred_at\"] = $transferredAt\r\n sale[\"status\"] = $WAITING_MANAGER\r\n\r\n saleId = DBInsert(\"ts_sales\", sale)\r\n\r\n // role Apla sales manager notification\r\n var params map title page string\r\n title = Sprintf(\"Check sale id %v\", saleId)\r\n page = \"ts_transfer_manager\"\r\n params[\"sale_id\"] = saleId\r\n @1NotificationsSend(\"rid,sender,text_header,page_name,params_map,closure_type,current_role_id\", $roleAplManager, 2, title, page, params, 1, $currentRole)\r\n\r\n }\r\n}", + "Value": "contract TsTransferAdmin {\r\n data {\r\n WalletStr string\r\n CurrencyType int\r\n AmountApl money\r\n TransferredDate string\r\n TransferredTime string\r\n }\r\n\r\n func getRoleId(name string) int {\r\n var rid int\r\n rid = Int(EcosysParam(name))\r\n if rid == 0 {\r\n warning Sprintf(LangRes(\"@1role_not_set_application_parameter\", \"en\"), name)\r\n }\r\n return rid\r\n }\r\n\r\n func trimZeroTime(s string) string {\r\n if Contains(s, \"T00:00:00Z\") {\r\n s = s Replace(s, \"T00:00:00Z\", \"\")\r\n }\r\n return s\r\n }\r\n\r\n func dateAddTime(d, t string) string {\r\n var dt string\r\n if Size(t) == 5 {\r\n dt = Sprintf(\"%v %v:00\", trimZeroTime(d), t)\r\n }\r\n return dt\r\n }\r\n\r\n conditions {\r\n $WAITING_MANAGER = 1\r\n $WAITING_SELLER = 2\r\n $FINISHED = 3\r\n $REJECTED = 4\r\n if $AmountApl <= 0 {\r\n warning \"invalid amount APLA\"\r\n }\r\n\r\n $transferredAt = UnixDateTime(dateAddTime($TransferredDate, $TransferredTime))\r\n if $transferredAt == 0 {\r\n warning \"invalid transfer datetime\"\r\n }\r\n \r\n $appId = Int(DBFind(\"@1applications\").Where({ecosystem:$ecosystem_id, name:\"Tokens sale\"}).One(\"id\"))\r\n if $appId == 0 {\r\n warning LangRes(\"@1app_not_found\", \"en\")\r\n }\r\n \r\n $currentRole = getRoleId(\"role_sale_admin\")\r\n if !RoleAccess($currentRole) {\r\n warning \"this action allowed only for role id #\" + $currentRole\r\n }\r\n\r\n if $CurrencyType <= 0 || $CurrencyType > 3 {\r\n warning \"Invalid Currency Type\"\r\n }\r\n\r\n if $CurrencyType == 1 {\r\n $wallet = DBFind(\"ts_wallets\").Where({wallet_btc: $WalletStr}).Row()\r\n }\r\n if $CurrencyType == 2 {\r\n $wallet = DBFind(\"ts_wallets\").Where({wallet_eth: $WalletStr}).Row()\r\n }\r\n if $CurrencyType == 3 {\r\n if $WalletStr == \"\" {\r\n warning LangRes(\"@1public_key_empty\", \"en\")\r\n }\r\n\r\n $WalletStr = Replace($WalletStr, \" \", \"\")\r\n if HasPrefix($WalletStr, \"04\") {\r\n $WalletStr = Substr($WalletStr, 2, Size($WalletStr) - 2)\r\n }\r\n var key_id_buyer int\r\n key_id_buyer = PubToID($WalletStr)\r\n if key_id_buyer == 0 || Size($WalletStr) != 128 {\r\n warning LangRes(\"@1public_key_invalid\", \"en\")\r\n }\r\n \r\n $wallet = DBFind(\"ts_wallets\").Where({key_id_buyer: key_id_buyer}).Row()\r\n }\r\n\r\n if !$wallet {\r\n warning \"Buyer wallet not found\"\r\n }\r\n }\r\n\r\n action {\r\n var sale map saleId int\r\n sale[\"key_id_buyer\"] = $wallet[\"key_id_buyer\"]\r\n sale[\"currency_type\"] = $CurrencyType\r\n sale[\"amount_apl\"] = $AmountApl\r\n sale[\"key_id_sale_apl_admin\"] = $key_id\r\n sale[\"created_at\"] = $time\r\n sale[\"buyer_transferred_at\"] = $transferredAt\r\n sale[\"status\"] = $WAITING_MANAGER\r\n\r\n saleId = DBInsert(\"ts_sales\", sale)\r\n\r\n // role Apla sales manager notification\r\n var params map title page string\r\n title = Sprintf(\"Check sale id %v\", saleId)\r\n page = \"ts_transfer_manager\"\r\n params[\"sale_id\"] = saleId\r\n $roleAplManager = getRoleId(\"role_sale_manager\")\r\n @1NotificationsSend(\"rid,sender,text_header,page_name,params_map,closure_type,current_role_id\", $roleAplManager, 2, title, page, params, 1, $currentRole)\r\n }\r\n}", "Type": "contracts" }, { diff --git a/other/tokens_sale/blocks/ts_contract_investors.ptl b/other/tokens_sale/blocks/ts_contract_investors.ptl index f0ebccf23..851654913 100644 --- a/other/tokens_sale/blocks/ts_contract_investors.ptl +++ b/other/tokens_sale/blocks/ts_contract_investors.ptl @@ -3,21 +3,19 @@ Div(list-group-item mt-lg mb-lg ml-lg mr-lg){ Div(Class: h3 text-bold m0 text-center, Body: the KYC screening at SnapSwap International S.A.) Div(Class: h4 mt-xl, Body: Em(Date: 1st of November 2018)) - Div(Class: h4, Body: Em(Re: Invitation to submit purchase orders to buy APL Tokens)) + Div(Class: h4, Body: Em(Re: Invitation to submit purchase orders to buy APLA Tokens)) Div(Class: h4 mt-xl, Body: Dear Apla User,) Div(Class: h4, Body: We are very delighted that you have chosen the Apla blockchain platform to build decentralised applications, create ecosystems and accommodate your other business needs.) - Div(Class: h4, Body: According to Article 8.1 of the Apla General Terms and Conditions (link to the site), EGAAS S.A. will be charging a license fee for each transaction signed by Apla users on the platform. The license fee is payable in the internal virtual currency of the Apla platform ecosystem named APL tokens. Hence, in order to use the platform, you will need to have APL tokens on your APL Wallet prior to signing each transaction.) - Div(Class: h4, Body: EGAAS S.A. will be conducting an initial sale of APL Tokens from November 2018 until July 2019. The commercial terms of the sale are summarised below:) - Div(row){ - Div(col-sm-12 text-center){ - Button(Class: btn-xs btn-link, Page: ts_commercial_terms){ - Span(Class: h4, Body: The commercial terms) - }.Popup(70, The commercial terms) - } + Div(Class: h4, Body: According to Article 8.1 of the Apla General Terms and Conditions (Span(Class: text-primary, Body: www.apla.io)), EGAAS S.A. will be charging a license fee for each transaction signed by Apla users on the platform. The license fee is payable in the internal virtual currency of the Apla platform ecosystem named APLA tokens. Hence, in order to use the platform, you will need to have APLA tokens on your APLA Wallet prior to signing each transaction.) + Div(Class: h4){ + Span(EGAAS S.A. will be conducting an initial sale of APLA Tokens from November 2018 until July 2019. The commercial terms of the sale are summarised below:) + Button(Class: btn-xs btn-link, Page: ts_commercial_terms){ + Span(Class: h4, Body: The commercial terms) + }.Popup(70, The commercial terms) } - Div(Class: h4, Body: Please submit your purchase order to buy APL tokens after you have reviewed and agreed with the legal terms of sale.) + Div(Class: h4, Body: Please submit your purchase order to buy APLA tokens after you have reviewed and agreed with the legal terms of sale.) Div(Class: h4, Body: After we have received your purchase order, we will send you an invoice for making the payment of the purchase price.) Div(Class: h4, Body: Please reach out to us via the email Span(Class: text-primary, Body: luxembourg@apla.io) if you have any questions or require any clarification of the above terms. We’ll also give you an access to the online data room with all information and legal documents concerning the Apla project, if you require so.) diff --git a/other/tokens_sale/config.json b/other/tokens_sale/config.json index c38560a65..cce47a5d9 100644 --- a/other/tokens_sale/config.json +++ b/other/tokens_sale/config.json @@ -16,6 +16,14 @@ "Name": "TsConsensusAction", "Conditions": "ContractConditions(\"@1DeveloperCondition\")" }, + { + "Name": "TsFreeWalletAdd", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")" + }, + { + "Name": "TsFreeWalletDelete", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")" + }, { "Name": "TsKeyApprove", "Conditions": "ContractConditions(\"@1DeveloperCondition\")" @@ -77,6 +85,16 @@ "Conditions": "ContractConditions(\"@1DeveloperCondition\")", "Menu": "default_menu" }, + { + "Name": "ts_free_wallet_add", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Menu": "default_menu" + }, + { + "Name": "ts_free_wallets", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Menu": "default_menu" + }, { "Name": "ts_key_approve", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", @@ -135,7 +153,7 @@ }, { "Name": "ts_wallets", - "Permissions": "{\"insert\": \"ContractAccess(\\\"@1TsKeyApprove\\\")\", \"update\": \"ContractAccess(\\\"@1TsBuyerAction\\\",\\\"@1TsConsensusAction\\\")\", \"new_column\": \"ContractConditions(\\\"@1AdminCondition\\\")\"}" + "Permissions": "{\"insert\": \"ContractAccess(\\\"@1TsFreeWalletAdd\\\")\", \"update\": \"ContractAccess(\\\"@1TsBuyerAction\\\",\\\"@1TsConsensusAction\\\",\\\"@1TsKeyApprove\\\",\\\"@1TsFreeWalletDelete\\\")\", \"new_column\": \"ContractConditions(\\\"@1AdminCondition\\\")\"}" } ], "parameters": [ diff --git a/other/tokens_sale/contracts/TsFreeWalletAdd.sim b/other/tokens_sale/contracts/TsFreeWalletAdd.sim new file mode 100644 index 000000000..7ac75633f --- /dev/null +++ b/other/tokens_sale/contracts/TsFreeWalletAdd.sim @@ -0,0 +1,32 @@ +contract TsFreeWalletAdd { + data { + wallet_btc string + wallet_eth string + } + + conditions { + var adminRoleId int adminRoleName string + adminRoleId = Int(EcosysParam("role_sale_admin")) + adminRoleName = DBFind("@1roles").Where({"id": adminRoleId}).One("role_name") + + if adminRoleId == 0 { + warning Sprintf(LangRes("@1role_not_set_application_parameter", "en"), "role_sale_admin") + } + + if !RoleAccess(adminRoleId) { + warning Sprintf(LangRes("x_role_only_action", "en"), adminRoleName) + } + + if DBFind("ts_wallets").Where({"wallet_btc": $wallet_btc}).One("id") { + warning Sprintf(LangRes("wallet_btc_exists", "en"), $wallet_btc) + } + + if DBFind("ts_wallets").Where({"wallet_eth": $wallet_eth}).One("id") { + warning Sprintf(LangRes("wallet_eth_exists", "en"), $wallet_eth) + } + } + + action { + DBInsert("ts_wallets", {"wallet_btc": $wallet_btc, "wallet_eth": $wallet_eth}) + } +} \ No newline at end of file diff --git a/other/tokens_sale/contracts/TsFreeWalletDelete.sim b/other/tokens_sale/contracts/TsFreeWalletDelete.sim new file mode 100644 index 000000000..b5e666f75 --- /dev/null +++ b/other/tokens_sale/contracts/TsFreeWalletDelete.sim @@ -0,0 +1,23 @@ +contract TsFreeWalletDelete { + data { + wallet_id int + } + + conditions { + var adminRoleId int adminRoleName string + adminRoleId = Int(EcosysParam("role_sale_admin")) + adminRoleName = DBFind("@1roles").Where({"id": adminRoleId}).One("role_name") + + if adminRoleId == 0 { + warning Sprintf(LangRes("@1role_not_set_application_parameter", "en"), "role_sale_admin") + } + + if !RoleAccess(adminRoleId) { + warning Sprintf(LangRes("x_role_only_action", "en"), adminRoleName) + } + } + + action { + DBUpdate("ts_wallets", $wallet_id, {"deleted": 1}) + } +} \ No newline at end of file diff --git a/other/tokens_sale/contracts/TsKeyApprove.sim b/other/tokens_sale/contracts/TsKeyApprove.sim index 75222ed55..9e756bcc2 100644 --- a/other/tokens_sale/contracts/TsKeyApprove.sim +++ b/other/tokens_sale/contracts/TsKeyApprove.sim @@ -5,6 +5,31 @@ contract TsKeyApprove { current_role_id int } + func getFreeWallet() int { + var count_wallets int wallet_map map wallet_arr array + wallet_arr = DBFind("ts_wallets").Where({"key_id_buyer": 0, "deleted":0}).Order({"id": 1}) + + count_wallets = Len(wallet_arr) + if count_wallets == 0 { + warning LangRes("@1ts_free_wallet_not_found", "en") + } + + if count_wallets == 1 { + var managerRoleId int + managerRoleId = Int(EcosysParam("role_sale_manager")) + if managerRoleId > 0 { + var params map title page body string + title = LangRes("@1ts_free_wallets_emptied", "en") + body = LangRes("@1ts_free_wallets_need", "en") + page = "@1ts_notification" + @1NotificationsSend("rid,sender,text_header,text_body,page_name,params_map,closure_type,current_role_id", managerRoleId, 2, title, body, page, params, 1, $current_role_id) + } + } + + wallet_map = wallet_arr[0] + return Int(wallet_map["id"]) + } + conditions { if $public_key == "" { warning LangRes("@1public_key_empty", "en") @@ -48,7 +73,10 @@ contract TsKeyApprove { @1TokensSend("Recipient,Amount", IdToAddress($userKey), start_balance) if $key_type == "investor" { - DBInsert("ts_wallets", {"key_id_buyer": $userKey, "created_at": $block_time}) + $wallet_id = getFreeWallet() + $public_key = "04" + $public_key + $pub_short_buyer = Substr($public_key, 0, 12) + "..." + Substr($public_key, Size($public_key)-12, 12) + DBUpdate("ts_wallets", $wallet_id, {"key_id_buyer": $userKey, "created_at": $block_time, "pub_buyer": $public_key, "pub_short_buyer": $pub_short_buyer}) // new user notification var params map title page body string diff --git a/other/tokens_sale/contracts/TsTransferAdmin.sim b/other/tokens_sale/contracts/TsTransferAdmin.sim index db1018db9..2c56eb086 100644 --- a/other/tokens_sale/contracts/TsTransferAdmin.sim +++ b/other/tokens_sale/contracts/TsTransferAdmin.sim @@ -1,26 +1,28 @@ contract TsTransferAdmin { data { WalletStr string - Amount string CurrencyType int AmountApl money TransferredDate string TransferredTime string } - func getRoleId(name string) int{ + + func getRoleId(name string) int { var rid int rid = Int(EcosysParam(name)) - if rid == 0{ + if rid == 0 { warning Sprintf(LangRes("@1role_not_set_application_parameter", "en"), name) } return rid } + func trimZeroTime(s string) string { if Contains(s, "T00:00:00Z") { s = s Replace(s, "T00:00:00Z", "") } return s } + func dateAddTime(d, t string) string { var dt string if Size(t) == 5 { @@ -28,47 +30,68 @@ contract TsTransferAdmin { } return dt } - conditions{ + + conditions { $WAITING_MANAGER = 1 $WAITING_SELLER = 2 $FINISHED = 3 $REJECTED = 4 - if $AmountApl <= 0{ - warning "invalid amount APL" - } - if $Amount <= 0.0{ - warning "invalid amount" + if $AmountApl <= 0 { + warning "invalid amount APLA" } $transferredAt = UnixDateTime(dateAddTime($TransferredDate, $TransferredTime)) if $transferredAt == 0 { warning "invalid transfer datetime" } + $appId = Int(DBFind("@1applications").Where({ecosystem:$ecosystem_id, name:"Tokens sale"}).One("id")) - if $appId == 0{ + if $appId == 0 { warning LangRes("@1app_not_found", "en") } - $roleAplManager = getRoleId("role_sale_manager") + $currentRole = getRoleId("role_sale_admin") - if !RoleAccess($currentRole){ + if !RoleAccess($currentRole) { warning "this action allowed only for role id #" + $currentRole } - $WalletId = AddressToId($WalletStr) - $wallet = DBFind("ts_wallets").Where({key_id_buyer:$WalletId}).Row() - if !$wallet{ - warning "Buyer wallet not found" - } - if $CurrencyType <= 0 || $CurrencyType > 3{ + if $CurrencyType <= 0 || $CurrencyType > 3 { warning "Invalid Currency Type" } + + if $CurrencyType == 1 { + $wallet = DBFind("ts_wallets").Where({wallet_btc: $WalletStr}).Row() + } + if $CurrencyType == 2 { + $wallet = DBFind("ts_wallets").Where({wallet_eth: $WalletStr}).Row() + } + if $CurrencyType == 3 { + if $WalletStr == "" { + warning LangRes("@1public_key_empty", "en") + } + + $WalletStr = Replace($WalletStr, " ", "") + if HasPrefix($WalletStr, "04") { + $WalletStr = Substr($WalletStr, 2, Size($WalletStr) - 2) + } + var key_id_buyer int + key_id_buyer = PubToID($WalletStr) + if key_id_buyer == 0 || Size($WalletStr) != 128 { + warning LangRes("@1public_key_invalid", "en") + } + + $wallet = DBFind("ts_wallets").Where({key_id_buyer: key_id_buyer}).Row() + } + + if !$wallet { + warning "Buyer wallet not found" + } } action { var sale map saleId int sale["key_id_buyer"] = $wallet["key_id_buyer"] sale["currency_type"] = $CurrencyType - sale["amount"] = $Amount sale["amount_apl"] = $AmountApl sale["key_id_sale_apl_admin"] = $key_id sale["created_at"] = $time @@ -82,7 +105,7 @@ contract TsTransferAdmin { title = Sprintf("Check sale id %v", saleId) page = "ts_transfer_manager" params["sale_id"] = saleId + $roleAplManager = getRoleId("role_sale_manager") @1NotificationsSend("rid,sender,text_header,page_name,params_map,closure_type,current_role_id", $roleAplManager, 2, title, page, params, 1, $currentRole) - } } \ No newline at end of file diff --git a/other/tokens_sale/menus/default_menu.ptl b/other/tokens_sale/menus/default_menu.ptl index aade94656..cec44c48a 100644 --- a/other/tokens_sale/menus/default_menu.ptl +++ b/other/tokens_sale/menus/default_menu.ptl @@ -20,11 +20,14 @@ If(#ecosystem_id# == 1){ SetVar(seller_role_id, EcosysParam(Name:role_sale_seller)) Span("Set here the menu of the first ecosystem") - If(And(#admin_role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#))){ - MenuItem(Title:$@1ts_sales$, Page:@1ts_sales, Icon:"icon-credit-card") + If(And(#role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#,#role_id#==#snapswap_role_id#))){ + MenuItem(Title:$@1ts_free_wallets$, Page:@1ts_free_wallets, Icon:"icon-credit-card") } - If(And(#snapswap_role_id#>0,#role_id#==#snapswap_role_id#)){ + If(And(#role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#,#role_id#==#snapswap_role_id#))){ MenuItem(Title:$@1ts_wallets$, Page:@1ts_wallets, Icon:"icon-credit-card") } + If(And(#role_id#>0,Or(#role_id#==#admin_role_id#,#role_id#==#manager_role_id#,#role_id#==#seller_role_id#,#role_id#==#snapswap_role_id#))){ + MenuItem(Title:$@1ts_sales$, Page:@1ts_sales, Icon:"icon-credit-card") + } } } \ No newline at end of file diff --git a/other/tokens_sale/pages/ts_buyer_congratulation.ptl b/other/tokens_sale/pages/ts_buyer_congratulation.ptl index dc8c4a78d..0d8b18be3 100644 --- a/other/tokens_sale/pages/ts_buyer_congratulation.ptl +++ b/other/tokens_sale/pages/ts_buyer_congratulation.ptl @@ -1,153 +1,135 @@ -Div(list-group-item mt-lg mb-lg ml-lg mr-lg){ - Div(Class: h3 text-bold text-center pb-xl, Body: Purchase Order) - - Div(Class: h4 pb-lg, Body: In response to your invitation to submit a purchase order as of 1s tof November 2018, we would like to submit the below purchase order to buy APL Tokens: ) - Div(){ - Div(row){ - Div(col-md-12){ - Div(table tablez){ - Div(table__row){ - Div(table__cell table__cell_10){APL Wallet Number} - Div(table__cell table__cell_10){} - } - Div(table__row){ - Div(table__cell table__cell_10){Number of APL Tokens to buy} - Div(table__cell table__cell_10){} - } - Div(table__row){ - Div(table__cell table__cell_10 tborder){Payment means} - Div(table__cell table__cell_10 tborder){[EUR/BTC/ETH]} +DBFind(@1ts_wallets).Where({"key_id_buyer":#key_id#}).Vars(w) +If(#w_id# > 0){ + Div(list-group-item mt-lg mb-lg ml-lg mr-lg){ + Div(Class: h3 text-bold text-center pb-xl, Body: Purchase Order) + Div(Class: h4 pb-lg, Body: In response to your invitation to submit a purchase order as of 1s tof November 2018, we would like to submit the below purchase order to buy APLA Tokens: ) + Div(){ + Div(row){ + Div(col-md-12){ + Div(table tablez){ + Div(table__row){ + Div(table__cell table__cell_10){APLA Wallet Number} + Div(table__cell table__cell_10){Address(#key_id#)} + } + Div(table__row){ + Div(table__cell table__cell_10){Number of APLA Tokens to buy} + Div(table__cell table__cell_10){} + } + Div(table__row){ + Div(table__cell table__cell_10 tborder){Payment means} + Div(table__cell table__cell_10 tborder){ + Div(Class: text-normal, Body: BTC: #w_wallet_btc#) + Div(Class: text-normal, Body: ETH: #w_wallet_eth#) + } + } } } } + }.Style( + .row-flex { + display: flex; + flex-flow: row wrap; + } + .table { + display: table; + border: solid 1px #000000; + } + .tablez { + border: solid 1px #000000; + } + .table .table__head { + display: table-header-group; + background: blue; + color: #fff; + } + .table .table__head .table__cell { + font-size: 15px; + color: #000000; + background: #B7B7B7; + } + .table > div:not(.table__body) { + display: table-row-group; + } + .table .table__body:last-child .table__row:last-child .table__cell { + border-bottom: none; + } + .table .table__row { + display: table-row; + flex-direction: row; + flex-wrap: no-wrap; + } + .table .table__row:nth-child(2n) { + display: table-row; + flex-direction: row; + flex-wrap: no-wrap; + border-left: solid 1px red; + } + .table .table__row .table__cell { + border-bottom: solid 1px #000000; + } + .table .table__cell { + display: table-cell; + padding: 8px 10px; + font-size: 14px; + color: #000000; + border-right: solid 1px #000000; + } + .tborder { + border-bottom: 0!important; + } + .table .table__cell:last-child { + border-right: none; + } + .table .table__cell.table__cell_collapse { + width: 1px; + } + .table .table__cell.table__cell_10 { + width: 10%; + } + .table .table__cell.table__cell_20 { + width: 20%; + } + .table .table__cell.table__cell_25 { + width: 25%; + } + .table .table__cell.table__cell_30 { + width: 30%; + } + .table .table__cell.table__cell_40 { + width: 40%; + } + .table .table__cell.table__cell_50 { + width: 50%; + } + .table .table__cell.table__cell_60 { + width: 60%; + } + .table .table__cell.table__cell_70 { + width: 70%; + } + .table .table__cell.table__cell_80 { + width: 80%; + } + .table .table__cell.table__cell_18 { + width: 18%; + } + .table .table__cell.table__cell_90 { + width: 90%; + } + .table .table__cell.table__cell_stretch { + width: 100%; + } + ) + Div(Class: h4, Body: We hereby acknowledge the receipt of and agree with the Standard Terms & Conditions of Sale. ) + Div(){ + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("closed").Vars(note) + If(#note_closed# == 0){ + Button(Body: $@1readed$, Class: btn btn-primary pull-right, Page: default_page, Contract: NotificationsClose, Params: "notific_id=#notific_id#") } - }.Style( - .row-flex { - display: flex; - flex-flow: row wrap; - } - - .table { - display: table; - border: solid 1px #000000; - } - - .tablez { - border: solid 1px #000000; - } - - .table .table__head { - display: table-header-group; - background: blue; - color: #fff; - } - - .table .table__head .table__cell { - font-size: 15px; - color: #000000; - background: #B7B7B7; - - } - - .table > div:not(.table__body) { - display: table-row-group; - } - - .table .table__body:last-child .table__row:last-child .table__cell { - border-bottom: none; - } - - .table .table__row { - display: table-row; - flex-direction: row; - flex-wrap: no-wrap; - } - - .table .table__row:nth-child(2n) { - display: table-row; - flex-direction: row; - flex-wrap: no-wrap; - border-left: solid 1px red; - } - - .table .table__row .table__cell { - border-bottom: solid 1px #000000; - } - - .table .table__cell { - display: table-cell; - padding: 8px 10px; - font-size: 14px; - color: #000000; - border-right: solid 1px #000000; - } - - .tborder { - border-bottom: 0!important; - } - - .table .table__cell:last-child { - border-right: none; - } - - .table .table__cell.table__cell_collapse { - width: 1px; - } - - .table .table__cell.table__cell_10 { - width: 10%; - } - - .table .table__cell.table__cell_20 { - width: 20%; - } - - .table .table__cell.table__cell_25 { - width: 25%; - } - - .table .table__cell.table__cell_30 { - width: 30%; - } - - .table .table__cell.table__cell_40 { - width: 40%; - } - - .table .table__cell.table__cell_50 { - width: 50%; - } - - .table .table__cell.table__cell_60 { - width: 60%; - } - - .table .table__cell.table__cell_70 { - width: 70%; - } - - .table .table__cell.table__cell_80 { - width: 80%; - } - - .table .table__cell.table__cell_18 { - width: 18%; - } - - .table .table__cell.table__cell_90 { - width: 90%; - } - - .table .table__cell.table__cell_stretch { - width: 100%; - } - ) - Div(Class: h4, Body: We hereby acknowledge the receipt of and agree with the Standard Terms & Conditions of Sale. ) - - Div(){ - DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("closed").Vars(note) - If(#note_closed# == 0){ - Button(Body: $@1readed$, Class: btn btn-primary pull-right, Page: default_page, Contract: NotificationsClose, Params: "notific_id=#notific_id#") } } +}.Else{ + Div(list-group-item text-center h4 ml mr mt-lg){ + $@1wallet$ $@1not_found$ + } } \ No newline at end of file diff --git a/other/tokens_sale/pages/ts_buyer_contract.ptl b/other/tokens_sale/pages/ts_buyer_contract.ptl index dae56a848..7da396232 100644 --- a/other/tokens_sale/pages/ts_buyer_contract.ptl +++ b/other/tokens_sale/pages/ts_buyer_contract.ptl @@ -1,28 +1,28 @@ DBFind(@1ts_wallets).Where({key_id_buyer:#key_id#, key_id_signer:0, rejected_at:0}).Vars(unconfirmed_wallet) If(#unconfirmed_wallet_id#>0){ Div(list-group-item mt-lg mb-lg ml-lg mr-lg){ - Div(Class: h3 text-bold m0 text-center, Body: APL Tokens) + Div(Class: h3 text-bold m0 text-center, Body: APLA Tokens) Div(Class: h3 text-bold m0 text-center, Body: Standard Terms and Conditions of Sale) Div(Class: h4 mt-xl text-bold, Body: 1. Introduction) - Div(Class: h4, Body: The present standard terms and conditions of sale (T&Cs) govern the relationship between the Seller and Buyer in connection with the sale and purchase of the APL Tokens as per the EGAAS S.A. letter to the Apla Users as of 1st of November 2018.).Style(padding-right: 60px!important;) + Div(Class: h4, Body: The present standard terms and conditions of sale (T&Cs) govern the relationship between the Seller and Buyer in connection with the sale and purchase of the APLA Tokens as per the EGAAS S.A. letter to the Apla Users as of 1st of November 2018.).Style(padding-right: 60px!important;) Div(Class: h4 mt-xl text-bold, Body: Glossary of Terms) Div(){ Div(Class: h4, Body: Strong(Body: 1.1) Unless the context requires otherwise, the following terms of this Article 1 shall be used in this Agreement:) - Div(Class: h4, Body: Strong(Body: APL Wallet) means a software application for storing, holding and transferring APL Tokens;) - Div(Class: h4, Body: Strong(Body: APL Tokens) means a digital representation of value generated by the source code of the Apla platform ecosystem that is used by Apla users to pay a license fee for the execution of smart contracts, creation of tables, and adding new columns and rows to them in all Apla ecosystems;) + Div(Class: h4, Body: Strong(Body: APLA Wallet) means a software application for storing, holding and transferring APLA Tokens;) + Div(Class: h4, Body: Strong(Body: APLA Tokens) means a digital representation of value generated by the source code of the Apla platform ecosystem that is used by Apla users to pay a license fee for the execution of smart contracts, creation of tables, and adding new columns and rows to them in all Apla ecosystems;) Div(Class: h4, Body: Strong(Body: Apla Contractual Documentation) means the Terms & Conditions and Apla policies, as amended from time to time, that can be downloaded from Span(Class: text-primary, Body: www.apla.io) website; ) Div(Class: h4, Body: Strong(Body: Apla platform) means a software program for executing smart laws and smart contracts based on the distributed ledger technology, the source code of which is stored at GitHub.com/AplaProject. The program operates on the basis of peer to peer (P2P) architecture that is a system of peer client-side programs installed on users' computers and participating in data exchange via peer to peer (P2P) computer network; ) Div(Class: h4, Body: Strong(Body: Apla Software) means the Apla platform software the source code of which is published at GitHub.com/AplaProject; ) Div(Class: h4, Body: Strong(Body: Buyer) means a legal entity or individual that has signed the Commercial Terms with the Seller; ) - Div(Class: h4, Body: Strong(Body: Commercial Terms) means the price, payment, delivery and other terms of sale of APL Tokens indicated in the Seller’s letter to the potential Buyers as of 1st of November 2018;) + Div(Class: h4, Body: Strong(Body: Commercial Terms) means the price, payment, delivery and other terms of sale of APLA Tokens indicated in the Seller’s letter to the potential Buyers as of 1st of November 2018;) Div(Class: h4, Body: Strong(Body: Laws) means the civil law in general, any constitution, legislation, decree, order, instruction, rule, regulation, ordinance, code, directive, by-law, judgment, international treaty or any other legislative or quasi-legislative measure related, in each case, to the respective jurisdiction that may be applicable to any transaction closed or to the circumstances existing as of the respective date and, in each case (if any liability is stipulated by or may arise in accordance with them) including any former provision (that may be statutorily amended or re-enacted from time to time) that was directly or indirectly replaced by such provision;) Div(Class: h4, Body: Strong(Body: Luxembourg) means the Grand Duchy of Luxembourg;) Div(Class: h4, Body: Strong(Body: Parties) means both the Seller and Buyer;) Div(Class: h4, Body: Strong(Body: Party) means either the Seller or Buyer as the context suggests; ) Div(Class: h4, Body: Strong(Body: Public Authority) means any supranational, national, municipal, local or foreign public authority or organisation, or any department, commission, administration, bureau, agency, court or instrumentality, subdivision or any other authority thereof, or any quasi-public or private authority having any regulatory, tax, financial regulation and any other public or quasi-public authority) - Div(Class: h4, Body: Strong(Body: Purchase Order) means an order to purchase APL Tokens submitted by the Buyer to the Seller in accordance with the Commercial Terms; ) + Div(Class: h4, Body: Strong(Body: Purchase Order) means an order to purchase APLA Tokens submitted by the Buyer to the Seller in accordance with the Commercial Terms; ) Div(Class: h4, Body: Strong(Body: Seller) means Strong(Body: EGAAS S.A.,) a legal entity incorporated under the laws of the Grand Duchy of Luxembourg, registered at RCS Luxembourg under the number B216 352 and having its registered office at L-1273 Luxembourg, 20, rue de Bitbourg; ) Div(Class: h4, Body: Strong(Body: SnapSwap) means SnapSwap International S.A., a legal entity incorporated under the laws of the Grand Duchy of Luxembourg, having its registered office at 59, Boulevard Royal L-2449 Luxembourg and authorised as an electronic money institution by the Ministry of Finance. ) Div(Class: h4, Body: Strong(Body: 1.2 In the context of this Agreement:) ) @@ -36,19 +36,19 @@ If(#unconfirmed_wallet_id#>0){ }.Style(padding-left: 50px!important;) Div(Class: h4, Body: Strong(Body: 2 Subject matter) ) - Div(Class: h4, Body: Strong(Body: 2.1) Subject to the terms and conditions set forth herein, Seller shall sell and Buyer shall buy the number of APL Tokens indicated in Purchase Order of Buyer to the extent such an order has been accepted by Seller. Seller shall be deemed accepted Purchase Order of Buyer by sending an invoice for making the payment of the purchase price to Buyer in response to the submitted Purchase Order.) - Div(Class: h4, Body: Strong(Body: 2.2) No U.S. Buyers. APL Tokens during the initial sale are not being offered to U.S. persons. U.S. persons are strictly prohibited and restricted from purchasing APL Tokens and Seller is not soliciting purchases by U.S. persons in any way. ) - Div(Class: h4, Body: Strong(Body: 2.3) APL Tokens are not intended to be offered for investment purposes. The pure purpose of the legitimate use of APL Tokens is to pay for license fees in connection with the execution of transactions on Apla Platform. ) - Div(Class: h4, Body: Strong(Body: 2.4) Buyer acknowledges and agrees that Buyer is not purchasing APL Tokens for purposes of investment, speculation, as some type of arbitrage strategy, for immediate resale or other financial purposes. ) + Div(Class: h4, Body: Strong(Body: 2.1) Subject to the terms and conditions set forth herein, Seller shall sell and Buyer shall buy the number of APLA Tokens indicated in Purchase Order of Buyer to the extent such an order has been accepted by Seller. Seller shall be deemed accepted Purchase Order of Buyer by sending an invoice for making the payment of the purchase price to Buyer in response to the submitted Purchase Order.) + Div(Class: h4, Body: Strong(Body: 2.2) No U.S. Buyers. APLA Tokens during the initial sale are not being offered to U.S. persons. U.S. persons are strictly prohibited and restricted from purchasing APLA Tokens and Seller is not soliciting purchases by U.S. persons in any way. ) + Div(Class: h4, Body: Strong(Body: 2.3) APLA Tokens are not intended to be offered for investment purposes. The pure purpose of the legitimate use of APLA Tokens is to pay for license fees in connection with the execution of transactions on Apla Platform. ) + Div(Class: h4, Body: Strong(Body: 2.4) Buyer acknowledges and agrees that Buyer is not purchasing APLA Tokens for purposes of investment, speculation, as some type of arbitrage strategy, for immediate resale or other financial purposes. ) - Div(Class: h4, Body: Strong(Body: 3 Transfer of APL Tokens) ) - Div(Class: h4, Body: Strong(Body: 3.1) Buyer shall open APL Wallet in accordance with the rules set forth in the Apla Contractual Documentation and following the KYC (know-your-customer procedure) with SnapSwap. Buyer shall inform Seller about the public key of the opened APL Wallet in Purchase Order.) - Div(Class: h4, Body: Strong(Body: 3.2) Seller shall transfer the number of APL Tokens, indicated in Purchase Order accepted by Seller, to the APL Wallet of Buyer within 2 business days following the receipt of the purchase price from the Buyer. ) + Div(Class: h4, Body: Strong(Body: 3 Transfer of APLA Tokens) ) + Div(Class: h4, Body: Strong(Body: 3.1) Buyer shall open APLA Wallet in accordance with the rules set forth in the Apla Contractual Documentation and following the KYC (know-your-customer procedure) with SnapSwap. Buyer shall inform Seller about the public key of the opened APLA Wallet in Purchase Order.) + Div(Class: h4, Body: Strong(Body: 3.2) Seller shall transfer the number of APLA Tokens, indicated in Purchase Order accepted by Seller, to the APLA Wallet of Buyer within 2 business days following the receipt of the purchase price from the Buyer. ) Div(Class: h4, Body: Strong(Body: 4 Representations and warranties of the Parties)) - Div(Class: h4, Body: Strong(Body: 4.1) Seller gives no guarantee and/or warrantee as regards the market value of APL Tokens throughout the term of this T&C and thereafter. ) - Div(Class: h4, Body: Strong(Body: 4.2) Buyer is made aware of the potential high volatility of APL Tokens on the market and other risks pretraining to crypto-currencies as further defined in the warning of the CSSF published on Span(Class: text-primary, Body: http://www.cssf.lu/fileadmin/files/Protection_consommateurs/Avertissements/W_virtual_currencies_140318_eng.pdf)) + Div(Class: h4, Body: Strong(Body: 4.1) Seller gives no guarantee and/or warrantee as regards the market value of APLA Tokens throughout the term of this T&C and thereafter. ) + Div(Class: h4, Body: Strong(Body: 4.2) Buyer is made aware of the potential high volatility of APLA Tokens on the market and other risks pretraining to crypto-currencies as further defined in the warning of the CSSF published on Span(Class: text-primary, Body: http://www.cssf.lu/fileadmin/files/Protection_consommateurs/Avertissements/W_virtual_currencies_140318_eng.pdf)) Div(Class: h4, Body: Strong(Body: 4.3) Hereby Buyer gives to Seller the following true, correct and irrevocable representations and warranties that shall be true at the date of submitting Purchase Order to Seller: ) Div(){ Div(){ @@ -62,7 +62,7 @@ If(#unconfirmed_wallet_id#>0){ Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.1) Span(Class: underline, Body: Legal Status of Seller.) Seller is a corporation duly established and acting on a legal basis in accordance with the legislation of Luxembourg. Seller is not undergoing any liquidation and/or bankruptcy procedure. ) Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.2) Span(Class: underline, Body: Powers and Authorities of Seller.) Seller has right, power and authority to enter into, execute and deliver these T&Cs, any other documents contemplated hereby and the transaction contemplated hereby and to perform its obligations hereunderand all corporate actions necessary for this has been undertaken by Seller. The T&Cs are valid and legally binding for Seller and can be lawfully enforced in accordance with its terms. The signatory of Seller that has executed the T&Cs was duly granted with the relevant powers.) Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.3) Span(Class: underline, Body: No Conflict.) The execution of the T& and the fulfilment of obligations by Seller will not constitute any conflict with (i) the provisions of Seller’s constituent documents and any other documents regulating the Seller’s status and activities, (ii) any laws, rules or regulations, arbitral awards, court rulings, official orders, resolutions, instructions etc. applicable to Seller. Seller obtained all applicable governmental, statutory, regulatory or other consents, licences, authorisations, waivers and exemptions required to enter into these T&Cs and any other documents contemplated hereby and to perform its obligations hereunder.) - Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.4) Span(Class: underline, Body: Title to APL Tokens.) As of the date of accepting Purchase Order, Seller will have legal and unrestricted title to the APL Tokens being the subject matter of these T&Cs, free from any pledge, lien, any other encumbrances and defects. ) + Div(Class: h4, Body: Strong(Class: wrap, Body: 4.4.4) Span(Class: underline, Body: Title to APLA Tokens.) As of the date of accepting Purchase Order, Seller will have legal and unrestricted title to the APLA Tokens being the subject matter of these T&Cs, free from any pledge, lien, any other encumbrances and defects. ) }.Style(padding-left: 50px!important;) }.Style( .underline { @@ -74,30 +74,30 @@ If(#unconfirmed_wallet_id#>0){ ) Div(Class: h4, Body: Strong(Body: 4.5) Unless otherwise specifically provided in these T&Cs, in the event that at any time it appears that any of the warranties and representations was not true and correct in any material respect when made, then the Party to whom these warranties and representations were given shall give prompt written notice of any such breach to the other Party and give this default Party the opportunity to eliminate (at the defaulting Party’s own cost and expense) any such breach and the Party to whom these warranties and representations were given shall be required (at the defaulting Party’s own cost and expense) to provide such assistance to the default Party with remedying any such breach as the defaulting party may reasonably request.) Div(Class: h4, Body: Strong(Body: 5 Liability)) - Div(Class: h4, Body: Strong(Body: 5.1 ) The Seller’s liability under these T&Cs may not exceed the amount of the purchase price received by Seller from Buyer for APL Tokens.) + Div(Class: h4, Body: Strong(Body: 5.1 ) The Seller’s liability under these T&Cs may not exceed the amount of the purchase price received by Seller from Buyer for APLA Tokens.) Div(Class: h4, Body: Strong(Body: 5.2) Seller shall in no case be liable for indirect or consequential damages incurred by Buyer. ) Div(Class: h4, Body: Strong(Body: 5.3) None of the Parties shall be liable for a failure to properly perform their duties under these T&Cs if this non-performance or poor performance is resulted from force majeure events. Force majeure event means any event and/or circumstance, which is beyond the reasonable control of, and is not attributable to, the affected party resulting in the affected party being prevented from performing or being delayed in the performance of any of its obligations under the T&Cs. Force majeure event may include, but not limited to, an act of a Public Authority or court of any state, interruption or unavailability of power supplies and telecommunication networks in addition to the acts of God. ) Div(Class: h4, Body: Strong(Body: 6 Entry into Force)) Div(Class: h4, Body: Strong(Body: 6.1) These T&Cs shall come into force on the date when Seller has accepted Purchase Order of Buyer. ) Div(Class: h4, Body: Strong(Body: 7 Termination of agreement)) Div(Class: h4, Body: The agreement between the Parties shall be deemed terminated on the following grounds: ) - Div(Class: h4, Body: Strong(Body: 7.1) Buyer has not transferred the purchase price to Seller for APL Tokens indicated in Purchase Order accepted by Seller within 5 business days from the acceptance date. ) + Div(Class: h4, Body: Strong(Body: 7.1) Buyer has not transferred the purchase price to Seller for APLA Tokens indicated in Purchase Order accepted by Seller within 5 business days from the acceptance date. ) Div(Class: h4, Body: Strong(Body: 8 Severability)) Div(Class: h4, Body: If any part of this agreement is recognized invalid, unlawful, or unenforceable, the other part will continue to be valid and enforceable to the fullest extent permitted by applicable Law. The invalid, unlawful, or unenforceable part shall be construed and further negotiated by the parties concerned in a manner compliant with applicable Law and consistent with original intentions of the Parties. ) Div(Class: h4, Body: Strong(Body: 9 Notices)) Div(Class: h4, Body: All notices under this Agreement shall be sent by registered mail or private courier to the following addresses:) - Div(Class: h4, Body: If to Seller: L-1273 Luxembourg, 20, rue de Bitbourg) - Div(Class: h4, Body: If to the Buyer: address of APL Wallet of Buyer) - Div(Class: h4, Body: or to such other addresses as shall be indicated by the Parties hereto. All notices shall be deemed to have been received [7 (seven) calendar] days after posting by registered mail or upon confirmation of receipt if sent by private courier.) + Div(Class: h4, Body: If to Seller: L-1273 Luxembourg, 20, rue de Bitbourg) + Div(Class: h4, Body: If to the Buyer: address of APLA Wallet of Buyer) + Div(Class: h4, Body: or to such other addresses as shall be indicated by the Parties hereto. All notices shall be deemed to have been received [7 (seven) calendar] days after posting by registered mail or upon confirmation of receipt if sent by private courier.) Div(Class: h4, Body: Strong(Body: 10 Dispute Resolution)) Div(Class: h4, Body: All disputes arising out of or in connection with these T&Cs shall be referred to the Arbitration Centre at the Chamber of Commerce and Industry of Luxembourg for final resolution under the Rules of Arbitration established by such Centre by one arbitrator appointed in accordance with those Rules.) - Div(Class: h4, Body: The law applicable to the relations of the Parties under these T&Cs shall be the Law of Luxembourg.) + Div(Class: h4, Body: The law applicable to the relations of the Parties under these T&Cs shall be the Law of Luxembourg.) }.Style(padding-left: 50px!important;) - Div(mt-xl mb-lg){ - Button(Body: $@1reject$, Class: btn btn-danger, Page: default_page, Contract: TsBuyerAction, Params: "Action=reject") - Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: default_page, Contract: TsBuyerAction, Params: "Action=accept") - } + Div(mt-xl mb-lg){ + Button(Body: $@1reject$, Class: btn btn-danger, Page: default_page, Contract: TsBuyerAction, Params: "Action=reject") + Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: default_page, Contract: TsBuyerAction, Params: "Action=accept") + } }.Style( padding-left: 60px!important; diff --git a/other/tokens_sale/pages/ts_commercial_terms.ptl b/other/tokens_sale/pages/ts_commercial_terms.ptl index cc6505e8a..4fa3345ef 100644 --- a/other/tokens_sale/pages/ts_commercial_terms.ptl +++ b/other/tokens_sale/pages/ts_commercial_terms.ptl @@ -6,7 +6,7 @@ Div(ml mr){ Div(table__head){ Div(table__row){ Div(table__cell table__cell_20){Round} - Div(table__cell table__cell_10){Volume of APL Tokens} + Div(table__cell table__cell_10){Volume of APLA Tokens} Div(table__cell table__cell_10){Price, EUR, excl. VAT} Div(table__cell table__cell_10){Discount} Div(table__cell){Extra terms} @@ -17,9 +17,9 @@ Div(ml mr){ Div(table__cell){15 100 000} Div(table__cell){5} Div(table__cell){20%} - Div(table__cell){25% of unsold APL tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers purchased the tokens during Round 1. - This option becomes available only if the conditions for free distribution of APL Tokens to the buyers participating to the Rounds 2-7 have been fulfilled. - If you acquire APL Tokens for the amount of at least 125,000 EUR, you will be entitled to additional benefits. Please reach out to us via email luxembourg@apla.io to get more details. + Div(table__cell){25% of unsold APLA tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers purchased the tokens during Round 1. + This option becomes available only if the conditions for free distribution of APLA Tokens to the buyers participating to the Rounds 2-7 have been fulfilled. + If you acquire APLA Tokens for the amount of at least 125,000 EUR, you will be entitled to additional benefits. Please reach out to us via email luxembourg@apla.io to get more details. } } Div(table__row){ @@ -27,7 +27,7 @@ Div(ml mr){ Div(table__cell){1 000 000} Div(table__cell){5} Div(table__cell){0%} - Div(table__cell tborder){75% of unsold APL tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers participating to the respective round. This option becomes available only if at least 40% of APL tokens have been sold out during this round. In all other cases, the unsold tokens remain the property of the current owner. + Div(table__cell tborder){75% of unsold APLA tokens during each Round 2 to 7 will be proportionally distributed for free among the buyers participating to the respective round. This option becomes available only if at least 40% of APLA tokens have been sold out during this round. In all other cases, the unsold tokens remain the property of the current owner. } } Div(table__row){ @@ -65,10 +65,10 @@ Div(ml mr){ Div(row mt-xl){ Div(col-sm-3){ - Div(Class: h5 text-bold, Body: 2. Delivery of APL Tokens) + Div(Class: h5 text-bold, Body: 2. Delivery of APLA Tokens) } Div(col-sm-9){ - Div(Class: h5, Body: The number of APL tokens you have paid for, will be delivered to your APL Wallet within 2 business days after EGAAS S.A. have received the payment of the purchase price.) + Div(Class: h5, Body: The number of APLA tokens you have paid for, will be delivered to your APLA Wallet within 2 business days after EGAAS S.A. have received the payment of the purchase price.) } } Div(row){ @@ -84,7 +84,7 @@ Div(ml mr){ Div(Class: h5 text-bold, Body: 4. Payment terms ) } Div(col-sm-9){ - Div(Class: h5, Body: If you make a payment in EUR, you will need to make a transfer of the purchase price from your EUR account with SnapSwap to the EUR account of EGAAS S.A. with the same financial institution. Please indicate in the payment order your APL Wallet number for the delivery of APL Tokens.) + Div(Class: h5, Body: If you make a payment in EUR, you will need to make a transfer of the purchase price from your EUR account with SnapSwap to the EUR account of EGAAS S.A. with the same financial institution. Please indicate in the payment order your APLA Wallet number for the delivery of APLA Tokens.) Div(Class: h5, Body: If you make a payment in BTC or ETH, the Bitstamp exchange rate of BTC/EUR or ETH/EUR shall be used to calculate the EUR equivalent. The Bitstamp rate shall be defined on the day EGAAS S.A. have received BTC or ETH into its wallet. ) Div(Class: h5, Body: The details of the BTC or ETH wallets of EGAAS S.A. will be communicated to you for each transaction individually after we have received your purchase order. ) } diff --git a/other/tokens_sale/pages/ts_consensus_contract.ptl b/other/tokens_sale/pages/ts_consensus_contract.ptl index dbf0b78ca..59a9feb8f 100644 --- a/other/tokens_sale/pages/ts_consensus_contract.ptl +++ b/other/tokens_sale/pages/ts_consensus_contract.ptl @@ -1,62 +1,86 @@ DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:"Tokens sale"}).Columns("id").Vars(application) -SetVar(row,"row mt-sm").(col_left,"col-sm-4 text-right").(col_right,"col-sm-8 text-left") SetVar(isStartProcessing,0) If(#notific_id#>0){ - DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("page_params->wallet_id,date_start_processing,notification->type,processing_info->member_id").Vars(note) + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("page_params->wallet_id,date_start_processing,notification->type,processing_info->member_id,closed").Vars(note) If(#note_date_start_processing#!=""){ SetVar(isStartProcessing,1) } } SetVar(this_page, ts_consensus_contract) -SetTitle($@1key_id_investor$) Div(content-wrapper){ - Div(row mt-sm){ - Div(col-lg-10 col-lg-offset-1){ - Form(panel panel-primary){ - DBFind(@1ts_wallets).Where({id:#note_page_params_wallet_id#, rejected_at:0}).Vars(wallet) - If(#wallet_id#>0){ - Div(panel-body){ - Div(#row#){ - Div(#col_left#){ - $@1key_id_investor$ - } - Div(#col_right#){ - LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#wallet_key_id_buyer#"){ - Address(#wallet_key_id_buyer#) - } - } - } - Div(#row# text-muted){ - Div(#col_left#){ - $@1signed_at$ - } - Div(#col_right#){ - DateTime(#wallet_signed_at#, "YYYY-MM-DD HH:MI:SS") - } - } + Form(){ + DBFind(@1ts_wallets).Where({id:#note_page_params_wallet_id#, rejected_at:0}).Vars(wallet) + If(#wallet_id#>0){ + Div(list-group-item){ + Div(text-center text-bold h4 m0){ + LangRes(@1key_id_investor) + } + } + Div(list-group-item){ + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1key_id_investor$ } - Div(panel-footer){ - If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){ - Button(Body: $@1reject$, Class: btn btn-default, Page: default_page, Contract: TsConsensusAction, Params: "Action=reject,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#") - Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: default_page, Contract: TsConsensusAction, Params: "Action=accept,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#") - }.ElseIf(#isStartProcessing#==1){ - Div(text-muted text-center){ - $@1notice_processing_started_another_member$ - } - }.ElseIf(#isStartProcessing#==0){ - Div(text-center){ - Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#") - } + Div(col-sm-9 text-left){ + LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#wallet_key_id_buyer#"){ + Address(#wallet_key_id_buyer#) } - } - }.Else{ - Div(panel-body){ - wallet $@1not_found$ + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1signed_at$ + } + Div(col-sm-9 text-left){ + DateTime(#wallet_signed_at#, "YYYY-MM-DD HH:MI:SS") + } + } + Div(row mt-sm){ + Div(col-sm-3 text-right text-bold){ + $@1pub_key$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_pub_buyer#) + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1ts_wallet_btc$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_wallet_btc#) + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1ts_wallet_eth$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_wallet_eth#) } } } + If(#note_closed# == 0){ + Div(list-group-item){ + If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){ + Button(Body: $@1reject$, Class: btn btn-default, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: TsConsensusAction, Params: "Action=reject,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#") + Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: TsConsensusAction, Params: "Action=accept,WalletId=#note_page_params_wallet_id#,NotificId=#notific_id#") + }.ElseIf(#isStartProcessing#==1){ + Div(text-muted text-center){ + $@1notice_processing_started_another_member$ + } + }.ElseIf(#isStartProcessing#==0){ + Div(text-right){ + Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#") + } + } + } + } + }.Else{ + Div(list-group-item text-center h4){ + $@1wallet$ $@1not_found$ + } } } } \ No newline at end of file diff --git a/other/tokens_sale/pages/ts_free_wallet_add.ptl b/other/tokens_sale/pages/ts_free_wallet_add.ptl new file mode 100644 index 000000000..eee354d70 --- /dev/null +++ b/other/tokens_sale/pages/ts_free_wallet_add.ptl @@ -0,0 +1,26 @@ +Form(){ + Div(row){ + Div(col-md-2 mt-lg text-right){ + Label(For: wallet_btc){ + LangRes(@1ts_wallet_btc) + } + } + Div(col-md-10){ + Input(Name: wallet_btc, Type: textarea).Validate(minLength:27, maxLength:34) + InputErr(Name: wallet_btc, minLength: $@1validate_wallet_btc$, maxLength: $@1validate_wallet_btc$) + } + } + Div(row mt){ + Div(col-md-2 mt-lg text-right){ + Label(For: wallet_eth){ + LangRes(@1ts_wallet_eth) + } + } + Div(col-md-10){ + Input(Name: wallet_eth, Type: textarea).Validate(minLength:40, maxLength:44) + InputErr(Name: wallet_btc, minLength: $@1validate_wallet_eth$, maxLength: $@1validate_wallet_eth$) + } + } + Button(Body: LangRes(@1add), Class: btn btn-primary pull-right mt, Page: @1ts_free_wallets, Contract: @1TsFreeWalletAdd) + Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1ts_free_wallets) +} \ No newline at end of file diff --git a/other/tokens_sale/pages/ts_free_wallets.ptl b/other/tokens_sale/pages/ts_free_wallets.ptl new file mode 100644 index 000000000..c785dddb0 --- /dev/null +++ b/other/tokens_sale/pages/ts_free_wallets.ptl @@ -0,0 +1,51 @@ +SetVar(this_page, @1ts_free_wallets).(this_table, @1ts_wallets) +Include(@1pager_header) + +SetTitle("$@1ts_free_wallets$") +SetVar(admin_role_id, EcosysParam(Name:role_sale_admin)) +If(And(#admin_role_id#>0,#role_id#==#admin_role_id#)){ + AddToolButton(Title:$@1ts_free_wallet_add$, Page: @1ts_free_wallet_add, Icon: icon-wallet).Popup(Header: $@1ts_free_wallet_add$, Width: "50") +} + +If(GetVar(search)!=""){ + SetVar(where, {$and: [{"deleted":0}, {"key_id_buyer":0}, {$or:[{"wallet_btc": {$like: #search#}},{"wallet_eth": {$like: #search#}}]}]}) +}.Else{ + SetVar(where, {$and: [{"deleted":0}, {"key_id_buyer":0}]}).(search,) +} + +Div(list-group-item ml-lg mr-lg pt-lg){ + SetVar(search_name, LangRes(@1wallet)) + Include(@1search) +} + +DBFind(#this_table#, src).Where(#where#).Order({"id": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_btc){ + Span(#wallet_btc#) +}.Custom(_eth){ + Span(#wallet_eth#) +}.Custom(action){ + Div(pull-right){ + If(#deleted#==0){ + Button(Body: Em(Class: fa fa-trash), Class: btn btn-default, Contract: @1TsFreeWalletDelete, Params: "wallet_id=#id#", Page: @1ts_free_wallets).Alert(Text: "$@1sure_want_delete$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + } + } +}.Count(count) + +Div(fullscreen){ + Div(table-responsive ml-lg mr-lg){ + Div(list-group-item){ + If(#count# > 0){ + Table(src, "$@1id$=id,$@1ts_wallet_btc$=_btc,$@1ts_wallet_eth$=_eth,=action") + }.Else{ + Div(Class: text-center h4 text-muted, Body: "$@1ts_free_wallets$ $@1not_founded$") + } + }.Style( + margin-top:-15px; + tbody > tr:nth-of-type(odd) { + background-color: #f8f9fc; + } + ) + } +} +Div(mt-sm ml-lg mr-sm mb-sm){ + Include(@1pager) +} \ No newline at end of file diff --git a/other/tokens_sale/pages/ts_notification.ptl b/other/tokens_sale/pages/ts_notification.ptl index 3b0bc845a..dfc1c1978 100644 --- a/other/tokens_sale/pages/ts_notification.ptl +++ b/other/tokens_sale/pages/ts_notification.ptl @@ -1,6 +1,6 @@ DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:"Tokens sale"}).Columns("id").Vars(application) If(#notific_id#>0){ - DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("notification->header,notification->body,id").Vars(note) + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("notification->type,notification->header,notification->body,id,processing_info->member_id,closed").Vars(note) } Div(content-wrapper){ @@ -9,20 +9,22 @@ Div(content-wrapper){ Form(panel panel-primary){ DBFind(@1ts_wallets).Where({key_id_signer:{$neq:0}, rejected_at:0}).Vars(wallet) If(#note_id#>0){ - Div(panel-body){ - Div(){ + Div(panel-body text-center){ + Div(h4 text-bold m0){ #note_notification_header# } - Div(){ + Div(m0){ #note_notification_body# } } - Div(panel-footer text-center){ - Button(Body: $@1readed$, Class: btn btn-primary, Page: @1default_page, Contract: NotificationsClose, Params: "notific_id=#notific_id#") - } - }.Else{ - Div(panel-body){ - Оповещение не найдено + If(#note_closed# == 0){ + Div(panel-footer text-right){ + If(Or(#note_notification_type#==1,#note_processing_info_member_id# == #key_id#)){ + Button(Body: $@1readed$, Class: btn btn-primary, Page: @1default_page, Contract: NotificationsClose, Params: "notific_id=#notific_id#") + }.ElseIf(#note_notification_type#==2){ + Button(Body: $@1processing$, Class: btn btn-primary, Page: @1ts_notification, PageParams: "notific_id=#notific_id#", Contract: NotificationsProcess, Params: "notific_id=#notific_id#") + } + } } } } diff --git a/other/tokens_sale/pages/ts_sales.ptl b/other/tokens_sale/pages/ts_sales.ptl index cc061f844..dd960304b 100644 --- a/other/tokens_sale/pages/ts_sales.ptl +++ b/other/tokens_sale/pages/ts_sales.ptl @@ -13,7 +13,7 @@ If(And(#admin_role_id#>0,#role_id#==#admin_role_id#)){ } If(GetVar(search)!=""){ - SetVar(where, {$or:[{"key_id_buyer":#search#},{"key_id_sale_apl_manager":#search#}, {"key_id_sale_apl_admin":#search#}, {"key_id_seller":#search#}]}) + SetVar(where, {id:#search#}) }.Else{ SetVar(where, {id:{$gt:0}}).(search,) } @@ -23,18 +23,18 @@ Div(list-group-item ml-lg mr-lg pt-lg){ Include(@1search) } -DBFind(#this_table#, src).Where(#where#).Order({"id": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_btat){ +DBFind(#this_table#, src).Where(#where#).Order({"id": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_id){ + Span(#id#) + SetVar(w_wallet_btc,).(w_wallet_eth,).(w_pub_short_buyer,) + DBFind(@1ts_wallets).Where({"key_id_buyer":#key_id_buyer#}).Vars(w) +}.Custom(_btat){ Span(Class: text-muted, Body: DateTime(#buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS)) }.Custom(_cat){ Span(Class: text-muted, Body: DateTime(#created_at#, Format: YYYY-MM-DD HH:MI:SS)) }.Custom(_amount){ - Div(text-right){ - Span(Class: text-bold, Body: #amount#).Style(margin-right:5px;) - Span(Class: text-bold, Body: AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #currency_type#)) - } Div(text-right){ Span(Class: text-bold, Body: Money(#amount_apl#)).Style(margin-right:5px;) - Span(Class: text-bold, Body: APL) + Span(Class: text-bold, Body: APLA) } }.Custom(_info){ Button(Class: btn-xs btn-link, Page: @1ts_transfer_view, PageParams: "Id=#id#"){ @@ -56,14 +56,26 @@ DBFind(#this_table#, src).Where(#where#).Order({"id": -1}).Limit(#pager_limit#). LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#key_id_buyer#"){ Address(#key_id_buyer#) } - Div(Class:text-muted m0 h6, Body:#key_id_buyer#) + Div(){ + Span(Class: h6 text-muted, Body: PUB:) + Span(Class: h6 text-muted ml-sm, Body: #w_pub_short_buyer#) + } +}.Custom(_wlts){ + Div(){ + Span(Class: h6 text-muted, Body: BTC:) + Span(Class: h6 ml-sm, Body: #w_wallet_btc#) + } + Div(){ + Span(Class: h6 text-muted, Body: ETH:) + Span(Class: h6 ml-sm, Body: #w_wallet_eth#) + } }.Count(count) Div(fullscreen){ Div(table-responsive ml-lg mr-lg){ Div(list-group-item){ If(#count# > 0){ - Table(src, "$@1id$=id,$@1key_id_investor$=_buyer,$@1information$=_info,$@1investor_funds_transfer_date$=_btat,$@1created_at$=_cat,$@1status$=_status,=_action,=_amount") + Table(src, "$@1id$=_id,$@1key_id_investor$=_buyer,$@1wallets$=_wlts,$@1information$=_info,$@1investor_funds_transfer_date$=_btat,$@1created_at$=_cat,$@1status$=_status,=_action,=_amount") }.Else{ Div(Class: text-center h4 text-muted, Body: "$@1sales$ $@1not_founded$") } diff --git a/other/tokens_sale/pages/ts_transfer_admin.ptl b/other/tokens_sale/pages/ts_transfer_admin.ptl index 97f9c8150..fb661a5ad 100644 --- a/other/tokens_sale/pages/ts_transfer_admin.ptl +++ b/other/tokens_sale/pages/ts_transfer_admin.ptl @@ -1,45 +1,58 @@ -DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:"Tokens sale"}).Columns("id").Vars(application) SetVar(this_page, @1ts_transfer_admin).(back_page, @1ts_sales) -AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Source:currency_type) -DBFind(@1ts_wallets, wallets).Where({key_id_buyer:{$neq:0}, key_id_signer:{$neq:0}, rejected_at:0}).Count(wallets_count).Custom(_name){ - Address(#key_id_buyer#) (#key_id_buyer#) +If(GetVar(type_currency)==""){ + SetVar(type_currency,1) } + Form(){ - Div(row){ - Div(col-sm-4 mt-sm text-right){ - $@1wallet$ + Div(row mb-sm){ + Div(col-md-4 mt-sm text-right text-bold){ + LangRes(@1type) } - Div(col-sm-8 text-left){ - Input(Name: WalletStr, Placeholder: "xxxx-xxxx-xxxx-xxxx-xxxx") + Div(col-md-8 text-left){ + If(GetVar(type_currency)==1){ + Input(Name: CurrencyType, Type: hidden, Value: 1) + Button(Body: BTC, Page: #this_page#, PageParams: "type_currency=1", Class: btn btn-primary disabled mr-lg).Popup(Header: $@1ts_add_transfer$, Width: "50") + Button(Body: ETH, Page: #this_page#, PageParams: "type_currency=2", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: "50") + Button(Body: EUR, Page: #this_page#, PageParams: "type_currency=3", Class: btn btn-primary).Popup(Header: $@1ts_add_transfer$, Width: "50") + }.ElseIf(GetVar(type_currency)==2){ + Input(Name: CurrencyType, Type: hidden, Value: 2) + Button(Body: BTC, Page: #this_page#, PageParams: "type_currency=1", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: "50") + Button(Body: ETH, Page: #this_page#, PageParams: "type_currency=2", Class: btn btn-primary disabled mr-lg).Popup(Header: $@1ts_add_transfer$, Width: "50") + Button(Body: EUR, Page: #this_page#, PageParams: "type_currency=3", Class: btn btn-primary).Popup(Header: $@1ts_add_transfer$, Width: "50") + }.ElseIf(GetVar(type_currency)==3){ + Input(Name: CurrencyType, Type: hidden, Value: 3) + Button(Body: BTC, Page: #this_page#, PageParams: "type_currency=1", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: "50") + Button(Body: ETH, Page: #this_page#, PageParams: "type_currency=2", Class: btn btn-primary mr-lg).Popup(Header: $@1ts_add_transfer$, Width: "50") + Button(Body: EUR, Page: #this_page#, PageParams: "type_currency=3", Class: btn btn-primary disabled).Popup(Header: $@1ts_add_transfer$, Width: "50") + } } } - Div(row mt-sm){ - Div(col-sm-4 mt-sm text-right){ - $@1investment_amount$ + Div(row){ + Div(col-sm-4 mt text-bold text-right){ + If(GetVar(type_currency)==1){ + LangRes(@1ts_wallet_btc) + }.ElseIf(GetVar(type_currency)==2){ + LangRes(@1ts_wallet_eth) + }.ElseIf(GetVar(type_currency)==3){ + LangRes(@1pub_key) + } } Div(col-sm-8 text-left){ - Div(row){ - Div(col-sm-8){ - Input(Name:Amount, Type:number) - } - Div(col-sm-4){ - Select(Name:CurrencyType, Source:currency_type, NameColumn: name, ValueColumn: id) - } - } + Input(Name: WalletStr, Type: textarea) } } Div(row mt-sm){ - Div(col-sm-4 mt-sm text-right){ - $@1amount_apl$ + Div(col-sm-4 mt-sm text-right text-bold){ + LangRes(@1amount_apl) } Div(col-sm-8 text-left){ Input(Name:AmountApl, Type:number) } } Div(row mt-sm){ - Div(col-sm-4 mt-sm text-right){ - $@1investor_funds_transfer_date$ + Div(col-sm-4 mt-sm text-right text-bold){ + LangRes(@1investor_funds_transfer_date) } Div(col-sm-8 text-left){ Div(row){ @@ -47,11 +60,11 @@ Form(){ Input(Name:TransferredDate, Type:date) } Div(col-sm-6){ - Input(Name:TransferredTime, Type:time) + Input(Name:TransferredTime, Type:time, Value: "00:00") } } } } Button(Body: $@1send_to_check$, Class: btn btn-primary pull-right mt, Page: #back_page#, Contract: TsTransferAdmin).Alert(Text: "$@1want_add_investor$", ConfirmButton: "$@1yes$", CancelButton: "$@1no$", Icon: question) Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#) -} +} \ No newline at end of file diff --git a/other/tokens_sale/pages/ts_transfer_manager.ptl b/other/tokens_sale/pages/ts_transfer_manager.ptl index 810b425f7..c941daa8c 100644 --- a/other/tokens_sale/pages/ts_transfer_manager.ptl +++ b/other/tokens_sale/pages/ts_transfer_manager.ptl @@ -2,12 +2,11 @@ DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:"Tokens sale"}).Col SetVar(this_page, ts_transfer_manager) SetVar(role_param, role_sale_manager) -SetVar(row,"row mt-sm").(col_left,"col-sm-4 text-right").(col_right,"col-sm-8 text-left") SetVar(needed_role_id, EcosysParam(Name:#role_param#)) SetVar(isStartProcessing,0) If(#notific_id#>0){ - DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("page_params->sale_id,date_start_processing,notification->type,processing_info->member_id").Vars(note) + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,closed").Vars(note) If(#note_date_start_processing#!=""){ SetVar(isStartProcessing,1) } @@ -21,105 +20,125 @@ If(#notific_id#>0){ SetVar(sale_id,0) If(#note_page_params_sale_id#>0){ DBFind(@1ts_sales).Where({id:#note_page_params_sale_id#}).Vars(sale) + DBFind(@1ts_wallets).Where({key_id_buyer:#sale_key_id_buyer#}).Vars(wallet) } -SetTitle($@1ts_transfer_manager$) + Div(content-wrapper){ - Div(row mt-sm){ - Div(col-lg-10 col-lg-offset-1){ - Form(panel panel-primary){ - If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){ - Div(panel-body){ - Div(#row#){ - Div(#col_left#){ - $@1key_id_investor$ - } - Div(#col_right#){ - LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#sale_key_id_buyer#"){ - Address(#sale_key_id_buyer#) - } - } - } - Div(#row#){ - Div(#col_left#){ - $@1amount$ - } - Div(#col_right#){ - #sale_amount# AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #sale_currency_type#) - } - } - Div(#row#){ - Div(#col_left#){ - $@1tokens$ - } - Div(#col_right#){ - Money(#sale_amount_apl#) APL - } - } - Div(#row# text-muted){ - Div(#col_left#){ - $@1investor_funds_transfer_date$ - } - Div(#col_right#){ - DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS) - } + Form(){ + If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){ + Div(list-group-item){ + Div(text-center text-bold h4 m0){ + LangRes(@1ts_transfer_manager) + } + } + Div(list-group-item){ + Div(row mt-sm){ + Div(col-sm-3 text-right text-bold){ + $@1key_id_investor$ + } + Div(col-sm-9 text-left){ + LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#sale_key_id_buyer#"){ + Address(#sale_key_id_buyer#) } - Div(#row# text-muted){ - Div(#col_left#){ - $@1created_at$ - } - Div(#col_right#){ - DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS) - } + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1tokens$ + } + Div(col-sm-9 text-left){ + Money(#sale_amount_apl#) APLA + } + } + Div(row mt-sm){ + Div(col-sm-3 text-right text-bold){ + $@1pub_key$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_pub_buyer#) + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1ts_wallet_btc$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_wallet_btc#) + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1ts_wallet_eth$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_wallet_eth#) + } + } + Div(row mt-sm text-muted ){ + Div(col-sm-3 text-right text-bold){ + $@1investor_funds_transfer_date$ + } + Div(col-sm-9 text-left){ + DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS) + } + } + Div(row text-muted){ + Div(col-sm-3 text-right text-bold){ + $@1created_at$ + } + Div(col-sm-9 text-left){ + DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS) + } + } + Div(row text-muted){ + Div(col-sm-3 text-right text-bold){ + $@1created_by$ + } + Div(col-sm-9 text-left){ + Address(#sale_key_id_sale_apl_admin#) + } + } + } + If(#sale_status# == 1){ + Div(list-group-item){ + If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){ + Button(Body: $@1reject$, Class: btn btn-default, Page: ts_transfer_reject, PageParams: "RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#").Popup(50,"Rejected comment") + Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferManager, Params: "SaleId=#sale_id#,NotificId=#notific_id#") + }.ElseIf(#isStartProcessing#==1){ + Div(text-muted text-center){ + process begin another manager } - Div(#row# text-muted){ - Div(#col_left#){ - $@1created_by$ - } - Div(#col_right#){ - Address(#sale_key_id_sale_apl_admin#) - } + }.ElseIf(#isStartProcessing#==0){ + Div(text-right){ + Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#") } } - Div(panel-footer){ - If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){ - Button(Body: $@1reject$, Class: btn btn-danger, Page: ts_transfer_reject, PageParams: "RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#").Popup(50,"Rejected comment") - Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferManager, Params: "SaleId=#sale_id#,NotificId=#notific_id#") - }.ElseIf(#isStartProcessing#==1){ - Div(text-muted text-center){ - process begin another manager - } - }.ElseIf(#isStartProcessing#==0){ - Div(text-center){ - Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#") - } + } + } + }.Else{ + Div(list-group-item text-center h4){ + If(#needed_role_id#>0){ + If(#needed_role_id#!=#role_id#){ + DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param) + Div(h4){ + This page only for role from parameter LinkPage(Page: @1params_edit, PageParams: "id=#param_id#,back_page=#this_page#", Body:#role_param#) } } }.Else{ - Div(panel-body text-center){ - If(#needed_role_id#>0){ - If(#needed_role_id#!=#role_id#){ - DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param) - Div(h4){ - this page only for role from parameter LinkPage(Page: @1params_edit, PageParams: "id=#param_id#,back_page=#this_page#", Body:#role_param#) - } - } - }.Else{ - Div(h4){ - #role_param# not setted - } - Div(h4){ - LinkPage(Body:$@1ts_settings$, Page:ts_settings) - } - } + Div(h4){ + #role_param# not setted + } + Div(h4){ + LinkPage(Body:$@1ts_settings$, Page:ts_settings) + } + } - If(#note_id_page_params_sale_id#>0){ - If(#sale_id#>0){}.Else{ - sale not found - } - }.Else{ - notification not found - } + If(#note_id_page_params_sale_id#>0){ + If(#sale_id#>0){}.Else{ + Sale not found } + }.Else{ + Notification not found } } } diff --git a/other/tokens_sale/pages/ts_transfer_seller.ptl b/other/tokens_sale/pages/ts_transfer_seller.ptl index 9a1a72e2a..79f83b3c2 100644 --- a/other/tokens_sale/pages/ts_transfer_seller.ptl +++ b/other/tokens_sale/pages/ts_transfer_seller.ptl @@ -2,18 +2,17 @@ DBFind(@1applications).Where({ecosystem:#ecosystem_id#, name:"Tokens sale"}).Col SetVar(this_page, ts_transfer_seller) SetVar(role_param, role_sale_seller) -SetVar(row,"row mt-sm").(col_left,"col-sm-4 text-right").(col_right,"col-sm-8 text-left") SetVar(needed_role_id, EcosysParam(Name:#role_param#)) AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Source:currency_type) SetVar(isStartProcessing,0) If(#notific_id#>0){ - DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("page_params->sale_id,date_start_processing,notification->type,processing_info->member_id").Vars(note) + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,closed").Vars(note) If(#note_date_start_processing#!=""){ SetVar(isStartProcessing,1) } }.ElseIf(GetVar(SaleId)!=""){ - DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, "page_params->sale_id":#SaleId#, closed:0}).Columns("page_params->sale_id,date_start_processing,notification->type,processing_info->member_id").Vars(note) + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, "page_params->sale_id":#SaleId#, closed:0}).Columns("page_params->sale_id,date_start_processing,notification->type,processing_info->member_id,closed").Vars(note) SetVar(notific_id,#note_id#) If(#note_date_start_processing#!=""){ SetVar(isStartProcessing,1) @@ -24,106 +23,124 @@ If(#note_page_params_sale_id#>0){ DBFind(@1ts_sales).Where({id:#note_page_params_sale_id#}).Vars(sale) } -SetTitle($@1ts_transfer_seller$) Div(content-wrapper){ - Div(row mt-sm){ - Div(col-lg-10 col-lg-offset-1){ - Form(panel panel-primary){ - DBFind(@1ts_wallets, wallets).Where({key_id_buyer:{$neq:0}, key_id_signer:{$neq:0}, rejected_at:0}).Vars(wallet).Custom(_name){ - Address(#key_id_buyer#) + Form(){ + DBFind(@1ts_wallets, wallets).Where({key_id_buyer:{$neq:0}, key_id_signer:{$neq:0}, rejected_at:0}).Vars(wallet).Custom(_name){ + Address(#key_id_buyer#) + } + If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){ + Div(list-group-item){ + Div(text-center text-bold h4 m0){ + LangRes(@1ts_transfer_seller) } - If(And(#needed_role_id#>0,#role_id#==#needed_role_id#,#sale_id#>0)){ - Div(panel-body){ - Div(#row#){ - Div(#col_left#){ - $@1key_id_investor$ - } - Div(#col_right#){ - LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#sale_key_id_buyer#"){ - Address(#sale_key_id_buyer#) - } - } - } - Div(#row#){ - Div(#col_left#){ - $@1amount$ - } - Div(#col_right#){ - #sale_amount# AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #sale_currency_type#) - } - } - Div(#row#){ - Div(#col_left#){ - $@1tokens$ - } - Div(#col_right#){ - Money(#sale_amount_apl#) APL - } - } - Div(#row# text-muted){ - Div(#col_left#){ - $@1investor_funds_transfer_date$ - } - Div(#col_right#){ - DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS) - } - } - Div(#row# text-muted){ - Div(#col_left#){ - $@1created_at$ - } - Div(#col_right#){ - DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS) - } + } + Div(list-group-item){ + Div(row mt-sm){ + Div(col-sm-3 text-right text-bold){ + $@1key_id_investor$ + } + Div(col-sm-9 text-left){ + LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#sale_key_id_buyer#"){ + Address(#sale_key_id_buyer#) } - Div(#row# text-muted){ - Div(#col_left#){ - $@1created_by$ - } - Div(#col_right#){ - Address(#sale_key_id_sale_apl_admin#) - } + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1tokens$ + } + Div(col-sm-9 text-left){ + Money(#sale_amount_apl#) APLA + } + } + Div(row mt-sm){ + Div(col-sm-3 text-right text-bold){ + $@1pub_key$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_pub_buyer#) + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1ts_wallet_btc$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_wallet_btc#) + } + } + Div(row){ + Div(col-sm-3 text-right text-bold){ + $@1ts_wallet_eth$ + } + Div(col-sm-9 text-left){ + Span(Class: h6, Body: #wallet_wallet_eth#) + } + } + Div(row mt-sm text-muted){ + Div(col-sm-3 text-right text-bold){ + $@1investor_funds_transfer_date$ + } + Div(col-sm-9 text-left){ + DateTime(#sale_buyer_transferred_at#, Format: YYYY-MM-DD HH:MI:SS) + } + } + Div(row text-muted){ + Div(col-sm-3 text-right text-bold){ + $@1created_at$ + } + Div(col-sm-9 text-left){ + DateTime(#sale_created_at#, Format: YYYY-MM-DD HH:MI:SS) + } + } + Div(row text-muted){ + Div(col-sm-3 text-right text-bold){ + $@1created_by$ + } + Div(col-sm-9 text-left){ + Address(#sale_key_id_sale_apl_admin#) + } + } + Div(row text-muted){ + Div(col-sm-3 text-right text-bold){ + $@1checked_by$ + } + Div(col-sm-9 text-left){ + Address(#sale_key_id_sale_apl_manager#) + } + } + } + If(#sale_status# == 2){ + Div(list-group-item){ + If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){ + Button(Body: $@1reject$, Class: btn btn-default, Page: ts_transfer_reject, PageParams: "RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#").Popup(50,"Rejected comment") + Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferSeller, Params: "SaleId=#sale_id#,NotificId=#notific_id#") + }.ElseIf(#isStartProcessing#==1){ + Div(text-muted text-center){ + process begin another seller } - Div(#row# text-muted){ - Div(#col_left#){ - $@1checked_by$ - } - Div(#col_right#){ - Address(#sale_key_id_sale_apl_manager#) - } + }.ElseIf(#isStartProcessing#==0){ + Div(text-right){ + Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#") } } - Div(panel-footer){ - If(And(#note_processing_info_member_id#==#key_id#,#isStartProcessing#==1)){ - Button(Body: $@1reject$, Class: btn btn-danger, Page: ts_transfer_reject, PageParams: "RoleParam=#role_param#,notific_id=#notific_id#,back_page=#this_page#").Popup(50,"Rejected comment") - Button(Body: $@1accept$, Class: btn btn-primary pull-right, Page: ts_sales, Contract: TsTransferSeller, Params: "SaleId=#sale_id#,NotificId=#notific_id#") - }.ElseIf(#isStartProcessing#==1){ - Div(text-muted text-center){ - process begin another seller - } - }.ElseIf(#isStartProcessing#==0){ - Div(text-center){ - Button(Body: $@1processing$, Class: btn btn-primary, Page: #this_page#, PageParams: "notific_id=#notific_id#", Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#") - } + } + } + }.Else{ + Div(panel-body){ + If(#needed_role_id#>0){ + If(#needed_role_id#!=#role_id#){ + DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param) + Div(h4){ + This page only for role from parameter LinkPage(Page: @1params_edit, PageParams: "id=#param_id#,back_page=#this_page#", Body:#role_param#) } } }.Else{ - Div(panel-body){ - If(#needed_role_id#>0){ - If(#needed_role_id#!=#role_id#){ - DBFind(@1parameters).Where({ecosystem:#ecosystem_id#, name:#role_param#}).Vars(param) - Div(h4){ - this page only for role from parameter LinkPage(Page: @1params_edit, PageParams: "id=#param_id#,back_page=#this_page#", Body:#role_param#) - } - } - }.Else{ - Div(h4){ - #role_param# not setted - } - Div(h4){ - LinkPage(Body:$@1ts_settings$, Page:ts_settings) - } - } + Div(h4){ + #role_param# not setted + } + Div(h4){ + LinkPage(Body:$@1ts_settings$, Page:ts_settings) } } } diff --git a/other/tokens_sale/pages/ts_transfer_view.ptl b/other/tokens_sale/pages/ts_transfer_view.ptl index dca0f5035..947053f32 100644 --- a/other/tokens_sale/pages/ts_transfer_view.ptl +++ b/other/tokens_sale/pages/ts_transfer_view.ptl @@ -23,16 +23,7 @@ If(#sale_id#>0){ $@1tokens$ } Div(#col_right#){ - Money(#sale_amount_apl#) APL - } - } - Div(#row#){ - Div(#col_left#){ - $@1amount$ - } - Div(#col_right#){ - Span(#sale_amount#).Style(margin-right:5px;) - Span(AppParam(App:#application_id#, Name:ts_currency_type, Ecosystem: #ecosystem_id#, Index: #sale_currency_type#)) + Money(#sale_amount_apl#) APLA } } Div(#row#){ diff --git a/other/tokens_sale/pages/ts_wallets.ptl b/other/tokens_sale/pages/ts_wallets.ptl index 76fb3ceb6..b38867440 100644 --- a/other/tokens_sale/pages/ts_wallets.ptl +++ b/other/tokens_sale/pages/ts_wallets.ptl @@ -8,19 +8,21 @@ If(And(#snapswap_role_id#>0,#role_id#==#snapswap_role_id#)){ } If(GetVar(search)!=""){ - SetVar(where, {$or:[{"key_id_buyer":#search#},{"key_id_signer":#search#}]}) + SetVar(where, {$and: [{"key_id_buyer":{$neq:0}}, {$or:[{"pub_buyer": {$like: #search#}},{"wallet_btc": {$like: #search#}},{"wallet_eth": {$like: #search#}}]}]}) }.Else{ - SetVar(where, {id:{$gt:0}}).(search,) + SetVar(where, {"key_id_buyer":{$neq:0}}).(search,) } Div(list-group-item ml-lg mr-lg pt-lg){ - SetVar(search_name, LangRes(@1key_id)) + SetVar(search_name, LangRes(@1pub_key) \ LangRes(@1wallet)) Include(@1search) } DBFind(#this_table#, src).Where(#where#).Order({"id": -1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_rat){ If(#rejected_at#>0){ DateTime(#rejected_at#, Format: YYYY-MM-DD HH:MI:SS) + }.Else{ + Span(Class: text-muted, Body: --) } }.Custom(_sat){ If(#signed_at#>0){ @@ -34,18 +36,30 @@ DBFind(#this_table#, src).Where(#where#).Order({"id": -1}).Limit(#pager_limit#). LinkPage(Class: text-primary h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#key_id_buyer#"){ Address(#key_id_buyer#) } - Div(Class:text-muted m0 h6, Body:#key_id_buyer#) + Div(){ + Span(Class: h6 text-muted, Body: PUB:) + Span(Class: h6 text-muted ml-sm, Body: #pub_short_buyer#) + } }.Custom(_signer){ If(#key_id_signer#!=0){ Span(Class:text-success, Body: Address(#key_id_signer#)) } +}.Custom(_wlts){ + Div(){ + Span(Class: h6 text-muted, Body: BTC:) + Span(Class: h6 ml-sm, Body: #wallet_btc#) + } + Div(){ + Span(Class: h6 text-muted, Body: ETH:) + Span(Class: h6 ml-sm, Body: #wallet_eth#) + } }.Count(count) Div(fullscreen){ Div(table-responsive ml-lg mr-lg){ Div(list-group-item){ If(#count# > 0){ - Table(src, "$@1id$=id,$@1key_id_investor$=_buyer,$@1created_at$=_cat,$@1rejected_at$=_rat,$@1signed_at$=_sat,$@1key_id_consensus$=_signer") + Table(src, "$@1id$=id,$@1key_id_investor$=_buyer,$@1wallets$=_wlts,$@1created_at$=_cat,$@1signed_at$=_sat,$@1rejected_at$=_rat,$@1key_id_consensus$=_signer") }.Else{ Div(Class: text-center h4 text-muted, Body: "$@1wallets$ $@1not_founded$") } diff --git a/other/tokens_sale/struct.dot b/other/tokens_sale/struct.dot index 0b871396a..f461beb05 100644 --- a/other/tokens_sale/struct.dot +++ b/other/tokens_sale/struct.dot @@ -1,6 +1,6 @@ digraph G { fontsize="24"; -label="tokens_sale\nWednesday, 31-Oct-18 20:36:55 +10"; +label="tokens_sale\nFriday, 16-Nov-18 22:04:51 +10"; nojustify=true; ordering=out; rankdir=LR; @@ -15,6 +15,7 @@ size="30"; "default_page\npage" -> "@1welcome\nblock" [ color=green, label=include ] "default_page\npage" [color=green, fontcolor=green, group=pages, shape=record]; "ts_buyer_congratulation\npage" -> "NotificationsClose\ncontract" [ color=red ] +"1ts_wallets\ntable" -> "ts_buyer_congratulation\npage" "1notifications\ntable" -> "ts_buyer_congratulation\npage" "ts_buyer_congratulation\npage" -> "default_page\npage" [ color=green ] "ts_buyer_congratulation\npage" [color=green, fontcolor=green, group=pages, shape=record]; @@ -29,17 +30,26 @@ size="30"; "1applications\ntable" -> "ts_consensus_contract\npage" "1notifications\ntable" -> "ts_consensus_contract\npage" "1ts_wallets\ntable" -> "ts_consensus_contract\npage" -"ts_consensus_contract\npage" -> "default_page\npage" [ color=green ] "ts_consensus_contract\npage" [color=green, fontcolor=green, group=pages, shape=record]; +"ts_free_wallet_add\npage" -> "@1TsFreeWalletAdd\ncontract" [ color=red ] +"ts_free_wallet_add\npage" [color=green, fontcolor=green, group=pages, shape=record]; +"ts_free_wallets\npage" -> "@1TsFreeWalletDelete\ncontract" [ color=red ] +"src\ntable" -> "ts_free_wallets\npage" +"ts_free_wallets\npage" -> "@1pager_header\nblock" [ color=green, label=include ] +"ts_free_wallets\npage" -> "@1search\nblock" [ color=green, label=include ] +"ts_free_wallets\npage" -> "@1pager\nblock" [ color=green, label=include ] +"ts_free_wallets\npage" [color=green, fontcolor=green, group=pages, shape=record]; "ts_key_approve\npage" -> "@1TsKeyApprove\ncontract" [ color=red ] "ts_key_approve\npage" [color=green, fontcolor=green, group=pages, shape=record]; "ts_notification\npage" -> "NotificationsClose\ncontract" [ color=red ] +"ts_notification\npage" -> "NotificationsProcess\ncontract" [ color=red ] "1applications\ntable" -> "ts_notification\npage" "1notifications\ntable" -> "ts_notification\npage" "1ts_wallets\ntable" -> "ts_notification\npage" "ts_notification\npage" [color=green, fontcolor=green, group=pages, shape=record]; "1applications\ntable" -> "ts_sales\npage" "src\ntable" -> "ts_sales\npage" +"1ts_wallets\ntable" -> "ts_sales\npage" "ts_sales\npage" -> "@1pager_header\nblock" [ color=green, label=include ] "ts_sales\npage" -> "@1search\nblock" [ color=green, label=include ] "ts_sales\npage" -> "@1pager\nblock" [ color=green, label=include ] @@ -48,14 +58,13 @@ size="30"; "1roles\ntable" -> "ts_settings\npage" "ts_settings\npage" [color=green, fontcolor=green, group=pages, shape=record]; "ts_transfer_admin\npage" -> "TsTransferAdmin\ncontract" [ color=red ] -"1applications\ntable" -> "ts_transfer_admin\npage" -"1ts_wallets\ntable" -> "ts_transfer_admin\npage" "ts_transfer_admin\npage" [color=green, fontcolor=green, group=pages, shape=record]; "ts_transfer_manager\npage" -> "TsTransferManager\ncontract" [ color=red ] "ts_transfer_manager\npage" -> "@1NotificationsProcess\ncontract" [ color=red ] "1applications\ntable" -> "ts_transfer_manager\npage" "1notifications\ntable" -> "ts_transfer_manager\npage" "1ts_sales\ntable" -> "ts_transfer_manager\npage" +"1ts_wallets\ntable" -> "ts_transfer_manager\npage" "1parameters\ntable" -> "ts_transfer_manager\npage" "ts_transfer_manager\npage" -> "ts_transfer_reject\npage" [ color=green ] "ts_transfer_manager\npage" -> "ts_sales\npage" [ color=green ] @@ -95,6 +104,12 @@ size="30"; "TsConsensusAction\ncontract" -> "ts_wallets\ntable" [ color="" ] "1applications\ntable" -> "TsConsensusAction\ncontract" "TsConsensusAction\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; +"TsFreeWalletAdd\ncontract" -> "ts_wallets\ntable" [ color="" ] +"1roles\ntable" -> "TsFreeWalletAdd\ncontract" +"TsFreeWalletAdd\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; +"TsFreeWalletDelete\ncontract" -> "ts_wallets\ntable" [ color="" ] +"1roles\ntable" -> "TsFreeWalletDelete\ncontract" +"TsFreeWalletDelete\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; "TsKeyApprove\ncontract" -> "ts_wallets\ntable" [ color="" ] "1keys\ntable" -> "TsKeyApprove\ncontract" "1roles\ntable" -> "TsKeyApprove\ncontract" diff --git a/other/tokens_sale/tables/ts_wallets.json b/other/tokens_sale/tables/ts_wallets.json index 6a2b62081..e8832da8d 100644 --- a/other/tokens_sale/tables/ts_wallets.json +++ b/other/tokens_sale/tables/ts_wallets.json @@ -5,7 +5,7 @@ "type":"number" }, { - "conditions":"ContractAccess(\"@1TsBuyerAction\")", + "conditions":"ContractAccess(\"@1TsKeyApprove\")", "name":"key_id_buyer", "type":"number" }, @@ -30,8 +30,33 @@ "type":"number" }, { - "conditions":"false", + "conditions":"ContractAccess(\"@1TsKeyApprove\")", "name":"created_at", "type":"number" + }, + { + "conditions": "false", + "name": "wallet_eth", + "type": "text" + }, + { + "conditions": "false", + "name": "wallet_btc", + "type": "text" + }, + { + "conditions":"ContractAccess(\"@1TsFreeWalletDelete\")", + "name":"deleted", + "type":"number" + }, + { + "conditions":"ContractAccess(\"@1TsKeyApprove\")", + "name": "pub_buyer", + "type": "text" + }, + { + "conditions":"ContractAccess(\"@1TsKeyApprove\")", + "name": "pub_short_buyer", + "type": "text" } ] \ No newline at end of file diff --git a/src/basic/blocks/notifications_roles.ptl b/src/basic/blocks/notifications_roles.ptl index 5aa41910e..7ecec1a74 100644 --- a/src/basic/blocks/notifications_roles.ptl +++ b/src/basic/blocks/notifications_roles.ptl @@ -11,7 +11,7 @@ SetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin)) If(And(#role_id#==#role_admin#,#ecosystem_id#==1)){ DBFind(@1ecosystems).Count(ecos_count) If(#ecos_count#>1){ - AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus) + AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus).Popup(Header: $@1notifications_broadcast$, Width: "50") } } AddToolButton(Title: $@1send$, Page: @1notifications_roles_send, Icon: icon-plus).Popup(Header: $@1send$, Width: "50") @@ -27,7 +27,7 @@ Div(list-group-item ml-lg mr-lg pt-lg){ Include(@1search) } -DBFind(#this_table#, src).Where(#where#).Order([{closed:"1"},{id:"-1"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns("id,recipient->role_id,recipient->role_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,page_name,page_params,date_created,date_closed,date_start_processing,processing_info->member_name,closed").Custom(_id){ +DBFind(#this_table#, src).Where(#where#).Order([{closed:"1"},{id:"-1"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns("id,recipient->role_id,recipient->role_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,notification->popup,page_name,page_params,date_created,date_closed,date_start_processing,processing_info->member_name,closed").Custom(_id){ If(#closed# == 0){ SetVar(style_text,"text-normal").(style_link,"text-primary") }.Else{ @@ -35,7 +35,7 @@ DBFind(#this_table#, src).Where(#where#).Order([{closed:"1"},{id:"-1"}]).Limit(# } Span(Class: #style_text#, Body: #id#) }.Custom(_recipient){ - LinkPage(Class: #style_link# t5 text-bold, Page: @1roles_view, PageParams: "v_role_id=#recipient.role_id#"){ + LinkPage(Class: #style_link# h5 text-bold, Page: @1roles_view, PageParams: "v_role_id=#recipient.role_id#"){ If(#recipient.image_id#>0){ Image(Src: Binary().ById(#recipient.image_id#) "#img_data#", Class: mr-sm).Style(width: 30px; border: 1px solid #5A5D63;) #recipient.role_name# @@ -58,20 +58,25 @@ DBFind(#this_table#, src).Where(#where#).Order([{closed:"1"},{id:"-1"}]).Limit(# }.Custom(_icon){ Span(Class: fa #notification.icon# fa-2x #style_text#) }.Custom(_page){ - LinkPage(Class: #style_link# t5 text-bold, Page: #page_name#, PageParams: "notific_id=#id#"){ - #page_name# + If(#notification.popup#==1){ + Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: "notific_id=#id#"){ + Span(Class: #style_link#, Body: #page_name#) + }.Popup(Header: $@1notifications_view$, Width: "40") + }.Else{ + Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: "notific_id=#id#"){ + Span(Class: #style_link#, Body: #page_name#) + } } }.Custom(_date){ - Div(#style_text# t6){DateTime(DateTime: #date_created#, Format: "DD.MM.YYYY HH:MI")} - Div(#style_text# t6){DateTime(DateTime: #date_closed#, Format: "DD.MM.YYYY HH:MI")} + Div(#style_text# h6 m0){DateTime(DateTime: #date_created#, Format: "DD.MM.YYYY HH:MI")} + Div(#style_text# h6 m0){DateTime(DateTime: #date_closed#, Format: "DD.MM.YYYY HH:MI")} }.Custom(_processing){ - Div(Class: #style_text# t6){ + Div(Class: #style_text# h6 m0){ If(#date_start_processing# == NULL){ $@1not_started$ }.Else{ - Span(LangRes(@1started), mr-sm) #processing_info.member_name# - Span(LangRes(@1at), mr-sm) - DateTime(DateTime: #date_start_processing#, Format: "DD.MM.YYYY HH:MI") + Span(LangRes(@1started_by) #processing_info.member_name#) + Div(){DateTime(DateTime: #date_start_processing#, Format: "DD.MM.YYYY HH:MI")} } } }.Custom(_status){ diff --git a/src/basic/blocks/notifications_single.ptl b/src/basic/blocks/notifications_single.ptl index a50f70e3d..e6103d73b 100644 --- a/src/basic/blocks/notifications_single.ptl +++ b/src/basic/blocks/notifications_single.ptl @@ -6,7 +6,7 @@ SetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin)) If(And(#role_id#==#role_admin#,#ecosystem_id#==1)){ DBFind(@1ecosystems).Count(ecos_count) If(#ecos_count#>1){ - AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus) + AddToolButton(Title: $@1broadcast_send$, Page: @1notifications_broadcast, Icon: icon-plus).Popup(Header: $@1notifications_broadcast$, Width: "50") } } AddToolButton(Title: $@1send$, Page: @1notifications_single_send, Icon: icon-plus).Popup(Header: $@1send$, Width: "50") @@ -22,7 +22,7 @@ Div(list-group-item ml-lg mr-lg pt-lg){ Include(@1search) } -DBFind(#this_table#, src).Where(#where#).Order([{closed:"1"}, {id:"-1"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns("id,recipient->member_id,recipient->member_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,page_name,page_params,date_created,date_closed,closed").Custom(custom_id){ +DBFind(#this_table#, src).Where(#where#).Order([{closed:"1"}, {id:"-1"}]).Limit(#pager_limit#).Offset(#pager_offset#).Columns("id,recipient->member_id,recipient->member_name,recipient->image_id,sender->type,sender->member_id,sender->member_name,sender->role_id,sender->role_name,notification->icon,notification->popup,page_name,page_params,date_created,date_closed,closed").Custom(custom_id){ If(#closed# == 0){ SetVar(Name: style_text, Value: "text-normal") SetVar(Name: style_link, Value: "text-primary") @@ -59,8 +59,14 @@ DBFind(#this_table#, src).Where(#where#).Order([{closed:"1"}, {id:"-1"}]).Limit( }.Custom(custom_icon){ Em(Class: fa #notification.icon# fa-2x #style_text#) }.Custom(custom_page){ - LinkPage(Class: #style_link# h5 text-bold, Page: #page_name#, PageParams: "notific_id=#id#"){ - Span(Body: #page_name#) + If(#notification.popup#==1){ + Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: "notific_id=#id#"){ + Span(Class: #style_link#, Body: #page_name#) + }.Popup(Header: $@1notifications_view$, Width: "40") + }.Else{ + Button(Class: btn-link h5 text-bold m0, Page: #page_name#, PageParams: "notific_id=#id#"){ + Span(Class: #style_link#, Body: #page_name#) + } } }.Custom(custom_date){ Div(Class: #style_text# h6 m0, Body: DateTime(DateTime: #date_created#, Format: "DD.MM.YYYY HH:MI")) diff --git a/src/basic/blocks/profile.ptl b/src/basic/blocks/profile.ptl index b76fa05a5..4fccf3905 100644 --- a/src/basic/blocks/profile.ptl +++ b/src/basic/blocks/profile.ptl @@ -68,7 +68,7 @@ Div(content-wrapper){ DBFind(@1keys).Where({ecosystem:#ecosystem_id#, id:#v_key_id#}).Vars(tokens) } Div(text-bold m0 h5, Body: LangRes(@1balance)) - Div(Class: m0 h5, Body: Money(#apl_amount#) APL) + Div(Class: m0 h5, Body: Money(#apl_amount#) APLA) If(#ecosystem_id#>1){ If(#tokens_amount#>0){ Div(Class: m0 h5, Body: Money(#tokens_amount#) ecosystem tokens) diff --git a/src/basic/config.json b/src/basic/config.json index d8aa494e3..923f69393 100644 --- a/src/basic/config.json +++ b/src/basic/config.json @@ -322,6 +322,21 @@ "Conditions": "ContractConditions(\"@1DeveloperCondition\")", "Menu": "default_menu" }, + { + "Name": "message_create", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Menu": "default_menu" + }, + { + "Name": "message_view", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Menu": "default_menu" + }, + { + "Name": "messages_list", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Menu": "default_menu" + }, { "Name": "notifications", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", @@ -357,6 +372,16 @@ "Conditions": "ContractConditions(\"@1DeveloperCondition\")", "Menu": "default_menu" }, + { + "Name": "notifications_testpage_popup", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Menu": "default_menu" + }, + { + "Name": "notifications_testpage_popup", + "Conditions": "ContractConditions(\"@1DeveloperCondition\")", + "Menu": "default_menu" + }, { "Name": "profile_avatar_edit", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", diff --git a/src/basic/contracts/DeleteMember.sim b/src/basic/contracts/DeleteMember.sim new file mode 100644 index 000000000..723020b07 --- /dev/null +++ b/src/basic/contracts/DeleteMember.sim @@ -0,0 +1,40 @@ +contract DeleteMember { + data { + KeyId int + } + func getPermission() { + var array_permissions array result i int prevContract string + array_permissions = ["@1DeleteMember"] + + prevContract = $stack[0] + if Len($stack) > 2 { + prevContract = $stack[Len($stack) - 2] + } + while i < Len(array_permissions) { + var contract_name string + contract_name = array_permissions[i] + if contract_name==prevContract { + result = 1 + } + i = i + 1 + } + + if result == 0 { + error LangRes("@1contract_chain_distorted", "en") + } + } + + conditions { + ContractConditions("@1AdminCondition") + + getPermission() + + if !DBFind("@1keys").Where({ecosystem:1, id:$KeyId}).One("id"){ + error LangRes("@1key_not_found", "en") + } + } + + action { + DBUpdate("@1keys", $KeyId, {"deleted": 1}) + } +} \ No newline at end of file diff --git a/src/basic/contracts/MembershipRequest.sim b/src/basic/contracts/MembershipRequest.sim index b266dc8a9..e326ec776 100644 --- a/src/basic/contracts/MembershipRequest.sim +++ b/src/basic/contracts/MembershipRequest.sim @@ -4,29 +4,60 @@ contract MembershipRequest { } conditions { - if $ecosystem_id != 1{ + if $ecosystem_id != 1 { warning LangRes("@1contract_first_ecosystem_only", "en") } - - if DBFind("@1notifications").Where({ecosystem:$ecosystem_num, "page_params->ecosystem_id":$ecosystem_num, "sender->member_id":$key_id, closed:0, page_name:"@1membership_admin_view"}).Row(){ - warning LangRes("@1request_sent_already", "en") + + if $ecosystem_num == 1 { + warning LangRes("@1impossible_for_platform_ecosystem", "en") } if !DBFind("@1ecosystems").Where({id:$ecosystem_num}).One("id"){ error Sprintf(LangRes("@1template_eco_not_exist", "en"), $ecosystem_num) } - $admin_id = Int(DBFind("@1parameters").Where({ecosystem:$ecosystem_num,name:"role_admin"}).One("value")) - if $admin_id == 0 { - LangRes("@1recipient_role_not_found", "en") + if DBFind("@1keys").Where({id:$key_id, ecosystem:$ecosystem_num}) { + warning LangRes("@1member_added_before", "en") + } + + $free_membership = Int(DBFind("@1parameters").Where({ecosystem:$ecosystem_num, name:"free_membership"}).One("value")) + if $free_membership == 0 { + if DBFind("@1notifications").Where({ecosystem:$ecosystem_num, "page_params->ecosystem_id":$ecosystem_num, "sender->member_id":$key_id, closed:0, page_name:"@1membership_admin_view"}).Row(){ + warning LangRes("@1request_sent_already", "en") + } + + $admin_id = Int(DBFind("@1parameters").Where({ecosystem:$ecosystem_num, name:"role_admin"}).One("value")) + if $admin_id == 0 { + warning LangRes("@1recipient_role_not_found", "en") + } } } action { - var notific_params map - notific_params["ecosystem_id"] = $ecosystem_num - notific_params["ecosystem_sender"] = $ecosystem_id + if $free_membership == 0 { + var notific_params map + notific_params["ecosystem_id"] = $ecosystem_num + notific_params["ecosystem_sender"] = $ecosystem_id - @1NotificationsSend("rid,sender,icon_name,text_header,text_body,page_name,params_map,closure_type,eco_id", $admin_id, 1, "icon icon-user-follow", LangRes("@1membership_request_new", "en"), LangRes("@1details_view", "en"), "@1membership_admin_view", notific_params,1,$ecosystem_num) + @1NotificationsSend("rid,sender,icon_name,text_header,text_body,page_name,params_map,closure_type,eco_id", $admin_id, 1, "icon icon-user-follow", LangRes("@1membership_request_new", "en"), LangRes("@1details_view", "en"), "@1membership_admin_view", notific_params,1,$ecosystem_num) + } + if $free_membership == 1 { + var pub string + pub = DBFind("@1keys").Where({ecosystem:1, id:$key_id}).One("pub") + DBInsert("@1keys", {id:$key_id, pub:pub, ecosystem:$ecosystem_num}) + + var params map + params["ecosystem_id"] = $ecosystem_num + params["status"] = 1 + + var icon header body page ecoName string + ecoName = DBFind("@1ecosystems").Where({id:$ecosystem_num}).One("name") + icon = "icon icon-user-follow" + header = LangRes("@1request_approved", "en") + body = Sprintf(LangRes("@1ecosystem_request_approved", "en"), ecoName, $ecosystem_num) + page = "@1membership_user_view" + + @1NotificationsSend("member_id,sender,icon_name,text_header,text_body,page_name,params_map,eco_id", $key_id, 1, icon, header, body, page, params, $ecosystem_id) + } } } \ No newline at end of file diff --git a/src/basic/contracts/NodeRemoveByKey.sim b/src/basic/contracts/NodeRemoveByKey.sim index b5d7f9fcc..6fc26b017 100644 --- a/src/basic/contracts/NodeRemoveByKey.sim +++ b/src/basic/contracts/NodeRemoveByKey.sim @@ -23,7 +23,7 @@ contract NodeRemoveByKey { conditions { if $original_contract != "ValidatorResign"{ - warning LangRes("@1contract_unknown", "en") + warning LangRes("@1contract_chain_distorted", "en") } } diff --git a/src/basic/contracts/NotificationsBroadcast.sim b/src/basic/contracts/NotificationsBroadcast.sim index 3fc4d4bb6..065aefe45 100644 --- a/src/basic/contracts/NotificationsBroadcast.sim +++ b/src/basic/contracts/NotificationsBroadcast.sim @@ -3,6 +3,7 @@ contract NotificationsBroadcast { RoleId int Header string Body string + Popup string "optional" } func getMemberInfo(kid int) map { @@ -31,7 +32,7 @@ contract NotificationsBroadcast { } $ecos = DBFind("@1ecosystems").Columns("id") $lenEcos = Len($ecos) - if $lenEcos == 1{ + if $lenEcos == 1 { error LangRes("@1other_ecosystems_not_found", "en") } } @@ -40,12 +41,17 @@ contract NotificationsBroadcast { var i lenIds int eco map ids array bt string sender recipient params note map bt = BlockTime() sender = getMemberInfo($key_id) - sender["type"] = "1" + sender["type"] = 1 note["header"] = $Header - note["type"] = "1" + note["type"] = 1 note["icon"] = "icon-envelope" note["body"] = $Body - + if $Popup == "true" || $Popup == "1" { + note["popup"] = 1 + }else{ + note["popup"] = 0 + } + while i < $lenEcos{ eco = $ecos[i] var ecoId int diff --git a/src/basic/contracts/NotificationsSend.sim b/src/basic/contracts/NotificationsSend.sim index 46796420f..a49738ca6 100644 --- a/src/basic/contracts/NotificationsSend.sim +++ b/src/basic/contracts/NotificationsSend.sim @@ -12,6 +12,7 @@ contract NotificationsSend { params_map string // json encoded expected current_role_id string "optional" eco_id string "optional" + popup string "optional" } func getMemberInfo(kid, ecoId int) map { @@ -37,6 +38,11 @@ contract NotificationsSend { notification["type"] = $notify_type notification["icon"] = $icon_name notification["body"] = $text_body + if $popup == "true" || $popup == "1" { + notification["popup"] = 1 + }else{ + notification["popup"] = 0 + } var sender map if $sender == 1 && $senderMember { // send from member diff --git a/src/basic/contracts/TokensSend.sim b/src/basic/contracts/TokensSend.sim index 21a1326b0..aab69a947 100644 --- a/src/basic/contracts/TokensSend.sim +++ b/src/basic/contracts/TokensSend.sim @@ -36,6 +36,6 @@ contract TokensSend { } action { - @1TokensTransfer("Amount,SenderId,RecipientId", $Amount, $key_id, $recipient_id) + @1TokensTransfer("Amount,SenderId,RecipientId,Comment,Ecosystem", $Amount, $key_id, $recipient_id, $Comment, $ecosystem_id) } } \ No newline at end of file diff --git a/src/basic/contracts/TokensTransfer.sim b/src/basic/contracts/TokensTransfer.sim index 3d4561e37..0314e05fa 100644 --- a/src/basic/contracts/TokensTransfer.sim +++ b/src/basic/contracts/TokensTransfer.sim @@ -4,6 +4,18 @@ contract TokensTransfer { SenderId int RecipientId int Comment string "optional" + Ecosystem int "optional" + } + + func getEcosystem() { + $e_id = Int($Ecosystem) + if $e_id == 0 { + $e_id = $ecosystem_id + } else { + if !DBFind("@1ecosystems").Where({id:$e_id}).One("id") { + error Sprintf(LangRes("@1ecosystem_not_found", "en"), $e_id) + } + } } func getPermission() { @@ -30,7 +42,7 @@ contract TokensTransfer { func checkSender() { var sender_map map - sender_map = DBFind("@1keys").Where({ecosystem:$ecosystem_id, id:$SenderId}).Row() + sender_map = DBFind("@1keys").Where({ecosystem:$e_id, id:$SenderId}).Row() if !sender_map { error Sprintf(LangRes("@1sender_x_invalid", "en"), $SenderId) @@ -48,7 +60,7 @@ contract TokensTransfer { func checkRecipient() { var recipient_map map - recipient_map = DBFind("@1keys").Where({ecosystem:$ecosystem_id, id:$RecipientId}).Row() + recipient_map = DBFind("@1keys").Where({ecosystem:$e_id, id:$RecipientId}).Row() if !recipient_map { error Sprintf(LangRes("@1recipient_x_invalid", "en"), $RecipientId) @@ -62,6 +74,7 @@ contract TokensTransfer { } conditions { + getEcosystem() //getting an ecosystem number getPermission() //getting permission to run checkSender() //check the sender checkRecipient() //check the recipient @@ -76,8 +89,11 @@ contract TokensTransfer { } action { - DBUpdate("@1keys", $SenderId, {"-amount": $Amount}) - DBUpdate("@1keys", $RecipientId, {"+amount": $Amount}) + var table_name string + table_name = "@" + Str($e_id) + "keys" + DBUpdate(table_name, $SenderId, {"-amount": $Amount}) + DBUpdate(table_name, $RecipientId, {"+amount": $Amount}) + var m map m["sender_id"] = $SenderId m["recipient_id"] = $RecipientId @@ -85,8 +101,9 @@ contract TokensTransfer { m["comment"] = $Comment m["block_id"] = $block m["txhash"] = $txhash - m["ecosystem"] = $ecosystem_id + m["ecosystem"] = $e_id m["type"] = 3 + //m["created_at"] = $block_time DBInsert("@1history", m) } } \ No newline at end of file diff --git a/src/basic/menus/admin_menu.ptl b/src/basic/menus/admin_menu.ptl index e7f2fafdb..01f988783 100644 --- a/src/basic/menus/admin_menu.ptl +++ b/src/basic/menus/admin_menu.ptl @@ -1,5 +1,5 @@ If(#ecosystem_id# == 1){ - MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:"fa icon-people") + MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:"icon-people") MenuItem(Title:$@1ecosystems$, Page:@1ecosystems_list, Icon:"icon-layers") MenuItem(Title:$@1platform_parameters$, Page:@1sysparams_list, Icon:"icon-settings") MenuItem(Title:$@1roles$, Page:@1roles_list, Icon:"icon-pie-chart") @@ -7,7 +7,7 @@ If(#ecosystem_id# == 1){ }.ElseIf(#ecosystem_id# > 1){ DBFind(@1roles).Where({"ecosystem": #ecosystem_id#}).Count(roles_count) If(#roles_count# > 0){ - MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:"fa icon-people") + MenuItem(Title:$@1ecosystem_members$, Page:@1members_list_admin, Icon:"icon-people") MenuItem(Title:$@1roles$, Page:@1roles_list, Icon:"icon-pie-chart") } } \ No newline at end of file diff --git a/src/basic/menus/default_menu.ptl b/src/basic/menus/default_menu.ptl index 3f76fbc53..15ed9d288 100644 --- a/src/basic/menus/default_menu.ptl +++ b/src/basic/menus/default_menu.ptl @@ -1,5 +1,6 @@ If(#ecosystem_id# == 1){ MenuItem(Title:$@1profile$, Page:@1profile_view, Icon:"icon-wallet") + MenuItem(Title:$@1messenger$, Page:@1messages_list, Icon:"icon-speech") MenuItem(Title:$@1notifications$, Page:@1notifications_list, Icon:"icon-flag") MenuItem(Title:$@1ecosystem_members$, Page:@1members_list, Icon:"icon-people") MenuItem(Title:$@1votings$, Page:@1voting_list, Icon:"icon-note") @@ -8,6 +9,7 @@ If(#ecosystem_id# == 1){ DBFind(@1roles).Where({"ecosystem": #ecosystem_id#}).Count(roles_count) If(#roles_count# > 0){ MenuItem(Title:$@1profile$, Page:@1profile_view, Icon:"icon-wallet") + MenuItem(Title:$@1messenger$, Page:@1messages_list, Icon:"icon-speech") MenuItem(Title:$@1notifications$, Page:@1notifications_list, Icon:"icon-flag") MenuItem(Title:$@1ecosystem_members$, Page:@1members_list, Icon:"icon-people") MenuItem(Title:$@1votings$, Page:@1voting_list, Icon:"icon-note") diff --git a/src/basic/pages/members_list.ptl b/src/basic/pages/members_list.ptl index 15ca17c69..4aef4a83d 100644 --- a/src/basic/pages/members_list.ptl +++ b/src/basic/pages/members_list.ptl @@ -8,9 +8,9 @@ If(And(#role_id# == EcosysParam(role_admin),#ecosystem_id# != 1)){ } If(GetVar(search)){ - SetVar(where, {ecosystem:#ecosystem_id#, id:#search#}) + SetVar(where, {deleted:0, ecosystem:#ecosystem_id#, id:#search#}) }.Else{ - SetVar(where, {ecosystem:#ecosystem_id#, id:{"$neq":0}}).(search,) + SetVar(where, {deleted:0, ecosystem:#ecosystem_id#, id:{"$neq":0}}).(search,) } Div(list-group-item ml-lg mr-lg pt-lg){ diff --git a/src/basic/pages/members_list_admin.ptl b/src/basic/pages/members_list_admin.ptl index 41f6ce413..48590eea8 100644 --- a/src/basic/pages/members_list_admin.ptl +++ b/src/basic/pages/members_list_admin.ptl @@ -18,9 +18,12 @@ Div(list-group-item ml-lg mr-lg pt-lg){ Include(@1search) } -DBFind(#this_table#, src).Where(#where#).Order({"id": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(custom_id){ - SetVar(Name: style_text, Value: "text-normal") - SetVar(Name: style_link, Value: "text-primary") +DBFind(#this_table#, src).Where(#where#).Order({deleted:"1", id:"1"}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(custom_id){ + If(#deleted# == 0){ + SetVar(style_text, "text-normal").(style_link, "text-primary") + }.Else{ + SetVar(style_text,"text-muted").(style_link,"text-muted") + } Span(Class: h6 text-muted, Body: #id#) SetVar(m_id, 0) DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#id#}).Vars(m) @@ -32,8 +35,8 @@ DBFind(#this_table#, src).Where(#where#).Order({"id": 1}).Limit(#pager_limit#).O SetVar(member_name, Address(#id#)) } }.Custom(custom_member_id){ - Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: "v_key_id=#id#"){ - Span(Class: h5, Body: Address(#id#)) + Button(Class: btn-xs btn-link, Page: @1tokens_send, PageParams: "v_key_id=#id#,back_page=#this_page#"){ + Span(Class: h5 #style_text#, Body: Address(#id#)) }.Popup(Header: $@1tokens_send$, Width: "50") }.Custom(custom_username){ LinkPage(Class: #style_link# h5 text-bold, Page: @1profile_view, PageParams: "v_key_id=#id#"){ @@ -48,10 +51,15 @@ DBFind(#this_table#, src).Where(#where#).Order({"id": 1}).Limit(#pager_limit#).O } } }.Custom(actions){ - If(#blocked#==0){ - Button(Body: LangRes(@1block_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:"KeyId=#id#,Value=1", Contract: @1BlockMember).Alert(Text: "$@1want_block_key$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + If(#deleted#==0){ + Button(Body: LangRes(@1delete), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:"KeyId=#id#", Contract: @1DeleteMember).Alert(Text: "$@1want_delete_key$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + If(#blocked#==0){ + Button(Body: LangRes(@1block_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:"KeyId=#id#,Value=1", Contract: @1BlockMember).Alert(Text: "$@1want_block_key$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + }.Else{ + Button(Body: LangRes(@1unblock_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:"KeyId=#id#,Value=0", Contract: @1BlockMember).Alert(Text: "$@1want_unblock_key$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + } }.Else{ - Button(Body: LangRes(@1unblock_key), Class: btn-xs btn-link pull-right, Page: #this_page#, Params:"KeyId=#id#,Value=0", Contract: @1BlockMember).Alert(Text: "$@1want_unblock_key$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + Span(Class: h6 text-muted pull-right, Body: $@1deleted$) } }.Count(count) diff --git a/src/basic/pages/membership_user_view.ptl b/src/basic/pages/membership_user_view.ptl index 978e9d40f..c26dd5172 100644 --- a/src/basic/pages/membership_user_view.ptl +++ b/src/basic/pages/membership_user_view.ptl @@ -30,7 +30,7 @@ Div(content-wrapper){ If(#notific_closed# == 0){ Div(row){ Div(col-md-12 mt-lg text-center){ - Button(Class: btn btn-success, Body: $@1add_ecosystem_to_list$, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: "@invite", PageParams: "ecosystem=#notific_page_params_ecosystem_id#,page=@1default_page") + Button(Class: btn btn-success, Body: $@1close$, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: "@1default_page") } } } diff --git a/src/basic/pages/message_create.ptl b/src/basic/pages/message_create.ptl new file mode 100644 index 000000000..3906d8f71 --- /dev/null +++ b/src/basic/pages/message_create.ptl @@ -0,0 +1,76 @@ +Form(){ + Div(row){ + Div(col-md-3 mt text-right){ + Label(){ + Span(Body: LangRes(@1broadcast)) + } + } + Div(col-md-9 text-left){ + Input(Name: "broadcast", Type: "checkbox", Value: "false") + } + } + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*) + } + } + Div(col-md-9 text-left){ + DBFind(@1keys,src_keys).Where({ecosystem:#ecosystem_id#}).Columns("id").Custom(_name){ + SetVar(m_member_name, "") + DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#id#}).Columns("id,member_name").Vars(m) + Address(#id#) + If(GetVar(m_member_name)!=""){ + " (#m_member_name#)" + } + } + Select(Name: member_id, Source: src_keys, NameColumn: _name, ValueColumn: id) + }.Show("broadcast=false") + Div(col-md-9 text-left){ + DBFind(@1roles,source_roles).Where({ecosystem:#ecosystem_id#, deleted:0}).Columns("id,role_name").Count(roles_count) + If(#roles_count#>0){ + Select(Name: rid, Source: source_roles, NameColumn: role_name, ValueColumn: id) + }.Else{ + Div(mt-sm){ + $@1roles$ $@1not_founded$ + } + } + }.Show("broadcast=true") + } + Div(row mt){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1message_subject)).(Class: text-danger, Body:*) + } + } + Div(col-md-9 text-left){ + Input(Name: text_header, Value: "", Placeholder: $@1message_subject_type_here$) + } + } + Div(row mt){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1message_text)).(Class: text-danger, Body:*) + } + } + Div(col-md-9 text-left){ + Input(Type: Hidden, Name: eco_id, Value: "#ecosystem_id#") + Input(Type: Hidden, Name: sender, Value: "1") + Input(Type: Hidden, Name: icon_name, Value: "icon-speech") + Input(Type: Hidden, Name: params_map, Value: `{"type": "message"}`) + Input(Type: Hidden, Name: page_name, Value: "@1message_view") + Input(Type: textarea, Name: text_body, Value: "", Placeholder: $@1message_type_here$).Style(resize: vertical; min-height: 6em;) + } + } + Div(row mt){ + Div(col-md-12){ + Div(){ + Button(Body: LangRes(@1send), Class: btn btn-primary pull-right, Page: @1messages_list, Contract: @1NotificationsSend, Params: "rid=0,current_role_id=#role_id#") + }.Show("broadcast=false") + Div(){ + Button(Body: LangRes(@1send), Class: btn btn-primary pull-right, Page: @1messages_list, Contract: @1NotificationsSend, Params: "member_id=0,current_role_id=#role_id#,closure_type=2") + }.Show("broadcast=true") + Button(Body: LangRes(@1back), Class: btn btn-default pull-right, Page: @1messages_list) + } + } +} \ No newline at end of file diff --git a/src/basic/pages/message_view.ptl b/src/basic/pages/message_view.ptl new file mode 100644 index 000000000..53383843d --- /dev/null +++ b/src/basic/pages/message_view.ptl @@ -0,0 +1,194 @@ +If(#notific_id#>0){ + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("id,sender->member_id,sender->member_name,sender->image_id,recipient->member_name,notification->body,notification->header,page_params->thread,date_created,closed").Vars(message) + DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#message_sender_member_id#}).Vars(highlighted) + If(GetVar(highlighted_id)){ + SetVar(message_sender_member_name,#highlighted_member_name#) + SetVar(message_sender_image_id,#highlighted_image_id#) + } + + If(#message_page_params_thread#>0){ + SetVar(thread,#message_page_params_thread#) + DBFind(@1notifications,src_thread).Where({ecosystem:#ecosystem_id#, page_params->thread:#message_page_params_thread#}).Order("id").Count("thread_quantity").Columns("id,sender->member_id,sender->member_name,sender->image_id,notification->body,date_created") + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#message_page_params_thread#}).Columns("id,sender->member_id,sender->member_name,sender->image_id,recipient->member_id,notification->body,date_created").Vars(init_message) + }.Else{ + SetVar(thread,#message_id#) + DBFind(@1notifications,src_thread).Where({ecosystem:#ecosystem_id#, page_params->thread:#message_id#}).Order("id").Count("thread_quantity").Columns("id,sender->member_id,sender->member_name,sender->image_id,notification->body,date_created") + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#message_id#}).Columns("id,sender->member_id,sender->member_name,sender->image_id,recipient->member_id,notification->body,date_created").Vars(init_message) + } + DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#init_message_sender_member_id#}).Vars(starter) + If(GetVar(starter_id)){ + SetVar(init_message_sender_member_name,#starter_member_name#) + SetVar(init_message_sender_image_id,#starter_image_id#) + } + + If(#init_message_sender_member_id#!=#key_id#){ + SetVar(reply_recipient,#init_message_sender_member_id#) + }.Else{ + SetVar(reply_recipient,#init_message_recipient_member_id#) + } + If(#message_notification_header#==""){ + SetVar(thread_name,$@1message_subject_empty$) + }.Else{ + SetVar(thread_name,#message_notification_header#) + } + + SetTitle($@1messenger$) + Span(Class: h5 m0 ml-lg){ + LinkPage(Class: ml-sm, Body: $@1messenger$, Page: @1messages_list) + Span(Class: text-muted mh, Body: /) + Span(Class: text-muted, Body: $@1message_view$) + }.Style( + display: inline-block; + ) + + Form(){ + Div(content-wrapper){ + Div(row){ + Div(col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1){ + Form(panel panel-primary){ + Div(text-center pt){ + If(#message_sender_member_id#==#key_id#){ + Span(Class: h4 text-bold, Body: LangRes(@1message_from_you)) + }.Else{ + Span(Class: h4 text-bold, Body: LangRes(@1message_from) #message_sender_member_name#) + } + } + Div(panel-body pt pb){ + Div(list-group-item wrapper-block){ + Div(avatar-block text-center){ + LinkPage(Page: @1profile_view, PageParams: "v_key_id=#message_sender_member_id#"){ + If(#message_sender_image_id#>0){ + Image(Src: Binary().ById(#message_sender_image_id#), Class: img-circle avatar) + }.Else{ + Span(Class: fa icon-user fa-3x) + } + Div(preview m0 h5){#message_sender_member_name#} + } + } + Div(message-block){ + Span(Class: h5, Body: #message_notification_body#) + } + Div(datetime-block text-muted){ + Span(Class: mb-sm h6, Body: DateTime(#message_date_created#,HH:MI DD.MM.YYYY)) + } + } + Div(row mt-lg){ + Div(col-md-12 text-left){ + Label(){ + If(#message_sender_member_id#!=#key_id#){ + Span(Body: LangRes(@1reply_text)) + }.Else{ + Span(Body: LangRes(@1message_text)) + } + } + Input(Type: Hidden, Name: member_id, Value: "#reply_recipient#") + Input(Type: Hidden, Name: eco_id, Value: "#ecosystem_id#") + Input(Type: Hidden, Name: sender, Value: "1") + Input(Type: Hidden, Name: icon_name, Value: "icon-speech") + Input(Type: Hidden, Name: params_map, Value: `{"type":"message","thread":"#thread#"}`) + Input(Type: Hidden, Name: page_name, Value: "@1message_view") + Input(Type: Hidden, Name: text_header, Value: "#thread_name#") + Input(Type: textarea, Name: text_body, Value: "", Placeholder: $@1message_type_here$).Style(resize: vertical; min-height: 6em;) + } + } + If(And(#message_closed#==0,#message_sender_member_id#!=#key_id#)){ + Div(mt text-right){ + Button(Body: LangRes(@1mark_read), Class: btn btn-default, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1messages_list) + Button(Body: LangRes(@1reply), Class: btn btn-primary, Contract: @1NotificationsSend, Params: "current_role_id=#role_id#", Page: @1message_view, PageParams: "notific_id=#message_id#") + } + }.Else{ + Div(mt text-right){ + Button(Body: LangRes(@1send), Class: btn btn-primary, Contract: @1NotificationsSend, Params: "current_role_id=#role_id#", Page: @1message_view, PageParams: "notific_id=#message_id#") + } + } + } + } + } + } + If(#thread_quantity#>0){ + Div(row){ + Div(col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1){ + Div(list-group-item text-center){ + Span(Class: h4 text-bold, Body: #thread_name#) + } + Div(list-group-item wrapper-block){ + Div(avatar-block text-center){ + LinkPage(Page: @1profile_view, PageParams: "v_key_id=#init_message_sender_member_id#"){ + If(#init_message_sender_image_id#>0){ + Image(Src: Binary().ById(#init_message_sender_image_id#), Class: img-circle avatar) + }.Else{ + Span(Class: fa icon-user fa-3x) + } + Div(preview m0 h5){#init_message_sender_member_name#} + } + } + Div(message-block){ + Span(Class: h5, Body: #init_message_notification_body#) + } + Div(datetime-block text-muted){ + Span(Class: badge mr, Body: 1) + Span(Class: mb-sm h6, Body: DateTime(#init_message_date_created#,HH:MI DD.MM.YYYY)) + } + } + ForList(src_thread){ + Div(list-group-item wrapper-block){ + Div(avatar-block text-center){ + DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#sender.member_id#}).Vars(thread_message) + If(GetVar(thread_message_id)==""){ + SetVar(thread_message_member_name,#sender.member_name#) + SetVar(thread_message_image_id,#sender.image_id#) + } + LinkPage(Page: @1profile_view, PageParams: "v_key_id=#sender.member_id#"){ + If(#thread_message_image_id#>0){ + Image(Src: Binary().ById(#thread_message_image_id#), Class: img-circle avatar) + }.Else{ + Span(Class: fa icon-user fa-3x) + } + Div(preview m0 h5){#thread_message_member_name#} + } + } + Div(message-block){ + Span(Class: h5, Body: #notification.body#) + } + Div(datetime-block text-muted){ + Span(Class: badge mr, Body: Calculate(#src_thread_index#+1)) + Span(Class: mb-sm h6, Body: DateTime(#date_created#,HH:MI DD.MM.YYYY)) + } + } + } + } + } + } + } + }.Style( + .preview { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .wrapper-block {min-height: 80px;} + .avatar-block { + position: absolute; + width: 70px; + } + .message-block { + margin-left: 85px; + margin-bottom: 15px; + } + .datetime-block { + position: absolute; + bottom: 5px; + right: 10px; + } + .avatar { + max-width: 42px; + max-height: 42px; + border: 1px solid #bbb; + } + .badge {margin-top: -2px;} + ) +}.Else{ + Div(col-md-12 alert alert-danger text-center){ + Span(Body: LangRes(@1attention)) + } +} \ No newline at end of file diff --git a/src/basic/pages/messages_list.ptl b/src/basic/pages/messages_list.ptl new file mode 100644 index 000000000..0a98db9c7 --- /dev/null +++ b/src/basic/pages/messages_list.ptl @@ -0,0 +1,114 @@ +DBFind(@1notifications,threads).Where({ecosystem:#ecosystem_id#, "page_params->type":"message",{"$or": [{"sender->member_id":#key_id#}, {"recipient->member_id":#key_id#}]}}).Order({"id":"-1"}).Limit(250).Count(threads_count).Columns("id,sender->member_id,sender->member_name,sender->image_id,recipient->member_name,notification->body,notification->header,page_params->thread,date_created,closed") + +Div(content-wrapper){ + Div(row){ + Div(col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1){ + Div(list-group-item text-center p0){ + Span(Class: h4 text-bold vc, Body: LangRes(@1message_active_threads)) + Button(Class: btn-xs btn-link plus-button p0 b0, Page: @1message_create){ + Span(Class: fa fa-2x icon-plus vc) + }.Popup(50, $@1message_create$) + }.Style( + .plus-button { + position: absolute; + right: 10px; + } + ) + If(#threads_count#>0){ + ForList(threads){ + If(#page_params.thread#>0){ + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, "page_params->thread": #page_params.thread#}).Order({"id":"-1"}).Limit(1).Columns("id").Vars(last) + }.Else{ + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, "page_params->thread": #id#}).Count(thread_depth) + } + If(Or(#id#==#last_id#,#thread_depth#==0)){ + If(Or(#closed#==1,#sender.member_id#==#key_id#)){SetVar(status,"read")}.Else{SetVar(status,"unread")} + Div(list-group-item col-sm-12 thread-block #status#){ + Div(avatar-block text-center){ + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#id#}).Columns("sender->member_id,recipient->member_id,sender->member_name,recipient->member_name,sender->image_id,recipient->image_id").Vars(init_message) + If(#init_message_sender_member_id#!=#key_id#){ + DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#init_message_sender_member_id#}).Vars(talker) + If(GetVar(talker_id)){ + SetVar(talker_name,#talker_member_name#) + SetVar(talker_picture,#talker_image_id#) + }.Else{ + SetVar(talker_id,#init_message_sender_member_id#) + SetVar(talker_name,#init_message_sender_member_name#) + SetVar(talker_picture,#init_message_sender_image_id#) + } + }.Else{ + DBFind(@1members).Where({ecosystem:#ecosystem_id#, id:#init_message_recipient_member_id#}).Vars(talker) + If(GetVar(talker_id)){ + SetVar(talker_name,#talker_member_name#) + SetVar(talker_picture,#talker_image_id#) + }.Else{ + SetVar(talker_id,#init_message_recipient_member_id#) + SetVar(talker_name,#init_message_recipient_member_name#) + SetVar(talker_picture,#init_message_recipient_image_id#) + } + } + LinkPage(Page: @1profile_view, PageParams: "v_key_id=#talker_id#"){ + If(#talker_picture#>0){ + Image(Src: Binary().ById(#talker_picture#), Class: img-circle avatar) + }.Else{ + Span(Class: fa icon-user fa-3x) + } + Div(preview m0 h5){#talker_name#} + } + } + Div(message-block){ + LinkPage(Page: @1message_view, PageParams: "notific_id=#id#"){ + If(#notification.header#==""){ + Div(Class: preview h4 m0, Body: LangRes(@1message_subject_empty)) + }.Else{ + Div(Class: preview h4 m0, Body: #notification.header#) + } + If(#sender.member_id#==#key_id#){ + Div(Class: preview text-muted, Body: $@1you$: #notification.body#) + }.Else{ + Div(Class: preview text-muted, Body: #notification.body#) + } + } + } + Div(datetime-block text-muted){ + If(GetVar(status)=="unread"){ + Span(Class: badge mr, Body: LangRes(@1unread)) + } + Span(Class: h6, Body: DateTime(#date_created#, HH:MI DD.MM.YYYY)) + } + } + } + } + }.Else{ + Div(list-group-item text-center text-muted){ + $@1messages_empty$ + } + } + } + }.Style( + .thread-block {height: 80px;} + .avatar-block { + position: absolute; + width: 70px; + } + .message-block {margin-left: 85px;} + .datetime-block { + position: absolute; + bottom: 5px; + right: 10px; + } + .preview { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .avatar { + max-width: 42px; + max-height: 42px; + border: 1px solid #bbb; + } + .badge {margin-top: -2px;} + .unread {background-color: #f7fafe;} + .vc {line-height: 44px;} + ) +} \ No newline at end of file diff --git a/src/basic/pages/notifications.ptl b/src/basic/pages/notifications.ptl index 0b5214681..b1dc8598f 100644 --- a/src/basic/pages/notifications.ptl +++ b/src/basic/pages/notifications.ptl @@ -1,6 +1,6 @@ -DBFind(@1notifications,notification_singles).Where({ecosystem:#ecosystem_id#, closed:0,"notification->type": 1, "recipient->member_id": #key_id#}).Columns("id,page_name,notification->icon,notification->header,notification->body").Count(count_singles) +DBFind(@1notifications,notification_singles).Where({ecosystem:#ecosystem_id#, closed:0,"notification->type": 1, "recipient->member_id": #key_id#}).Columns("id,page_name,notification->icon,notification->header,notification->popup,notification->body").Count(count_singles) -DBFind(@1notifications,notification_roles).Where({ecosystem:#ecosystem_id#, closed:0, "notification->type": 2, "recipient->role_id":#role_id#, {"$or":[{date_start_processing: $isnull}, {"processing_info->member_id": #key_id#}]}}).Columns("id,page_name,notification->icon,notification->header,notification->body,recipient->role_id").Count(count_current_role) +DBFind(@1notifications,notification_roles).Where({ecosystem:#ecosystem_id#, closed:0, "notification->type": 2, "recipient->role_id":#role_id#, {"$or":[{date_start_processing: $isnull}, {"processing_info->member_id": #key_id#}]}}).Columns("id,page_name,notification->icon,notification->header,notification->popup,notification->body,recipient->role_id").Count(count_current_role) SetVar(limit,10).(limit_count,#limit#) SetVar(remaining,Calculate(#count_singles#+#count_current_role#-#limit#)) @@ -9,18 +9,34 @@ If(And(#limit_count#>0,#count_singles#>0)){ ForList(notification_singles){ If(#limit_count#>0){ SetVar(limit_count,Calculate(#limit_count#-1)) - Div(list-group-item){ - LinkPage(Page: #page_name#, PageParams: "notific_id=#id#"){ - Div(media-box clearfix){ - Div(pull-left){ - Em(Class: fa #notification.icon# fa-1x text-primary) + If(#notification.popup#==1){ + Div(list-group-item){ + Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: "notific_id=#id#"){ + Div(media-box clearfix){ + Div(pull-left){ + Em(Class: fa #notification.icon# fa-1x text-primary) + } + Div(media-box-body){ + Div(Class: m0 text-normal h6, Body: #notification.header#) + Div(Class: m0 text-muted h6, Body: #notification.body#) + } } - Div(media-box-body){ - Div(Class: m0 text-normal h6, Body: #notification.header#) - Div(Class: m0 text-muted h6, Body: #notification.body#) + }.Popup(Header: $@1notifications_view$, Width: "40") + }.Style(.vm{vertical-align: middle;}) + }.Else{ + Div(list-group-item){ + Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: "notific_id=#id#"){ + Div(media-box clearfix){ + Div(pull-left){ + Em(Class: fa #notification.icon# fa-1x text-primary) + } + Div(media-box-body){ + Div(Class: m0 text-normal h6, Body: #notification.header#) + Div(Class: m0 text-muted h6, Body: #notification.body#) + } } } - } + }.Style(.vm{vertical-align: middle;}) } } } @@ -28,24 +44,40 @@ If(And(#limit_count#>0,#count_singles#>0)){ If(And(#limit_count#>0,#count_current_role#>0)){ DBFind(@1roles).Where({ecosystem:#ecosystem_id#, id:#role_id#}).Columns("role_name").Vars(role) - Div(h6 mb-sm mt-lg ml-lg text-muted){ - $@1role_notifics$ (#role_role_name#): + Div(dropdown-heading b0){ + $@1role_notifics$ (#role_role_name#) } ForList(notification_roles){ If(#limit_count#>0){ SetVar(limit_count,Calculate(#limit_count#-1)) - Div(list-group-item){ - LinkPage(Page: #page_name#, PageParams: "notific_id=#id#"){ - Div(media-box clearfix){ - Div(pull-left){ - Em(Class: fa #notification.icon# fa-1x text-primary) + If(#notification.popup#==1){ + Div(list-group-item){ + Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: "notific_id=#id#"){ + Div(media-box clearfix){ + Div(pull-left){ + Em(Class: fa #notification.icon# fa-1x text-primary) + } + Div(media-box-body){ + Div(Class: m0 text-normal h6, Body: #notification.header#) + Div(Class: m0 text-muted h6, Body: #notification.body#) + } } - Div(media-box-body){ - Div(Class: m0 text-normal h6, Body: #notification.header#) - Div(Class: m0 text-muted h6, Body: #notification.body#) + }.Popup(Header: $@1notifications_view$, Width: "40") + }.Style(.vm{vertical-align: middle;}) + }.Else{ + Div(list-group-item){ + Button(Class: btn-link m0 p0 b0 text-left vm, Page: #page_name#, PageParams: "notific_id=#id#"){ + Div(media-box clearfix){ + Div(pull-left){ + Em(Class: fa #notification.icon# fa-1x text-primary) + } + Div(media-box-body){ + Div(Class: m0 text-normal h6, Body: #notification.header#) + Div(Class: m0 text-muted h6, Body: #notification.body#) + } } } - } + }.Style(.vm{vertical-align: middle;}) } } } diff --git a/src/basic/pages/notifications_broadcast.ptl b/src/basic/pages/notifications_broadcast.ptl index e33ff4531..dbb8c41c1 100644 --- a/src/basic/pages/notifications_broadcast.ptl +++ b/src/basic/pages/notifications_broadcast.ptl @@ -1,63 +1,60 @@ SetVar(role_admin, EcosysParam(Ecosystem:1, Name: role_admin)) -SetTitle($@1notifications_broadcast$) DBFind(@1ecosystems).Count(ecos_count) -SetVar(left_col,"col-sm-3 mt text-right").(right_col,"col-sm-9") -Div(content-wrapper){ - Div(breadcrumb){ - LinkPage($@1notifications$, @1notifications_list) - Span(/,mh) - Span($@1broadcast_send$,text-muted) - } - - Div(row){ - Div(col-sm-6 col-sm-offset-3){ - If(And(#role_id#==#role_admin#,#ecosystem_id#==1,#ecos_count#>1)){ - DBFind(@1roles,src_roles).Where({role_type:3, ecosystem:2}).Columns("id,role_name") - Form(panel panel-primary){ - Div(panel-body){ - Div(row mt){ - Div(#left_col#){ - LangRes(@1header) - } - Div(#right_col#){ - Input(Name: Header, Type: textarea) - } - } - Div(row mt){ - Div(#left_col#){ - LangRes(@1body_text) - } - Div(#right_col#){ - Input(Name: Body, Type: textarea) - } - } - Div(row mt){ - Div(#left_col#){ - LangRes(@1recipient) - } - Div(#right_col# mt){ - LangRes(@1ecosystems_administrators) - } - } - } - Div(panel-footer text-left){ - Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1notifications_list) - Button(Body: LangRes(@1send), Class: btn btn-primary pull-right, Contract: @1NotificationsBroadcast, Params: "RoleId=#role_id#", Page: @1notifications_list) - } +Form(){ + If(And(#role_id#==#role_admin#,#ecosystem_id#==1,#ecos_count#>1)){ + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1recipient)).(Class: text-danger, Body:*) + } + } + Div(col-md-9 text-left){ + Input(Value: $@1ecosystems_administrators$, Disabled: true) + } + } + Div(row mt-sm){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1header)).(Class: text-danger, Body:*) + } + } + Div(col-md-9 text-left){ + Input(Name: Header) + } + } + Div(row mt-sm){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1body_text)).(Class: text-danger, Body:*) } - }.Else{ - Div(col-sm-12 alert alert-warning text-center){ - If(#role_id#!=#role_admin#){ - LangRes(@1only_admin_action) - } - If(#ecosystem_id#!=1){ - LangRes(@1only_first_ecosystem_action) - } - If(#ecos_count#==1){ - LangRes(@1other_ecosystems_not_found) - } + } + Div(col-md-9 text-left){ + Input(Name: Body, Type: textarea).Style(resize: vertical;) + } + } + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1popup)) } + }.Style(line-height: 18px;) + Div(col-md-9 text-left){ + Input(Name: Popup, Type: checkbox, Value: false, Class: mt-sm) + } + } + }.Else{ + Div(col-sm-12 alert alert-warning text-center){ + If(#role_id#!=#role_admin#){ + LangRes(@1only_admin_action) + } + If(#ecosystem_id#!=1){ + LangRes(@1only_first_ecosystem_action) + } + If(#ecos_count#==1){ + LangRes(@1other_ecosystems_not_found) } } } + Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: @1notifications_list, Contract: @1NotificationsBroadcast, Params: "RoleId=#role_id#") + Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list) } \ No newline at end of file diff --git a/src/basic/pages/notifications_roles_send.ptl b/src/basic/pages/notifications_roles_send.ptl index 2d788ece6..a23d4f358 100644 --- a/src/basic/pages/notifications_roles_send.ptl +++ b/src/basic/pages/notifications_roles_send.ptl @@ -89,7 +89,7 @@ Form(){ } } Div(col-md-9 text-left){ - Input(Name: text_body, Value: "Body text") + Input(Name: text_body, Type: textarea, Value: "Body text").Style(resize: vertical;) } } Div(row mt-lg){ @@ -101,7 +101,11 @@ Form(){ Div(col-md-9 text-left){ Input(Name: page_name, Value: "@1notifications_testpage").Validate(minLength:3, maxLength:255) InputErr(Name: page_name, minLength: $@1validate_name$, maxLength: $@1validate_role_name$) - } + }.Show("popup=false") + Div(col-md-9 text-left){ + Input(Name: page_name_popup, Value: "@1notifications_testpage_popup").Validate(minLength:3, maxLength:255) + InputErr(Name: page_name_popup, minLength: $@1validate_name$, maxLength: $@1validate_role_name$) + }.Show("popup=true") } Div(row mt-sm){ Div(col-md-3 mt-sm text-right){ @@ -113,6 +117,21 @@ Form(){ Input(Name: params_map, Value: `{"param_int":"10","param_str":"my_string"}`) } } - Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, PageParams: "type=1", Contract: @1NotificationsSend, Params: "current_role_id=#role_id#") + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1popup)) + } + }.Style(line-height: 18px;) + Div(col-md-9 text-left){ + Input(Name: popup, Type: checkbox, Value: false, Class: mt-sm) + } + } + Div(){ + Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, PageParams: "type=1", Contract: @1NotificationsSend, Params: "current_role_id=#role_id#,page_name=Val(page_name)") + }.Show("popup=false") + Div(){ + Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, PageParams: "type=1", Contract: @1NotificationsSend, Params: "current_role_id=#role_id#,page_name=Val(page_name_popup)") + }.Show("popup=true") Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#, PageParams: "type=1") } \ No newline at end of file diff --git a/src/basic/pages/notifications_show.ptl b/src/basic/pages/notifications_show.ptl index 61a7dc68a..9b5173d3d 100644 --- a/src/basic/pages/notifications_show.ptl +++ b/src/basic/pages/notifications_show.ptl @@ -23,15 +23,19 @@ Div(content-wrapper){ Div(panel-footer text-right){ If(#type# == 1){ If(#note_closed# == 0){ - Button(Body: LangRes(@1understand), Class: btn btn-primary, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1default_page) + Button(Body: LangRes(@1understood), Class: btn btn-primary, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1default_page) + }.Else{ + Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1default_page) } }.ElseIf(#type# == 2){ If(#note_closed#==0){ If(#note_date_start_processing#==""){ - Button(Body: LangRes(@1understand), Class: btn btn-primary, Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#", Page: @1notifications_show) + Button(Body: LangRes(@1understood), Class: btn btn-primary, Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#", Page: @1notifications_show) }.Else{ Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1default_page) } + }.Else{ + Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1default_page) } } } diff --git a/src/basic/pages/notifications_single_send.ptl b/src/basic/pages/notifications_single_send.ptl index 3d1ce1769..f38337d2c 100644 --- a/src/basic/pages/notifications_single_send.ptl +++ b/src/basic/pages/notifications_single_send.ptl @@ -79,7 +79,7 @@ Form(){ } } Div(col-md-9 text-left){ - Input(Name: text_body, Value: "Body text") + Input(Name: text_body, Type: textarea, Value: "Body text").Style(resize: vertical;) } } Div(row mt-lg){ @@ -91,7 +91,11 @@ Form(){ Div(col-md-9 text-left){ Input(Name: page_name, Value: "@1notifications_testpage").Validate(minLength:3, maxLength:255) InputErr(Name: page_name, minLength: $@1validate_name$, maxLength: $@1validate_role_name$) - } + }.Show("popup=false") + Div(col-md-9 text-left){ + Input(Name: page_name_popup, Value: "@1notifications_testpage_popup").Validate(minLength:3, maxLength:255) + InputErr(Name: page_name_popup, minLength: $@1validate_name$, maxLength: $@1validate_role_name$) + }.Show("popup=true") } Div(row mt-sm){ Div(col-md-3 mt-sm text-right){ @@ -103,6 +107,21 @@ Form(){ Input(Name: params_map, Value: `{"param_int":"10","param_str":"my_string"}`) } } - Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: @1notifications_list, Contract: @1NotificationsSend, Params: "current_role_id=#role_id#") - Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list) + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(Body: LangRes(@1popup)) + } + }.Style(line-height: 18px;) + Div(col-md-9 text-left){ + Input(Name: popup, Type: checkbox, Value: false, Class: mt-sm) + } + } + Div(){ + Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, Contract: @1NotificationsSend, Params: "current_role_id=#role_id#,page_name=Val(page_name)") + }.Show("popup=false") + Div(){ + Button(Body: LangRes(@1send), Class: btn btn-primary pull-right mt, Page: #back_page#, Contract: @1NotificationsSend, Params: "current_role_id=#role_id#,page_name=Val(page_name_popup)") + }.Show("popup=true") + Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: #back_page#) } \ No newline at end of file diff --git a/src/basic/pages/notifications_testpage.ptl b/src/basic/pages/notifications_testpage.ptl index 9f97c2cdf..1905458f6 100644 --- a/src/basic/pages/notifications_testpage.ptl +++ b/src/basic/pages/notifications_testpage.ptl @@ -1,93 +1,99 @@ Div(content-wrapper){ DBFind(@1applications).Columns("name,id").Where({ecosystem:1, name:"Basic"}).Vars(application) - SetTitle($@1test_page$) If(#notific_id#>0){ - DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("id,sender->type,notification->type,notification->header,page_params->param_int,page_params->param_str,date_start_processing,closed").Vars(prefix) - SetVar(sender_type,#prefix_sender_type#).(notification_type,#prefix_notification_type#).(notific_header,#prefix_notification_header#).(notific_val_int,#prefix_page_params_param_int#).(notific_val_str,#prefix_page_params_param_str#) + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("id,sender->type,notification->type,notification->header,notification->body,page_params->param_int,page_params->param_str,date_start_processing,closed").Vars(prefix) + SetVar(sender_type,#prefix_sender_type#).(notification_type,#prefix_notification_type#).(notific_header,#prefix_notification_header#).(notific_body,#prefix_notification_body#).(notific_val_int,#prefix_page_params_param_int#).(notific_val_str,#prefix_page_params_param_str#) }.Else{ Div(md-12 alert alert-danger text-center){ Span(Body: LangRes(@1attention)) } - SetVar(notific_id,"0").SetVar(sender_type,"0").(notification_type,"0").(notific_header,"null").(notific_val_int,"null").(notific_val_str,"null") + SetVar(notific_id,"0").SetVar(sender_type,"0").(notification_type,"0").(notific_header,"null").(notific_body,"null").(notific_val_int,"null").(notific_val_str,"null") } Div(row){ Div(col-md-6 col-md-offset-3){ - Form(panel panel-default){ - Div(panel-body){ - Div(list-group-item text-center){ - Span(Class: h3, Body: #notific_header#) + Form(){ + Div(list-group-item text-center){ + Span(Class: h3, Body: #notific_header#) + } + Div(list-group-item){ + Div(row){ + Div(col-md-6 mt-sm text-right){ + Span(Class: h4, Body: LangRes(@1id)) + } + Div(col-md-6 mt-sm text-left){ + Span(Class: h4, Body: #notific_id#) + } } - Div(list-group-item){ - Div(row){ - Div(col-md-6 mt-sm text-right){ - Span(Class: h4, Body: LangRes(@1id)) - } - Div(col-md-6 mt-sm text-left){ - Span(Class: h4, Body: #notific_id#) - } + Div(row){ + Div(col-md-6 mt-sm text-right){ + Span(Class: h4, Body: LangRes(@1type)) } - Div(row){ - Div(col-md-6 mt-sm text-right){ - Span(Class: h4, Body: LangRes(@1type)) - } - Div(col-md-6 mt-sm text-left){ - If(#notification_type# > 0){ - Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_type, Index: #notification_type#)) - }.Else{ - Span(Class: h4, Body: #notification_type#) - } + Div(col-md-6 mt-sm text-left){ + If(#notification_type# > 0){ + Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_type, Index: #notification_type#)) + }.Else{ + Span(Class: h4, Body: #notification_type#) } } - Div(row){ - Div(col-md-6 mt-sm text-right){ - Span(Class: h4, Body: LangRes(@1sender)) - } - Div(col-md-6 mt-sm text-left){ - If(#sender_type# > 0){ - Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_sender, Index: #sender_type#)) - }.Else{ - Span(Class: h4, Body: #sender_type#) - } + } + Div(row){ + Div(col-md-6 mt-sm text-right){ + Span(Class: h4, Body: LangRes(@1sender)) + } + Div(col-md-6 mt-sm text-left){ + If(#sender_type# > 0){ + Span(Class: h4, Body: AppParam(Ecosystem: 1, App:#application_id#, Name: notification_sender, Index: #sender_type#)) + }.Else{ + Span(Class: h4, Body: #sender_type#) } } } - Div(list-group-item){ - Div(row){ - Div(col-md-6 mt-sm text-right){ - Span(Class: h4, Body: LangRes(@1value_number)) - } - Div(col-md-6 mt-sm text-left){ - Span(Class: h4, Body: #notific_val_int#) - } + Div(row){ + Div(col-md-6 mt-sm text-right){ + Span(Class: h4, Body: LangRes(@1body_text)) } - Div(row){ - Div(col-md-6 mt-sm text-right){ - Span(Class: h4, Body: LangRes(@1value_string)) - } - Div(col-md-6 mt-sm text-left){ - Span(Class: h4, Body: #notific_val_str#) - } + Div(col-md-6 mt-sm text-left){ + Span(Class: h4, Body: #notific_body#) } } } - If(#notification_type# == 1){ - If(#prefix_closed# == 0){ - Div(panel-footer text-right){ - Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1notifications_list).Alert(Text: "$@1want_close_notification$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + Div(list-group-item){ + Div(row){ + Div(col-md-6 mt-sm text-right){ + Span(Class: h4, Body: LangRes(@1value_number)) + } + Div(col-md-6 mt-sm text-left){ + Span(Class: h4, Body: #notific_val_int#) + } + } + Div(row){ + Div(col-md-6 mt-sm text-right){ + Span(Class: h4, Body: LangRes(@1value_string)) + } + Div(col-md-6 mt-sm text-left){ + Span(Class: h4, Body: #notific_val_str#) } } } - If(#notification_type# == 2){ + Div(list-group-item text-right){ If(#prefix_closed# == 0){ - Div(panel-footer text-right){ + If(#notification_type# == 1){ + Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1notifications_list).Alert(Text: "$@1want_close_notification$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + }.ElseIf(#notification_type# == 2){ If(#prefix_date_start_processing# == ""){ Button(Body: LangRes(@1begin), Class: btn btn-primary, Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#", Page: @1notifications_list, PageParams: "type=1").Alert(Text: "$@1want_start_processing_notification$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) }.Else{ Button(Body: LangRes(@1close), Class: btn btn-primary, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1notifications_list, PageParams: "type=1").Alert(Text: "$@1want_close_notification$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) } } + }.Else{ + If(#notification_type# == 1){ + Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1notifications_list, PageParams: "type=0") + }.ElseIf(#notification_type# == 2){ + Button(Body: LangRes(@1back), Class: btn btn-default, Page: @1notifications_list, PageParams: "type=1") + } } } } diff --git a/src/basic/pages/notifications_testpage_popup.ptl b/src/basic/pages/notifications_testpage_popup.ptl new file mode 100644 index 000000000..5c632b46d --- /dev/null +++ b/src/basic/pages/notifications_testpage_popup.ptl @@ -0,0 +1,65 @@ +DBFind(@1applications).Columns("name,id").Where({ecosystem:1, name:"Basic"}).Vars(application) +Form(){ + If(#notific_id#>0){ + DBFind(@1notifications).Where({ecosystem:#ecosystem_id#, id:#notific_id#}).Columns("id,sender->type,sender->member_name,sender->role_name,notification->body,notification->type,notification->header,date_start_processing,closed").Vars(n) + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(LangRes(@1sender)) + } + } + Div(col-md-9 mt-sm text-left){ + If(#n_sender_type#==1){ + Span(Class: text-normal, Body: #n_sender_member_name#) + }.ElseIf(#n_sender_type#==2){ + Span(Class: text-normal, Body: #n_sender_role_name#) + } + } + } + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(LangRes(@1header)) + } + } + Div(col-md-9 mt-sm text-left){ + Span(Class: text-normal, Body: #n_notification_header#) + } + } + Div(row){ + Div(col-md-3 mt-sm text-right){ + Label(){ + Span(LangRes(@1body_text)) + } + } + Div(col-md-9 mt-sm text-left){ + Span(Class: text-normal, Body: #n_notification_body#) + } + } + }.Else{ + Div(md-12 alert alert-danger text-center){ + Span(Body: LangRes(@1attention)) + } + } + If(#n_notification_type# == 1){ + SetVar(page_type,0) + }.ElseIf(#n_notification_type# == 2){ + SetVar(page_type,1) + } + If(#n_closed# == 0){ + If(#n_notification_type# == 1){ + Button(Body: LangRes(@1close), Class: btn btn-primary pull-right mt, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1notifications_list, PageParams: "type=#page_type#").Alert(Text: "$@1want_close_notification$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: "type=#page_type#") + }.ElseIf(#n_notification_type# == 2){ + If(#n_date_start_processing# == ""){ + Button(Body: LangRes(@1begin), Class: btn btn-primary pull-right mt, Contract: @1NotificationsProcess, Params: "notific_id=#notific_id#", Page: @1notifications_list, PageParams: "type=#page_type#").Alert(Text: "$@1want_start_processing_notification$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: "type=#page_type#") + }.Else{ + Button(Body: LangRes(@1close), Class: btn btn-primary pull-right mt, Contract: @1NotificationsClose, Params: "notific_id=#notific_id#", Page: @1notifications_list, PageParams: "type=#page_type#").Alert(Text: "$@1want_close_notification$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) + Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: "type=#page_type#") + } + } + }.Else{ + Button(Body: LangRes(@1back), Class: btn btn-default pull-right mt, Page: @1notifications_list, PageParams: "type=#page_type#") + } +} \ No newline at end of file diff --git a/src/basic/pages/profile_transactions.ptl b/src/basic/pages/profile_transactions.ptl index df549d114..a35c60c18 100644 --- a/src/basic/pages/profile_transactions.ptl +++ b/src/basic/pages/profile_transactions.ptl @@ -57,7 +57,7 @@ DBFind(@1history, src_history).Where(#where#).Order({"id": -1}).Limit(#pager_lim Address(#recipient_id#) } }.Custom(amount_apl){ - Money(#amount#) APL + Money(#amount#) APLA }.Custom(_type){ AppParam(Ecosystem:1, App:#appication_id#, Name: type_tokens_transfer, Index: #type#) }.Count(count) diff --git a/src/basic/pages/profile_transactions_filter.ptl b/src/basic/pages/profile_transactions_filter.ptl index 65999502e..520cc64e7 100644 --- a/src/basic/pages/profile_transactions_filter.ptl +++ b/src/basic/pages/profile_transactions_filter.ptl @@ -17,7 +17,7 @@ Form(){ Div(row mt){ Div(col-md-4 mt-sm text-right){ Label(){ - Span(Body: "$@1amount_range$ (APL)") + Span(Body: "$@1amount_range$ (APLA)") } } Div(col-sm-3 pr0){ diff --git a/src/basic/pages/roles_list.ptl b/src/basic/pages/roles_list.ptl index 9c4b7ee12..c2298f04b 100644 --- a/src/basic/pages/roles_list.ptl +++ b/src/basic/pages/roles_list.ptl @@ -16,7 +16,7 @@ Div(list-group-item ml-lg mr-lg pt-lg){ Include(@1search) } -DBFind(#this_table#).Count(all_roles_count) +DBFind(#this_table#).Where({ecosystem:#ecosystem_id#}).Count(all_roles_count) DBFind(#this_table#, src_roles).Where(#where#).Order({deleted:"1", id:"1"}).Limit(#pager_limit#).Offset(#pager_offset#).Columns("id,role_name,role_type,image_id,creator->member_id,creator->member_name,date_created,date_deleted,deleted,roles_access").Custom(_id){ If(#deleted# == 0){ SetVar(style_text,).(style_link,"text-primary") diff --git a/src/basic/pages/sysparams_list.ptl b/src/basic/pages/sysparams_list.ptl index e86ecd0f2..2437600a6 100644 --- a/src/basic/pages/sysparams_list.ptl +++ b/src/basic/pages/sysparams_list.ptl @@ -5,8 +5,8 @@ SetTitle("$@1platform_parameters$") Span(Class: text-muted h5 m0 mb ml-lg, Body: Span(Class: ml-sm, Body: "$@1platform_params_desc$")) SetVar(role_validator, EcosysParam(Ecosystem:1, Name: role_validator)) DBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, "member->member_id":#key_id#, "role->id":#role_validator#, deleted:0}).Columns("id").Vars(validator) -If(#validator_id#==0){ - AddToolButton(Title: $@1sysparams_validator_resign$, Icon: icon-pin, Page: @1sysparams_validator_resign) +If(#validator_id#>0){ + AddToolButton(Title: $@1sysparams_validator_resign$, Icon: icon-pin, Page: @1sysparams_validator_resign).Popup(50, $@1sysparams_validator_resign$) } If(GetVar(search)!=""){ diff --git a/src/basic/pages/sysparams_validator_resign.ptl b/src/basic/pages/sysparams_validator_resign.ptl index f4f1f104f..3e33432d0 100644 --- a/src/basic/pages/sysparams_validator_resign.ptl +++ b/src/basic/pages/sysparams_validator_resign.ptl @@ -1,34 +1,13 @@ -SetVar(role_validator, EcosysParam(Ecosystem:1, Name: role_validator)) -DBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, "member->member_id":#key_id#, "role->id":#role_validator#, deleted:0}).Columns("id").Vars(validator) -SetTitle($@1sysparams_validator_resign$) - -Div(content-wrapper){ - Div(breadcrumb){ - LinkPage(Body:$system_params$, Page: @1sysparams_list) - Span(/,mh) - Span(Class: text-muted, Body: $@1sysparams_validator_resign$) +Form(){ + Div(row){ + Div(col-sm-12 text-center h4){ + $@1validator_removing_desc$ + } } + SetVar(role_validator, EcosysParam(Ecosystem:1, Name: role_validator)) + DBFind(@1roles_participants).Where({ecosystem:#ecosystem_id#, "member->member_id":#key_id#, "role->id":#role_validator#, deleted:0}).Columns("id").Vars(validator) If(#validator_id#>0){ - Div(row){ - Div(col-md-6 col-md-offset-3){ - Div(panel panel-primary text-center){ - Div(panel-heading){ - $@1validator_removing$ - } - Div(panel-body text-center){ - $@1validator_removing_desc$ - } - Div(panel-footer text-left){ - Button(Body: $@1back$, Class: btn btn-default, Page: @1sysparams_list) - Button(Body: $@1resign$, Class: btn btn-danger pull-right, Page: @1sysparams_list, Contract: @1ValidatorResign).Alert(Text: "$@1want_resign$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) - } - } - } - } - }.Else{ - Div(text-danger text-center text-bold){ - LangRes(@1attention_not_validator) - } + Button(Body: $@1resign$, Class: btn btn-danger pull-right mt-lg, Page: @1sysparams_list, Contract: @1ValidatorResign).Alert(Text: "$@1want_resign$", ConfirmButton: $@1yes$, CancelButton: $@1no$, Icon: question) } - + Button(Body: $@1back$, Class: btn btn-default pull-right mt-lg, Page: @1sysparams_list) } \ No newline at end of file diff --git a/src/basic/pages/sysparams_voting.ptl b/src/basic/pages/sysparams_voting.ptl index c8c894293..3b45cff38 100644 --- a/src/basic/pages/sysparams_voting.ptl +++ b/src/basic/pages/sysparams_voting.ptl @@ -112,16 +112,6 @@ Div(content-wrapper){ SetVar(node_owner, 1) } } - - If(#node_owner#==1){ - Form(text-center){ - Div(h3){$delete_node$} - Div(){$delete_node_desc$} - Div(text-right){ - Button(Body: LangRes(@1delete), Class: btn btn-danger, Page: @1sysparams_list, Contract: @1NodeRemoveByKey) - } - } - } If(`#full_nodes#`!=""){ SetVar(nodes_count,0) ArrayToSource(src_full_nodes,`#full_nodes#`) diff --git a/src/basic/pages/tokenrefund_list.ptl b/src/basic/pages/tokenrefund_list.ptl index 03d614155..9d9dd2b3a 100644 --- a/src/basic/pages/tokenrefund_list.ptl +++ b/src/basic/pages/tokenrefund_list.ptl @@ -21,8 +21,6 @@ If(And(#template_voters#>0,#template_voters#==#role_id#)){ } } -AddToolButton(Title: $@1create_request$, Icon: icon-plus, Page: @1tokenrefund_create).Popup(50, $@1create_request$) - If(GetVar(search)){ SetVar(where, "{note:{$like:#search#}}") }.Else{ diff --git a/src/basic/pages/voting_templates_list.ptl b/src/basic/pages/voting_templates_list.ptl index a6a268153..56131d1a1 100644 --- a/src/basic/pages/voting_templates_list.ptl +++ b/src/basic/pages/voting_templates_list.ptl @@ -22,7 +22,7 @@ Div(list-group-item ml-lg mr-lg pt-lg){ } DBFind(@1applications).Where({ecosystem:1, name:"Basic"}).Columns("name,id").Vars(application) -DBFind(#this_table#).Count(all_templates_count) +DBFind(#this_table#).Where({ecosystem:#ecosystem_id#}).Count(all_templates_count) DBFind(#this_table#, src).Where(#where#).Order({"id": 1}).Limit(#pager_limit#).Offset(#pager_offset#).Custom(_participants){ AppParam(Ecosystem:1, App:#application_id#, Name:type_voting_participants, Index: #type_participants#) }.Custom(_decision){ @@ -68,7 +68,7 @@ Div(fullscreen){ yes,$@1use_default_voting_templates$ no,$@1select_default_templates_manually$ } - RadioGroup(Name: fill_ids, Source: autofill, NameColumn: description, ValueColumn: value) + RadioGroup(Name: fill_ids, Source: autofill, NameColumn: description, ValueColumn: value).Style(line-height: 20px;) Button(Body: $@1install_default_templates$, Class: btn btn-primary, Page: @1voting_templates_list, Contract: @1VotingTemplatesInstall) } } diff --git a/src/basic/struct.dot b/src/basic/struct.dot index ffdb85839..3ca9514a0 100644 --- a/src/basic/struct.dot +++ b/src/basic/struct.dot @@ -1,6 +1,6 @@ digraph G { fontsize="24"; -label="basic\nThursday, 01-Nov-18 21:01:03 +10"; +label="basic\nFriday, 16-Nov-18 22:05:01 +10"; nojustify=true; ordering=out; rankdir=LR; @@ -39,6 +39,7 @@ size="30"; "members_list\npage" -> "@1search\nblock" [ color=green, label=include ] "members_list\npage" -> "@1pager\nblock" [ color=green, label=include ] "members_list\npage" [color=green, fontcolor=green, group=pages, shape=record]; +"members_list_admin\npage" -> "@1DeleteMember\ncontract" [ color=red ] "members_list_admin\npage" -> "@1BlockMember\ncontract" [ color=red ] "src\ntable" -> "members_list_admin\npage" "1members\ntable" -> "members_list_admin\npage" @@ -54,12 +55,24 @@ size="30"; "1notifications\ntable" -> "membership_user_view\npage" "1ecosystems\ntable" -> "membership_user_view\npage" "membership_user_view\npage" [color=green, fontcolor=green, group=pages, shape=record]; +"message_create\npage" -> "@1NotificationsSend\ncontract" [ color=red ] +"1keys\ntable" -> "message_create\npage" +"1members\ntable" -> "message_create\npage" +"1roles\ntable" -> "message_create\npage" +"message_create\npage" [color=green, fontcolor=green, group=pages, shape=record]; +"message_view\npage" -> "@1NotificationsClose\ncontract" [ color=red ] +"message_view\npage" -> "@1NotificationsSend\ncontract" [ color=red ] +"1notifications\ntable" -> "message_view\npage" +"1members\ntable" -> "message_view\npage" +"message_view\npage" [color=green, fontcolor=green, group=pages, shape=record]; +"1notifications\ntable" -> "messages_list\npage" +"1members\ntable" -> "messages_list\npage" +"messages_list\npage" [color=green, fontcolor=green, group=pages, shape=record]; "1notifications\ntable" -> "notifications\npage" "1roles\ntable" -> "notifications\npage" "notifications\npage" [color=green, fontcolor=green, group=pages, shape=record]; "notifications_broadcast\npage" -> "@1NotificationsBroadcast\ncontract" [ color=red ] "1ecosystems\ntable" -> "notifications_broadcast\npage" -"1roles\ntable" -> "notifications_broadcast\npage" "notifications_broadcast\npage" [color=green, fontcolor=green, group=pages, shape=record]; "notifications_list\npage" -> "@1notifications_single\nblock" [ color=green, label=include ] "notifications_list\npage" -> "@1notifications_roles\nblock" [ color=green, label=include ] @@ -85,6 +98,11 @@ size="30"; "1applications\ntable" -> "notifications_testpage\npage" "1notifications\ntable" -> "notifications_testpage\npage" "notifications_testpage\npage" [color=green, fontcolor=green, group=pages, shape=record]; +"notifications_testpage_popup\npage" -> "@1NotificationsClose\ncontract" [ color=red ] +"notifications_testpage_popup\npage" -> "@1NotificationsProcess\ncontract" [ color=red ] +"1applications\ntable" -> "notifications_testpage_popup\npage" +"1notifications\ntable" -> "notifications_testpage_popup\npage" +"notifications_testpage_popup\npage" [color=green, fontcolor=green, group=pages, shape=record]; "profile_avatar_edit\npage" -> "@1ProfileEditAvatar\ncontract" [ color=red ] "profile_avatar_edit\npage" [color=green, fontcolor=green, group=pages, shape=record]; "profile_edit\npage" -> "@1ProfileEdit\ncontract" [ color=red ] @@ -163,7 +181,6 @@ size="30"; "sysparams_validator_resign\npage" [color=green, fontcolor=green, group=pages, shape=record]; "sysparams_voting\npage" -> "@1VotingParamCreate\ncontract" [ color=red ] "sysparams_voting\npage" -> "@1VotingNodeAdd\ncontract" [ color=red ] -"sysparams_voting\npage" -> "@1NodeRemoveByKey\ncontract" [ color=red ] "sysparams_voting\npage" -> "@1VotingNodeRemove\ncontract" [ color=red ] "1applications\ntable" -> "sysparams_voting\npage" "1voting_templates\ntable" -> "sysparams_voting\npage" @@ -294,6 +311,8 @@ size="30"; "1roles_participants\ntable" -> "DelegateRefresh\ncontract" "1keys\ntable" -> "DelegateRefresh\ncontract" "DelegateRefresh\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; +"1keys\ntable" -> "DeleteMember\ncontract" +"DeleteMember\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; "InvestorRefresh\ncontract" -> "RolesAssign\ncontract" [ color=red ] "InvestorRefresh\ncontract" -> "RolesUnassign\ncontract" [ color=red ] "1applications\ntable" -> "InvestorRefresh\ncontract" @@ -311,9 +330,10 @@ size="30"; "1ecosystems\ntable" -> "MembershipDecide\ncontract" "MembershipDecide\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; "MembershipRequest\ncontract" -> "NotificationsSend\ncontract" [ color=red ] -"1notifications\ntable" -> "MembershipRequest\ncontract" "1ecosystems\ntable" -> "MembershipRequest\ncontract" +"1keys\ntable" -> "MembershipRequest\ncontract" "1parameters\ntable" -> "MembershipRequest\ncontract" +"1notifications\ntable" -> "MembershipRequest\ncontract" "MembershipRequest\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; "MetricsUpdate\ncontract" -> "BufferManager\ncontract" [ color=red ] "MetricsUpdate\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; @@ -438,6 +458,7 @@ size="30"; "TokensSend\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; "TokensTransfer\ncontract" -> "TokensRefund\ncontract" [ color=red ] "TokensTransfer\ncontract" -> "TokensSend\ncontract" [ color=red ] +"1ecosystems\ntable" -> "TokensTransfer\ncontract" "1keys\ntable" -> "TokensTransfer\ncontract" "TokensTransfer\ncontract" [color=red, fontcolor=red, group=contracts, shape=record]; "ValidatorResign\ncontract" -> "NodeRemoveByKey\ncontract" [ color=red ] diff --git a/src/conditions/struct.dot b/src/conditions/struct.dot index db110735d..d4d53000d 100644 --- a/src/conditions/struct.dot +++ b/src/conditions/struct.dot @@ -1,6 +1,6 @@ digraph G { fontsize="24"; -label="conditions\nSunday, 28-Oct-18 13:18:36 +10"; +label="conditions\nFriday, 16-Nov-18 22:05:09 +10"; nojustify=true; ordering=out; rankdir=LR; diff --git a/src/lang_res/languages/amount_apl.json b/src/lang_res/languages/amount_apl.json index a4369d511..02eda1466 100644 --- a/src/lang_res/languages/amount_apl.json +++ b/src/lang_res/languages/amount_apl.json @@ -1 +1 @@ -{"en": "APL amount", "ru": "Сумма APL"} \ No newline at end of file +{"en": "APLA amount", "ru": "Сумма APLA"} \ No newline at end of file diff --git a/src/lang_res/languages/broadcast.json b/src/lang_res/languages/broadcast.json new file mode 100644 index 000000000..c42b91f07 --- /dev/null +++ b/src/lang_res/languages/broadcast.json @@ -0,0 +1 @@ +{"en": "Broadcast", "ru": "Рассылка"} \ No newline at end of file diff --git a/src/lang_res/languages/ecosystem_not_found.json b/src/lang_res/languages/ecosystem_not_found.json new file mode 100644 index 000000000..3119a6739 --- /dev/null +++ b/src/lang_res/languages/ecosystem_not_found.json @@ -0,0 +1 @@ +{"en": "Ecosystem %v not found", "ru": "Экосистема %v не найдена"} \ No newline at end of file diff --git a/src/lang_res/languages/guest.json b/src/lang_res/languages/guest.json new file mode 100644 index 000000000..f84b4e2fd --- /dev/null +++ b/src/lang_res/languages/guest.json @@ -0,0 +1 @@ +{"en": "Guest", "ru": "Гость"} \ No newline at end of file diff --git a/src/lang_res/languages/mark_read.json b/src/lang_res/languages/mark_read.json new file mode 100644 index 000000000..d63118363 --- /dev/null +++ b/src/lang_res/languages/mark_read.json @@ -0,0 +1 @@ +{"en": "Mark as read", "ru": "Прочитано"} \ No newline at end of file diff --git a/src/lang_res/languages/message_active_threads.json b/src/lang_res/languages/message_active_threads.json new file mode 100644 index 000000000..045969af4 --- /dev/null +++ b/src/lang_res/languages/message_active_threads.json @@ -0,0 +1 @@ +{"en": "Active threads", "ru": "Активные переписки"} \ No newline at end of file diff --git a/src/lang_res/languages/message_create.json b/src/lang_res/languages/message_create.json new file mode 100644 index 000000000..7638c9c26 --- /dev/null +++ b/src/lang_res/languages/message_create.json @@ -0,0 +1 @@ +{"en": "Create message", "ru": "Создать сообщение"} \ No newline at end of file diff --git a/src/lang_res/languages/message_from.json b/src/lang_res/languages/message_from.json new file mode 100644 index 000000000..55e1f385e --- /dev/null +++ b/src/lang_res/languages/message_from.json @@ -0,0 +1 @@ +{"en": "Message from", "ru": "Сообщение от"} \ No newline at end of file diff --git a/src/lang_res/languages/message_from_you.json b/src/lang_res/languages/message_from_you.json new file mode 100644 index 000000000..5488980ac --- /dev/null +++ b/src/lang_res/languages/message_from_you.json @@ -0,0 +1 @@ +{"en": "Message from you", "ru": "Сообщение от вас"} \ No newline at end of file diff --git a/src/lang_res/languages/message_subject.json b/src/lang_res/languages/message_subject.json new file mode 100644 index 000000000..6d4475320 --- /dev/null +++ b/src/lang_res/languages/message_subject.json @@ -0,0 +1 @@ +{"en": "Subject", "ru": "Тема"} \ No newline at end of file diff --git a/src/lang_res/languages/message_subject_empty.json b/src/lang_res/languages/message_subject_empty.json new file mode 100644 index 000000000..86f9cb31b --- /dev/null +++ b/src/lang_res/languages/message_subject_empty.json @@ -0,0 +1 @@ +{"en": "No subject", "ru": "Без темы"} \ No newline at end of file diff --git a/src/lang_res/languages/message_subject_type_here.json b/src/lang_res/languages/message_subject_type_here.json new file mode 100644 index 000000000..5c22795f8 --- /dev/null +++ b/src/lang_res/languages/message_subject_type_here.json @@ -0,0 +1 @@ +{"en": "Describe the subject of your message", "ru": "Опишите тему сообщения"} \ No newline at end of file diff --git a/src/lang_res/languages/message_text.json b/src/lang_res/languages/message_text.json new file mode 100644 index 000000000..6211a44dc --- /dev/null +++ b/src/lang_res/languages/message_text.json @@ -0,0 +1 @@ +{"en": "Message text", "ru": "Текст сообщения"} \ No newline at end of file diff --git a/src/lang_res/languages/message_thread_history.json b/src/lang_res/languages/message_thread_history.json new file mode 100644 index 000000000..953271754 --- /dev/null +++ b/src/lang_res/languages/message_thread_history.json @@ -0,0 +1 @@ +{"en": "Thread history", "ru": "История переписки"} \ No newline at end of file diff --git a/src/lang_res/languages/message_thread_show.json b/src/lang_res/languages/message_thread_show.json new file mode 100644 index 000000000..f4f6c5427 --- /dev/null +++ b/src/lang_res/languages/message_thread_show.json @@ -0,0 +1 @@ +{"en": "Show thread", "ru": "Показать переписку"} \ No newline at end of file diff --git a/src/lang_res/languages/message_type_here.json b/src/lang_res/languages/message_type_here.json new file mode 100644 index 000000000..4e485ee3b --- /dev/null +++ b/src/lang_res/languages/message_type_here.json @@ -0,0 +1 @@ +{"en": "Type your message here", "ru": "Введите текст сообщения"} \ No newline at end of file diff --git a/src/lang_res/languages/message_view.json b/src/lang_res/languages/message_view.json new file mode 100644 index 000000000..9b47f14f8 --- /dev/null +++ b/src/lang_res/languages/message_view.json @@ -0,0 +1 @@ +{"en": "Message view", "ru": "Просмотр сообщения"} \ No newline at end of file diff --git a/src/lang_res/languages/messages_empty.json b/src/lang_res/languages/messages_empty.json new file mode 100644 index 000000000..28bf7377c --- /dev/null +++ b/src/lang_res/languages/messages_empty.json @@ -0,0 +1 @@ +{"en": "There are no messages yet. You can create your first message using the Plus button at the top right corner", "ru": "Сообщений нет. Вы можете написать первое сообщение, нажав на кнопку создания справа вверху"} \ No newline at end of file diff --git a/src/lang_res/languages/messenger.json b/src/lang_res/languages/messenger.json new file mode 100644 index 000000000..279fc9492 --- /dev/null +++ b/src/lang_res/languages/messenger.json @@ -0,0 +1 @@ +{"en": "Messenger", "ru": "Мессенджер"} \ No newline at end of file diff --git a/src/lang_res/languages/need_fuel.json b/src/lang_res/languages/need_fuel.json index ebb72c4a0..de97e209f 100644 --- a/src/lang_res/languages/need_fuel.json +++ b/src/lang_res/languages/need_fuel.json @@ -1 +1 @@ -{"en": "APL needed", "ru": "Нужно APL"} \ No newline at end of file +{"en": "APLA needed", "ru": "Нужно APLA"} \ No newline at end of file diff --git a/src/lang_res/languages/not_need_fuel.json b/src/lang_res/languages/not_need_fuel.json index f46ed553b..e7e04897b 100644 --- a/src/lang_res/languages/not_need_fuel.json +++ b/src/lang_res/languages/not_need_fuel.json @@ -1 +1 @@ -{"en": "Not need APL", "ru": "Не нужно APL"} \ No newline at end of file +{"en": "Not need APLA", "ru": "Не нужно APLA"} \ No newline at end of file diff --git a/src/lang_res/languages/notifications_view.json b/src/lang_res/languages/notifications_view.json index 766803066..10a088d41 100644 --- a/src/lang_res/languages/notifications_view.json +++ b/src/lang_res/languages/notifications_view.json @@ -1 +1 @@ -{"en": "View notification", "ru": "Просмотр уведомления"} \ No newline at end of file +{"en": "Notification view", "ru": "Просмотр уведомления"} \ No newline at end of file diff --git a/src/lang_res/languages/only_admin_action.json b/src/lang_res/languages/only_admin_action.json index a08abc48d..e91aaaf96 100644 --- a/src/lang_res/languages/only_admin_action.json +++ b/src/lang_res/languages/only_admin_action.json @@ -1 +1 @@ -{"en": "Actions on this page are available to administrators only", "ru": "Действия на данной странице доступны только администраторам"} \ No newline at end of file +{"en": "Any actions on this page are available to administrators only", "ru": "Действия на данной странице доступны только администраторам"} \ No newline at end of file diff --git a/src/lang_res/languages/only_first_ecosystem_action.json b/src/lang_res/languages/only_first_ecosystem_action.json index 3bdd4a628..7a90941c0 100644 --- a/src/lang_res/languages/only_first_ecosystem_action.json +++ b/src/lang_res/languages/only_first_ecosystem_action.json @@ -1 +1 @@ -{"en": "Work on this page is available only in first ecosystem", "ru": "Работа на данной странице доступна только в первой экосистеме"} \ No newline at end of file +{"en": "Any actions on this page are available in the first ecosystem only", "ru": "Действия на данной странице доступны только в первой экосистеме"} \ No newline at end of file diff --git a/src/lang_res/languages/poa_not_rights_to_change.json b/src/lang_res/languages/poa_not_rights_to_change.json new file mode 100644 index 000000000..0a8289ba4 --- /dev/null +++ b/src/lang_res/languages/poa_not_rights_to_change.json @@ -0,0 +1 @@ +{"en": "Not enough rights to change the parameters of this power of attorney", "ru": "Не достаточно прав для изменения параметров этой доверенности."} \ No newline at end of file diff --git a/src/lang_res/languages/popup.json b/src/lang_res/languages/popup.json new file mode 100644 index 000000000..392f11b8a --- /dev/null +++ b/src/lang_res/languages/popup.json @@ -0,0 +1 @@ +{"en": "Popup window", "ru": "Всплывающее окно"} \ No newline at end of file diff --git a/src/lang_res/languages/reply.json b/src/lang_res/languages/reply.json new file mode 100644 index 000000000..02fae988d --- /dev/null +++ b/src/lang_res/languages/reply.json @@ -0,0 +1 @@ +{"en": "Reply", "ru": "Ответить"} \ No newline at end of file diff --git a/src/lang_res/languages/reply_text.json b/src/lang_res/languages/reply_text.json new file mode 100644 index 000000000..48a6f605b --- /dev/null +++ b/src/lang_res/languages/reply_text.json @@ -0,0 +1 @@ +{"en": "Reply text", "ru": "Текст ответа"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_free_wallet_add.json b/src/lang_res/languages/ts_free_wallet_add.json new file mode 100644 index 000000000..cda1757eb --- /dev/null +++ b/src/lang_res/languages/ts_free_wallet_add.json @@ -0,0 +1 @@ +{"en": "Add a free wallet", "ru": "Добавить свободный кошелек"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_free_wallet_not_found.json b/src/lang_res/languages/ts_free_wallet_not_found.json new file mode 100644 index 000000000..b2319b768 --- /dev/null +++ b/src/lang_res/languages/ts_free_wallet_not_found.json @@ -0,0 +1 @@ +{"en": "Free wallet not found", "ru": "Свободный кошелек не найден"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_free_wallets.json b/src/lang_res/languages/ts_free_wallets.json new file mode 100644 index 000000000..06dcdb092 --- /dev/null +++ b/src/lang_res/languages/ts_free_wallets.json @@ -0,0 +1 @@ +{"en": "Free wallets", "ru": "Свободные кошельки"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_free_wallets_emptied.json b/src/lang_res/languages/ts_free_wallets_emptied.json new file mode 100644 index 000000000..3cdc23931 --- /dev/null +++ b/src/lang_res/languages/ts_free_wallets_emptied.json @@ -0,0 +1 @@ +{"en": "Free wallet emptied", "ru": "Свободные кошелеки закончились"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_free_wallets_need.json b/src/lang_res/languages/ts_free_wallets_need.json new file mode 100644 index 000000000..23ebd2408 --- /dev/null +++ b/src/lang_res/languages/ts_free_wallets_need.json @@ -0,0 +1 @@ +{"en": "Need to add free wallets", "ru": "Необходимо добавить свободные кошельки"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_investor_key.json b/src/lang_res/languages/ts_investor_key.json index f1d65da8d..d5a70b210 100644 --- a/src/lang_res/languages/ts_investor_key.json +++ b/src/lang_res/languages/ts_investor_key.json @@ -1 +1 @@ -{"en": "Investor key. Add the public key and transfer APL tokens", "ru": "Ключ инвестора. Добавить публичный ключ и перевести токены APL"} \ No newline at end of file +{"en": "Investor key. Add the public key and transfer APLA tokens", "ru": "Ключ инвестора. Добавить публичный ключ и перевести токены APLA"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_settings_description.json b/src/lang_res/languages/ts_settings_description.json index 8028e877d..3de6761f2 100644 --- a/src/lang_res/languages/ts_settings_description.json +++ b/src/lang_res/languages/ts_settings_description.json @@ -1 +1 @@ -{"en": "Ecosystem's and Trade APL application roles compliance", "ru": "Соответствие ролей приложения Trade APL ролям экосистемы"} \ No newline at end of file +{"en": "Ecosystem's and Trade APLA application roles compliance", "ru": "Соответствие ролей приложения Trade APLA ролям экосистемы"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_transfer_seller.json b/src/lang_res/languages/ts_transfer_seller.json index 3dc6ceede..57c04ea20 100644 --- a/src/lang_res/languages/ts_transfer_seller.json +++ b/src/lang_res/languages/ts_transfer_seller.json @@ -1 +1 @@ -{"en": "Selling APL: the transfer of funds", "ru": "Продажа APL: перевод средств"} \ No newline at end of file +{"en": "Selling APLA: the transfer of funds", "ru": "Продажа APLA: перевод средств"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_wallet_btc.json b/src/lang_res/languages/ts_wallet_btc.json new file mode 100644 index 000000000..81b5d4520 --- /dev/null +++ b/src/lang_res/languages/ts_wallet_btc.json @@ -0,0 +1 @@ +{"en": "BTC wallet", "ru": "BTC кошелек"} \ No newline at end of file diff --git a/src/lang_res/languages/ts_wallet_eth.json b/src/lang_res/languages/ts_wallet_eth.json new file mode 100644 index 000000000..1317fbe52 --- /dev/null +++ b/src/lang_res/languages/ts_wallet_eth.json @@ -0,0 +1 @@ +{"en": "ETH wallet", "ru": "ETH кошелек"} \ No newline at end of file diff --git a/src/lang_res/languages/understood.json b/src/lang_res/languages/understood.json new file mode 100644 index 000000000..54002b568 --- /dev/null +++ b/src/lang_res/languages/understood.json @@ -0,0 +1 @@ +{"en": "Understood", "ru": "Ознакомился"} \ No newline at end of file diff --git a/src/lang_res/languages/unread.json b/src/lang_res/languages/unread.json new file mode 100644 index 000000000..f22c01324 --- /dev/null +++ b/src/lang_res/languages/unread.json @@ -0,0 +1 @@ +{"en": "unread", "ru": "не прочитано"} \ No newline at end of file diff --git a/src/lang_res/languages/validate_wallet_btc.json b/src/lang_res/languages/validate_wallet_btc.json new file mode 100644 index 000000000..9e60a995d --- /dev/null +++ b/src/lang_res/languages/validate_wallet_btc.json @@ -0,0 +1 @@ +{"en": "must be between 27 and 34 characters", "ru": "должно быть от 27 до 34 символов"} \ No newline at end of file diff --git a/src/lang_res/languages/validate_wallet_eth.json b/src/lang_res/languages/validate_wallet_eth.json new file mode 100644 index 000000000..c93ffef8b --- /dev/null +++ b/src/lang_res/languages/validate_wallet_eth.json @@ -0,0 +1 @@ +{"en": "must be between 40 and 44 characters", "ru": "должно быть от 40 до 44 символов"} \ No newline at end of file diff --git a/src/lang_res/languages/vde_form_desc.json b/src/lang_res/languages/vde_form_desc.json index 50489f028..0c074fb19 100644 --- a/src/lang_res/languages/vde_form_desc.json +++ b/src/lang_res/languages/vde_form_desc.json @@ -1 +1 @@ -{"en": "Address of the VDE form in VDE system for applying for the membership (for someones without APL)", "ru": "Адрес VDE-формы для подачи заявки на членство (для тех, у кого ещё нет APL)"} \ No newline at end of file +{"en": "Address of the VDE form in VDE system for applying for the membership (for someones without APLA)", "ru": "Адрес VDE-формы для подачи заявки на членство (для тех, у кого ещё нет APLA)"} \ No newline at end of file diff --git a/src/lang_res/languages/wallet_btc_exists.json b/src/lang_res/languages/wallet_btc_exists.json new file mode 100644 index 000000000..b8857faab --- /dev/null +++ b/src/lang_res/languages/wallet_btc_exists.json @@ -0,0 +1 @@ +{"en":"%s BTC wallet already exists", "ru":"%s BTC кошелек уже существует"} \ No newline at end of file diff --git a/src/lang_res/languages/wallet_eth_exists.json b/src/lang_res/languages/wallet_eth_exists.json new file mode 100644 index 000000000..7cf9f8142 --- /dev/null +++ b/src/lang_res/languages/wallet_eth_exists.json @@ -0,0 +1 @@ +{"en":"%s ETH wallet already exists", "ru":"%s ETH кошелек уже существует"} \ No newline at end of file diff --git a/src/lang_res/languages/want_delete_key.json b/src/lang_res/languages/want_delete_key.json new file mode 100644 index 000000000..9f96cb26b --- /dev/null +++ b/src/lang_res/languages/want_delete_key.json @@ -0,0 +1 @@ +{"en": "Do you want to delete this key?", "ru": "Вы хотите удалить этот ключ?"} \ No newline at end of file diff --git a/src/lang_res/languages/web_form_desc.json b/src/lang_res/languages/web_form_desc.json index 8962b06d7..eee89a60e 100644 --- a/src/lang_res/languages/web_form_desc.json +++ b/src/lang_res/languages/web_form_desc.json @@ -1 +1 @@ -{"en": "Web address of the form for applying for the membership (for someones without APL)", "ru": "Адрес web-формы для подачи заявки на членство (для тех, у кого ещё нет APL)"} \ No newline at end of file +{"en": "Web address of the form for applying for the membership (for someones without APLA)", "ru": "Адрес web-формы для подачи заявки на членство (для тех, у кого ещё нет APLA)"} \ No newline at end of file diff --git a/src/lang_res/languages/you.json b/src/lang_res/languages/you.json new file mode 100644 index 000000000..d81979eae --- /dev/null +++ b/src/lang_res/languages/you.json @@ -0,0 +1 @@ +{"en": "You", "ru": "Вы"} \ No newline at end of file diff --git a/src/lang_res/struct.dot b/src/lang_res/struct.dot index b2009eaca..1916a9d38 100644 --- a/src/lang_res/struct.dot +++ b/src/lang_res/struct.dot @@ -1,6 +1,6 @@ digraph G { fontsize="24"; -label="lang_res\nThursday, 01-Nov-18 21:01:09 +10"; +label="lang_res\nFriday, 16-Nov-18 22:05:15 +10"; nojustify=true; ordering=out; rankdir=LR; diff --git a/src/system/blocks/pager.ptl b/src/system/blocks/pager.ptl index aa005b926..c9df552b9 100644 --- a/src/system/blocks/pager.ptl +++ b/src/system/blocks/pager.ptl @@ -1,9 +1,9 @@ -DBFind(#this_table#).Where(#where#).Count(records_count) +DBFind(#this_table#).Where(#where#).Order({"id": 1}).Count(records_count) If(#pager_limit# < #records_count#){ - If(GetVar(page_par)==""){ - SetVar(page_par,) - } + If(GetVar(page_par)==""){ + SetVar(page_par,) + } SetVar(previous_page, Calculate(Exp: #current_page# - 1, Type: int)) SetVar(next_page, Calculate(Exp: #current_page# + 1, Type: int)) diff --git a/src/system/contracts/EditColumn.sim b/src/system/contracts/EditColumn.sim index d36dc06f7..a171b16ac 100644 --- a/src/system/contracts/EditColumn.sim +++ b/src/system/contracts/EditColumn.sim @@ -7,7 +7,8 @@ contract EditColumn { } conditions { - if(!DBFind("@1tables").Columns("name,ecosystem").Where({name: $TableName,ecosystem: $ecosystem_id})){ + $TableName = ToLower($TableName) + if(!DBFind("@1tables").Columns("name,ecosystem").Where({name: $TableName, ecosystem: $ecosystem_id})){ warning LangRes("@1item_not_found", "en") } var permissions map diff --git a/src/system/pages/table_edit.ptl b/src/system/pages/table_edit.ptl index ecf20d111..3cdd28a6f 100644 --- a/src/system/pages/table_edit.ptl +++ b/src/system/pages/table_edit.ptl @@ -1,6 +1,6 @@ Div(content-wrapper){ 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#}) - + SetTitle($@1tables$) Div(breadcrumb){ Div(){ @@ -25,11 +25,12 @@ Div(content-wrapper){ Div(col-xs-5 col-md-5 h4){ Label($@1conditions$) } - Div(col-xs-2 col-md-2 h4 text-right){ + Div(col-xs-2 col-md-2 text-right){ } } JsonToSource(src_columns, #pre_columns#) ForList(src_columns){ + SetVar(name_column,#key#) Div(list-group-item){ Div(row){ Div(col-xs-3 col-md-3 h5){ @@ -39,40 +40,56 @@ Div(content-wrapper){ SetVar(col_type,GetColumnType(#pre_name#, #key#)) If(#col_type# == text){ Span("Text") - } - If(#col_type# == number){ + }.ElseIf(#col_type# == number){ Span("Number") - } - If(#col_type# == money){ + }.ElseIf(#col_type# == money){ Span("Money") - } - If(#col_type# == varchar){ + }.ElseIf(#col_type# == varchar){ Span("Varchar") - } - If(#col_type# == datetime){ + }.ElseIf(#col_type# == datetime){ Span("Date/Time") - } - If(#col_type# == double){ + }.ElseIf(#col_type# == double){ Span("Double") - } - If(#col_type# == character){ + }.ElseIf(#col_type# == character){ Span("Character") - } - If(#col_type# == json){ + }.ElseIf(#col_type# == json){ Span("JSON") - } - If(#col_type# == bytea){ + }.ElseIf(#col_type# == bytea){ Span("Binary Data") - } - If(#col_type# == uuid){ + }.ElseIf(#col_type# == uuid){ Span("UUID") } } - Div(col-xs-5 col-md-5 h5){ - Span(`#value#`) + Div(col-xs-5 col-md-5){ + SetVar(isObject,0) + JsonToSource(condition,#value#) + ForList(condition){ + SetVar(isObject,1) + If(#key#==read){ + Div(){ + Span($@1reading$:,text-muted) + Span(#value#,ml-sm) + } + }.ElseIf(#key#==update){ + Div(){ + Span($@1updating$:,text-muted) + Span(#value#,ml-sm) + } + } + } + If(#isObject#==0){ + Div(){ + Span($@1reading$:,text-muted) + Span(true,ml-sm) + } + Div(){ + Span($@1updating$:,text-muted) + Span(#value#,ml-sm) + } + } } Div(col-xs-2 col-md-2 text-right){ - Button(Body: $@1edit$, Class: btn btn-primary, Page: @1column_edit, PageParams: "name_column=#key#,tabl_id=#tabl_id#") + Button(Body: $@1edit$, Class: btn btn-primary, Page: @1column_edit, PageParams: "name_column=#name_column#,tabl_id=#tabl_id#") } } } diff --git a/src/system/struct.dot b/src/system/struct.dot index 2be695074..8cd0908fb 100644 --- a/src/system/struct.dot +++ b/src/system/struct.dot @@ -1,6 +1,6 @@ digraph G { fontsize="24"; -label="system\nThursday, 01-Nov-18 13:35:10 +10"; +label="system\nFriday, 16-Nov-18 22:05:25 +10"; nojustify=true; ordering=out; rankdir=LR; @@ -194,7 +194,7 @@ size="30"; "1tables\ntable" -> "export_info\nblock" "export_info\nblock" [color=green, fontcolor=green, group=blocks, shape=record]; "export_link\nblock" [color=green, fontcolor=green, group=blocks, shape=record]; -"records_count\ntable" -> "pager\nblock" +"id\ntable" -> "pager\nblock" "pager\nblock" [color=green, fontcolor=green, group=blocks, shape=record]; "pager_header\nblock" [color=green, fontcolor=green, group=blocks, shape=record]; "search\nblock" [color=green, fontcolor=green, group=blocks, shape=record]; diff --git a/system.json b/system.json index 90c8251ba..a28294818 100644 --- a/system.json +++ b/system.json @@ -23,7 +23,7 @@ { "Name": "pager", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "DBFind(#this_table#).Where(#where#).Count(records_count)\r\n\r\nIf(#pager_limit# < #records_count#){\r\n\tIf(GetVar(page_par)==\"\"){\r\n\t\tSetVar(page_par,)\r\n\t}\r\n SetVar(previous_page, Calculate(Exp: #current_page# - 1, Type: int))\r\n SetVar(next_page, Calculate(Exp: #current_page# + 1, Type: int))\r\n\r\n SetVar(count_div_limit_int, Calculate(Exp: (#records_count# / #pager_limit#), Type: int))\r\n SetVar(remainder, Calculate(Exp: (#records_count# / #pager_limit#) - #count_div_limit_int#, Type: float))\r\n If(#remainder# != 0){\r\n SetVar(last_page, Calculate(Exp: #count_div_limit_int# + 1, Type: int))\r\n }.Else{\r\n SetVar(last_page, #count_div_limit_int#)\r\n }\r\n\r\n SetVar(last_page_plus_one, Calculate(Exp: #last_page# + 1, Type: int))\r\n SetVar(delta_last_page, Calculate(Exp: #last_page# - #current_page#))\r\n SetVar(range_l, Calculate(Exp: #current_page# - 4, Type: int))\r\n SetVar(range_r, Calculate(Exp: #current_page# + 6, Type: int))\r\n SetVar(range_l_max, Calculate(Exp: #last_page# - #pager_limit#, Type: int))\r\n SetVar(last_page_min_set, Calculate(Exp: #last_page_plus_one# - 10, Type: int))\r\n\r\n If(#current_page# < 5){\r\n If(#last_page# >= 10){\r\n Range(src_pages, 1, 11)\r\n }.Else{\r\n Range(src_pages, 1, #last_page_plus_one#) \r\n }\r\n }.ElseIf(#delta_last_page# < 6){\r\n If(#range_l_max# > 0){\r\n Range(src_pages, #last_page_min_set#, #last_page_plus_one#)\r\n }.Else{\r\n Range(src_pages, 1, #last_page_plus_one#)\r\n }\r\n }.Else{\r\n Range(src_pages, #range_l#, #range_r#)\r\n }\r\n\r\n Div(){\r\n Span(Class: pull-left){\r\n If(#current_page# == 1){\r\n Button(Body: Em(Class: fa fa-angle-double-left), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n If(#current_page# == 1){\r\n Button(Body: Em(Class: fa fa-angle-left), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n ForList(src_pages){\r\n Span(){\r\n If(#id# == #current_page#){\r\n Button(Body: #id#, Class: btn bg-primary-light, Page: #this_page#, PageParams: \"current_page=#id#,sort=#sort#,width=#width#,page_par=#page_par#\")\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\n Button(Body: #id#, Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#id#,sort=#sort#,width=#width#,page_par=#page_par#\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n If(#current_page# == #last_page#){\r\n Button(Body: Em(Class: fa fa-angle-right), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n If(#current_page# == #last_page#){\r\n Button(Body: Em(Class: fa fa-angle-double-right), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n }.Style(\r\n .btn {\r\n font-size: 10px;\r\n text-align:left;\r\n width:50px;\r\n }\r\n )\r\n}", + "Value": "DBFind(#this_table#).Where(#where#).Order({\"id\": 1}).Count(records_count)\r\n\r\nIf(#pager_limit# < #records_count#){\r\n If(GetVar(page_par)==\"\"){\r\n SetVar(page_par,)\r\n }\r\n SetVar(previous_page, Calculate(Exp: #current_page# - 1, Type: int))\r\n SetVar(next_page, Calculate(Exp: #current_page# + 1, Type: int))\r\n\r\n SetVar(count_div_limit_int, Calculate(Exp: (#records_count# / #pager_limit#), Type: int))\r\n SetVar(remainder, Calculate(Exp: (#records_count# / #pager_limit#) - #count_div_limit_int#, Type: float))\r\n If(#remainder# != 0){\r\n SetVar(last_page, Calculate(Exp: #count_div_limit_int# + 1, Type: int))\r\n }.Else{\r\n SetVar(last_page, #count_div_limit_int#)\r\n }\r\n\r\n SetVar(last_page_plus_one, Calculate(Exp: #last_page# + 1, Type: int))\r\n SetVar(delta_last_page, Calculate(Exp: #last_page# - #current_page#))\r\n SetVar(range_l, Calculate(Exp: #current_page# - 4, Type: int))\r\n SetVar(range_r, Calculate(Exp: #current_page# + 6, Type: int))\r\n SetVar(range_l_max, Calculate(Exp: #last_page# - #pager_limit#, Type: int))\r\n SetVar(last_page_min_set, Calculate(Exp: #last_page_plus_one# - 10, Type: int))\r\n\r\n If(#current_page# < 5){\r\n If(#last_page# >= 10){\r\n Range(src_pages, 1, 11)\r\n }.Else{\r\n Range(src_pages, 1, #last_page_plus_one#) \r\n }\r\n }.ElseIf(#delta_last_page# < 6){\r\n If(#range_l_max# > 0){\r\n Range(src_pages, #last_page_min_set#, #last_page_plus_one#)\r\n }.Else{\r\n Range(src_pages, 1, #last_page_plus_one#)\r\n }\r\n }.Else{\r\n Range(src_pages, #range_l#, #range_r#)\r\n }\r\n\r\n Div(){\r\n Span(Class: pull-left){\r\n If(#current_page# == 1){\r\n Button(Body: Em(Class: fa fa-angle-double-left), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n If(#current_page# == 1){\r\n Button(Body: Em(Class: fa fa-angle-left), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n ForList(src_pages){\r\n Span(){\r\n If(#id# == #current_page#){\r\n Button(Body: #id#, Class: btn bg-primary-light, Page: #this_page#, PageParams: \"current_page=#id#,sort=#sort#,width=#width#,page_par=#page_par#\")\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\n Button(Body: #id#, Class: btn bg-gray-lighter, Page: #this_page#, PageParams: \"current_page=#id#,sort=#sort#,width=#width#,page_par=#page_par#\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n If(#current_page# == #last_page#){\r\n Button(Body: Em(Class: fa fa-angle-right), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n Span(Class: pull-left){\r\n If(#current_page# == #last_page#){\r\n Button(Body: Em(Class: fa fa-angle-double-right), Class: btn bg-gray-lighter disabled)\r\n }.Else{\r\n If(GetVar(search)!=\"\"){\r\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#\")\r\n }.Else{\r\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#\")\r\n }\r\n }\r\n }\r\n }.Style(\r\n .btn {\r\n font-size: 10px;\r\n text-align:left;\r\n width:50px;\r\n }\r\n )\r\n}", "Type": "blocks" }, { @@ -270,7 +270,7 @@ { "Name": "table_edit", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "Div(content-wrapper){\r\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#})\r\n \r\n SetTitle($@1tables$)\r\n Div(breadcrumb){\r\n Div(){\r\n LinkPage($@1tables$, @1app_tables)\r\n Span(/, mh)\r\n LinkPage(#pre_name#, @1table_view,, \"tabl_id=#tabl_id#\")\r\n Span(/, mh)\r\n Span($@1edit_table$, text-muted)\r\n }\r\n }\r\n\r\n Form(){\r\n Div(panel panel-default){\r\n Div(panel-body){\r\n Div(row){\r\n Div(col-xs-3 col-md-3 h4){\r\n Label($@1name$)\r\n }\r\n Div(col-xs-2 col-md-2 h4){\r\n Label($@1type$)\r\n }\r\n Div(col-xs-5 col-md-5 h4){\r\n Label($@1conditions$)\r\n }\r\n Div(col-xs-2 col-md-2 h4 text-right){\r\n }\r\n }\r\n JsonToSource(src_columns, #pre_columns#)\r\n ForList(src_columns){\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-xs-3 col-md-3 h5){\r\n Span(#key#)\r\n }\r\n Div(col-xs-2 col-md-2 h5){\r\n SetVar(col_type,GetColumnType(#pre_name#, #key#))\r\n If(#col_type# == text){\r\n Span(\"Text\")\r\n }\r\n If(#col_type# == number){\r\n Span(\"Number\")\r\n }\r\n If(#col_type# == money){\r\n Span(\"Money\")\r\n }\r\n If(#col_type# == varchar){\r\n Span(\"Varchar\")\r\n }\r\n If(#col_type# == datetime){\r\n Span(\"Date/Time\")\r\n }\r\n If(#col_type# == double){\r\n Span(\"Double\")\r\n }\r\n If(#col_type# == character){\r\n Span(\"Character\")\r\n }\r\n If(#col_type# == json){\r\n Span(\"JSON\")\r\n }\r\n If(#col_type# == bytea){\r\n Span(\"Binary Data\")\r\n }\r\n If(#col_type# == uuid){\r\n Span(\"UUID\")\r\n }\r\n }\r\n Div(col-xs-5 col-md-5 h5){\r\n Span(`#value#`)\r\n }\r\n Div(col-xs-2 col-md-2 text-right){\r\n Button(Body: $@1edit$, Class: btn btn-primary, Page: @1column_edit, PageParams: \"name_column=#key#,tabl_id=#tabl_id#\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Div(panel-footer text-right){\r\n Button(Body: $@1column_add$, Class: btn btn-primary, Page: @1column_add, PageParams: \"next_table_name=#pre_name#,tabl_id=#tabl_id#\")\r\n }\r\n }\r\n Div(row){\r\n Div(col-xs-6 col-md-6){\r\n Div(panel panel-default){\r\n Div(panel-heading){$@1write_permissions$}\r\n Div(panel-body){\r\n Div(form-group){\r\n Label($@1insert$)\r\n Input(Name: InsertPerm, Type: text, Value: #pre_permissions_insert#)\r\n }\r\n Div(form-group){\r\n Label($@1updating$)\r\n Input(Name: UpdatePerm, Type: text, Value: #pre_permissions_update#)\r\n }\r\n Div(form-group){\r\n Label($@1new_column$)\r\n Input(Name: NewColumnPerm, Type: text, Value: #pre_permissions_new_column#)\r\n }\r\n Div(form-group){\r\n Label($@1reading$)\r\n Input(Name: ReadPerm, Type: text, Value: #pre_permissions_read#)\r\n }\r\n }\r\n Div(panel-footer text-right){\r\n Button(Body: $@1save$, Class: btn btn-primary, Contract: @1EditTable, Page: @1app_tables, Params: \"Name=#pre_name#\")\r\n }\r\n }\r\n }\r\n Div(col-xs-6 col-md-6){\r\n Div(panel panel-default){\r\n Div(panel-heading){$@1conditions_for_change$}\r\n Div(panel-body){\r\n Div(form-group){\r\n Input(Name: Insert_condition, Disabled: true, Type: text, Value: #pre_conditions#)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", + "Value": "Div(content-wrapper){\r\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#})\r\n\r\n SetTitle($@1tables$)\r\n Div(breadcrumb){\r\n Div(){\r\n LinkPage($@1tables$, @1app_tables)\r\n Span(/, mh)\r\n LinkPage(#pre_name#, @1table_view,, \"tabl_id=#tabl_id#\")\r\n Span(/, mh)\r\n Span($@1edit_table$, text-muted)\r\n }\r\n }\r\n\r\n Form(){\r\n Div(panel panel-default){\r\n Div(panel-body){\r\n Div(row){\r\n Div(col-xs-3 col-md-3 h4){\r\n Label($@1name$)\r\n }\r\n Div(col-xs-2 col-md-2 h4){\r\n Label($@1type$)\r\n }\r\n Div(col-xs-5 col-md-5 h4){\r\n Label($@1conditions$)\r\n }\r\n Div(col-xs-2 col-md-2 text-right){\r\n }\r\n }\r\n JsonToSource(src_columns, #pre_columns#)\r\n ForList(src_columns){\r\n SetVar(name_column,#key#)\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-xs-3 col-md-3 h5){\r\n Span(#key#)\r\n }\r\n Div(col-xs-2 col-md-2 h5){\r\n SetVar(col_type,GetColumnType(#pre_name#, #key#))\r\n If(#col_type# == text){\r\n Span(\"Text\")\r\n }.ElseIf(#col_type# == number){\r\n Span(\"Number\")\r\n }.ElseIf(#col_type# == money){\r\n Span(\"Money\")\r\n }.ElseIf(#col_type# == varchar){\r\n Span(\"Varchar\")\r\n }.ElseIf(#col_type# == datetime){\r\n Span(\"Date/Time\")\r\n }.ElseIf(#col_type# == double){\r\n Span(\"Double\")\r\n }.ElseIf(#col_type# == character){\r\n Span(\"Character\")\r\n }.ElseIf(#col_type# == json){\r\n Span(\"JSON\")\r\n }.ElseIf(#col_type# == bytea){\r\n Span(\"Binary Data\")\r\n }.ElseIf(#col_type# == uuid){\r\n Span(\"UUID\")\r\n }\r\n }\r\n Div(col-xs-5 col-md-5){\r\n SetVar(isObject,0)\r\n JsonToSource(condition,#value#)\r\n ForList(condition){\r\n SetVar(isObject,1)\r\n If(#key#==read){\r\n Div(){\r\n Span($@1reading$:,text-muted)\r\n Span(#value#,ml-sm)\r\n }\r\n }.ElseIf(#key#==update){\r\n Div(){\r\n Span($@1updating$:,text-muted)\r\n Span(#value#,ml-sm)\r\n }\r\n }\r\n }\r\n If(#isObject#==0){\r\n Div(){\r\n Span($@1reading$:,text-muted)\r\n Span(true,ml-sm)\r\n }\r\n Div(){\r\n Span($@1updating$:,text-muted)\r\n Span(#value#,ml-sm)\r\n }\r\n }\r\n }\r\n Div(col-xs-2 col-md-2 text-right){\r\n Button(Body: $@1edit$, Class: btn btn-primary, Page: @1column_edit, PageParams: \"name_column=#name_column#,tabl_id=#tabl_id#\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Div(panel-footer text-right){\r\n Button(Body: $@1column_add$, Class: btn btn-primary, Page: @1column_add, PageParams: \"next_table_name=#pre_name#,tabl_id=#tabl_id#\")\r\n }\r\n }\r\n Div(row){\r\n Div(col-xs-6 col-md-6){\r\n Div(panel panel-default){\r\n Div(panel-heading){$@1write_permissions$}\r\n Div(panel-body){\r\n Div(form-group){\r\n Label($@1insert$)\r\n Input(Name: InsertPerm, Type: text, Value: #pre_permissions_insert#)\r\n }\r\n Div(form-group){\r\n Label($@1updating$)\r\n Input(Name: UpdatePerm, Type: text, Value: #pre_permissions_update#)\r\n }\r\n Div(form-group){\r\n Label($@1new_column$)\r\n Input(Name: NewColumnPerm, Type: text, Value: #pre_permissions_new_column#)\r\n }\r\n Div(form-group){\r\n Label($@1reading$)\r\n Input(Name: ReadPerm, Type: text, Value: #pre_permissions_read#)\r\n }\r\n }\r\n Div(panel-footer text-right){\r\n Button(Body: $@1save$, Class: btn btn-primary, Contract: @1EditTable, Page: @1app_tables, Params: \"Name=#pre_name#\")\r\n }\r\n }\r\n }\r\n Div(col-xs-6 col-md-6){\r\n Div(panel panel-default){\r\n Div(panel-heading){$@1conditions_for_change$}\r\n Div(panel-body){\r\n Div(form-group){\r\n Input(Name: Insert_condition, Disabled: true, Type: text, Value: #pre_conditions#)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "Menu": "developer_menu", "Type": "pages" }, @@ -350,7 +350,7 @@ { "Name": "EditColumn", "Conditions": "ContractConditions(\"@1DeveloperCondition\")", - "Value": "contract EditColumn {\r\n data {\r\n TableName string\r\n Name string\r\n UpdatePerm string\r\n ReadPerm string\r\n }\r\n\r\n conditions {\r\n if(!DBFind(\"@1tables\").Columns(\"name,ecosystem\").Where({name: $TableName,ecosystem: $ecosystem_id})){\r\n warning LangRes(\"@1item_not_found\", \"en\")\r\n }\r\n var permissions map\r\n permissions[\"update\"] = $UpdatePerm\r\n permissions[\"read\"] = $ReadPerm\r\n $Permissions = permissions\r\n ColumnCondition($TableName, $Name, \"\", JSONEncode($Permissions))\r\n }\r\n\r\n action {\r\n PermColumn($TableName, $Name, JSONEncode($Permissions))\r\n }\r\n}", + "Value": "contract EditColumn {\r\n data {\r\n TableName string\r\n Name string\r\n UpdatePerm string\r\n ReadPerm string\r\n }\r\n\r\n conditions {\r\n $TableName = ToLower($TableName)\r\n if(!DBFind(\"@1tables\").Columns(\"name,ecosystem\").Where({name: $TableName, ecosystem: $ecosystem_id})){\r\n warning LangRes(\"@1item_not_found\", \"en\")\r\n }\r\n var permissions map\r\n permissions[\"update\"] = $UpdatePerm\r\n permissions[\"read\"] = $ReadPerm\r\n $Permissions = permissions\r\n ColumnCondition($TableName, $Name, \"\", JSONEncode($Permissions))\r\n }\r\n\r\n action {\r\n PermColumn($TableName, $Name, JSONEncode($Permissions))\r\n }\r\n}", "Type": "contracts" }, {