Skip to content

Commit

Permalink
CAP: More Help tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
biplovbhandari committed Oct 8, 2015
1 parent f8e439b commit a457a29
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
31 changes: 31 additions & 0 deletions controllers/cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ def area():
"""

def prep(r):
area_fields_comments()
artable = s3db.cap_area
for f in ("alert_id", "info_id"):
field = artable[f]
Expand Down Expand Up @@ -1090,6 +1091,12 @@ def area_fields_comments():
"""

table = db.cap_area
table.info_id.comment = DIV(
_class="tooltip",
_title="%s|%s" % (
T("Information segment for this Area segment"),
T("To which Information segment is this Area segment related. Note an Information segment can have multiple Area segments.")))

table.name.comment = DIV(
_class="tooltip",
_title="%s|%s" % (
Expand Down Expand Up @@ -1120,6 +1127,18 @@ def area_fields_comments():
T("The maximum altitude of the affected area"),
T("must not be used except in combination with the 'altitude' element. The ceiling measure is in feet above mean sea level.")))

table.event_type_id.comment = DIV(
_class="tooltip",
_title="%s|%s" % (
T("Event Type of this predefined alert area"),
T("Event Type relating to this predefined area.")))

table.priority.comment = DIV(
_class="tooltip",
_title="%s|%s" % (
T("Priority of the Event Type"),
T("Defines the priority of the Event Type for this predefined area.")))

# -----------------------------------------------------------------------------
def info_fields_comments():
"""
Expand All @@ -1145,6 +1164,18 @@ def info_fields_comments():
T("The text denoting the type of the subject event of the alert message"),
T("If not specified, will the same as the Event Type.")))

table.event_type_id.comment = DIV(
_class="tooltip",
_title="%s|%s" % (
T("Event Type of the alert message"),
T("Event field above is more general. And this Event Type is classification of event. For eg. Event can be 'Terrorist Attack' and Event Type can be either 'Terrorist Bomb Explosion' or 'Terrorist Chemical Waefare Attack'. If not specified, will the same as the Event Type.")))

table.priority.comment = DIV(
_class="tooltip",
_title="%s|%s" % (
T("Priority of the alert message"),
T("Defines the priority of the alert message. Selection of the priority automatically sets the value for 'Urgency', 'Severity' and 'Certainty'")))

table.response_type.comment = DIV(
_class="tooltip",
_title="%s|%s" % (
Expand Down
39 changes: 39 additions & 0 deletions modules/s3db/cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,31 +565,70 @@ def model(self):
Field("priority_rank", "integer",
label = T("Priority Rank"),
length = 2,
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("Priority Rank"),
T("The Priority Rank is basically to give it a ranking 1, 2, ..., n. That way we know 1 is the most important of the chain and n is lowest element. For eg. (1, Signal 1), (2, Signal 2)..., (5, Signal 5) to enumerate the priority for cyclone."))),
),
Field("event_code",
label = T("Event Code"),
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("Event Code"),
T("Code (key) for the event like for eg. (2001, Typhoon), (2002, Flood)"))),
),
Field("name", notnull=True, length=64,
label = T("Name"),
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("Name"),
T("The actual name for the warning priority, for eg. Typhoons in Philippines have five priority name (PSWS# 1, PSWS# 2, PSWS# 3, PSWS# 4 and PSWS# 5)"))),
),
Field("event_type",
label = T("Event Type"),
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("Event Type"),
T("The Event to which this priority is targeted for. The 'Event Type' is the name of the standard Eden Event Type . These are available at /eden/event/event_type (The 'Event Type' should be exactly same as in /eden/event/event_type - case sensitive). For those events which are not in /eden/event/event_type but having the warning priority, you can create the event type using /eden/event/event_type/create and they will appear in this list."))),
),
Field("urgency",
label = T("Urgency"),
requires = IS_IN_SET(cap_info_urgency_opts),
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("Denotes the urgency of the subject event of the alert message"),
T("The urgency, severity, and certainty of the information collectively distinguish less emphatic from more emphatic messages." +
"'Immediate' - Responsive action should be taken immediately" +
"'Expected' - Responsive action should be taken soon (within next hour)" +
"'Future' - Responsive action should be taken in the near future" +
"'Past' - Responsive action is no longer required" +
"'Unknown' - Urgency not known"))),
),
Field("severity",
label = T("Severity"),
requires = IS_IN_SET(cap_info_severity_opts),
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("Denotes the severity of the subject event of the alert message"),
T("The urgency, severity, and certainty elements collectively distinguish less emphatic from more emphatic messages." +
"'Extreme' - Extraordinary threat to life or property" +
"'Severe' - Significant threat to life or property" +
"'Moderate' - Possible threat to life or property" +
"'Minor' - Minimal to no known threat to life or property" +
"'Unknown' - Severity unknown"))),
),
Field("certainty",
label = T("Certainty"),
requires = IS_IN_SET(cap_info_certainty_opts),
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("Denotes the certainty of the subject event of the alert message"),
T("The urgency, severity, and certainty elements collectively distinguish less emphatic from more emphatic messages." +
"'Observed' - Determined to have occurred or to be ongoing" +
"'Likely' - Likely (p > ~50%)" +
"'Possible' - Possible but not likely (p <= ~50%)" +
"'Unlikely' - Not expected to occur (p ~ 0)" +
"'Unknown' - Certainty unknown"))),
),
Field("color_code",
label = T("Color Code"),
widget = S3ColorPickerWidget(),
comment = DIV(_class="tooltip",
_title="%s|%s" % (T("The color code for this priority"),
T("Pick from the color widget the color that is associated to this priority of the event. The color code is in hex format"))),
),
*s3_meta_fields())

Expand Down

0 comments on commit a457a29

Please sign in to comment.