Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nursix/eden
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Jun 14, 2019
2 parents 2a983bc + aca004a commit 00758eb
Show file tree
Hide file tree
Showing 56 changed files with 5,792 additions and 3,903 deletions.
11 changes: 2 additions & 9 deletions controllers/cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,6 @@ def prep(r):
(table.approved_on != None)
resource.add_filter(filter)

#elif r.representation == "cap":
# # This is either importing from or exporting to cap format. Set both
# # postprocessing hooks so we don't have to enumerate methods.
# s3db.configure("gis_location",
# xml_post_parse = s3db.cap_gis_location_xml_post_parse,
# xml_post_render = s3db.cap_gis_location_xml_post_render,
# )
record = r.record
if r.id:

Expand Down Expand Up @@ -923,8 +916,8 @@ def postp(r, output):
row_clone["template_info_id"] = row.id
row_clone["is_template"] = False
row_clone["effective"] = request.utcnow
row_clone["expires"] = s3db.cap_expiry_date()
row_clone["sender_name"] = s3db.cap_sender_name()
row_clone["expires"] = s3db.cap_expirydate()
row_clone["sender_name"] = s3db.cap_sendername()
row_clone["web"] = settings.get_base_public_url() + \
URL(c="cap", f=fn, args=lastid)
row_clone["audience"] = audience
Expand Down
44 changes: 27 additions & 17 deletions controllers/default.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-

