Reverse order of recent notes to show most recent first

This commit is contained in:
Ryan Prather 2024-05-16 21:03:14 -04:00
parent b817ac7e23
commit 7beb08c72d
2 changed files with 6 additions and 7 deletions

View File

@ -48,8 +48,8 @@
</tr>
</thead>
<tbody>
{% for n in app.user.notes %}
{{ n.toTableRow() | raw }}<br />
{% for n in app.user.notes|reverse %}
{{ n.toTableRow()|raw }}<br />
{% endfor %}
</tbody>
</table>

View File

@ -5,7 +5,7 @@
<!-- Search -->
{% if app.user %}
<section id="search" class="alt">
<input type="text" name="query" id="query" placeholder="Search" />
<input type="text" name="query" id="query" placeholder="Search for note by title or passage" />
</section>
{% endif %}
@ -15,9 +15,7 @@
<h2>Menu</h2>
{% if app.user %}
<h3>Welcome {{ app.user.name }}</h3>
<ul>
<li><a href='/index.php/logout'>Logout</a>
</ul>
<a href='/index.php/logout'>Logout</a>
{% endif %}
</header>
<ul>
@ -47,8 +45,9 @@
<h2>Recent Notes</h2>
</header>
<div class="mini-posts" id='old-notes'>
{% for n in app.user.notes %}
{% for n in last4Notes %}
<article>
<p>{{ n.date|date("m/d/Y") }}</p>
<a href="#" onclick="retrieveNote('{{ n.id }}');openNote();">{{ n.title }}</a>
<p>{{ n.passage }}</p>
</article>