101 lines
2 KiB
HTML
101 lines
2 KiB
HTML
{% extends "base_plain.html" %}
|
|
|
|
{% block title %}Build links{% endblock %}
|
|
|
|
{% block style %}
|
|
<style>
|
|
body, html {
|
|
height: 100%; margin: 0; padding: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.col {
|
|
position: absolute;
|
|
height: calc(100% - 75px);
|
|
flex: 1;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.col1 {
|
|
left: 0;
|
|
width: 20%;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.col2 {
|
|
left: 20%;
|
|
width: 40%;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.col3 {
|
|
left: 60%;
|
|
width: 40%;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.selected-span {
|
|
background: yellow;
|
|
}
|
|
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% macro show_doc(doc) %}
|
|
<div class="card" id="text1">
|
|
<div class="card-header">{{ doc.raw_title() }}</div>
|
|
<div class="card-body">
|
|
{%- for start, line in iter_lines(doc.text) if line != '\r\n' %}
|
|
<p class="card-text margin-bottom-zero" data-start="{{ start }}">{{- nbsp_at_start(line) -}}</p>
|
|
{%- endfor -%}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% block content %}
|
|
|
|
<div>
|
|
<div class="col col1">
|
|
<h3>Link builder</h3>
|
|
<p>Select something in the first document.</p>
|
|
<button class="btn btn-primary" id="new-link">confirm selection</button>
|
|
|
|
</div>
|
|
<div class="col col2">
|
|
{% if doc1 %}
|
|
{{ show_doc(doc1) }}
|
|
{% else %}
|
|
<h3>select document 1</h3>
|
|
<ul>
|
|
{% for doc in SourceDoc.query %}
|
|
<li>
|
|
<a href="{{ url_for(request.endpoint, doc1=doc.hashid, doc2=hashid2) }}">{{ doc.raw_title() }}</a>
|
|
— {{ doc.user.username }} — {{ doc.created | datetime }}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
<div class="col col3">
|
|
{% if doc2 %}
|
|
{{ show_doc(doc2) }}
|
|
{% else %}
|
|
<h3>select document 2</h3>
|
|
<ul>
|
|
{% for doc in SourceDoc.query %}
|
|
<li>
|
|
<a href="{{ url_for(request.endpoint, doc1=hashid1, doc2=doc.hashid) }}">{{ doc.raw_title() }}</a>
|
|
— {{ doc.user.username }} — {{ doc.created | datetime }}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script src="{{ url_for('static', filename='js/build_links.js') }}"></script>
|
|
{% endblock %}
|