CSS + HTML change

This commit is contained in:
Yusur 2023-12-12 19:29:43 +01:00
parent acf918f656
commit 14e69ac291
20 changed files with 292 additions and 248 deletions

13
app.py
View file

@ -13,8 +13,9 @@ Application is kept compact, with all its core in a single file.
#### IMPORTS #### #### IMPORTS ####
from flask import ( from flask import (
Flask, Markup, abort, flash, g, jsonify, make_response, redirect, request, Flask, abort, flash, g, jsonify, make_response, redirect, request,
render_template, send_from_directory) render_template, send_from_directory)
from markupsafe import Markup
from flask_login import LoginManager, login_user, logout_user, current_user, login_required from flask_login import LoginManager, login_user, logout_user, current_user, login_required
from flask_wtf import CSRFProtect from flask_wtf import CSRFProtect
#from flask_arrest import RestBlueprint, serialize_response #from flask_arrest import RestBlueprint, serialize_response
@ -1005,7 +1006,15 @@ def calendar_month(y, m):
(Page.calendar < datetime.date(y+1 if m==12 else y, 1 if m==12 else m+1, 1)) (Page.calendar < datetime.date(y+1 if m==12 else y, 1 if m==12 else m+1, 1))
).order_by(Page.calendar) ).order_by(Page.calendar)
return render_paginated_template('month.jinja2', "notes", d=datetime.date(y, m, 1), notes=notes, advance_calendar=_advance_calendar) #toc_q = Page.select(fn.Month(Page.calendar).alias('month'), fn.Count(Page.id).alias('n_notes')).where(
# (datetime.date(y, 1, 1) <= Page.calendar) &
# (Page.calendar < datetime.date(y+1, 1, 1))
#).group_by()
toc = {}
#for i in toc_q:
# toc[i.month] = i.n_notes
return render_paginated_template('month.jinja2', "notes", d=datetime.date(y, m, 1), notes=notes, advance_calendar=_advance_calendar, toc=toc)
@app.route('/history/revision/<int:revisionid>/') @app.route('/history/revision/<int:revisionid>/')
def view_old(revisionid): def view_old(revisionid):

View file

@ -5,6 +5,9 @@
"latest-notes": "Dernières notes", "latest-notes": "Dernières notes",
"latest-uploads": "Derniers téléchargements", "latest-uploads": "Derniers téléchargements",
"new-note": "Créer un note", "new-note": "Créer un note",
"upload-file": "Télécharger une image" "upload-file": "Télécharger une image",
"easter-date-calc": "Calculer la date de Pâques",
"easter": "Pâques",
"other-dates": "Autres dates"
} }
} }

View file

