Well, a lot.

This commit is contained in:
2021-02-27 20:44:11 +01:00
parent 4908f763e5
commit d888357d97
11 changed files with 195 additions and 220 deletions
+5 -4
View File
@@ -176,7 +176,8 @@ def node(node,user_list=[]):
search_subnodes = db.search_subnodes(node)
return render_template(
'node_rendered.html',
# yuck
'content.html',
node=n,
backlinks=n.back_links(),
pull_nodes=n.pull_nodes() if n.subnodes else permutations,
@@ -184,7 +185,7 @@ def node(node,user_list=[]):
search=search_subnodes,
pulling_nodes=n.pulling_nodes(),
pushing_nodes=n.pushing_nodes(),
q=n.wikilink.replace('-', '%20'),
query=n.wikilink.replace('-', '%20'),
# disabled a bit superstitiously due to [[heisenbug]] after I added this everywhere :).
# sorry for the fuzzy thinking but I'm short on time and want to get things done.
# (...famous last words).
@@ -235,14 +236,14 @@ def subnode(node, user):
search_subnodes = db.search_subnodes_by_user(node, user)
return render_template(
'subnode_rendered.html',
'subnode.html',
node=n,
)
@bp.route('/subnode/<path:subnode>')
def old_subnode(subnode):
return render_template('subnode_rendered.html', subnode=db.subnode_by_uri(subnode), backlinks=db.subnodes_by_outlink(subnode))
return render_template('subnode.html', subnode=db.subnode_by_uri(subnode), backlinks=db.subnodes_by_outlink(subnode))
@bp.route('/u/<user>')
@bp.route('/user/<user>')
+32 -64
View File
@@ -30,7 +30,7 @@ nav { font-family: sans-serif}
padding: 0.8em; background: white; }
.entries { list-style: none; margin: 0; padding: 0; }
.add-entry { font-size: 0.9em; border-bottom: 1px solid #ccc; }
.add-entry dl { font-weight: bold; }
.add-entry dl { font-weight: bolder; }
.metanav { text-align: right; font-size: 0.8em; padding: 0.3em;
margin-bottom: 1em; background: #fafafa; }
.flash { background: #cee5F5; padding: 0.5em;
@@ -47,28 +47,37 @@ nav { font-family: sans-serif}
content: "]]"
}
.subnode {
/* background: #351a4a; */
/* background: #2a153b; */
background: #12091a;
color: #cfcfcf;
padding: 0.5em;
margin-bottom: 10px;
border-radius: 10px;
.node, .context, .stoa {
/*border-color: #7f5af0;*/
border-color: gray;
border-style: dotted;
margin: 10px;
border-radius: 20px;
padding: 10px;
}
.pulled-subnode {
.subnode, .links {
background: #12091a;
/* background: #150d38; */
color: #cfcfcf;
padding: 10px;
margin: 10px;
border-radius: 20px;
}
.pulled-subnode, .pushed-subnode, .search, .stoa-public {
background: #101010;
color: #cfcfcf;
padding: 0.5em;
margin-bottom: 10px;
border-radius: 10px;
padding: 10px;
margin: 10px;
border-radius: 20px;
}
.node-header {
.node-header, .context-header, .stoa-header {
text-align: left;
margin-bottom: 1em;
margin-left: 0.2em;
font-weight: bolder;
}
.not-found {
@@ -82,43 +91,27 @@ nav { font-family: sans-serif}
/*.subnode li { margin: 0.8em 1.2em; }*/
/*.subnode li h2 { margin-left: -1em; }*/
.subnode-header {
.subnode-header, .subnode-footer, .links-header, .search-header, .subnode-id {
font-style: italic;
font-weight: bolder;
width: 100%;
margin-bottom: 10px;
border-radius: 10px;
display: inline-block;
}
.subnode-footer {
font-style: italic;
width: 100%;
background: #1f1f1f;
color: #cfcfcf;
margin-bottom: 10px;
border-radius: 10px;
.links-subnode {
}
.subnode-id {
.links-flex {
display: flex;
}
.subnode-links {
.search-flex {
display: flex;
}
.links {
width: 100%;
display: flex;
background: #080808;
color: #cfcfcf;
padding: 0.5em;
margin-bottom: 10px;
border-radius: 10px;
overflow: auto;
gap: 10px;
/*
-webkit-transition: height 2s;
transition: height 2s;
*/
max-height: 250px;
}
@@ -162,53 +155,28 @@ nav { font-family: sans-serif}
.pushlinks {
width: 20%;
background: #080808;
color: #cfcfcf;
}
.pulllinks {
width: 20%;
background: #080808;
color: #cfcfcf;
}
.forwardlinks {
background: #080808;
width: 50%;
}
.backlinks-header, .pushlinks-header, .pulllinks-header, .forwardlinks-header {
font-style: italic;
font-weight: bold;
margin-bottom: 1em;
}
.links-header {
font-weight: bold;
text-align: left;
margin-bottom: 1em;
margin-left: 0.2em;
}
.search {
width: 100%;
display: flex;
background: #080808;
overflow: auto;
color: #cfcfcf;
padding: 0.5em;
margin-bottom: 10px;
border-radius: 10px;
gap: 10px;
/*
-webkit-transition: height 2s;
transition: height 2s;
*/
max-height: 250px;
}
.search-header {
font-weight: bold;
font-weight: bolder;
text-align: left;
margin-bottom: 1em;
margin-left: 0.2em;
@@ -227,7 +195,7 @@ nav { font-family: sans-serif}
.search-agora-header, .search-internet-header {
font-style: italic;
font-weight: bold;
font-weight: bolder;
margin-bottom: 1em;
}
+12
View File
@@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block content %}
{% include "node.html" %}
{% include "context.html" %}
{% include "stoa.html" %}
{% endblock %}
+10
View File
@@ -0,0 +1,10 @@
<div class="context">
<span class="context-header">Context for [[do]] ↓</span><br />
{% include "links.html" %}
{% include "search.html" %}
</div>
+3 -5
View File
@@ -14,9 +14,9 @@
limitations under the License.
-->
<!-- todo: rename context -->
<span class="links-header">Context</span><br />
<div class="links">
<span class="links-header">Links</span>
<div class="links-flex">
<div class="backlinks">
<span class="backlinks-header">← back</span><br />
{% for link in backlinks %}
@@ -66,6 +66,7 @@
<br />
</div>
</div>
</div>
{% if annotations_enabled %}
<div class="annotations">
@@ -85,6 +86,3 @@
{% endif %}
</div>
{% endif %}
</div>
@@ -14,9 +14,6 @@
limitations under the License.
-->
{% extends "base.html" %}
{% block content %}
{% if not node.subnodes and not node.pushed_subnodes() %}
<div class="not-found">
No node found at [[{{node.uri}}]].
@@ -24,32 +21,31 @@ No node found at [[{{node.uri}}]].
If you <a href="https://flancia.org/go/agora">contributed a matching subnode</a> with basename '{{node.uri}}' to the Agora (e.g. a note named {{node}}.md or an image named {{node}}.jpg), this node would exist :)
<br /><br />
You can try searching or listing <a href="/nodes">all nodes</a>.<br /><br />
<strong>Existing permutations</strong> are optimistically pulled below.<br/>
Existing permutations are optimistically pulled below.<br/>
</div>
{% endif %}
{% if node.subnodes %}
<div class="node">
<span class="node-header"><strong>Node</strong> <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>:
<span class="node-header">Node <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>
{% for subnode in node.subnodes %}
<div class="subnode">
<div class="subnode-header">
<span class="subnode-id"><strong>Subnode</strong> <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span><br />
<span class="subnode-links"><strong>from</strong> <a href="/raw/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
<span class="subnode-id">Subnode <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span><br />
<span class="subnode-links">from <a href="/raw/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
</div>
{{ subnode.render()|linkify|safe }}
</div>
{% endfor %}
</div>
{% endif %}
{% if node.pushed_subnodes() %}
{% for subnode in node.pushed_subnodes() %}
<div class="pulled-subnode">
<div class="pushed-subnode">
<div class="subnode-header">
<span class="subnode-id"><strong>Subnode</strong> <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span><br />
<span class="subnode-links"><strong>pushed from</strong> <a href="/subnode/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
<span class="subnode-id">Subnode <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span><br />
<span class="subnode-links">pushed from <a href="/subnode/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
</div>
<ul>
{{ subnode.render()|linkify|safe }}
@@ -61,14 +57,14 @@ You can try searching or listing <a href="/nodes">all nodes</a>.<br /><br />
{% for node in pull_nodes %}
<div class="node">
<span class="node-header"><strong>Pulled node</strong> <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>:
<span class="node-header">Pulled node <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a></span>:
{% if node.subnodes %}
{% for subnode in node.subnodes %}
<div class="pulled-subnode">
<div class="subnode-header">
<span class="subnode-id"><strong>Subnode</strong> <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span><br />
<span class="subnode-links"><strong>from</strong> <a href="/raw/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
<span class="subnode-id">Subnode <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span><br />
<span class="subnode-links">from <a href="/raw/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
</div>
{{ subnode.render()|linkify|safe }}
</div>
@@ -79,11 +75,4 @@ You can try searching or listing <a href="/nodes">all nodes</a>.<br /><br />
</div>
{% endfor %}
{% include "links.html" %}
{% include "node_search.html" %}
{% include "stoa.html" %}
{% endblock %}
</div>
-44
View File
@@ -1,44 +0,0 @@
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<br />
<span class="search-header">Searching '{{node}}'</span><br />
<div class="search">
<div class="search-internet">
<span class="search-internet-header">Around the internet</span> <br />
<a href="https://www.google.com/search?q={{q}}">Google</a> <br />
<a href="https://www.duckduckgo.com/{{q}}">DuckDuckGo</a> <br />
<a href="https://en.wikipedia.org/wiki/Special:Search/{{q}}">Wikipedia</a> <br />
<a href="https://twitter.com/search/?f=live&q={{q}}">Twitter</a> <br />
<a href="https://github.com/search?q={{q}}">Github</a> <br />
<a href="https://forum.effectivealtruism.org/search?terms={{q}}">Effective Altruism</a> <br />
<a href="https://www.lesswrong.com/search?terms={{q}}">Less Wrong</a> <br />
<a href="http://encyclopedia.uia.org/en/problems?combine={{q}}">Encyclopedia of World Problems</a> <br />
<a href="https://www.pubpub.org/search?q={{q}}">PubPub</a> <br />
</div>
<div class="search-agora">
<span class="search-agora-header">In this Agora</span> <br />
{% if search %}
{% for subnode in search %}
<a href="/@{{subnode.user}}/{{subnode.wikilink}}">@{{subnode.user}}/{{subnode.wikilink}}</a><br />
{% endfor %}
{% else %}
No search results.
{% endif %}
</div>
</div>
+45
View File
@@ -0,0 +1,45 @@
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% extends 'base.html' %}
{% block content %}
<!--{% if form.errors %}
{{ form.errors }}
{% endif %}
-->
<div class="listing">
<div class="formwrapper">
<h1>Search</h1>
<form method="POST" action="{{url_for('agora.oldsearch')}}">
<div class="form-field">{{ form.query.label }} {{ form.query(size=20, autofocus=true) }}
{{ form.csrf_token }}
{{ form.submit }}</div>
</form>
</div>
{% if subnodes %}
<br />
<h2> Results </h2>
{% for subnode in subnodes %}
(user: {{subnode.user}}) {{ subnode.uri }}: <a href="{{subnode.url}}">{{subnode.wikilink}}</a><br />
{% endfor %}
{% endif %}
</div>
{% endblock %}
+22 -23
View File
@@ -14,32 +14,31 @@
limitations under the License.
-->
{% extends 'base.html' %}
{% block content %}
<!--{% if form.errors %}
{{ form.errors }}
{% endif %}
-->
<div class="listing">
<div class="formwrapper">
<h1>Search</h1>
<form method="POST" action="{{url_for('agora.oldsearch')}}">
<div class="form-field">{{ form.query.label }} {{ form.query(size=20, autofocus=true) }}
{{ form.csrf_token }}
{{ form.submit }}</div>
</form>
<div class="search">
<div class="search-flex">
<div class="search-internet">
<span class="search-internet-header">Search for '{{query}}' around the web</span> <br />
<a href="https://www.google.com/search?q={{q}}">Google</a> <br />
<a href="https://www.duckduckgo.com/{{q}}">DuckDuckGo</a> <br />
<a href="https://en.wikipedia.org/wiki/Special:Search/{{q}}">Wikipedia</a> <br />
<a href="https://twitter.com/search/?f=live&q={{q}}">Twitter</a> <br />
<a href="https://github.com/search?q={{q}}">Github</a> <br />
<a href="https://forum.effectivealtruism.org/search?terms={{q}}">Effective Altruism</a> <br />
<a href="https://www.lesswrong.com/search?terms={{q}}">Less Wrong</a> <br />
<a href="http://encyclopedia.uia.org/en/problems?combine={{q}}">Encyclopedia of World Problems</a> <br />
<a href="https://www.pubpub.org/search?q={{q}}">PubPub</a> <br />
</div>
{% if subnodes %}
<br />
<h2> Results </h2>
{% for subnode in subnodes %}
(user: {{subnode.user}}) {{ subnode.uri }}: <a href="{{subnode.url}}">{{subnode.wikilink}}</a><br />
<div class="search-agora">
<span class="search-agora-header">Search for '{{query}}' in the Agora</span> <br />
{% if search %}
{% for subnode in search %}
<a href="/@{{subnode.user}}/{{subnode.wikilink}}">@{{subnode.user}}/{{subnode.wikilink}}</a><br />
{% endfor %}
{% else %}
No search results.
{% endif %}
</div>
</div>
</div>
{% endblock %}
+4 -5
View File
@@ -14,11 +14,10 @@
limitations under the License.
-->
<div class="node">
<div class="node-header">
<span class="subnode-id"><strong>Stoas for '{{node.uri}}'</strong></span><br />
<div class="pulled-subnode">
<span class="subnode-id"><strong>Scratchpad</strong> <a href="https://stoa.anagora.org/p/{{node.uri}}">/p/{{node.uri}}</a></span><br />
<div class="stoa">
<span class="stoa-header">Stoa for [[{{node.uri}}]] ↓</span><br />
<div class="stoa-public">
<span class="subnode-header">from <a href="https://stoa.anagora.org/p/{{node.uri}}">stoa.anagora.org/p/{{node.uri}}</a></span><br />
<iframe name="embed_readwrite" src="https://stoa.anagora.org/p/{{node.uri}}?showControls=true&showChat=true&showLineNumbers=true&useMonospaceFont=false" width="100%" height="600" frameborder="0"></iframe>
</div>
</div>
+3 -5
View File
@@ -30,10 +30,8 @@ Try going up to node <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a> or perhap
{% for subnode in node.subnodes %}
<div class="subnode">
<div class="subnode-header">
<span><strong>Subnode</strong> <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span> in <strong>node</strong> <a href="/node/{{subnode.wikilink}}">[[{{subnode.wikilink}}]]</a></span><br />
<span class="subnode-links"><strong>from</strong> <a href="/raw/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
<span>Subnode <a href="/@{{subnode.user}}/{{node.uri}}">[[@{{subnode.user}}/{{node.uri}}]]</a></span> in node <a href="/node/{{subnode.wikilink}}">[[{{subnode.wikilink}}]]</a></span><br />
<span class="subnode-links">from <a href="/raw/{{subnode.uri}}">{{subnode.uri}}</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a></span>
</div>
{{ subnode.render()|linkify|safe }}
</div>
@@ -51,7 +49,7 @@ Try going up to node <a href="/node/{{node.uri}}">[[{{node.uri}}]]</a> or perhap
<!-- old_subnode uses this -->
{% if subnode %}
<div class="subnode">
<span class="subnode-header"><strong>Subnode</strong> <a href="/{{subnode.uri}}">[[{{subnode.uri}}]]</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a> in node <a href="/node/{{subnode.wikilink}}">[[{{subnode.wikilink}}]]</a></span>
<span class="subnode-header">Subnode <a href="/{{subnode.uri}}">[[{{subnode.uri}}]]</a> by <a href="/@{{subnode.user}}">@{{subnode.user}}</a> in node <a href="/node/{{subnode.wikilink}}">[[{{subnode.wikilink}}]]</a></span>
{{ subnode.render()|linkify|safe }}
</div>
<div class="links">