Browse Source

Add title to listing table

pm2
Luke Childs 8 years ago
parent
commit
14771aaa13
  1. 3
      viewModels/listing.js
  2. 1
      views/listing.html

3
viewModels/listing.js

@ -2,10 +2,12 @@ const tor = require('../lib/tor');
module.exports = (req, res) => {
let title = 'Top 10 nodes by consensus weight';
const query = {
limit: 10
};
if(req.query.s) {
title = `Search results for "${req.query.s}"`;
query.search = req.query.s;
} else {
query.order = '-consensus_weight';
@ -13,6 +15,7 @@ module.exports = (req, res) => {
}
tor.listNodes(query).then(nodes => res.render('listing.html', {
title: title,
nodes: nodes
}));
}

1
views/listing.html

@ -1,6 +1,7 @@
{% extends 'index.html' %}
{% block main %}
<h2>{{ title }}</h2>
<table>
<thead>
<tr>

Loading…
Cancel
Save