fix indexed sites
This commit is contained in:
parent
ccdd13a188
commit
0ca6a2b490
9
app.py
9
app.py
@ -17,9 +17,14 @@ def parsetime(value):
|
|||||||
def index():
|
def index():
|
||||||
statement = 'SELECT "id", "name", "website", "comment", "date", "ip" FROM "entries" ORDER BY id DESC'
|
statement = 'SELECT "id", "name", "website", "comment", "date", "ip" FROM "entries" ORDER BY id DESC'
|
||||||
cs.execute(statement)
|
cs.execute(statement)
|
||||||
return render_template("index.html", comments=cs.fetchall())
|
comments = cs.fetchall()
|
||||||
|
statement = 'SELECT DISTINCT website FROM entries'
|
||||||
|
cs.execute(statement)
|
||||||
|
sites = cs.fetchall()
|
||||||
|
print(sites)
|
||||||
|
return render_template("index.html", comments=comments, sites=sites)
|
||||||
|
|
||||||
@app.route('/submit', methods=["POST"])
|
@app.route('/gb/submit', methods=["POST"])
|
||||||
def submit():
|
def submit():
|
||||||
errors = []
|
errors = []
|
||||||
name = request.form.get("name")
|
name = request.form.get("name")
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<button>submit</button>
|
<button>submit</button>
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
<b>Sites indexed</b>: {% for comment in comments %}<a href="http://{{comment[2]}}">{{comment[2]}}</a> {% endfor %}
|
<b>Sites indexed</b>: {% for site in sites %}<a href="http://{{site[0]}}">{{site[0]}}</a> {% endfor %}
|
||||||
<hr>
|
<hr>
|
||||||
{% for comment in comments %}
|
{% for comment in comments %}
|
||||||
<div class="comment">
|
<div class="comment">
|
||||||
|
Loading…
Reference in New Issue
Block a user