Skip to content

Commit

Permalink
S3AddResourceLink is now S3PopupLink
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Oct 6, 2015
1 parent ad22021 commit 4d86fee
Show file tree
Hide file tree
Showing 43 changed files with 767 additions and 647 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nursix-1.1.0-devel-2863-g1bf7d87 (2015-10-06 10:10:01)
nursix-1.1.0-devel-2864-gad22021 (2015-10-06 12:10:55)
25 changes: 14 additions & 11 deletions modules/s3/s3aaa.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-

""" Authentication, Authorization, Accouting
Expand Down Expand Up @@ -1685,11 +1684,13 @@ def configure_user_fields(self, pe_ids=None):
else:
organisation_id.requires = IS_EMPTY_OR(requires)

from s3layouts import S3AddResourceLink
organisation_id.comment = S3AddResourceLink(c="org",
f="organisation",
label=s3db.crud_strings["org_organisation"].label_create,
title=s3db.crud_strings["org_organisation"].title_list,)
from s3layouts import S3PopupLink
org_crud_strings = s3db.crud_strings["org_organisation"]
organisation_id.comment = S3PopupLink(c = "org",
f = "organisation",
label = org_crud_strings.label_create,
title = org_crud_strings.title_list,
)
#from s3widgets import S3OrganisationAutocompleteWidget
#organisation_id.widget = S3OrganisationAutocompleteWidget()
#organisation_id.comment = DIV(_class="tooltip",
Expand Down Expand Up @@ -1717,11 +1718,13 @@ def configure_user_fields(self, pe_ids=None):
org_group_id.requires = requires
else:
org_group_id.requires = IS_EMPTY_OR(requires)
#from s3layouts import S3AddResourceLink
#org_group_id.comment = S3AddResourceLink(c="org",
# f="group",
# label=s3db.crud_strings["org_group"].label_create,
# title=s3db.crud_strings["org_group"].title_list,)
#from s3layouts import S3PopupLink
#ogroup_crud_strings = s3db.crud_strings["org_group"]
#org_group_id.comment = S3PopupLink(c = "org",
# f = "group",
# label = ogroup_crud_strings.label_create,
# title = ogroup_crud_strings.title_list,
# )
if multiselect_widget:
org_group_id.widget = S3MultiSelectWidget(multiple=False)

Expand Down
2 changes: 1 addition & 1 deletion modules/s3/s3xforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __call__(self, field, label, ref):
comment = field.comment
if comment and isinstance(comment, basestring):
# @todo: support LazyT, and extract hints from
# S3AddResourceLinks or other tooltip DIVs
# S3PopupLinks or other tooltip DIVs
self.setstr("hint", comment)

return self.widget(field, attr), self._strings
Expand Down
14 changes: 7 additions & 7 deletions modules/s3db/budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

from ..s3 import *
from s3dal import Row
from s3layouts import S3AddResourceLink
from s3layouts import S3PopupLink

# =============================================================================
class S3BudgetModel(S3Model):
Expand Down Expand Up @@ -193,7 +193,7 @@ def model(self):
# requires = IS_ONE_OF(db, "budget_budget.id",
# budget_budget_represent,
# ),
# comment = S3AddResourceLink(
# comment = S3PopupLink(
# c = "budget",
# f = "budget",
# label = ADD_BUDGET,
Expand Down Expand Up @@ -296,7 +296,7 @@ def model(self):
requires = IS_ONE_OF(db, "budget_location.id",
budget_location_represent,
),
comment = S3AddResourceLink(
comment = S3PopupLink(
c = "budget",
f = "location",
label = ADD_LOCATION,
Expand Down Expand Up @@ -373,7 +373,7 @@ def model(self):
requires = IS_ONE_OF(db, "budget_staff.id",
budget_staff_represent,
),
comment = S3AddResourceLink(
comment = S3PopupLink(
c = "budget",
f = "staff",
label = ADD_STAFF_TYPE,
Expand Down Expand Up @@ -621,7 +621,7 @@ def model(self):
requires = IS_ONE_OF(db, "budget_kit.id",
budget_kit_represent,
),
comment = S3AddResourceLink(
comment = S3PopupLink(
c = "budget",
f = "kit",
label = ADD_KIT,
Expand Down Expand Up @@ -747,7 +747,7 @@ def model(self):
requires = IS_ONE_OF(db, "budget_item.id",
budget_item_represent,
),
comment = S3AddResourceLink(
comment = S3PopupLink(
c = "budget",
f = "item",
label = ADD_ITEM,
Expand Down Expand Up @@ -1001,7 +1001,7 @@ def model(self):
requires = IS_ONE_OF(db, "budget_bundle.id",
budget_bundle_represent,
),
comment = S3AddResourceLink(
comment = S3PopupLink(
c = "budget",
f = "bundle",
label = ADD_BUNDLE,
Expand Down
10 changes: 6 additions & 4 deletions modules/s3db/cms.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from gluon import *
from gluon.storage import Storage
from ..s3 import *
from s3layouts import S3AddResourceLink
from s3layouts import S3PopupLink

# Compact JSON encoding
SEPARATORS = (",", ":")
Expand Down Expand Up @@ -242,9 +242,11 @@ def model(self):
# Reusable field
represent = S3Represent(lookup=tablename)
post_id = S3ReusableField("post_id", "reference %s" % tablename,
comment = S3AddResourceLink(c="cms", f="post",
title=ADD_POST,
tooltip=T("A block of rich text which could be embedded into a page, viewed as a complete page or viewed as a list of news items.")),
comment = S3PopupLink(c = "cms",
f = "post",
title = ADD_POST,
tooltip = T("A block of rich text which could be embedded into a page, viewed as a complete page or viewed as a list of news items."),
),
label = T("Post"),
ondelete = "CASCADE",
represent = represent,
Expand Down
30 changes: 17 additions & 13 deletions modules/s3db/cr.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from gluon import *
from gluon.storage import Storage
from ..s3 import *
from s3layouts import S3AddResourceLink
from s3layouts import S3PopupLink

NIGHT = 1
DAY_AND_NIGHT = 2
Expand Down Expand Up @@ -138,9 +138,10 @@ def model(self):
requires = IS_EMPTY_OR(
IS_ONE_OF(db, "cr_shelter_type.id",
represent)),
comment=S3AddResourceLink(c="cr",
f="shelter_type",
label=ADD_SHELTER_TYPE),
comment=S3PopupLink(c = "cr",
f = "shelter_type",
label = ADD_SHELTER_TYPE,
),
)

# -------------------------------------------------------------------------
Expand Down Expand Up @@ -199,9 +200,10 @@ def model(self):
service_represent,
multiple=True)),
sortby = "name",
comment = S3AddResourceLink(c="cr",
f="shelter_service",
label=ADD_SHELTER_SERVICE),
comment = S3PopupLink(c = "cr",
f = "shelter_service",
label = ADD_SHELTER_SERVICE,
),
widget = S3MultiSelectWidget(header=False,
)
)
Expand Down Expand Up @@ -550,12 +552,14 @@ def model(self):
IS_ONE_OF(db, "cr_shelter.id",
represent,
sort=True)),
comment = S3AddResourceLink(c="cr",
f="shelter",
label=ADD_SHELTER,
title=SHELTER_LABEL,
tooltip="%s (%s)." % (SHELTER_HELP,
T("optional"))),
comment = S3PopupLink(c = "cr",
f = "shelter",
label = ADD_SHELTER,
title = SHELTER_LABEL,
tooltip = "%s (%s)." % (SHELTER_HELP,
T("optional"),
),
),
widget = S3AutocompleteWidget("cr", "shelter")
)

Expand Down
20 changes: 10 additions & 10 deletions modules/s3db/dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from gluon import *

from ..s3 import *
from s3layouts import S3AddResourceLink
from s3layouts import S3PopupLink

# =============================================================================
class DataCollectionTemplateModel(S3Model):
Expand Down Expand Up @@ -93,9 +93,9 @@ def model(self):
represent,
),
sortby = "name",
comment = S3AddResourceLink(f="template",
tooltip=T("Add a new data collection template"),
),
comment = S3PopupLink(f="template",
tooltip=T("Add a new data collection template"),
),
)

# CRUD strings
Expand Down Expand Up @@ -165,9 +165,9 @@ def model(self):
represent,
),
sortby = "name",
comment = S3AddResourceLink(f="question",
tooltip=T("Add a new data collection question"),
),
comment = S3PopupLink(f="question",
tooltip=T("Add a new data collection question"),
),
)

# Components
Expand Down Expand Up @@ -319,9 +319,9 @@ def model(self):
requires = IS_ONE_OF(db, "dc_collection.id",
represent,
),
comment = S3AddResourceLink(f="collection",
tooltip=T("Add a new data collection"),
),
comment = S3PopupLink(f="collection",
tooltip=T("Add a new data collection"),
),
)

# =====================================================================
Expand Down
36 changes: 18 additions & 18 deletions modules/s3db/disease.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from gluon.storage import Storage

from ..s3 import *
from s3layouts import S3AddResourceLink
from s3layouts import S3PopupLink

# Monitoring upgrades {new_level:previous_levels}
MONITORING_UPGRADE = {"OBSERVATION": ("NONE",
Expand Down Expand Up @@ -118,9 +118,9 @@ def model(self):
represent,
),
sortby = "name",
comment = S3AddResourceLink(f="disease",
tooltip=T("Add a new disease to the catalog"),
),
comment = S3PopupLink(f = "disease",
tooltip = T("Add a new disease to the catalog"),
),
)

self.add_components(tablename,
Expand Down Expand Up @@ -365,9 +365,9 @@ def model(self):
requires = IS_ONE_OF(db, "disease_case.id",
represent,
),
comment = S3AddResourceLink(f="case",
tooltip=T("Add a new case"),
),
comment = S3PopupLink(f = "case",
tooltip = T("Add a new case"),
),
)

# Components
Expand Down Expand Up @@ -465,9 +465,9 @@ def model(self):
requires = IS_ONE_OF(db, "disease_case.id",
represent,
),
comment = S3AddResourceLink(f="case",
tooltip=T("Add a new case"),
),
comment = S3PopupLink(f = "case",
tooltip = T("Add a new case"),
),
)

# Components
Expand Down Expand Up @@ -881,9 +881,9 @@ def model(self):
represent,
)),
sortby = "date",
comment = S3AddResourceLink(f="tracing",
tooltip=T("Add a new contact tracing information"),
),
comment = S3PopupLink(f = "tracing",
tooltip = T("Add a new contact tracing information"),
),
)

self.add_components(tablename,
Expand Down Expand Up @@ -1237,11 +1237,11 @@ def model(self):
readable = True,
writable = True,
empty = False,
comment = S3AddResourceLink(c="disease",
f="statistic",
vars = dict(child = "parameter_id"),
title=ADD_STATISTIC,
),
comment = S3PopupLink(c = "disease",
f = "statistic",
vars = {"child": "parameter_id"},
title = ADD_STATISTIC,
),
),
location_id(
requires = IS_LOCATION(),
Expand Down
15 changes: 8 additions & 7 deletions modules/s3db/dvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from gluon import *
from gluon.storage import Storage
from ..s3 import *
from s3layouts import S3AddResourceLink
from s3layouts import S3PopupLink

# =============================================================================
class S3DVIModel(S3Model):
Expand Down Expand Up @@ -462,12 +462,13 @@ def person_id_comment(fieldname):
c_comment = T("Type the first few characters of one of the Person's names.")

ADD_PERSON = T("Add Person")
return S3AddResourceLink(c="pr",
f="person",
vars=dict(child=fieldname),
label=ADD_PERSON,
title=c_title,
tooltip=c_comment)
return S3PopupLink(c = "pr",
f = "person",
vars = {"child": fieldname},
label = ADD_PERSON,
title = c_title,
tooltip = c_comment,
)

# -------------------------------------------------------------------------
@staticmethod
Expand Down
9 changes: 5 additions & 4 deletions modules/s3db/dvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from gluon.storage import Storage
from gluon.tools import callback
from ..s3 import *
from s3layouts import S3AddResourceLink
from s3layouts import S3PopupLink

# =============================================================================
class S3DVRModel(S3Model):
Expand Down Expand Up @@ -245,9 +245,10 @@ def model(self):
requires = IS_EMPTY_OR(
IS_ONE_OF(db, "dvr_need.id",
represent)),
comment=S3AddResourceLink(c="dvr",
f="need",
label=ADD_NEED),
comment=S3PopupLink(c = "dvr",
f = "need",
label = ADD_NEED,
),
)

configure(tablename,
Expand Down
Loading

0 comments on commit 4d86fee

Please sign in to comment.