Move notes to a central file and add linebreaksbr
This commit is contained in:
@@ -74,10 +74,6 @@ button {
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes.notes-grid {
|
|
||||||
display: grid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note {
|
.note {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -7,53 +7,17 @@
|
|||||||
{% include "notes/messages.html" %}
|
{% include "notes/messages.html" %}
|
||||||
|
|
||||||
<h2>Notes for you</h2>
|
<h2>Notes for you</h2>
|
||||||
{% if notes %}
|
{% include "notes/notes.html" with object_list=notes show_from=True show_to=False %}
|
||||||
<div class="notes">
|
|
||||||
{% for note in notes %}
|
|
||||||
<div class="note">
|
|
||||||
<p>{{ note.note }}</p>
|
|
||||||
<p class="note-from">From {{ note.from_user.visible_name }}</p>
|
|
||||||
<p class="note-at">{{ note.created_at|date:"j M, H:i"}}</p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<div class="card">No Notes found</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="title-and-link">
|
<div class="title-and-link">
|
||||||
<h2>Active Sent Notes</h2>
|
<h2>Active Sent Notes</h2>
|
||||||
<a href="{% url "sent-notes" %}">View All including expired</a>
|
<a href="{% url "sent-notes" %}">View All including expired</a>
|
||||||
</div>
|
</div>
|
||||||
{% if alive_created %}
|
{% include "notes/notes.html" with object_list=alive_created show_from=False show_to=True %}
|
||||||
<div class="notes">
|
|
||||||
{% for note in alive_created %}
|
|
||||||
<div class="note">
|
|
||||||
<p>{{ note.note }}</p>
|
|
||||||
<p class="note-from">From {{ note.from_user.visible_name }}</p>
|
|
||||||
<p class="note-at">{{ note.created_at|date:"j M Y, H:i"}}</p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<div class="card">No Notes found</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="title-and-link">
|
<div class="title-and-link">
|
||||||
<h2>Archived Notes</h2>
|
<h2>Archived Notes</h2>
|
||||||
<a href="{% url "archive" %}">View All</a>
|
<a href="{% url "archive" %}">View All</a>
|
||||||
</div>
|
</div>
|
||||||
{% if archive %}
|
{% include "notes/notes.html" with object_list=archive show_from=True show_to=False %}
|
||||||
<div class="notes">
|
|
||||||
{% for note in archive %}
|
|
||||||
<div class="note">
|
|
||||||
<p>{{ note.note }}</p>
|
|
||||||
<p class="note-from">From {{ note.from_user.visible_name }}</p>
|
|
||||||
<p class="note-at">{{ note.created_at|date:"j M Y, H:i"}}</p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<div class="card">No Notes found</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -5,20 +5,5 @@
|
|||||||
{% block body %}
|
{% block body %}
|
||||||
<h1>{{ title }}</h1>
|
<h1>{{ title }}</h1>
|
||||||
{% include "notes/messages.html" %}
|
{% include "notes/messages.html" %}
|
||||||
|
{% include "notes/notes.html" %}
|
||||||
{% if object_list %}
|
|
||||||
<div class="notes">
|
|
||||||
{% for note in object_list %}
|
|
||||||
<div class="note">
|
|
||||||
<p>{{ note.note }}</p>
|
|
||||||
{% if show_from %}<p class="note-from">From {{ note.from_user.visible_name }}</p>{% endif %}
|
|
||||||
{% if show_to %}<p class="note-to">To {{ note.to_user.visible_name }}</p>{% endif %}
|
|
||||||
<p class="note-at">{{ note.created_at|date:"j M Y, H:i"}}</p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<div class="card">No Notes found</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
15
server/notes/templates/notes/notes.html
Normal file
15
server/notes/templates/notes/notes.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{% if object_list %}
|
||||||
|
<div class="notes">
|
||||||
|
{% for note in object_list %}
|
||||||
|
<div class="note">
|
||||||
|
<p>{{ note.note | linebreaksbr }}</p>
|
||||||
|
{% if show_from %}<p class="note-from">From {{ note.from_user.visible_name }}</p>{% endif %}
|
||||||
|
{% if show_to %}<p class="note-to">To {{ note.to_user.visible_name }}</p>{% endif %}
|
||||||
|
<p class="note-at">{{ note.created_at|date:"j M Y, H:i"}}</p>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="card">No Notes found</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
Reference in New Issue
Block a user