Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
CynepHy6 committed Feb 15, 2018
1 parent 2d788d3 commit f6685ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions demo_apps.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
},
{
"Name": "land_registry_UpdateOwner",
"Value": "contract land_registry_UpdateOwner{\n data{\n LandId int\n NotificId int\n Price int\n }\n \n func conditions{}\n \n func action{\n DBUpdate(\"land_registry\", $LandId, \"price, timestamp modification_date\", $Price, $block_time)\n Notifications_Single_Close(\"notific_id\", $NotificId)\n }\n}",
"Value": "contract land_registry_UpdateOwner{\n data{\n LandId int\n NotificId string \"optional\"\n Price string\n }\n \n func conditions{\n $Price = Int($Price)\n $NotificId = Int($NotificId)\n var entry map\n entry = DBFind(\"land_registry\").Where(\"id=? and owner_id=?\",$LandId, $key_id).Row()\n if !entry{\n info \"You cant change this Land\"\n }\n }\n \n func action{\n DBUpdate(\"land_registry\", $LandId, \"price,timestamp modification_date\", $Price, $block_time)\n if $NotificId > 0{\n Notifications_Single_Close(\"notific_id\", $NotificId)\n }\n }\n}",
"Conditions": "ContractConditions(\"MainCondition\")"
},
{
Expand Down Expand Up @@ -2432,7 +2432,7 @@
},
{
"Name": "land_registry_view",
"Value": "If(GetVar(notific_val_int)){\n SetVar(LandId, #notific_val_int#)\n}.Else{}\n\nIf(GetVar(notific_id)){}.Else{SetVar(notific_id,0)}\n\nSetVar(title,$land_record$)\n\nIf(#admin#==1){}.Else{SetVar(admin, 0)}\n\nIf(#LandId#>0){}.Else{SetVar(LandId, 1)}\n\nIf(GetVar(LandId)){\n DBFind(Name: land_registry, Source: src_entry).WhereId(#LandId#).Vars(entry)\n DBFind(Name: land_registry_ownership, Source: src_land_ownership).Where(lend_object_id=#LandId#).Vars(ownership)\n \n DBFind(Name: members, Source: src_owner).Where(id=#ownership_owner_id#).Vars(owner)\n}\nSetTitle(#title#)\n\nDiv(content-wrapper){\n Div(breadcrumb){\n Div(){\n LinkPage(Body:$land_records$,Page: land_registry_records, PageParams: \"admin=#admin#\")\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span(#title#, text-muted)\n }\n }\n If(GetVar(LandId)){\n Div(row df f-valign){\n Div(col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3 mt-sm text-left){\n Div(panel panel-default){\n Form(){\n Div(list-group-item){\n Div(h3){$land_record$ #GetVar(LandId)}\n }\n Div(row df f-valign){\n Div(col-sm-12){\n Map(MapType: hybrid, Hmap:300, Value: #entry_map_coords#)\n }\n }\n Div(list-group-item){\n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){\n Strong($owner$:)\n }\n Div(col-md-6 mt-sm text-left h5){\n Div(){\n Image(Src: #owner_avatar#, Alt: ava, Class: img-thumbnail img-circle).Style(max-width:40px;margin-right:10px;)\n Span(#owner_member_name#)\n }\n }\n }\n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){\n Strong($area_size$)\n (Span(m).(2).Style(vertical-align: super;font-size:small;)):\n }\n Div(col-md-7 mt-sm text-left h5){#entry_area#}\n }\n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){\n Strong($address$:)\n }\n Div(col-md-7 mt-sm text-left h5){#entry_address#}\n }\n \n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){Strong($record_add_date$:)}\n Div(col-md-7 mt-sm text-left h5){DateTime(#entry_date_create#)}\n }\n \n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($buildings_use_class$:)}\n Div(col-md-7 mt-sm text-left h5){\n EcosysParam(Name: buildings_use_class, Index: #entry_buildings_use_class#)\n }\n }\n \n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($land_nature$:)}\n Div(col-md-7 mt-sm text-left h5){\n EcosysParam(Name: land_nature, Index: #entry_land_nature#)\n }\n }\n \n DBFind(Name: notifications, Source: src_alert).Where(page_params='LandId=#LandId#,admin=1,second_request=1' and closed=0).Vars(alert)\n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($legal_status$:)}\n Div(col-md-7 mt-sm text-left h5){\n If(GetVar(alert_id)){\n SetVar(alert, 1)\n }.Else{\n SetVar(alert, 0)\n }\n EcosysParam(Name: legal_status, Index: #entry_legal_status#)\n Span().Style(margin-right:10px;)\n If(And(#entry_legal_status#!=1, #alert#==0)){\n Button(Contract: land_registry_SecondRequest, Body:$send_request$, Params: \"LandId=#LandId#\", Class: btn btn-default, Page: land_registry_view, PageParams: \"LandId=#LandId#\").Alert(Text:$ask_request_second$, ConfirmButton:$confirm$, CancelButton:$cancel$)\n }\n }\n }\n \n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($encumbrance_certificate$:)}\n Div(col-md-7 mt-sm text-left h5){\n EcosysParam(Name: land_ec_status, Index: #entry_encumbrance_certificate#)\n Span().Style(margin-right:10px;)\n If(And(#entry_encumbrance_certificate#!=1, #alert#==0)){\n Button(Contract: land_registry_SecondRequest, Body:$send_request$, Params: \"LandId=#LandId#\", Class: btn btn-default, Page: land_registry_view, PageParams: \"LandId=#LandId#\").Alert(Text:$ask_request_second$, ConfirmButton:$confirm$, CancelButton:$cancel$)\n }\n }\n }\n \n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){Strong($consideration_value$:)}\n Div(col-md-7 mt-sm text-left h5){\n If(#entry_price#>0){\n #entry_price# INR\n }.Else{\n $undefined$\n }\n If(#ownership_owner_id#==#key_id#){\n Button(Page: land_registry_edit, Body:$change$, PageParams: \"LandId=#LandId#\", Class: btn btn-default)\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}",
"Value": "If(GetVar(notific_val_int)){\n SetVar(LandId, #notific_val_int#)\n}.Else{}\n\nIf(GetVar(notific_id)){}.Else{SetVar(notific_id,0)}\n\nSetVar(title,$land_record$)\n\nIf(#admin#==1){}.Else{SetVar(admin, 0)}\n\nIf(#LandId#>0){}.Else{SetVar(LandId, 1)}\n\nIf(GetVar(LandId)){\n DBFind(Name: land_registry, Source: src_entry).WhereId(#LandId#).Vars(entry)\n DBFind(Name: land_registry_ownership, Source: src_land_ownership).Where(lend_object_id=#LandId#).Vars(ownership)\n \n DBFind(Name: members, Source: src_owner).Where(id=#ownership_owner_id#).Vars(owner)\n}\nSetTitle(#title#)\n\nDiv(content-wrapper){\n Div(breadcrumb){\n Div(){\n LinkPage(Body:$land_records$,Page: land_registry_records, PageParams: \"admin=#admin#\")\n Span(/).Style(margin-right: 10px; margin-left: 10px;)\n Span(#title#, text-muted)\n }\n }\n If(GetVar(LandId)){\n Div(row df f-valign){\n Div(col-sm-8 col-sm-offset-2 col-lg-6 col-lg-offset-3 mt-sm text-left){\n Div(panel panel-default){\n Form(){\n Div(list-group-item){\n Div(h3){$land_record$ #GetVar(LandId)}\n }\n Div(row df f-valign){\n Div(col-sm-12){\n Map(MapType: hybrid, Hmap:300, Value: #entry_map_coords#)\n }\n }\n Div(list-group-item){\n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){\n Strong($owner$:)\n }\n Div(col-md-6 mt-sm text-left h5){\n Div(){\n Image(Src: #owner_avatar#, Alt: ava, Class: img-thumbnail img-circle).Style(max-width:40px;margin-right:10px;)\n Span(#owner_member_name#)\n }\n }\n }\n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){\n Strong($area_size$)\n (Span(m).(2).Style(vertical-align: super;font-size:small;)):\n }\n Div(col-md-7 mt-sm text-left h5){#entry_area#}\n }\n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){\n Strong($address$:)\n }\n Div(col-md-7 mt-sm text-left h5){#entry_address#}\n }\n \n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){Strong($record_add_date$:)}\n Div(col-md-7 mt-sm text-left h5){DateTime(#entry_date_create#)}\n }\n \n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($buildings_use_class$:)}\n Div(col-md-7 mt-sm text-left h5){\n EcosysParam(Name: buildings_use_class, Index: #entry_buildings_use_class#)\n }\n }\n \n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($land_nature$:)}\n Div(col-md-7 mt-sm text-left h5){\n EcosysParam(Name: land_nature, Index: #entry_land_nature#)\n }\n }\n \n DBFind(Name: notifications, Source: src_alert).Where(page_params='LandId=#LandId#,admin=1,second_request=1' and closed=0).Vars(alert)\n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($legal_status$:)}\n Div(col-md-7 mt-sm text-left h5){\n If(GetVar(alert_id)){\n SetVar(alert, 1)\n }.Else{\n SetVar(alert, 0)\n }\n Span(EcosysParam(Name: legal_status, Index: #entry_legal_status#)).Style(margin-right:10px;)\n If(And(#entry_legal_status#!=1, #alert#==0)){\n Button(Contract: land_registry_SecondRequest, Body:$send_request$, Params: \"LandId=#LandId#\", Class: btn btn-default, Page: land_registry_view, PageParams: \"LandId=#LandId#\").Alert(Text:$ask_request_second$, ConfirmButton:$confirm$, CancelButton:$cancel$)\n }\n }\n }\n \n Div(row df){\n Div(col-md-5 mt-sm text-right h5){Strong($encumbrance_certificate$:)}\n Div(col-md-7 mt-sm text-left h5){\n Span(EcosysParam(Name: land_ec_status, Index: #entry_encumbrance_certificate#)).Style(padding-right:10px;)\n If(And(#entry_encumbrance_certificate#!=1, #alert#==0)){\n Button(Contract: land_registry_SecondRequest, Body:$send_request$, Params: \"LandId=#LandId#\", Class: btn btn-default, Page: land_registry_view, PageParams: \"LandId=#LandId#\").Alert(Text:$ask_request_second$, ConfirmButton:$confirm$, CancelButton:$cancel$)\n }\n }\n }\n \n Div(row df f-valign){\n Div(col-md-5 mt-sm text-right h5){Strong($consideration_value$:)}\n Div(col-md-7 mt-sm text-left h5){\n If(#entry_price#>0){\n Span(#entry_price# INR).Style(padding-right:10px;)\n }.Else{\n $undefined$\n }\n If(#ownership_owner_id#==#key_id#){\n Button(Page: land_registry_edit, Body:$change$, PageParams: \"LandId=#LandId#\", Class: btn btn-default)\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}",
"Conditions": "ContractConditions(\"MainCondition\")",
"Menu": "Applications"
},
Expand Down
2 changes: 1 addition & 1 deletion src/demo_apps/struct.dot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
digraph G {
fontsize="20.0";
label="demo_apps Thursday, 15-Feb-18 16:23:42 MSK";
label="demo_apps Thursday, 15-Feb-18 16:54:39 MSK";
rankdir=LR;
"demo_block_sendContract\nblock" -> "DemoContract\ncontract" [ color=red ]
"demo_block_sendContract\nblock" -> "parameters\ntable"
Expand Down

0 comments on commit f6685ad

Please sign in to comment.