Skip to content

Commit 3d33b23

Browse files
committed
Fixed qs
1 parent b5a49d4 commit 3d33b23

26 files changed

+160
-192
lines changed

quick-start-apps/application_form_demo.json

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

quick-start-apps/application_form_demo/pages/DemoCompaniesList.ptl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
SetTitle(Companies list)
1+
SetTitle("Companies")
2+
Div(breadcrumb){
3+
Div(Class: text-muted, Body: "The app allows to apply for a new business registration and displays the process of request approval by different departments.")
4+
}
25
Div(Class: content-wrapper){
36
Div(Class: col-md-12 panel panel-primary data-sweet-alert){
47
Form(){

quick-start-apps/application_form_demo/pages/DemoCreateCompany.ptl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
SetTitle("Application Form")
1+
SetTitle("Business registration")
2+
Div(breadcrumb){
3+
Div(Class: text-muted, Body: "The app allows to apply for a new business registration and displays the process of request approval by different departments.")
4+
}
25
Div(Class: content-wrapper){
36
Div(Class: row){
47
DBFind(applications,src_app).Columns("name,id").Where("name='Application form'").Vars(appli)
@@ -426,9 +429,10 @@ Div(Class: content-wrapper){
426429
Div(Class: col-md-3 mt-sm text-right){
427430
Label("Business premises")
428431
}
429-
Div(Class: col-md-9 mt-sm text-center){
432+
Div(Class: col-md-9 mt-sm){
430433
DBFind(Name: pc_property_demo, Source: src_property).Where("del=0")
431434
Select(Name:business_premises,Source:src_property,NameColumn:"name",ValueColumn:"id",Value:#create_business_premises#)
435+
P(Class:text-muted h6 m0, Body: `Before filling the form, create several real estate entries. You can do it via "Property" menu item.`)
432436
}
433437
}
434438
}
@@ -470,9 +474,10 @@ Div(Class: content-wrapper){
470474
Div(Class: col-md-3 mt-sm text-right){
471475
Label("Business premises")
472476
}
473-
Div(Class: col-md-9 mt-sm text-center){
477+
Div(Class: col-md-9 mt-sm){
474478
DBFind(Name: pc_property_demo, Source: src_property).Where("del=0")
475479
Select(Name:business_premises,Source:src_property,NameColumn:"name",ValueColumn:"id")
480+
P(Class:text-muted h6 m0, Body: `Before filling the form, create several real estate entries. You can do it via "Property" menu item.`)
476481
}
477482
}
478483
}

quick-start-apps/application_form_demo/pages/demo_property_list.ptl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
SetTitle(Property list)
1+
SetTitle("Property")
2+
Div(breadcrumb){
3+
Div(Class: text-muted, Body: "The app allows to apply for a new business registration and displays the process of request approval by different departments.")
4+
}
25
Div(Class: content-wrapper){
36
AddToolButton(Add property, fa fa-plus-circle, addProperty, PageParams)
47
DBFind(Name:pc_property_demo,Source: src_prop).Custom(typ){

quick-start-apps/application_form_demo/struct.dot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
digraph G {
22
fontsize="24";
3-
label="application_form_demo\nFriday, 14-Sep-18 18:58:05 +10";
3+
label="application_form_demo\nSaturday, 15-Sep-18 00:37:05 +10";
44
nojustify=true;
55
ordering=out;
66
rankdir=LR;

quick-start-apps/land_registry_demo.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"Name": "land_registry_records",
1212
"Conditions": "ContractConditions(\"MainCondition\")",
13-
"Value": "If(GetVar(Search)){\r\n SetVar(Where,\"delete=0 and buildings_use_class=#Search#\")\r\n}.Else{\r\n SetVar(Where,\"delete=0\").(Search,)\r\n}\r\n\r\nIf(GetVar(Order)){}.Else{\r\n SetVar(Order,\"id desc\")\r\n}\r\n\r\nDBFind(Name: land_registry, Source: src_land_registry).Where(#Where#).Order(#Order#).Custom(_id){\r\n Span(#id#)\r\n}.Custom(_owner){\r\n DBFind(Name: members, Source: src_members).Where(\"id=#owner_id#\").Vars(row)\r\n LinkPage(Page: profile_view, PageParams: \"v_member_id=#row_id#\"){\r\n Span(Class: h5 text-bold, Body: #row_member_name#)\r\n }\r\n}.Custom(_land){\r\n Span(AppParam(App:#application_id#, Name: land_use, Index: #land_use#))\r\n}.Custom(_buildings){\r\n Span(AppParam(App:#application_id#, Name: land_buildings_use_class, Index: #buildings_use_class#))\r\n}.Custom(_area){\r\n Span(#area#)\r\n}.Custom(_address){\r\n Span(#address#)\r\n}.Custom(_cons){\r\n Div(h6 ml-lg){\r\n If(#price#>0){\r\n Span(#price#)\r\n }.Else{\r\n Em(Class: fa fa-1x text-muted fa-question-circle)\r\n }\r\n }\r\n}.Custom(_legal){\r\n Div(h6 ml-lg){\r\n If(#legal_status#==0){\r\n Em(Class: fa fa-1x text-muted fa-question-circle)\r\n }\r\n If(#legal_status#==1){\r\n Em(Class: fa fa-1x text-success fa-check-circle)\r\n }\r\n If(#legal_status#==2){\r\n Em(Class: fa fa-1x text-danger fa-exclamation-circle)\r\n }\r\n }\r\n}.Custom(_encumberance){\r\n Div(h6 ml-lg){\r\n If(#encumbrance_certificate#==0){\r\n Em(Class: fa fa-1x text-muted fa-question-circle)\r\n }\r\n If(#encumbrance_certificate#==1){\r\n Em(Class: fa fa-1x text-success fa-check-circle)\r\n }\r\n If(#encumbrance_certificate#==2){\r\n Em(Class: fa fa-1x text-danger fa-exclamation-circle)\r\n }\r\n }\r\n}.Custom(_actions){\r\n Div(text-right text-nowrap){\r\n Button(Page: #this#, Contract: land_registry_Delete, Params: \"LandId=#id#\", Class: btn btn-default fa fa-2x fa-trash mh-sm)\r\n Button(Page: land_registry_view, PageParams: \"LandId=#id#\", Class: btn btn-default fa fa-2x fa-eye mh-sm)\r\n }\r\n}.Count(reg_count)\r\n\r\nDiv(content-wrapper){\r\n Form(panel panel-primary){\r\n Div(list-group-item){\r\n Div(row){\r\n Div(col-md-9 text-left){\r\n Div(input-group){\r\n Div(input-group-addon){\r\n $buildings_use_class$\r\n }\r\n AppParam(App:#application_id#, Name: buildings_use_class, Source:src_search)\r\n Select(Name: BuildingUse, Source: src_search, NameColumn: name, ValueColumn: id, Value: #Search#)\r\n\r\n Div(input-group-btn){\r\n Button(Page: #this#, PageParams: \"Search=Val(BuildingUse),Order=#Order#\", Class: btn btn-default fa fa-search)\r\n }\r\n }\r\n }\r\n Div(col-md-3 text-center){\r\n Div(btn-group text-nowrap){\r\n If(#Order#==\"price\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=price desc,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-asc) $price$)\r\n }.ElseIf(#Order#==\"price desc\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=price,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-desc) $price$)\r\n }.Else{\r\n Button(Page: #this#, Class: ml-sm btn bg-gray-lighter, PageParams: \"Order=price,Search=#Search#\", Body: $price$)\r\n }\r\n\r\n If(#Order#==\"area\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=area desc,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-asc) $area_size$)\r\n }.ElseIf(#Order#==\"area desc\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=area,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-desc) $area_size$)\r\n }.Else{\r\n Button(Page: #this#, Class: ml-sm btn bg-gray-lighter, PageParams: \"Order=area desc,Search=#Search#\", Body: $area_size$)\r\n }\r\n }\r\n\r\n\r\n }\r\n }\r\n }\r\n Div(list-group-item){\r\n If(#reg_count#>0){\r\n Table(Source:src_land_registry, Columns: \"ID=_id,$owner$=_owner,$area_size$=_area,$lr_address$=_address,$consideration_value$(INR)=_cons,$legal_status$=_legal,$encumbrance_certificate$=_encumberance,=_actions\")\r\n }.Else{\r\n Div(text-center h3){\r\n records not found\r\n }\r\n }\r\n If(GetVar(Search)){\r\n Form(text-center){\r\n Button(Page: #this#, Class: btn btn-primary btn-oval){\r\n LangRes(view_all)\r\n }\r\n }\r\n }\r\n }\r\n Div(panel-footer text-right){\r\n Button(Page: land_registry_add, Class: btn btn-primary, Body: $lr_add$)\r\n }\r\n }\r\n}",
13+
"Value": "If(GetVar(Search)){\r\n SetVar(Where,\"delete=0 and buildings_use_class=#Search#\")\r\n}.Else{\r\n SetVar(Where,\"delete=0\").(Search,)\r\n}\r\n\r\nIf(GetVar(Order)){}.Else{\r\n SetVar(Order,\"id desc\")\r\n}\r\n\r\nDBFind(applications).Columns(\"name,id\").Where(\"name='Land registry'\").Vars(application)\r\n\r\nDBFind(Name: land_registry, Source: src_land_registry).Where(#Where#).Order(#Order#).Custom(_id){\r\n Span(#id#)\r\n}.Custom(_owner){\r\n DBFind(Name: members, Source: src_members).Where(\"id=#owner_id#\").Vars(row)\r\n LinkPage(Page: profile_view, PageParams: \"v_member_id=#row_id#\"){\r\n Span(Class: h5 text-bold, Body: #row_member_name#)\r\n }\r\n}.Custom(_land){\r\n Span(AppParam(App:#application_id#, Name: land_use, Index: #land_use#))\r\n}.Custom(_buildings){\r\n Span(AppParam(App:#application_id#, Name: land_buildings_use_class, Index: #buildings_use_class#))\r\n}.Custom(_area){\r\n Span(#area#)\r\n}.Custom(_address){\r\n Span(#address#)\r\n}.Custom(_cons){\r\n Div(h6 ml-lg){\r\n If(#price#>0){\r\n Span(#price#)\r\n }.Else{\r\n Em(Class: fa fa-1x text-muted fa-question-circle)\r\n }\r\n }\r\n}.Custom(_legal){\r\n Div(h6 ml-lg){\r\n If(#legal_status#==0){\r\n Em(Class: fa fa-1x text-muted fa-question-circle)\r\n }\r\n If(#legal_status#==1){\r\n Em(Class: fa fa-1x text-success fa-check-circle)\r\n }\r\n If(#legal_status#==2){\r\n Em(Class: fa fa-1x text-danger fa-exclamation-circle)\r\n }\r\n }\r\n}.Custom(_encumberance){\r\n Div(h6 ml-lg){\r\n If(#encumbrance_certificate#==0){\r\n Em(Class: fa fa-1x text-muted fa-question-circle)\r\n }\r\n If(#encumbrance_certificate#==1){\r\n Em(Class: fa fa-1x text-success fa-check-circle)\r\n }\r\n If(#encumbrance_certificate#==2){\r\n Em(Class: fa fa-1x text-danger fa-exclamation-circle)\r\n }\r\n }\r\n}.Custom(_actions){\r\n Div(text-right text-nowrap){\r\n Button(Page: #this#, Contract: land_registry_Delete, Params: \"LandId=#id#\", Class: btn btn-default fa fa-2x fa-trash mh-sm)\r\n Button(Page: land_registry_view, PageParams: \"LandId=#id#\", Class: btn btn-default fa fa-2x fa-eye mh-sm)\r\n }\r\n}.Count(reg_count)\r\n\r\nDiv(Class: content-wrapper){\r\n Form(panel panel-primary){\r\n Div(panel-body){\r\n Div(row){\r\n Div(col-md-9 text-left){\r\n Div(input-group){\r\n Div(input-group-addon){\r\n $buildings_use_class$\r\n }\r\n AppParam(App:#application_id#, Name: land_buildings_use_class, Source:src_search)\r\n Select(Name: BuildingUse, Source: src_search, NameColumn: name, ValueColumn: id, Value: #Search#)\r\n\r\n Div(input-group-btn){\r\n Button(Page: #this#, PageParams: \"Search=Val(BuildingUse),Order=#Order#\", Class: btn btn-default fa fa-search)\r\n }\r\n }\r\n }\r\n Div(col-md-3 text-center){\r\n Div(btn-group text-nowrap){\r\n If(#Order#==\"price\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=price desc,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-asc) $price$)\r\n }.ElseIf(#Order#==\"price desc\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=price,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-desc) $price$)\r\n }.Else{\r\n Button(Page: #this#, Class: ml-sm btn bg-gray-lighter, PageParams: \"Order=price,Search=#Search#\", Body: $price$)\r\n }\r\n\r\n If(#Order#==\"area\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=area desc,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-asc) $area_size$)\r\n }.ElseIf(#Order#==\"area desc\"){\r\n Button(Page: #this#, Class: ml-sm btn bg-gray, PageParams: \"Order=area,Search=#Search#\", Body: Em(Class:fa fa-sort-numeric-desc) $area_size$)\r\n }.Else{\r\n Button(Page: #this#, Class: ml-sm btn bg-gray-lighter, PageParams: \"Order=area desc,Search=#Search#\", Body: $area_size$)\r\n }\r\n }\r\n\r\n\r\n }\r\n }\r\n Div(table-responsive){\r\n Table(Source:src_land_registry, Columns: \"ID=_id,$owner$=_owner,$area_size$=_area,$lr_address$=_address,$consideration_value$(INR)=_cons,$legal_status$=_legal,$encumbrance_certificate$=_encumberance,=_actions\")\r\n }\r\n If(GetVar(isSearch) == 1){\r\n Div(row){\r\n Div(col-md-12 mt-lg){\r\n Div(text-center){\r\n Button(Body: View all, Class: btn btn-primary, Page: #this#, PageParams: \"isSearch=0\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}",
1414
"Type": "blocks"
1515
},
1616
{
@@ -440,7 +440,7 @@
440440
{
441441
"Name": "land_registry_records",
442442
"Conditions": "ContractConditions(\"MainCondition\")",
443-
"Value": "DBFind(applications,src_app).Columns(\"name,id\").Where(\"name='Land registry'\").Vars(application)\r\nSetTitle($land_records$)\r\nSetVar(this, land_registry_records)\r\nInclude(land_registry_records)",
443+
"Value": "DBFind(applications,src_app).Columns(\"name,id\").Where(\"name='Land registry'\").Vars(application)\r\nSetTitle(\"Land registry\")\r\nDiv(breadcrumb){\r\n Div(Class: text-muted, Body: \"The app is a registry of real estate objects.\")\r\n}\r\nAddToolButton(Title: $lr_add$, Page: land_registry_add, Icon: icon-plus)\r\nSetVar(this, land_registry_records)\r\nInclude(land_registry_records)",
444444
"Menu": "default_menu",
445445
"Type": "pages"
446446
},

quick-start-apps/land_registry_demo/blocks/land_registry_records.ptl

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ If(GetVar(Order)){}.Else{
88
SetVar(Order,"id desc")
99
}
1010

11+
DBFind(applications).Columns("name,id").Where("name='Land registry'").Vars(application)
12+
1113
DBFind(Name: land_registry, Source: src_land_registry).Where(#Where#).Order(#Order#).Custom(_id){
1214
Span(#id#)
1315
}.Custom(_owner){
@@ -62,16 +64,16 @@ DBFind(Name: land_registry, Source: src_land_registry).Where(#Where#).Order(#Ord
6264
}
6365
}.Count(reg_count)
6466

65-
Div(content-wrapper){
67+
Div(Class: content-wrapper){
6668
Form(panel panel-primary){
67-
Div(list-group-item){
69+
Div(panel-body){
6870
Div(row){
6971
Div(col-md-9 text-left){
7072
Div(input-group){
7173
Div(input-group-addon){
7274
$buildings_use_class$
7375
}
74-
AppParam(App:#application_id#, Name: buildings_use_class, Source:src_search)
76+
AppParam(App:#application_id#, Name: land_buildings_use_class, Source:src_search)
7577
Select(Name: BuildingUse, Source: src_search, NameColumn: name, ValueColumn: id, Value: #Search#)
7678

7779
Div(input-group-btn){
@@ -101,25 +103,18 @@ Div(content-wrapper){
101103

102104
}
103105
}
104-
}
105-
Div(list-group-item){
106-
If(#reg_count#>0){
106+
Div(table-responsive){
107107
Table(Source:src_land_registry, Columns: "ID=_id,$owner$=_owner,$area_size$=_area,$lr_address$=_address,$consideration_value$(INR)=_cons,$legal_status$=_legal,$encumbrance_certificate$=_encumberance,=_actions")
108-
}.Else{
109-
Div(text-center h3){
110-
records not found
111-
}
112108
}
113-
If(GetVar(Search)){
114-
Form(text-center){
115-
Button(Page: #this#, Class: btn btn-primary btn-oval){
116-
LangRes(view_all)
109+
If(GetVar(isSearch) == 1){
110+
Div(row){
111+
Div(col-md-12 mt-lg){
112+
Div(text-center){
113+
Button(Body: View all, Class: btn btn-primary, Page: #this#, PageParams: "isSearch=0")
114+
}
117115
}
118116
}
119117
}
120118
}
121-
Div(panel-footer text-right){
122-
Button(Page: land_registry_add, Class: btn btn-primary, Body: $lr_add$)
123-
}
124119
}
125120
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
DBFind(applications,src_app).Columns("name,id").Where("name='Land registry'").Vars(application)
2-
SetTitle($land_records$)
2+
SetTitle("Land registry")
3+
Div(breadcrumb){
4+
Div(Class: text-muted, Body: "The app is a registry of real estate objects.")
5+
}
6+
AddToolButton(Title: $lr_add$, Page: land_registry_add, Icon: icon-plus)
37
SetVar(this, land_registry_records)
48
Include(land_registry_records)

quick-start-apps/land_registry_demo/struct.dot

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
digraph G {
22
fontsize="24";
3-
label="land_registry_demo\nFriday, 14-Sep-18 18:58:10 +10";
3+
label="land_registry_demo\nSaturday, 15-Sep-18 00:37:11 +10";
44
nojustify=true;
55
ordering=out;
66
rankdir=LR;
@@ -15,6 +15,7 @@ size="30";
1515
"land_registry_edit\npage" -> "land_registry_edit\nblock" [ color=green, label=include ]
1616
"land_registry_edit\npage" [color=green, fontcolor=green, group=pages, shape=record];
1717
"applications\ntable" -> "land_registry_records\npage"
18+
"land_registry_records\npage" -> "land_registry_add\npage" [ color=green ]
1819
"land_registry_records\npage" -> "land_registry_records\nblock" [ color=green, label=include ]
1920
"land_registry_records\npage" [color=green, fontcolor=green, group=pages, shape=record];
2021
"land_registry_view\npage" -> "land_registry_SecondRequest\ncontract" [ color=red ]
@@ -35,11 +36,11 @@ size="30";
3536
"land_registry_edit\nblock" -> "land_registry_records\npage" [ color=green ]
3637
"land_registry_edit\nblock" [color=green, fontcolor=green, group=blocks, shape=record];
3738
"land_registry_records\nblock" -> "land_registry_Delete\ncontract" [ color=red ]
39+
"applications\ntable" -> "land_registry_records\nblock"
3840
"land_registry\ntable" -> "land_registry_records\nblock"
3941
"members\ntable" -> "land_registry_records\nblock"
4042
"land_registry_records\nblock" -> "profile_view\npage" [ color=green ]
4143
"land_registry_records\nblock" -> "land_registry_view\npage" [ color=green ]
42-
"land_registry_records\nblock" -> "land_registry_add\npage" [ color=green ]
4344
"land_registry_records\nblock" [color=green, fontcolor=green, group=blocks, shape=record];
4445
"land_registry_Add\ncontract" -> "land_registry\ntable" [ color="" ]
4546
"land_registry_Add\ncontract" -> "land_registry_ownership\ntable" [ color="" ]

0 commit comments

Comments
 (0)