@ -69,6 +69,7 @@ body{font-family:sans-serif;background-color:var(--bg-main); color: var(--fg-mai
.nl-prev,.nl-next{text-align:center} .nl-prev,.nl-next{text-align:center}
.nl-placeholder {font-style: italic; text-align: center;} .nl-placeholder {font-style: italic; text-align: center;}
.nl-pagination {text-align: center; color: var(--fg-alt)} .nl-pagination {text-align: center; color: var(--fg-alt)}
.nl-item {padding: 12px; border: 1px solid gray; border-radius: 12px; box-shadow: 2px 2px 2px gray; background-color: var(--bg-alt);}
input{border:0;border-bottom:3px solid var(--border);font:inherit;color:var(--fg-main);background-color:transparent} input{border:0;border-bottom:3px solid var(--border);font:inherit;color:var(--fg-main);background-color:transparent}
input:focus{color:var(--fg-sharp);border-bottom-color:var(--border-sharp)} input:focus{color:var(--fg-sharp);border-bottom-color:var(--border-sharp)}
input.error{border-bottom-color:var(--btn-error)} input.error{border-bottom-color:var(--btn-error)}

View file

@ -3,23 +3,25 @@
{% block title %}Administrative tools — {{ app_name }}{% endblock %} {% block title %}Administrative tools — {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<h1>Administrative tools</h1> <main>
<h1>Administrative tools</h1>
<div class="inner-content"> <div class="inner-content">
{% if current_user and current_user.is_admin %} {% if current_user and current_user.is_admin %}
<ul> <ul>
<li> <li>
<a href="/manage/export">Export pages</a> <a href="/manage/export">Export pages</a>
</li> </li>
<li> <li>
<a href="/manage/import">Import pages</a> <a href="/manage/import">Import pages</a>
</li> </li>
<li> <li>
<a href="/manage/accounts">Manage accounts</a> <a href="/manage/accounts">Manage accounts</a>
</li> </li>
</ul> </ul>
{% else %} {% else %}
<p>Administrative tools can be accessed by administrator users only.</p> <p>Administrative tools can be accessed by administrator users only.</p>
{% endif %} {% endif %}
</div> </div>
</main>
{% endblock %} {% endblock %}

View file

@ -7,24 +7,26 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1 id="firstHeading">{{ p.title }}</h1> <main>
<div class="preview-subtitle">{{ T('backlinks') }}</div> <h1 id="firstHeading">{{ p.title }}</h1>
<div class="preview-subtitle">{{ T('backlinks') }}</div>
<div class="inner-content"> <div class="inner-content">
{% if backlinks %} {% if backlinks %}
<ul> <ul>
{% for op in backlinks %} {% for op in backlinks %}
<li><a href="{{ op.get_url() }}"> <li><a href="{{ op.get_url() }}">
{{ op.title }} (<strong>#{{ op.id }}</strong>) {{ op.title }} (<strong>#{{ op.id }}</strong>)
</a></li> </a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
<p class="placeholder">{{ T("backlinks-empty") }}</p> <p class="placeholder">{{ T("backlinks-empty") }}</p>
{% endif %} {% endif %}
</div> </div>
<p>{{ T("back-to") }} <a href="{{ p.get_url() }}">{{ p.title }}</a>.</p> <p>{{ T("back-to") }} <a href="{{ p.get_url() }}">{{ p.title }}</a>.</p>
</main>
{% endblock %} {% endblock %}

View file

@ -3,9 +3,11 @@
{% block title %}Bad Request - {{ app_name }}{% endblock %} {% block title %}Bad Request - {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<h1>Bad request</h1> <main class="error-page">
<h1 id="firstHeading">Bad request</h1>
<div class="inner-content"> <div class="inner-content">
<p>You sent a request the server cant understand. If you entered the URL manually please check your spelling and try again.</p> <p>You sent a request the server cant understand. If you entered the URL manually please check your spelling and try again.</p>
</div> </div>
</main>
{% endblock %} {% endblock %}

View file

@ -3,7 +3,7 @@
{% block title %}Calendar {{ app_name }}{% endblock %} {% block title %}Calendar {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<article> <main>
<h1 id="firstHeading">{{ T('calendar') }}</h1> <h1 id="firstHeading">{{ T('calendar') }}</h1>
<div class="inner-content"> <div class="inner-content">
@ -32,5 +32,5 @@
</ul> </ul>
</p> </p>
</div> </div>
</article> </main>
{% endblock %} {% endblock %}

View file

@ -7,37 +7,40 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>Contributions of {{ u.username }}</h1> <main>
<h1 id="firstHeading">{{ u.username }}</h1>
<p class="preview-subtitle">Contributions</p>
<div class="inner-content"> <div class="inner-content">
<p class="nl-pagination">Showing results <strong>{{ page_n * 20 - 19 }}</strong> to <strong>{{ min(page_n * 20, total_count) }}</strong> of <strong>{{ total_count }}</strong> total.</p> <p class="nl-pagination">Showing results <strong>{{ page_n * 20 - 19 }}</strong> to <strong>{{ min(page_n * 20, total_count) }}</strong> of <strong>{{ total_count }}</strong> total.</p>
<ul> <ul>
{% if page_n > 1 %} {% if page_n > 1 %}
<li class="nl-prev"><a href="?page={{ page_n - 1 }}">&laquo; Previous page</a></li> <li class="nl-prev"><a href="?page={{ page_n - 1 }}">&laquo; Previous page</a></li>
{% endif %} {% endif %}
{% for rev in contributions %} {% for rev in contributions %}
<li> <li>
<a href="/history/revision/{{ rev.id }}/"> <a href="/history/revision/{{ rev.id }}/">
#{{ rev.id }} #{{ rev.id }}
&middot; &middot;
{{ rev.pub_date.strftime("%B %-d, %Y %H:%M:%S") }} {{ rev.pub_date.strftime("%B %-d, %Y %H:%M:%S") }}
{% if rev.comment %} {% if rev.comment %}
“{{ rev.comment }}” “{{ rev.comment }}”
{% endif %} {% endif %}
</a> </a>
on on
<a href="{{ rev.page.get_url() }}"> <a href="{{ rev.page.get_url() }}">
{{ rev.page.title }} {{ rev.page.title }}
</a> </a>
</li> </li>
{% endfor %} {% endfor %}
{% if page_n < total_count // 20 %} {% if page_n < total_count // 20 %}
<li class="nl-next"><a href="?page={{ page_n + 1 }}">Next page &raquo;</a></li> <li class="nl-next"><a href="?page={{ page_n + 1 }}">Next page &raquo;</a></li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
</main>
{% endblock %} {% endblock %}

View file

@ -3,9 +3,11 @@
{% block title %}Access Denied - {{ app_name }}{% endblock %} {% block title %}Access Denied - {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<h1>Forbidden</h1> <main class="error-page">
<h1 id="firstHeading">Forbidden</h1>
<div class="inner-content"> <div class="inner-content">
<p>You dont have permission to access this resource.</p> <p>You dont have permission to access this resource.</p>
</div> </div>
</main>
{% endblock %} {% endblock %}

View file

@ -7,33 +7,35 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1 id="firstHeading">{{ p.title }}</h1> <main>
<div class="preview-subtitle">Page history</div> <h1 id="firstHeading">{{ p.title }}</h1>
<div class="preview-subtitle">Page history</div>
<div class="inner-content"> <div class="inner-content">
<ul> <ul>
{% for rev in history %} {% for rev in history %}
<li> <li>
<a href="/history/revision/{{ rev.id }}/"> <a href="/history/revision/{{ rev.id }}/">
#{{ rev.id }} #{{ rev.id }}
&middot; &middot;
{{ rev.pub_date.strftime("%B %-d, %Y %H:%M:%S") }} {{ rev.pub_date.strftime("%B %-d, %Y %H:%M:%S") }}
{% if rev.comment %} {% if rev.comment %}
“{{ rev.comment }}” “{{ rev.comment }}”
{% endif %}
</a>
by
{% if rev.user_id %}
<a href="/u/{{ rev.user.username }}">
{{ rev.user.username }}
</a>
{% else %}
<span>&lt;Unknown User&gt;</span>
{% endif %} {% endif %}
</a> </li>
by {% endfor %}
{% if rev.user_id %} </ul>
<a href="/u/{{ rev.user.username }}"> </div>
{{ rev.user.username }}
</a>
{% else %}
<span>&lt;Unknown User&gt;</span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<p>{{ T("back-to") }} <a href="{{ p.get_url() }}">{{ p.title }}</a>.</p> <p>{{ T("back-to") }} <a href="{{ p.get_url() }}">{{ p.title }}</a>.</p>
</main>
{% endblock %} {% endblock %}

View file

@ -3,22 +3,24 @@
{% block title %}{{ T('homepage') }} - {{ app_name }}{% endblock %} {% block title %}{{ T('homepage') }} - {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<article class="homepage"> <main class="homepage">
<h1 id="firstHeading">{{ T('welcome').format(app_name) }}</h1> <h1 id="firstHeading">{{ T('welcome').format(app_name) }}</h1>
<div class="nl-new"> <div class="inner-content">
<a href="/create/"> <div class="nl-new">
<button class="submit-primary"><span class="material-icons">create</span> {{ T('new-note') }}</button> <a href="/create/">
</a> <button class="submit-primary"><span class="material-icons">create</span> {{ T('new-note') }}</button>
</a>
</div>
<h2>{{ T('latest-notes') }}</h2>
<br style="clear:both">
{% from "macros/nl.jinja2" import nl_list with context %}
{{ nl_list(new_notes) }}
</div> </div>
<h2>{{ T('latest-notes') }}</h2> </main>
<br style="clear:both">
{% from "macros/nl.jinja2" import nl_list with context %}
{{ nl_list(new_notes) }}
</article>
{% endblock %} {% endblock %}

View file

@ -1,3 +1,8 @@
{# DEPRECATED #}
{# Use "macros/nl.jinja2" instead. #}
<div class="flash">DEPRECATED</div>
<p class="nl-title"> <p class="nl-title">
<a href="{{ n.get_url() }}" class="nl-title">{{ n.title }}</a> <a href="{{ n.get_url() }}" class="nl-title">{{ n.title }}</a>
</p> </p>

View file

@ -3,9 +3,11 @@
{% block title %}% _ % - {{ app_name }}{% endblock %} {% block title %}% _ % - {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<h1>Internal Server Error</h1> <main class="error-page">
<h1 id="firstHeading">Internal Server Error</h1>
<div class="inner-content"> <div class="inner-content">
<p>Were sorry, an unexpected error occurred. Try refreshing the page.</p> <p>Were sorry, an unexpected error occurred. Try refreshing the page.</p>
</div> </div>
</main>
{% endblock %} {% endblock %}

View file

@ -1,10 +1,12 @@
{% extends "base.jinja2" %} {% extends "base.jinja2" %}
{% block content %} {% block content %}
<article> <main>
<h1 id="firstHeading">Notes by date</h1> <h1 id="firstHeading">Notes by date</h1>
{% from "macros/nl.jinja2" import nl_list with context %} <div class="inner-content">
{{ nl_list(notes, page_n=page_n, total_count=total_count) }} {% from "macros/nl.jinja2" import nl_list with context %}
</article> {{ nl_list(notes, page_n=page_n, total_count=total_count) }}
</div>
</main>
{% endblock %} {% endblock %}

View file

@ -3,17 +3,19 @@
{% block title %}Notes tagged #{{ tagname }} - {{ app_name }}{% endblock %} {% block title %}Notes tagged #{{ tagname }} - {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<article> <main>
<h1 id="firstHeading">#{{ tagname }}</h1> <h1 id="firstHeading">#{{ tagname }}</h1>
<div class="preview-subtitle">{{ T('notes-tagged') }}</div> <div class="preview-subtitle">{{ T('notes-tagged') }}</div>
{% if total_count > 0 %} <div class="inner-content">
{% from "macros/nl.jinja2" import nl_list with context %} {% if total_count > 0 %}
{{ nl_list(l, page_n=page_n, total_count=total_count, hl_tags=(tagname,)) }} {% from "macros/nl.jinja2" import nl_list with context %}
{% else %} {{ nl_list(tagged_notes, page_n=page_n, total_count=total_count, hl_tags=(tagname,), other_url='tags/' + tagname) }}
<p class="nl-placeholder">{{ T('notes-tagged-empty') }}</p> {% else %}
{% endif %} <p class="nl-placeholder">{{ T('notes-tagged-empty') }}</p>
{% endif %}
</div>
</article> </main>
{% endblock %} {% endblock %}

View file

@ -1,6 +1,10 @@
{#
Recommendations: Always import this macro with context,
otherwise it fails. It depends on a couple context-defined functions.
#}
{% macro nl_list(l, page_n=None, total_count=None, hl_tags=(), other_url='p/most_recent') %} {% macro nl_list(l, page_n=None, total_count=None, hl_tags=(), hl_calendar=None, other_url='p/most_recent') %}
{% if page_n and total_count %} {% if page_n and total_count %}
<p class="nl-pagination"> <p class="nl-pagination">
Showing results <strong>{{ page_n * 20 - 19 }}</strong> to <strong>{{ min(page_n * 20, total_count) }}</strong> Showing results <strong>{{ page_n * 20 - 19 }}</strong> to <strong>{{ min(page_n * 20, total_count) }}</strong>
@ -13,36 +17,44 @@
{% endif %} {% endif %}
{% for n in l %} {% for n in l %}
<li> <li>
<a href="{{ n.get_url() }}" class="nl-title">{{ n.title }}</a> <article class="nl-item">
<p class="nl-desc">{{ n.short_desc() }}</p> <a href="{{ n.get_url() }}" class="nl-title">{{ n.title }}</a>
{% if n.tags %} <p class="nl-desc">{{ n.short_desc() }}</p>
<p class="nl-tags"> {% if n.tags %}
<span class="material-icons">tag</span> <p class="nl-tags">
{{ T('tags') }}: <span class="material-icons">tag</span>
{% for tag in n.tags %} {{ T('tags') }}:
{% set tn = tag.name %} {% for tag in n.tags %}
{% if tn in hl_tags %} {% set tn = tag.name %}
<strong class="nl-tag-hl">#{{ tn }}</strong> {% if tn in hl_tags %}
{% else %} <strong class="nl-tag-hl">#{{ tn }}</strong>
<a href="/tags/{{ tn }}/" class="nl-tag">#{{ tn }}</a> {% else %}
<a href="/tags/{{ tn }}/" class="nl-tag">#{{ tn }}</a>
{% endif %}
{% endfor %}
</p>
{% endif %} {% endif %}
{% endfor %} {% if n.calendar %}
</p> <p class="nl-calendar">
{% endif %} <span class="material-icons">calendar_today</span>
{% if n.calendar %} {% if hl_calendar and hl_calendar.y == n.calendar.y and hl_calendar.m == n.calendar.m %}
<p class="nl-calendar"> <strong>
<span class="material-icons">calendar_today</span> <time datetime="{{ n.calendar.isoformat() }}">{{ n.calendar.strftime('%B %-d, %Y') }}</time>
<a href="/calendar/{{ n.calendar.year }}/{{ n.calendar.month }}"> </strong>
<time datetime="{{ n.calendar.isoformat() }}">{{ n.calendar.strftime('%B %-d, %Y') }}</time> {% else %}
</a> <a href="/calendar/{{ n.calendar.year }}/{{ n.calendar.month }}">
</p> <time datetime="{{ n.calendar.isoformat() }}">{{ n.calendar.strftime('%B %-d, %Y') }}</time>
{% endif %} </a>
{% endif %}
</p>
{% endif %}
</article>
</li> </li>
{% endfor %} {% endfor %}
{% if page_n is none %} {% if page_n is none %}
<li class="nl-next"><a href="/{{ other_url }}/">{{ T('show-all') }}</a></li> <li class="nl-next"><a href="/{{ other_url }}/">{{ T('show-all') }}</a></li>
{% elif page_n <= total_count // 20 %} {% elif page_n <= (total_count - 1) // 20 %}
<li class="nl-next"><a href="/{{ other_url }}/?page={{ page_n + 1 }}">Next page &raquo;</a></li> <li class="nl-next"><a href="/{{ other_url }}/?page={{ page_n + 1 }}">Next page &raquo;</a></li>
{% endif %} {% endif %}
</ul> </ul>

View file

@ -3,61 +3,48 @@
{% block title %}{{ d.strftime("%B %Y") }} {{ app_name }}{% endblock %} {% block title %}{{ d.strftime("%B %Y") }} {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<article> <main>
<h1 id="firstHeading">{{ d.strftime("%B %Y") }}</h1> <h1 id="firstHeading">{{ d.strftime("%B %Y") }}</h1>
{% if total_count > 0 %} <div class="inner-content">
<p class="nl-pagination">Showing results <strong>{{ page_n * 20 - 19 }}</strong> to <strong>{{ min(page_n * 20, total_count) }}</strong> of <strong>{{ total_count }}</strong> total.</p> {% if total_count > 0 %}
{% from "macros/nl.jinja2" import nl_list with context %}
{{ nl_list(notes, total_count=total_count, page_n=page_n, hl_calendar=d) }}
<ul class="nl-list"> {% else %}
{% for n in notes %} <p class="nl-placeholder">{{ T('notes-month-empty') }}</p>
<li> {% endif %}
<a href="{{ n.get_url() }}" class="nl-title">{{ n.title }}</a>
<p class="nl-desc">{{ n.short_desc() }}</p>
{% if n.tags %}
<p class="nl-tags">{{ T('tags') }}:
{% for tag in n.tags %}
{% set tn = tag.name %}
<a href="/tags/{{ tn }}/" class="nl-tag">#{{ tn }}</a>
{% endfor %}
</p>
{% endif %}
{% if n.calendar %}
<p class="nl-calendar">
<span class="material-icons">calendar_today</span>
{% if n.calendar.year == d.year and n.calendar.month == d.month %}
<strong>
<time datetime="{{ n.calendar.isoformat() }}">{{ n.calendar.strftime('%B %-d, %Y') }}</time>
</strong>
{% else %}
<a href="/calendar/{{ n.calendar.year }}/{{ n.calendar.month }}">
<time datetime="{{ n.calendar.isoformat() }}">{{ n.calendar.strftime('%B %-d, %Y') }}</time>
</a>
{% endif %}
</p>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<p class="nl-placeholder">{{ T('notes-month-empty') }}</p>
{% endif %}
{% set past_year = advance_calendar(d, -2) %} {% set past_year = advance_calendar(d, -2) %}
{% set past_month = advance_calendar(d, -1) %} {% set past_month = advance_calendar(d, -1) %}
{% set next_month = advance_calendar(d, 1) %} {% set next_month = advance_calendar(d, 1) %}
{% set next_year = advance_calendar(d, 2) %} {% set next_year = advance_calendar(d, 2) %}
<div class="calendar-navigation"> <div class="calendar-navigation">
<ul class="inline"> <ul class="inline">
<li>&laquo; <a href="/calendar/{{ past_year.year }}/{{ past_year.month }}">{{ past_year.strftime("%B %Y") }}</a></li> <li>&laquo; <a href="/calendar/{{ past_year.year }}/{{ past_year.month }}">{{ past_year.strftime("%B %Y") }}</a></li>
<li><a href="/calendar/{{ past_month.year }}/{{ past_month.month }}">{{ past_month.strftime("%B %Y") }}</a></li> <li><a href="/calendar/{{ past_month.year }}/{{ past_month.month }}">{{ past_month.strftime("%B %Y") }}</a></li>
<li><strong>{{ d.strftime("%B %Y") }}</strong></li> <li><strong>{{ d.strftime("%B %Y") }}</strong></li>
<li><a href="/calendar/{{ next_month.year }}/{{ next_month.month }}">{{ next_month.strftime("%B %Y") }}</a></li> <li><a href="/calendar/{{ next_month.year }}/{{ next_month.month }}">{{ next_month.strftime("%B %Y") }}</a></li>
<li><a href="/calendar/{{ next_year.year }}/{{ next_year.month }}">{{ next_year.strftime("%B %Y") }}</a> &raquo;</li> <li><a href="/calendar/{{ next_year.year }}/{{ next_year.month }}">{{ next_year.strftime("%B %Y") }}</a> &raquo;</li>
</ul> </ul>
</div>
<p>{{ T('back-to') }} <a href="/calendar">{{ T('calendar') }}</a></p>
</div> </div>
</main>
<p>{{ T('back-to') }} <a href="/calendar">{{ T('calendar') }}</a></p> {% endblock %}
</article>
{% block toc %}
<nav class="toc">
<h3>{{ d.year }}</h3>
<ul>
{#% for i in range(1, 13) %}
<li>
<a href="/calendar/{{ d.year }}/{{ i }}">{{ nd.strftime("%B") }}</a>
<strong>({{ toc[i] }})</strong>
</li>
{% endfor %#}
</ul>
</nav>
{% endblock %} {% endblock %}

View file

@ -3,9 +3,11 @@
{% block title %}{{ T('not-found') }} - {{ app_name }}{% endblock %} {% block title %}{{ T('not-found') }} - {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<h1>{{ T('not-found') }}</h1> <main class="error-page">
<h1 id="firstHeading">{{ T('not-found') }}</h1>
<div class="inner-content"> <div class="inner-content">
<p>{{ T('not-found-text-1') }} <strong>{{ request.path }}</strong> {{ T('not-found-text-2') }}.</p> <p>{{ T('not-found-text-1') }} <strong>{{ request.path }}</strong> {{ T('not-found-text-2') }}.</p>
</div> </div>
</main>
{% endblock %} {% endblock %}

View file

@ -3,31 +3,33 @@
{% block title %}{% if q %}Search results for "{{ q }}"{% else %}Search{% endif %} - {{ app_name }}{% endblock %} {% block title %}{% if q %}Search results for "{{ q }}"{% else %}Search{% endif %} - {{ app_name }}{% endblock %}
{% block content %} {% block content %}
<h1>Search</h1> <main>
<h1>Search</h1>
<div class="inner-content"> <div class="inner-content">
<form method="POST"> <form method="POST">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<div class="search-wrapper"> <div class="search-wrapper">
<label for="q">Search for: </label> <label for="q">Search for: </label>
<input type="search" name="q" value="{{ q }}" class="search-input"> <input type="search" name="q" value="{{ q }}" class="search-input">
</div> </div>
<div> <div>
<input type="checkbox" name="include-tags" value="1" {% if pl_include_tags %}checked{% endif %}> <input type="checkbox" name="include-tags" value="1" {% if pl_include_tags %}checked{% endif %}>
<label for="include-tags">{{ T('include-tags') }}</label> <label for="include-tags">{{ T('include-tags') }}</label>
</div> </div>
</form> </form>
{% if results %} {% if results %}
<h2>Search results for <em>{{ q }}</em></h2> <h2>Search results for <em>{{ q }}</em></h2>
{% from "macros/nl.jinja2" import nl_list with context %} {% from "macros/nl.jinja2" import nl_list with context %}
{{ nl_list(l, other_url=None) }} {{ nl_list(results, other_url=None) }}
{% elif q %} {% elif q %}
<h2>{{ T('search-no-results') }} <em>{{ q }}</em></h2> <h2>{{ T('search-no-results') }} <em>{{ q }}</em></h2>
{% else %} {% else %}
<p>Please note that search queries do not search for page text.</p> <p>Please note that search queries do not search for page text.</p>
{% endif %} {% endif %}
</div> </div>
</main>
{% endblock %} {% endblock %}

View file

@ -1,21 +1,23 @@
{% extends "base.jinja2" %} {% extends "base.jinja2" %}
{% block content %} {% block content %}
<h1>Upload new file</h1> <main>
<h1>Upload new file</h1>
<p>Uploads are no more supported. Please use this syntax instead for external images: <code>![alt text](https://www.example.com/path/to/image.jpg)</code>.</p> <p>Uploads are no more supported. Please use this syntax instead for external images: <code>![alt text](https://www.example.com/path/to/image.jpg)</code>.</p>
<form method="POST" enctype="multipart/form-data"> <form method="POST" enctype="multipart/form-data">
<div> <div>
<label for="name">Name: </label> <label for="name">Name: </label>
<input type="text" id="name-input" name="name" required maxlength="256" disabled=""> <input type="text" id="name-input" name="name" required maxlength="256" disabled="">
</div> </div>
<div> <div>
<label for="file">File: </label> <label for="file">File: </label>
<input type="file" id="file-input" name="file" accept="image/jpeg, image/png" disabled=""> <input type="file" id="file-input" name="file" accept="image/jpeg, image/png" disabled="">
</div> </div>
<div> <div>
<input type="submit" value="Upload" disabled=""> <input type="submit" value="Upload" disabled="">
</div> </div>
</form> </form>
</main>
{% endblock %} {% endblock %}