Simplify template

This commit is contained in:
Patrick Jentsch 2020-02-18 15:31:10 +01:00
parent e611a15aac
commit 4de2fdf6d8
8 changed files with 440 additions and 428 deletions

View File

@ -2,7 +2,8 @@
{% set full_width = False %}
{% set roadmap = False %}
{% set title_override = '<i class="material-icons left service" data-service="{service}" style="font-size: inherit;"></i>Job'.format(service=job.service) %}
<!-- Override title -->
{% set title = '<i class="material-icons left service" data-service="{service}" style="font-size: inherit;"></i>Job'.format(service=job.service) %}
{% block page_content %}
<div class="col s12 m4">

View File

@ -3,13 +3,7 @@
{% set parallax = True %}
{% block page_content %}
<style media="screen">
.grey.lighten-5 {
background-color: transparent !important;
}
</style>
{% if current_user.is_anonymous %}
<div class="parallax-container">
<div class="parallax">
<img src="{{ url_for('static', filename='images/bible_text.jpg') }}" alt="">

View File

@ -88,56 +88,29 @@
</ul>
</header>
{%- macro insert_page_content() -%}
{% block page_content %}{% endblock %}
{%- endmacro -%}
{% if parallax %}
<main>
{{ insert_page_content() }}
</main>
{% else %}
<main class="grey lighten-5">
{% if not parallax %}
{% if not full_width %}
<div class="container">
{% endif %}
<div class="row">
<div class="col s12">
<h2>
{% if title_override %}
{{ title_override }}
{% elif title %}
{{ title }}
{% else %}
Unnamed page
{% endif %}
</h2>
<h2>{% if title %}{{ title }}{% else %}Unnamed page{% endif %}</h2>
</div>
{% if roadmap %}
<div class="col s12 m9 l10">
{% else %}
<div class="col s12">
{% endif %}
<div class="row">
{% endif %}
{% block page_content %}
{% endblock %}
{% if not parallax %}
</div>
</div>
{% if roadmap %}
<div class="col hide-on-small-only m3 l2">
<ul class="table-of-contents" id="roadmap">
<li><b>Roadmap</b></li>
<li><a href="{{ url_for('services.service', service='setup_files') }}">File setup</a></li>
<li><a href="{{ url_for('services.service', service='ocr') }}">Optical Character Recognition</a></li>
<li><a href="{{ url_for('services.service', service='nlp') }}">Natural Language Processing</a></li>
<li><a href="{{ url_for('corpora.add_corpus') }}">Create a corpus</a></li>
<li><a href="{{ url_for('services.service', service='corpus_analysis') }}">Corpus analysis</a></li>
</ul>
</div>
<script>
for (let entry of document.querySelectorAll(`#roadmap a`)) {
if (entry.href === window.location.href) {entry.classList.add("active");}
}
</script>
{% endif %}
{{ insert_page_content() }}
</div>
{% if not full_width %}
</div>
{% endif %}
</div>
{% endif %}
</main>

View File

@ -4,7 +4,8 @@
{% set roadmap = True %}
{% block page_content %}
<div class="col s12">
<div class="col s12 m9 l10">
<div class="col s12">
<div class="card">
<div class="card-content">
<div class="row">
@ -30,9 +31,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="col s12">
<div class="col s12">
<h3>My corpora</h3>
<div class="card">
<div class="card-content" id="corpora">
@ -61,6 +62,11 @@
<a class="waves-effect waves-light btn" href="{{ url_for('corpora.add_corpus') }}">New corpus<i class="material-icons right">add</i></a>
</div>
</div>
</div>
</div>
<div class="col hide-on-small-only m3 l2">
{% include 'services/roadmap.html.j2' %}
</div>
<script>

View File

@ -4,7 +4,8 @@
{% set roadmap = True %}
{% block page_content %}
<div class="col s12">
<div class="col s12 m9 l10">
<div class="col s12">
<div class="card">
<div class="card-content">
<div class="row">
@ -30,9 +31,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="col s12">
<div class="col s12">
<h3>Submit a job</h3>
<div class="card">
<form class="nopaque-job-form" data-progress-modal="progress-modal">
@ -114,6 +115,11 @@
</div>
</form>
</div>
</div>
</div>
<div class="col hide-on-small-only m3 l2">
{% include 'services/roadmap.html.j2' %}
</div>
<div id="progress-modal" class="modal">

View File

@ -4,7 +4,8 @@
{% set roadmap = True %}
{% block page_content %}
<div class="col s12">
<div class="col s12 m9 l10">
<div class="col s12">
<div class="card">
<div class="card-content">
<div class="row">
@ -30,9 +31,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="col s12">
<div class="col s12">
<h3>Submit a job</h3>
<div class="card">
<form class="nopaque-job-form" data-progress-modal="progress-modal">
@ -189,6 +190,11 @@
</div>
</form>
</div>
</div>
</div>
<div class="col hide-on-small-only m3 l2">
{% include 'services/roadmap.html.j2' %}
</div>
<div id="progress-modal" class="modal">

View File

@ -0,0 +1,20 @@
<ul class="table-of-contents" id="roadmap">
<li><b>Roadmap</b></li>
<li>
<a href="{{ url_for('services.service', service='setup_files') }}">File setup</a>
</li>
<li>
<a href="{{ url_for('services.service', service='ocr') }}">Optical Character Recognition</a>
</li>
<li>
<a href="{{ url_for('services.service', service='nlp') }}">Natural Language Processing</a>
</li>
<li>
<a href="{{ url_for('services.service', service='corpus_analysis') }}">Corpus analysis</a>
</li>
</ul>
<script>
for (let entry of document.querySelectorAll(`#roadmap a`)) {
if (entry.href === window.location.href) {entry.classList.add("active");}
}
</script>

View File

@ -4,7 +4,8 @@
{% set roadmap = True %}
{% block page_content %}
<div class="col s12">
<div class="col s12 m9 l10">
<div class="col s12">
<div class="card">
<div class="card-content">
<div class="row">
@ -20,9 +21,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="col s12">
<div class="col s12">
<h3>Submit a job</h3>
<div class="card">
<form class="nopaque-job-form" data-progress-modal="progress-modal">
@ -80,6 +81,11 @@
</div>
</form>
</div>
</div>
</div>
<div class="col hide-on-small-only m3 l2">
{% include 'services/roadmap.html.j2' %}
</div>
<div id="progress-modal" class="modal">