Skip to content

Commit

Permalink
Merge pull request #24 from KaartGroup/kaart-stage
Browse files Browse the repository at this point in the history
Merge for v3.4.4 w/hotfixes
  • Loading branch information
Zack LaVergne authored Sep 9, 2019
2 parents 937578a + 69530a5 commit 1f13b9a
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 22 deletions.
3 changes: 1 addition & 2 deletions client/app/project/project.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,6 @@
vm.isSelectedMappable = true;
vm.lockedTaskData = data;
vm.lockTime[taskId] = getLastLockedAction(vm.lockedTaskData).actionDate;
vm.isSelectedSplittable = isTaskSplittable(vm.taskVectorLayer.getSource().getFeatures(), data.taskId);
formatHistoryComments(vm.selectedTaskData.taskHistory);
}, function (error) {
onLockError(projectId, error);
Expand Down Expand Up @@ -1446,7 +1445,7 @@
};

/**
* Call api to lock currently selected task for validation. Will update view and map after unlock.
* Call api to lock currently selected task for validation. Will update view and map after unlock.
*/
vm.lockSelectedTaskValidation = function () {
// if(vm.user.isEmailVerified){
Expand Down
18 changes: 11 additions & 7 deletions server/services/mapping_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ def generate_gpx(project_id: int, task_ids_str: str, timestamp=None):
ET.SubElement(trkseg, 'trkpt', attrib=dict(lon=str(point[0]), lat=str(point[1])))

# Append wpt elements to end of doc
# wpt = ET.Element('wpt', attrib=dict(lon=str(point[0]), lat=str(point[1])))
# root.append(wpt)
wpt = ET.Element('wpt', attrib=dict(lon=str(point[0]), lat=str(point[1])))
root.append(wpt)

xml_gpx = ET.tostring(root, encoding='utf8')
return xml_gpx
Expand Down Expand Up @@ -299,16 +299,14 @@ def generate_project_file_osm_xml(project_id: int, file_id: int, task_ids_str: s
os.makedirs(filedir)

tasks_file = os.path.join(filedir, "{project_id}_tasks.geojson".format(project_id=str(project_id)))
current_app.logger.debug(tasks_file)

with open(tasks_file, 'w') as t:
t.write(str(tasks))

# Convert the geojson features into separate .poly files
# to use with osmosis
poly_cmd = './server/tools/ogr2poly.py {file} -p {filedir}/ -f taskId'.format(file=tasks_file, filedir=filedir)
current_app.logger.debug(poly_cmd)
subprocess.call(poly_cmd, shell=True)
subprocess.check_output(poly_cmd, shell=True)
os.remove(tasks_file)

osm_files = []
Expand All @@ -317,7 +315,13 @@ def generate_project_file_osm_xml(project_id: int, file_id: int, task_ids_str: s
task_cmd = './server/tools/osmosis/bin/osmosis --rx file={xml} enableDateParsing=no --bp completeWays=yes clipIncompleteEntities=true file={task_poly} --wx file={task_xml}'.format(
xml=os.path.join(dto.path, dto.file_name),
task_poly=os.path.join(filedir, poly),
task_xml=os.path.join(filedir, "task_{task_id}_{file_name}.osm".format(task_id=os.path.splitext(poly)[0], file_name=os.path.splitext(dto.file_name)[0]))
task_xml=os.path.join(
filedir,
"task_{task_id}_{file_name}.osm".format(
task_id=os.path.splitext(poly)[0],
file_name=os.path.splitext(dto.file_name)[0]
)
)
)
osm_files.append(
os.path.join(
Expand All @@ -327,7 +331,7 @@ def generate_project_file_osm_xml(project_id: int, file_id: int, task_ids_str: s
file_name=os.path.splitext(dto.file_name)[0])
)
)
subprocess.call(task_cmd, shell=True)
subprocess.check_output(task_cmd, shell=True)
os.remove(os.path.join(filedir, poly))

# Merge the extracted files back together. Used if more than one task is sent in request.
Expand Down
4 changes: 2 additions & 2 deletions server/services/messaging/smtp_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def send_verification_email(to_address: str, username: str):
text_template = text_template.replace('[USERNAME]', username)
text_template = text_template.replace('[VEFIFICATION_LINK]', verification_url)

subject = 'HOT Tasking Manager - Email Verification'
subject = 'Kaart Tasking Manager - Email Verification'
SMTPService._send_mesage(to_address, subject, html_template, text_template)

return True
Expand All @@ -50,7 +50,7 @@ def send_email_alert(to_address: str, username: str):
text_template = text_template.replace('[USERNAME]', username)
text_template = text_template.replace('[PROFILE_LINK]', inbox_url)

subject = 'You have a new message on the HOT Tasking Manager'
subject = 'You have a new message on the Kaart Tasking Manager'
SMTPService._send_mesage(to_address, subject, html_template, text_template)

return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a href="[VEFIFICATION_LINK]">Click here to verify your email address</a><br><br>
Please ignore this email if you have received it by mistake.<br><br>
Many thanks<br>
HOT Mapping Team<br>
Kaart<br>
</p>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Thank you for supply your email address, please click the link below to verify y
Please ignore this email if you have received it by mistake.

Many thanks
HOT Mapping Team
Kaart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Hi [USERNAME],<br />
<br />
Congratulations! Your'e now an [LEVEL] mapper.<br />
Congratulations! You're now an [LEVEL] mapper.<br />
Thank you very much for mapping!<br />
We encourage you to continue your contribution to HOT.<br />
You can now begin validating tasks across projects. <br />
<br />
Many thanks <br />
HOT Mapping Team
Kaart
4 changes: 2 additions & 2 deletions server/services/messaging/templates/message_alert_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<body>
<p>
Hi [USERNAME]<br><br>
You have a new message on the HOT Tasking Manager.<br><br>
You have a new message on the Kaart Tasking Manager.<br><br>
<a href="[PROFILE_LINK]">Click here to view it.</a>.<br><br>
Many thanks,<br>
Humanitarian OpenStreetMap Team<br><br>
Kaart<br><br>
Please note: You can now opt-out of all automated validation<br>
messages by visiting your User Profile and clicking "Edit-Add Contact Details."<br><br>
</p>
Expand Down
4 changes: 2 additions & 2 deletions server/services/messaging/templates/message_alert_en.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Hi [USERNAME]

You have a new message on the HOT Tasking Manager. Click the link below to view it.
You have a new message on the Kaart Tasking Manager. Click the link below to view it.

[PROFILE_LINK]

Please note: You can now opt-out of all automated validation messages by visiting your User Profile and clicking "Edit-Add Contact Details."

Many thanks,
Humanitarian OpenStreetMap Team
Kaart
4 changes: 1 addition & 3 deletions server/services/messaging/templates/welcome_message_en.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
Hi [USERNAME],<br />
<br />
Welcome to the HOT Tasking Manager, we hope you will enjoy being part of the community that is helping map the world.<br />
Welcome to the Kaart Tasking Manager, we hope you will enjoy being part of the community that is helping map the world.<br />
<br />
In order to be notified on project updates and feedback on your mapping, you have to add your email address to your profile by clicking on the link below.<br />
<br />
<a href="[PROFILE_LINK]">Update your profile here</a><br />
<br />
Thank you very much!<br />
<br />
On behalf of the Humanitarian OpenStreetMap Team volunteer and staff community we want to welcome you to humanitarian mapping and the wider OpenStreetMap community.<br />
<br />
For a much more detailed welcome letter, please visit <a href="https://wiki.openstreetmap.org/wiki/Humanitarian_OSM_Team/TM_Welcome_Letter">the OSM Wiki Tasking Manager Welcome page</a>. It has links to great learning resources if you want to learn more right away!

0 comments on commit 1f13b9a

Please sign in to comment.