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 Oct 21, 2019
2 parents bc4aac1 + 0f35035 commit 06f7a2e
Show file tree
Hide file tree
Showing 31 changed files with 10,222 additions and 936 deletions.
2,131 changes: 2,093 additions & 38 deletions languages/ar.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions languages/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -3128,6 +3128,7 @@
'Names, IDs, Reference Numbers, Contact Information, Addresses': 'Namen, ID, Referenznummern, Kontaktinformationen, Addressen',
'National ID Card': 'Nationaler Identitätsnachweis',
'National NGO': 'Nationale NGO',
'Nationality lacking!': 'Nationalität fehlt!',
'Nationality of the person.': 'Nationalität der Person.',
'Nationality': 'Nationalität',
'Nautical Accident': 'See-Unfall',
Expand Down Expand Up @@ -3662,6 +3663,7 @@
'Performance Indicators': 'Leistungskennzahlen',
'Performance Rating': 'Leistungsbeurteilung',
'Permanent Home Address': 'Dauerhafte Heimatadresse',
'Persian': 'Farsi',
'Person 1, Person 2 are the potentially duplicate records': 'Person 1 und Person 2 sind möglicherweise Duplikate',
'Person De-duplicator': 'Dubletten in Personen auflösen',
'Person Details': 'Details zur Person',
Expand Down Expand Up @@ -5630,6 +5632,7 @@
'tweepy module not available within the running Python - this needs installing for non-Tropo Twitter support!': 'Tweepy Modul nicht verfügbar in der aktuellen Python Umgebung läuft - das benötigt die Installation einer none-Tropo Twitter Unterstützung!',
'unable to parse csv file': 'CSV Datei kann nicht analysiert werden',
'uncheck all': 'Alles deselektieren',
'unclear': 'ungeklärt',
'unidentified': 'nicht identifiziert',
'unknown': 'unbekannt',
'unspecified': 'unspezifiziert',
Expand Down
6,605 changes: 6,593 additions & 12 deletions languages/th.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions modules/s3/s3filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,11 @@ def widget(self, resource, values):
timepicker = False if ftype == "date" or hide_time else True
if timepicker and "datetimepicker" not in input_class:
input_class += " datetimepicker"
if ftype != "date" and hide_time:
# Indicate that this filter is for a datetime field but
# with a hidden time selector (so it shall add a suitable
# time fragment automatically)
input_class += " hide-time"

for operator in operators:

Expand Down
3 changes: 3 additions & 0 deletions modules/s3/s3organizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,9 @@ def html(self, widget_id=None, formkey=None):
tformat = settings.get_ui_organizer_time_format()
if tformat:
script_opts["timeFormat"] = tformat
snap_duration = settings.get_ui_organizer_snap_duration()
if snap_duration:
script_opts["snapDuration"] = snap_duration

self.inject_script(widget_id, script_opts)

Expand Down
2 changes: 1 addition & 1 deletion modules/s3/s3report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ def _sortdim(items, rfield, index=3):
if isinstance(requires, IS_IN_SET):
sortby = "text"

elif ftype[:9] == "reference":
elif ftype[:9] == "reference" or ftype[:8] == "list:ref":
# Sort foreign keys by their representation
sortby = "text"

Expand Down
20 changes: 20 additions & 0 deletions modules/s3cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2516,6 +2516,12 @@ def get_ui_organizer_time_format(self):
"""
return self.__lazy("ui", "organizer_time_format", None)

def get_ui_organizer_snap_duration(self):
"""
Snap raster width in organizer (hh:mm:ss), default 00:15:00
"""
return self.__lazy("ui", "organizer_snap_duration", None)

# =========================================================================
# Messaging
#
Expand Down Expand Up @@ -3761,6 +3767,12 @@ def get_dvr_response_due_date(self):
return self.get_dvr_response_planning() and \
self.__lazy("dvr", "response_due_date", default=False)

def get_dvr_response_use_time(self):
"""
Use date+time for responses rather than just date
"""
return self.__lazy("dvr", "response_use_time", default=False)

def get_dvr_response_types(self):
"""
Use response type categories
Expand Down Expand Up @@ -5023,6 +5035,14 @@ def get_pr_hide_third_gender(self):
"""
return self.__lazy("pr", "hide_third_gender", default=True)

def get_pr_nationality_explicit_unclear(self):
"""
Have an explicit "unclear" option for nationality, useful
when the field shall be mandatory yet allow for cases
where the nationality of a person is unclear
"""
return self.pr.get("nationality_explicit_unclear", False)

def get_pr_import_update_requires_email(self):
"""
During imports, records are only updated if the import
Expand Down
57 changes: 53 additions & 4 deletions modules/s3db/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"""

__all__ = ("S3DocumentLibrary",
"S3DocumentTagModel",
"S3CKEditorModel",
"S3DataCardModel",
"doc_image_represent",
Expand Down Expand Up @@ -68,6 +69,7 @@ def model(self):
UNKNOWN_OPT = messages.UNKNOWN_OPT

# Shortcuts
add_components = self.add_components
configure = self.configure
crud_strings = s3.crud_strings
define_table = self.define_table
Expand Down Expand Up @@ -126,10 +128,10 @@ def model(self):

# Components
doc_id = "doc_id"
self.add_components(tablename,
doc_document = doc_id,
doc_image = doc_id,
)
add_components(tablename,
doc_document = doc_id,
doc_image = doc_id,
)

# ---------------------------------------------------------------------
# Documents
Expand Down Expand Up @@ -256,6 +258,10 @@ def model(self):
represent),
)

add_components(tablename,
doc_document_tag = document_id,
)

# ---------------------------------------------------------------------
# Images
#
Expand Down Expand Up @@ -533,6 +539,49 @@ def document_ondelete(row):
args = [document],
)

# =============================================================================
class S3DocumentTagModel(S3Model):
"""
Document Tags
"""

names = ("doc_document_tag",)

def model(self):

T = current.T

# ---------------------------------------------------------------------
# Document Tags
# - Key-Value extensions
# - can be used to provide conversions to external systems
# - can be a Triple Store for Semantic Web support
# - can be used to add a document type
# - can be used to add custom fields
#
tablename = "doc_document_tag"
self.define_table(tablename,
self.doc_document_id(),
# key is a reserved word in MySQL
Field("tag",
label = T("Key"),
),
Field("value",
label = T("Value"),
),
s3_comments(),
*s3_meta_fields())

self.configure(tablename,
deduplicate = S3Duplicate(primary = ("document_id",
"tag",
),
),
)

# Pass names back to global scope (s3.*)
return {}

# =============================================================================
def doc_image_represent(filename):
"""
Expand Down
Loading

0 comments on commit 06f7a2e

Please sign in to comment.