Fool around with topline for way too long :)

This commit is contained in:
2021-03-12 21:49:59 +01:00
parent d6a1d42935
commit a7134f4b4d
3 changed files with 43 additions and 26 deletions
+3 -2
View File
@@ -17,6 +17,7 @@ import jsons
from flask import Blueprint, url_for, render_template, current_app, Response, redirect, request, jsonify from flask import Blueprint, url_for, render_template, current_app, Response, redirect, request, jsonify
from markupsafe import escape from markupsafe import escape
from slugify import slugify, SLUG_OK from slugify import slugify, SLUG_OK
from urllib.parse import parse_qs
from . import config from . import config
from . import db from . import db
from . import feed from . import feed
@@ -143,7 +144,7 @@ def push(node, other):
@bp.route('/exec') @bp.route('/exec')
@bp.route('/search') @bp.route('/search')
@bp.route('/jump') @bp.route('/jump')
def jump(): def search():
"""Redirects to an appropriate context. """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]]. 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 # hack hack
# [[push]] [[2021-02-28]] in case I don't get to it today. # [[push]] [[2021-02-28]] in case I don't get to it today.
if tokens[0] == 'go' and len(tokens) > 1: 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))) return redirect(url_for('.node', node=slugify(q)))
# Entities # Entities
+14 -5
View File
@@ -48,7 +48,6 @@ nav { font-family: sans-serif}
} }
.navigation { .navigation {
width: 100%;
vertical-align: middle; vertical-align: middle;
overflow-y: auto; overflow-y: auto;
margin-bottom: 10px; margin-bottom: 10px;
@@ -67,13 +66,23 @@ nav { font-family: sans-serif}
.navigation-item { .navigation-item {
} }
.mini-cli { .topline-container {
width: 350px; display: flex;
height: 20px; }
line-height: 20px; .topline-home {
margin-right: 10px;
}
.topline-cli {
margin-right: 10px;
}
.topline-icons {
flex-grow: 1;
} }
.mini-search { .mini-search {
padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid grey; border-bottom: 1px solid grey;
} }
+24 -17
View File
@@ -29,7 +29,7 @@
<link rel="search" type="application/opensearchdescription+xml" <link rel="search" type="application/opensearchdescription+xml"
title="Agora" href={{url_for('agora.search_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" 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> <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. <!-- considering this way of integrating hypothesis, although I like "standard" (sidebar) mode.
<script type="application/json" class="js-hypothesis-config"> <script type="application/json" class="js-hypothesis-config">
@@ -42,11 +42,19 @@
<script src="https://hypothes.is/embed.js" async></script> <script src="https://hypothes.is/embed.js" async></script>
</head> </head>
<body> <body>
<nav> <nav class="topline-container">
<div class="navigation">
<div class="topline-home">
<a href="/"><img src="/static/img/agora.png" class="logo" width="20px" height="20px"></a> <a href="/"><img src="/static/img/agora.png" class="logo" width="20px" height="20px"></a>
<a href="/"><strong>anagora.org</strong></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="/nodes">nodes</a> <a href="/nodes">nodes</a>
| |
<a href="/users">@</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-help" style="text-decoration: none;" class="help-button"></a>
| |
<a href="/node/agora-cli">cli</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>
</div> </div>
</nav> </nav>
<div class="mini-search"> <div class="mini-search">
<strong>Search on</strong> <strong>in the internet</strong>
<a href="https://www.google.com/search?q={{q}}">Google</a> <a href="https://www.google.com/search?q={{q}}">google</a>
| <a href="https://www.duckduckgo.com/{{q}}">DDG</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://en.wikipedia.org/wiki/Special:Search/{{q}}">wp</a>
| <a href="https://twitter.com/search/?f=live&q={{q}}">Twitter</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="https://github.com/search?q={{q}}">gh</a>
| <a href="http://encyclopedia.uia.org/en/problems?combine={{q}}">World Problems</a> | <a href="http://encyclopedia.uia.org/en/problems?combine={{q}}">uia</a>
| <a href="https://www.pubpub.org/search?q={{q}}">PubPub</a> | <a href="https://www.pubpub.org/search?q={{q}}">pp</a>
</div> </div>
<div class="content"> <div class="content">
{% block content %} {% block content %}
{% endblock %} {% endblock %}