Skip to content

Commit

Permalink
STL: expose "Outcome for DS" box, introduce "monthly_income" in place of
Browse files Browse the repository at this point in the history
"weekly_income" (the latter retained for data migration), styles fix,
cleanup
  • Loading branch information
nursix committed Jan 13, 2017
1 parent c1aa13b commit 4bf57de
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0d494ce (2017-01-12 16:12:42)
nursix-dev-746-gc1aa13b (2017-01-13 11:06:03)
16 changes: 13 additions & 3 deletions modules/s3db/dvr.py
Expand Up @@ -1597,8 +1597,10 @@ def model(self):
past = 0,
),
# @todo: provide options lookup?
Field("outcome",
Field("outcome", "text",
label = T("Outcome"),
represent = s3_text_represent,
widget = s3_comments_widget,
),
Field("completed", "boolean",
default = False,
Expand Down Expand Up @@ -2642,6 +2644,10 @@ def model(self):
label = T("Average Weekly Income"),
requires = IS_EMPTY_OR(IS_FLOAT_IN_RANGE(0.0, None)),
),
Field("monthly_income", "double",
label = T("Average Monthly Income"),
requires = IS_EMPTY_OR(IS_FLOAT_IN_RANGE(0.0, None)),
),
s3_currency(),
s3_comments(),
*s3_meta_fields())
Expand Down Expand Up @@ -2673,7 +2679,8 @@ def model(self):
# CRUD Form
crud_form = S3SQLCustomForm("housing_type_id",
"monthly_costs",
"average_weekly_income",
#"average_weekly_income",
"monthly_income",
"currency",
S3SQLInlineLink("income_source",
field = "income_source_id",
Expand All @@ -2687,7 +2694,8 @@ def model(self):
list_fields = ["housing_type_id",
"monthly_costs",
"income_source_economy.income_source_id",
"average_weekly_income",
#"average_weekly_income",
"monthly_income",
"comments",
]

Expand Down Expand Up @@ -3644,6 +3652,8 @@ def model(self):
),
Field("reason", "text",
label = T("Reason"),
represent = s3_text_represent,
widget = s3_comments_widget,
),
Field("proposal", "text",
label = T("Proposed Assistance"),
Expand Down
6 changes: 5 additions & 1 deletion modules/templates/STL/config.py
Expand Up @@ -565,13 +565,16 @@ def expose_human_resource_id(table):

if r.function == "due_followups":
table = r.table
component = r.resource
# Filter activities by root service
query = (FS("service_id$root_service") == root_service_id)
r.resource.add_filter(query)
component.add_filter(query)
else:
table = r.component.table
component = r.component

component.configure(orderby=~table.start_date)

expose_project_id(table)
expose_human_resource_id(table)

Expand Down Expand Up @@ -671,6 +674,7 @@ def expose_human_resource_id(table):
"followup_date",
"completed",
"end_date",
(T("Outcome for DS"), "outcome"),
"activity_funding.funding_required",
"activity_funding.reason",
S3SQLInlineComponent(
Expand Down
4 changes: 2 additions & 2 deletions modules/templates/STL/menus.py
Expand Up @@ -169,7 +169,7 @@ def dvr():
),
),
M("Administration", c="dvr", link=False,
restrict = ("ADMIN","ORG_ADMIN"))(
restrict = (ADMIN, "ORG_ADMIN"))(
M("Beneficiary Types", f="beneficiary_type"),
M("Evaluation Questions", f="evaluation_question"),
M("Housing Types", f="housing_type"),
Expand Down Expand Up @@ -211,7 +211,7 @@ def org():
#M("Import", m="import"),
),
M("Administration", c=("org", "project"), link=False,
restrict = ("ADMIN","ORG_ADMIN"))(
restrict = (ADMIN, "ORG_ADMIN"))(
M("Organization Types", f="organisation_type"),
M("Service Types", f="service"),
M("Facility Types", f="facility_type"),
Expand Down
2 changes: 1 addition & 1 deletion static/themes/STL/eden.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/themes/STL/scss/custom/_rheader.scss
Expand Up @@ -39,7 +39,7 @@ div.tabs {
margin: 0.8rem 0;
padding: 0;

line-height: 1.3rem;
line-height: 1.25rem;
text-align: left;

border-bottom: 1px solid $rheader_tabs_bgcolor_inactive;
Expand Down
2 changes: 1 addition & 1 deletion static/themes/STL/style.css
Expand Up @@ -468,7 +468,7 @@ div.tabs {
width: 100%;
margin: 0.8rem 0;
padding: 0;
line-height: 1.3rem;
line-height: 1.25rem;
text-align: left;
border-bottom: 1px solid #20579A;
}
Expand Down

0 comments on commit 4bf57de

Please sign in to comment.