Added edit comments, user contributions and improved history page

This commit is contained in:
Yusur 2023-01-08 17:59:52 +01:00
parent f4d536dc47
commit d2cef14c38
6 changed files with 80 additions and 23 deletions

View file

@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block title %}Contributions of {{ u.username }} - {{ app_name }}{% endblock %}
{% block meta %}
<meta name="robots" content="noindex,nofollow" />
{% endblock %}
{% block content %}
<h1>Contributions of {{ u.username }}</div>
<ul>
{% for rev in contributions %}
<li>
<a href="/history/revision/{{ rev.id }}/">
#{{ rev.id }}
&middot;
{{ rev.pub_date.strftime("%B %-d, %Y %H:%M:%S") }}
{% if rev.comment %}
“{{ rev.comment }}”
{% endif %}
</a>
on
<a href="{{ rev.page.get_url() }}">
{{ rev.page.title }}
</a>
</li>
{% endfor %}
</ul>
{% endblock %}

View file

@ -64,6 +64,7 @@
<div>
<input type="submit" value="Save" id="save-button" class="submit-primary">
<input type="submit" name="preview" value="Preview" id="preview-button" class="submit-secondary">
<input type="text" name="comment" value="{{ pl_comment }}" placeholder="{{ T('write-a-comment') }}" />
</div>
<h3>Advanced options</h3>
<div>
@ -78,6 +79,7 @@
{% endif %}
{% endif %}
</form>
{% endblock %}
{% block scripts %}

View file

@ -12,13 +12,22 @@
<ul>
{% for rev in history %}
<li><a href="/history/revision/{{ rev.id }}/">
#{{ rev.id }}
&middot;
{{ rev.pub_date.strftime("%B %-d, %Y %H:%M:%S") }}
<li>
<a href="/history/revision/{{ rev.id }}/">
#{{ rev.id }}
&middot;
{{ rev.pub_date.strftime("%B %-d, %Y %H:%M:%S") }}
{% if rev.comment %}
“{{ rev.comment }}”
{% endif %}
</a>
by
{{ rev.user.username }}
</a></li>
<a href="/u/{{ rev.user.username }}">
{{ rev.user.username }}
</a>
</li>
{% endfor %}
</ul>
<p>{{ T("back-to") }} <a href="{{ p.get_url() }}">{{ p.title }}</a>.</p>
{% endblock %}