Skip to content

Commit

Permalink
Merge pull request #18 from geometalab/remarks
Browse files Browse the repository at this point in the history
Remarks
  • Loading branch information
Zverik committed Feb 14, 2018
2 parents 0d03ae2 + 4a83199 commit d821c40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion www/audit.py
@@ -1,5 +1,5 @@
from www import app
from db import database, User, Feature, Project, Task, fn_Random
from .db import database, User, Feature, Project, Task, fn_Random
from flask import session, url_for, redirect, request, render_template, flash, jsonify
from flask_oauthlib.client import OAuth
from peewee import fn
Expand Down
13 changes: 12 additions & 1 deletion www/static/audit.js
Expand Up @@ -91,6 +91,7 @@ $(function() {
defaultTitle = $('#title').html();
$('#hint').hide();
$('#last_action').hide();
$('#remarks_box').hide();
map1.on('zoomend', function() {
if (map1.getZoom() >= 10) {
if (readonly) {
Expand Down Expand Up @@ -191,7 +192,8 @@ function displayPoint(data, audit) {
props = data['properties'],
canMove = !readonly && (props['can_move'] || props['action'] == 'create'),
refCoord = props['action'] == 'create' ? coord : props['ref_coords'],
wereCoord = props['were_coords'];
wereCoord = props['were_coords'],
remarks = props['remarks'];

var $good = $('#good');
$good.text('Good');
Expand Down Expand Up @@ -435,6 +437,14 @@ function displayPoint(data, audit) {
}
}

// render remarks, if any.
if (remarks) {
$('#remarks_box').show();
$('#remarks_content').text(remarks);
} else {
$('#remarks_box').hide();
}

// Render the table
function esc(s) {
s = s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
Expand Down Expand Up @@ -504,6 +514,7 @@ function hidePoint() {
$('#hint').hide();
$('#last_action').hide();
$('#fixme_box').hide();
$('#remarks_box').hide();
$('#title').html(defaultTitle);
if (marker2) {
map1.removeLayer(marker2);
Expand Down
3 changes: 3 additions & 0 deletions www/templates/task.html
Expand Up @@ -39,6 +39,9 @@ <h1 id="title">{{ project.title }}</h1>
<p>Value for the <tt>fixme</tt> tag if needed:<br>
<input type="text" id="fixme"></p>
</div>
<div id="remarks_box">
<b>Remarks:</b> <span id="remarks_content"></span>
</div>
<div id="buttons">
<button id="good" class="b_good">Good</button>
<button id="bad" class="b_bad">Don't Change</button>
Expand Down

0 comments on commit d821c40

Please sign in to comment.