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

View File

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