Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

One format switch button for both latitude and longitude; Fixes

  • Loading branch information...
commit f15aab49bbcdf6ec2752e4d1342853854edb97de 1 parent 2a60360
@flavour authored
View
2  VERSION
@@ -1 +1 @@
-4afaf87 (2012-04-15 14:40:32)
+8f88855 (2012-04-15 16:48:43)
View
7 controllers/project.py
@@ -293,6 +293,11 @@ def prep(r):
# Pre-process
def postp(r, output):
if r.representation == "plain":
+ def represent(record, field):
+ if field.represent:
+ return field.represent(record[field])
+ else:
+ return record[field]
# Add VirtualFields to Map Popup
# Can't inject into SQLFORM, so need to simply replace
item = TABLE()
@@ -301,7 +306,7 @@ def postp(r, output):
fields = [table[f] for f in table.fields if table[f].readable]
record = r.record
for field in fields:
- item.append(TR(TD(field.label), TD(field.represent(record[field]))))
+ item.append(TR(TD(field.label), TD(represent(record, field))))
hierarchy = gis.get_location_hierarchy()
item.append(TR(TD(hierarchy["L4"]), TD(record["name"])))
for field in ["L3", "L2", "L1"]:
View
1  modules/eden/irs.py
@@ -311,6 +311,7 @@ def model(self):
title_display = T("Incident Report Details"),
title_list = LIST_INC_REPORTS,
title_update = T("Edit Incident Report"),
+ title_upload = T("Import Incident Reports"),
title_search = T("Search Incident Reports"),
subtitle_create = T("Add New Incident Report"),
subtitle_list = T("Incident Reports"),
View
1  modules/eden/menus.py
@@ -961,6 +961,7 @@ def irs(self):
M("List All"),
M("Open Incidents", vars={"open":1}),
M("Timeline", args="timeline"),
+ M("Import", m="import"),
M("Search", m="search"),
M("Report", m="report",
vars=dict(rows="L1",
View
34 modules/s3/s3widgets.py
@@ -1613,8 +1613,10 @@ def ac_help_widget(level):
_name="gis_location_postcode",
_disabled="disabled")
- lat_widget = S3LatLonWidget("lat", True).widget(value=lat)
- lon_widget = S3LatLonWidget("lon", True).widget(value=lon)
+ lat_widget = S3LatLonWidget("lat",
+ disabled=True).widget(value=lat)
+ lon_widget = S3LatLonWidget("lon",
+ switch_button=True, disabled=True).widget(value=lon)
for level in levels:
if level == "L0":
@@ -1664,7 +1666,7 @@ def ac_help_widget(level):
postcode_widget = INPUT(_id="gis_location_postcode",
_name="gis_location_postcode")
lat_widget = S3LatLonWidget("lat").widget()
- lon_widget = S3LatLonWidget("lon").widget()
+ lon_widget = S3LatLonWidget("lon", switch_button=True).widget()
for level in levels:
hidden = ""
@@ -1897,23 +1899,22 @@ class S3LatLonWidget(DoubleWidget):
Widget for latitude or longitude input, gives option to input in terms
of degrees, minutes and seconds
"""
-
_id = ""
_name = ""
disabled = False
+ switch_button = False
- def __init__(self, type, disabled=False):
- self._id = "gis_location_%s" % type
- self._name = self._id
- self.disabled = disabled
+ def __init__(self, type, switch_button=False, disabled=False):
+ self._id="gis_location_%s" % type
+ self._name=self._id
+ self.disabled=disabled
+ self.switch_button=switch_button
def widget(self,
field = None,
value = None):
-
s3 = current.response.s3
T = current.T
- BUTTON = TAG.button
attr = dict(value=value,
_class="decimal %s" % self._class,
@@ -1930,17 +1931,20 @@ def widget(self,
INPUT(_class="degrees", **attr_dms), "° ",
INPUT(_class="minutes", **attr_dms), "' ",
INPUT(_class="seconds", **attr_dms), "\" ",
- BUTTON(T("use decimal"),
- _class="gis_coord_switch_decimal"),
+ ["",
+ DIV(A(T("Use decimal"),
+ _class="action-btn gis_coord_switch_decimal"))
+ ][self.switch_button],
_style="display: none;",
_class="gis_coord_dms"
)
decimal = SPAN(
INPUT(**attr),
- BUTTON(T("use Degrees Minutes Seconds"),
- _class="gis_coord_switch_dms"
- ),
+ ["",
+ DIV(A(T("Use deg, min, sec"),
+ _class="action-btn gis_coord_switch_dms"))
+ ][self.switch_button],
_class="gis_coord_decimal"
)
View
2  private/prepopulate/demo/IFRC/gis_layer_feature.csv
@@ -1,5 +1,5 @@
"Name","Description","Module","Resource","Symbology","Marker","GPS Marker","Popup Label","Popup Fields","REST Filter","Filter Field","Filter Value","Trackable","Folder","Visible","Enabled"
-"Events",,"irs","ireport","IFRC","incident","Danger Area","Incident Report","name/category",,,,,,"False"
+"Incidents",,"irs","ireport","IFRC","incident","Danger Area","Incident Report","name/category",,,,,,"False"
"Offices","All Active Offices","org","office","IFRC","office","Building","Office","name/organisation_id","office.type=NONE,1,2,3,4&office.obsolete=False",,,,,"False"
"Project Communities",,"project","activity","IFRC","activity",,"Project Community","name/location_id/multi_activity_type_id",,,,,,"False"
"Staff","All Active Staff","hrm","human_resource","IFRC","staff","Contact, Dreadlocks","Staff","person_id/job_title/organisation_id","human_resource.type=1&human_resource.status=1","type",1,True,,"False"
View
180 static/scripts/S3/S3.min.js
90 additions, 90 deletions not shown
View
16 static/scripts/S3/s3.locationselector.widget.js
@@ -540,16 +540,20 @@ function s3_gis_lat_lon_converter() {
});
$('.gis_coord_switch_dms').click(function (evt) {
- var wrap = get_wrap($(this));
- $('.gis_coord_dms', wrap).show();
- $('.gis_coord_decimal', wrap).hide();
+ $('.gis_coord_dms').show();
+ $('.gis_coord_decimal').hide();
+ $('.gis_coord_wrap').each(function () {
+ to_dms($(this));
+ });
evt.preventDefault();
});
$('.gis_coord_switch_decimal').click(function (evt) {
- var wrap = get_wrap($(this));
- $('.gis_coord_decimal', wrap).show();
- $('.gis_coord_dms', wrap).hide();
+ $('.gis_coord_decimal').show();
+ $('.gis_coord_dms').hide();
+ $('.gis_coord_wrap').each(function () {
+ to_decimal($(this));
+ });
evt.preventDefault();
});
View
11 static/styles/S3/locationselector.widget.css
@@ -1,14 +1,15 @@
.gis_coord_wrap .decimal {
- width: 180px;
+ width: 174px;
}
.gis_coord_wrap .gis_coord_dms input {
- width: 32px;
+ width: 37px;
}
.gis_coord_wrap .gis_coord_dms input.seconds {
- width: 64px;
+ width: 70px;
}
-.gis_coord_dms {
-font-weight: bold;
+
+.gis_coord_wrap div {
+ padding-top: 8px;
}
View
3  static/styles/S3/sahana.css
@@ -612,6 +612,9 @@ table {
text-align: justify;
line-height: 1.25;
}
+#home li {
+ margin-left: 12px;
+}
#footer {
margin: 0 auto;
clear: both;
View
2  static/styles/S3/sahana.min.css
1 addition, 1 deletion not shown
Please sign in to comment.
Something went wrong with that request. Please try again.