1

Display compatibility score on the client

This commit is contained in:
Alex Yatskov 2015-03-26 13:09:58 +09:00
parent 474d02ebcb
commit da0ed3a356
3 changed files with 6 additions and 2 deletions

View File

@ -83,6 +83,7 @@ func executeQuery(rw http.ResponseWriter, req *http.Request) {
Name: value.name,
Url: value.url,
Score: value.score,
Compatibility: value.compatibility,
DistanceToUser: value.distanceToUser,
DistanceToStn: value.distanceToStn,
ClosestStn: value.closestStn,

View File

@ -100,8 +100,9 @@
<th>Distance to user</th>
<th>Closest station</th>
<th>Distance to station</th>
<th>Access count</th>
<th>Compatibility</th>
<th>Score</th>
<th>Access count</th>
</tr>
</thead>
{{#each records}}
@ -110,8 +111,9 @@
<td>{{#prettyFloat 2}}{{distanceToUser}}{{/prettyFloat}} km</td>
<td>{{closestStn}}</td>
<td>{{distanceToStn}} m</td>
<td>{{accessCount}}</td>
<td>{{#prettyFloat 4}}{{compatibility}}{{/prettyFloat}}</td>
<td>{{#prettyFloat 4}}{{score}}{{/prettyFloat}}</td>
<td>{{accessCount}}</td>
</tr>
{{/each}}
</table>

View File

@ -59,6 +59,7 @@ type jsonProjection struct {
type jsonRecord struct {
AccessCount int `json:"accessCount"`
ClosestStn string `json:"closestStn"`
Compatibility float64 `json:"compatibility"`
DistanceToStn float64 `json:"distanceToStn"`
DistanceToUser float64 `json:"distanceToUser"`
Id int `json:"id"`