mirror of
https://github.com/flancian/garden.git
synced 2026-08-07 06:56:19 +00:00
Fool around with topline for way too long :)
This commit is contained in:
+3
-2
@@ -17,6 +17,7 @@ import jsons
|
||||
from flask import Blueprint, url_for, render_template, current_app, Response, redirect, request, jsonify
|
||||
from markupsafe import escape
|
||||
from slugify import slugify, SLUG_OK
|
||||
from urllib.parse import parse_qs
|
||||
from . import config
|
||||
from . import db
|
||||
from . import feed
|
||||
@@ -143,7 +144,7 @@ def push(node, other):
|
||||
@bp.route('/exec')
|
||||
@bp.route('/search')
|
||||
@bp.route('/jump')
|
||||
def jump():
|
||||
def search():
|
||||
"""Redirects to an appropriate context.
|
||||
Originally called "jump" because in the [[agora]] nodes *always* exist, as they map 1:1 to all possible queries. Thus [[agora search]].
|
||||
"""
|
||||
@@ -152,7 +153,7 @@ def jump():
|
||||
# hack hack
|
||||
# [[push]] [[2021-02-28]] in case I don't get to it today.
|
||||
if tokens[0] == 'go' and len(tokens) > 1:
|
||||
return redirect(url_for('.go', node=slugify(q[3:])))
|
||||
return redirect(url_for('.go', node=slugify(" ".join(tokens[1:]))))
|
||||
return redirect(url_for('.node', node=slugify(q)))
|
||||
|
||||
# Entities
|
||||
|
||||
@@ -48,7 +48,6 @@ nav { font-family: sans-serif}
|
||||
}
|
||||
|
||||
.navigation {
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 10px;
|
||||
@@ -67,13 +66,23 @@ nav { font-family: sans-serif}
|
||||
.navigation-item {
|
||||
}
|
||||
|
||||
.mini-cli {
|
||||
width: 350px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
.topline-container {
|
||||
display: flex;
|
||||
}
|
||||
.topline-home {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.topline-cli {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.topline-icons {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.mini-search {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid grey;
|
||||
}
|
||||
|
||||
+26
-19
@@ -29,7 +29,7 @@
|
||||
<link rel="search" type="application/opensearchdescription+xml"
|
||||
title="Agora" href={{url_for('agora.search_xml')}}>
|
||||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400" />
|
||||
<link rel="stylesheet" media="screen" type="text/css" href="{{ url_for('static',filename='css/screen-dark.css')}}?uncached16" id="theme-link" />
|
||||
<link rel="stylesheet" media="screen" type="text/css" href="{{ url_for('static',filename='css/screen-dark.css')}}?uncached18" id="theme-link" />
|
||||
<script type=text/javascript src="{{url_for('static', filename='js/main.js')}}"></script>
|
||||
<!-- considering this way of integrating hypothesis, although I like "standard" (sidebar) mode.
|
||||
<script type="application/json" class="js-hypothesis-config">
|
||||
@@ -42,11 +42,19 @@
|
||||
<script src="https://hypothes.is/embed.js" async></script>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<nav class="topline-container">
|
||||
|
||||
<div class="topline-home">
|
||||
<a href="/"><img src="/static/img/agora.png" class="logo" width="20px" height="20px"></a>
|
||||
<a href="/"><strong>in the agora ↪</strong></a>
|
||||
</div>
|
||||
<div class="topline-cli">
|
||||
<form action="/exec" method="get">
|
||||
<input id="mini-cli" type="text" value="{{qstr}}" name="q" autofocus>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="navigation">
|
||||
<a href="/"><img src="/static/img/agora.png" class="logo" width="20px" height="20px"></a>
|
||||
<a href="/"><strong>anagora.org</strong></a>
|
||||
|
|
||||
<a href="/nodes">nodes</a>
|
||||
|
|
||||
<a href="/users">@</a>
|
||||
@@ -59,22 +67,21 @@
|
||||
|
|
||||
<a href="/node/agora-help" style="text-decoration: none;" class="help-button">❓</a>
|
||||
|
|
||||
<a href="/node/agora-cli">cli →</a>
|
||||
<form action="/exec" style="display: inline;" method="get">
|
||||
<input class="mini-cli" id="mini-cli" type="text" value="{{qstr}}" name="q" autofocus>
|
||||
</form>
|
||||
<a href="/node/agora-cli">cli</a>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="mini-search">
|
||||
<strong>Search on ↪</strong>
|
||||
<a href="https://www.google.com/search?q={{q}}">Google</a>
|
||||
| <a href="https://www.duckduckgo.com/{{q}}">DDG</a>
|
||||
| <a href="https://en.wikipedia.org/wiki/Special:Search/{{q}}">Wikipedia</a>
|
||||
| <a href="https://twitter.com/search/?f=live&q={{q}}">Twitter</a>
|
||||
| <a href="https://github.com/search?q={{q}}">Github</a>
|
||||
| <a href="http://encyclopedia.uia.org/en/problems?combine={{q}}">World Problems</a>
|
||||
| <a href="https://www.pubpub.org/search?q={{q}}">PubPub</a>
|
||||
</div>
|
||||
|
||||
<div class="mini-search">
|
||||
<strong>in the internet ↪</strong>
|
||||
<a href="https://www.google.com/search?q={{q}}">google</a>
|
||||
| <a href="https://www.duckduckgo.com/{{q}}">ddg</a>
|
||||
| <a href="https://en.wikipedia.org/wiki/Special:Search/{{q}}">wp</a>
|
||||
| <a href="https://twitter.com/search/?f=live&q={{q}}">twitter</a>
|
||||
| <a href="https://github.com/search?q={{q}}">gh</a>
|
||||
| <a href="http://encyclopedia.uia.org/en/problems?combine={{q}}">uia</a>
|
||||
| <a href="https://www.pubpub.org/search?q={{q}}">pp</a>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user