"""
Default Controllers
Expand Down Expand Up @@ -394,7 +395,6 @@ def index():
"registered": registered,
"r": None, # Required for dataTable to work
"datatable_ajax_source": datatable_ajax_source,

}

if get_vars.tour:
Expand Down Expand Up @@ -464,6 +464,7 @@ def organisation():
else:
from gluon.http import HTTP
raise HTTP(415, ERROR.BAD_FORMAT)

return items

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -501,10 +502,11 @@ def message():
% {"system_name": settings.get_system_name(),
"email": request.vars.email}
image = "email_icon.png"
return dict(title = title,
message = message,
image_src = "/%s/static/img/%s" % (appname, image)
)

return {"title": title,
"message": message,
"image_src": "/%s/static/img/%s" % (appname, image),
}

# -----------------------------------------------------------------------------
def rapid():
Expand All @@ -518,7 +520,7 @@ def rapid():
session.s3.rapid_data_entry = val

response.view = "xml.html"
return dict(item=str(session.s3.rapid_data_entry))
return {"item": str(session.s3.rapid_data_entry)}

# -----------------------------------------------------------------------------
def user():
Expand All @@ -544,6 +546,11 @@ def user():
auth_settings.profile_onaccept = auth.s3_user_profile_onaccept
auth_settings.register_onvalidation = register_validation

# Check for template-specific customisations
customise = settings.customise_auth_user_controller
if customise:
customise(arg=arg)

self_registration = settings.get_security_self_registration()
login_form = register_form = None

Expand All @@ -559,10 +566,7 @@ def user():
auth_settings.actions_disabled = ("retrieve_password",
)

# Check for template-specific customisations
customise = settings.customise_auth_user_controller
if customise:
customise(arg=arg)
header = response.s3_user_header or ""

if arg == "login":
title = response.title = T("Login")
Expand All @@ -573,11 +577,16 @@ def user():
login_form = form

elif arg == "register":
title = response.title = T("Register")
# @ToDo: move this code to /modules/s3/s3aaa.py:def register()?
if not self_registration:
session.error = T("Registration not permitted")
redirect(URL(f="index"))
if response.title:
# Customised
title = response.title
else:
# Default
title = response.title = T("Register")
form = register_form = auth.register()

elif arg == "change_password":
Expand Down Expand Up @@ -651,6 +660,7 @@ def user():
break

return {"title": title,
"header": header,
"form": form,
"login_form": login_form,
"register_form": register_form,
Expand Down Expand Up @@ -1332,7 +1342,7 @@ def help():

response.title = T("Help")

return dict(item=item)
return {"item": item}

# -----------------------------------------------------------------------------
def privacy():
Expand All @@ -1341,7 +1351,7 @@ def privacy():
_custom_view("privacy")

response.title = T("Privacy")
return dict()
return {}

# -----------------------------------------------------------------------------
def tos():
Expand All @@ -1350,7 +1360,7 @@ def tos():
_custom_view("tos")

response.title = T("Terms of Service")
return dict()
return {}

# -----------------------------------------------------------------------------
def video():
Expand All @@ -1359,7 +1369,7 @@ def video():
_custom_view("video")

response.title = T("Video Tutorials")
return dict()
return {}

# -----------------------------------------------------------------------------
def contact():
Expand Down Expand Up @@ -1433,14 +1443,14 @@ def prep(r):
raise HTTP("404", "Unable to open Custom View: %s" % view)

response.title = T("Contact us")
return dict()
return {}

if settings.has_module("cms"):
# Use CMS
return s3db.cms_index("default", "contact", page_name=T("Contact Us"))

# Just use default HTML View
return dict()
return {}

# -----------------------------------------------------------------------------
def load_all_models():
Expand Down
24 changes: 21 additions & 3 deletions controllers/pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,31 @@ def prep(r):
return True
s3.prep = prep

return s3_rest_controller("pr", "education")
return s3_rest_controller()

# -----------------------------------------------------------------------------
def education_level():
""" RESTful CRUD controller """

return s3_rest_controller("pr", "education_level")
return s3_rest_controller()

# -----------------------------------------------------------------------------
def language():
""" RESTful CRUD controller """

def prep(r):
if r.method in ("create", "create.popup", "update", "update.popup"):
# Coming from Profile page?
person_id = get_vars.get("~.person_id", None)
if person_id:
field = s3db.pr_language.person_id
field.default = person_id
field.readable = field.writable = False

return True
s3.prep = prep

return s3_rest_controller()

# -----------------------------------------------------------------------------
def occupation_type():
Expand Down Expand Up @@ -609,7 +627,7 @@ def tooltip():

if "formfield" in request.vars:
response.view = "pr/ajaxtips/%s.html" % request.vars.formfield
return dict()
return {}

# =============================================================================
def filter():
Expand Down
2 changes: 2 additions & 0 deletions languages/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,9 @@
'Enter a valid date before': 'Geben Sie zuvor eine gültiges Datum ein',
'Enter a valid email': 'Geben Sie eine gültige E-Mail-Adresse ein',
'Enter a valid future date': 'Geben Sie ein gültiges, zukünftiges Datum ein',
'Enter a value': 'Eingabe erforderlich',
'Enter an integer greater or equal to 0': 'Geben Sie eine ganze Zahl grösser oder gleich 0 ein',
'Enter from %(min)g to %(max)g characters': 'Geben Sie zwischen %(min)g und %(max)g Zeichen ein',
'Enter or scan ID': 'ID eingeben/scannen',
'Enter some characters of the ID or name to start the search, then select from the drop-down': 'Geben Sie die ersten Zeichen der ID oder des Namens ein um die Suche zu starten, und wählen Sie dann aus der Liste aus',
'Enter some characters to bring up a list of possible matches': 'Geben Sie einige Zeichen ein um eine Liste möglicher Übereinstimmungen anzuzeigen',
Expand Down
1 change: 1 addition & 0 deletions languages/en-gb.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
'Sent Shipment canceled': 'Sent Shipment cancelled',
'Sent Shipment canceled and items returned to Warehouse': 'Sent Shipment cancelled and items returned to Warehouse',
'Shipping Organization': 'Shipping Organisation',
'Skills Utilized': 'Skills Utilised',
'Social Mobilization': 'Social Mobilisation',
'Specialized Hospital': 'Specialised Hospital',
'Synchronization': 'Synchronisation',
Expand Down
Loading

0 comments on commit 00758eb

Please sign in to comment.