refactor: Refactors HTML templates for consistency

Updates Django templates to unify block definition format
Removes unnecessary whitespace and aligns code for better readability
Standardizes form method attribute casing for uniformity

These changes enhance maintainability and readability across templates.
This commit is contained in:
Kumi 2024-12-23 21:30:08 +01:00
parent f932922cd7
commit f3d6154259
Signed by: kumi
GPG key ID: ECBCC9082395383F
34 changed files with 1038 additions and 831 deletions

View file

@ -1,16 +1,17 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6>
<h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <p>Are you sure you wish to delete this dream? This cannot be undone.</p>
<p>Are you sure you wish to delete this dream? This cannot be undone.</p> <form action="" method="post">
<form action="" method="POST">{% csrf_token %}<button class="form-control btn-danger" type="submit">Delete Dream</button></form> {% csrf_token %}
</div> <button class="form-control btn-danger" type="submit">Delete Dream</button>
</div> </form>
</div> </div>
</div>
{% endblock %} </div>
{% endblock content %}

View file

@ -1,60 +1,133 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
{% if form.errors %}
{% if form.errors %} {% for field in form %}
{% for field in form %} {% for error in field.errors %}
{% for error in field.errors %} <div class="alert alert-danger" role="alert">{{ field.name }}: {{ error }}</div>
<div class="alert alert-danger" role="alert"> {% endfor %}
{{ field.name }}: {{ error }} {% endfor %}
</div> {% endif %}
{% endfor %} <div class="card shadow mb-4">
{% endfor %} <div class="card-header py-3">
{% endif %} <h6 class="m-0 font-weight-bold text-primary">Edit {{ object.title }}</h6>
<div class="card shadow mb-4"> </div>
<div class="card-header py-3"> <div class="card-body">
<h6 class="m-0 font-weight-bold text-primary">Edit {{ object.title }}</h6> <form action="" method="post" enctype="multipart/form-data">
</div> {% csrf_token %}
<div class="card-body"> <div class="table-responsive">
<form action="" method="POST" enctype="multipart/form-data"> <table>
{% csrf_token %} <tr>
<div class="table-responsive"> <th>
<table> <label for="id_timestamp">Timestamp:</label>
<tr><th><label for="id_timestamp">Timestamp:</label></th><td><input type="text" name="timestamp" value="{% if object.timestamp %}{{ object.timestamp | date:"Y-m-d H:i" }}{% else %}{% now "Y-m-d H:i" %}{% endif %}" required id="id_timestamp"><input type="hidden" name="initial-timestamp" value="2020-12-26 19:24:14" id="initial-id_timestamp"></td></tr> </th>
<tr><th><label for="id_type">Type:</label></th><td><select name="type" required="" id="id_type"> <td>
{% for value, text in form.type.field.choices %} <input type="text"
name="timestamp"
value="{% if object.timestamp %}{{ object.timestamp | date:"Y-m-d H:i" }}{% else %}{% now "Y-m-d H:i" %}{% endif %}"
required
id="id_timestamp">
<input type="hidden"
name="initial-timestamp"
value="2020-12-26 19:24:14"
id="initial-id_timestamp">
</td>
</tr>
<tr>
<th>
<label for="id_type">Type:</label>
</th>
<td>
<select name="type" required="" id="id_type">
{% for value, text in form.type.field.choices %}
<option value="{{ value }}" {% if object.type == value %}selected{% endif %}>{{ text }}</option> <option value="{{ value }}" {% if object.type == value %}selected{% endif %}>{{ text }}</option>
{% endfor %} {% endfor %}
</select>
</select></td></tr> </td>
<tr><th><label for="id_title">Title:</label></th><td><input value="{{ object.title }}" type="text" name="title" maxlength="64" id="id_title"></td></tr> </tr>
<tr>
<tr><th><label for="id_content">Text:</label></th><td><textarea name="content" cols="40" rows="10" id="id_content">{{ object.content }}</textarea></td></tr> <th>
<label for="id_title">Title:</label>
<tr><th><label for="id_mood">Mood:</label></th><td><select name="mood" class="dtb" required id="id_mood"> </th>
<option value="" {% if not object.mood %}selected{% endif %}>---------</option> <td>
<input value="{{ object.title }}"
{% for mood in request.user.mood_set.all|dictsort:"value" %} type="text"
<option data-icon="{{ mood.icon }}" value="{{ mood.id }}" {% if object.mood == mood %}selected{% endif %}>{{ mood }}</option> name="title"
{% endfor %} maxlength="64"
id="id_title">
</select></td></tr> </td>
</tr>
<tr>
<tr><th><label for="id_lucid">Lucid:</label></th><td><input type="checkbox" {% if object.lucid %}checked{% endif %} name="lucid"> <i class="fas fa-exclamation"></i> Lucid Dream?<br></td></tr> <th>
<tr><th><label for="id_lucid">Wet:</label></th><td><input type="checkbox" {% if object.wet %}checked{% endif %} name="wet"> <i class="fas fa-tint"></i> Wet Dream?<br></td></tr> <label for="id_content">Text:</label>
</th>
<tr><th><label for="activities">Themes:</label></th><td> <td>
{% for theme in request.user.theme_set.all %} <textarea name="content" cols="40" rows="10" id="id_content">{{ object.content }}</textarea>
<input type="checkbox" {% if theme in object.theme_set %}checked{% endif %} value="{{ theme.id }}" name="themes"> <i class="{{ theme.icon }}" style="color:{{ theme.color }};"></i> {{ theme }}<br> </td>
{% endfor %} </tr>
</td></tr> <tr>
<th>
<tr><th><label for="id_uploads">Uploads:</label></th><td><input type="file" name="uploads" id="id_uploads" multiple="multiple"></td></tr> <label for="id_mood">Mood:</label>
</table> </th>
</div> <td>
<button style="margin-top: 20px;" class="form-control btn-primary" type="submit">Save</button> <select name="mood" class="dtb" required id="id_mood">
</form> <option value="" {% if not object.mood %}selected{% endif %}>---------</option>
</div> {% for mood in request.user.mood_set.all|dictsort:"value" %}
</div> <option data-icon="{{ mood.icon }}"
value="{{ mood.id }}"
{% endblock %} {% if object.mood == mood %}selected{% endif %}>{{ mood }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<th>
<label for="id_lucid">Lucid:</label>
</th>
<td>
<input type="checkbox" {% if object.lucid %}checked{% endif %} name="lucid">
<i class="fas fa-exclamation"></i> Lucid Dream?
<br>
</td>
</tr>
<tr>
<th>
<label for="id_lucid">Wet:</label>
</th>
<td>
<input type="checkbox" {% if object.wet %}checked{% endif %} name="wet">
<i class="fas fa-tint"></i> Wet Dream?
<br>
</td>
</tr>
<tr>
<th>
<label for="activities">Themes:</label>
</th>
<td>
{% for theme in request.user.theme_set.all %}
<input type="checkbox"
{% if theme in object.theme_set %}checked{% endif %}
value="{{ theme.id }}"
name="themes">
<i class="{{ theme.icon }}" style="color:{{ theme.color }};"></i> {{ theme }}
<br>
{% endfor %}
</td>
</tr>
<tr>
<th>
<label for="id_uploads">Uploads:</label>
</th>
<td>
<input type="file" name="uploads" id="id_uploads" multiple="multiple">
</td>
</tr>
</table>
</div>
<button style="margin-top: 20px"
class="form-control btn-primary"
type="submit">Save</button>
</form>
</div>
</div>
{% endblock content %}

View file

@ -1,34 +1,46 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Dreams</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Dreams</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table data-order="[[ 0, &quot;desc&quot; ]]"
<table data-order="[[ 0, &quot;desc&quot; ]]" class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> class="table table-bordered"
<thead> id="dataTable"
<tr> width="100%"
<th>Timestamp</th> cellspacing="0">
<th>Mood</th> <thead>
<th>Themes</th> <tr>
<th>Title</th> <th>Timestamp</th>
</tr> <th>Mood</th>
</thead> <th>Themes</th>
<tbody> <th>Title</th>
{% for dream in object_list %} </tr>
<tr onclick="window.location.href='{% url "dreams:dream_view" dream.id %}'"> </thead>
<td data-order="{{ dream.timestamp | date:"U" }}">{{ dream.timestamp }}</td> <tbody>
<td><i data-order="{{ dream.mood.value }}" style="color:{{ dream.mood.color }};" class="{{ dream.mood.icon }}"></i> {{ dream.mood }}</td> {% for dream in object_list %}
<td>{% for theme in dream.dreamtheme_set.all %}<i title="{{ theme.theme }}{% if theme.comment %} - {{ theme.comment }}{% endif %}" style="color:{{ theme.theme.color }};" class="{{ theme.theme.icon }}"></i> {% endfor %}</td> <tr onclick="window.location.href='{% url "dreams:dream_view" dream.id %}'">
<td>{{ dream.short_text }}</td> <td data-order="{{ dream.timestamp | date:"U" }}">{{ dream.timestamp }}</td>
</tr> <td>
{% endfor %} <i data-order="{{ dream.mood.value }}"
</tbody> style="color:{{ dream.mood.color }}"
</table> class="{{ dream.mood.icon }}"></i> {{ dream.mood }}
</div> </td>
</div> <td>
</div> {% for theme in dream.dreamtheme_set.all %}
<i title="{{ theme.theme }}{% if theme.comment %} - {{ theme.comment }}{% endif %}"
{% endblock %} style="color:{{ theme.theme.color }}"
class="{{ theme.theme.icon }}"></i>
{% endfor %}
</td>
<td>{{ dream.short_text }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock content %}

View file

@ -1,70 +1,78 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="row">
<div class="row"> <!-- Entry details -->
<div class="col-xl-8 col-lg-7">
<!-- Entry details --> <div class="card shadow mb-4">
<div class="col-xl-8 col-lg-7"> <!-- Card Header - Dropdown -->
<div class="card shadow mb-4"> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<!-- Card Header - Dropdown --> <h6 class="m-0 font-weight-bold text-primary">Dream Entry</h6>
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> </div>
<h6 class="m-0 font-weight-bold text-primary">Dream Entry</h6> <!-- Card Body -->
<div class="card-body">
</div> <p>
<!-- Card Body --> <i>{{ object.timestamp }}</i>
<div class="card-body"> </p>
<p><i>{{ object.timestamp }}</i></p> <h3>{{ object.title }}</h3>
<h3>{{ object.title }}</h3> <blockquote>
<blockquote>{{ object.content|linebreaks }}</blockquote> {{ object.content|linebreaks }}
</div> </blockquote>
</div> </div>
</div> </div>
</div>
<!-- Mood --> <!-- Mood -->
<div class="col-xl-4 col-lg-5"> <div class="col-xl-4 col-lg-5">
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<!-- Card Header - Dropdown --> <!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Mood</h6> <h6 class="m-0 font-weight-bold text-primary">Mood</h6>
</div> </div>
<!-- Card Body --> <!-- Card Body -->
<div class="card-body"> <div class="card-body">
<i title="{{ object.mood }}" style="color: {{ object.mood.color }}; font-size: 200px;" title="" class="{{ object.mood.icon }}"></i> <i title="{{ object.mood }}"
</div> style="color: {{ object.mood.color }};
</div> font-size: 200px"
</div> title=""
class="{{ object.mood.icon }}"></i>
</div>
</div>
</div>
</div>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Themes</h6>
</div>
<div class="py-3">
<div class="container">
<div class="row" id="cards">
{% for theme in object.dreamtheme_set.all %}
<div class="card">
<i title="{{ theme.theme }}"
style="display: inline;
color: {{ theme.theme.color }};
font-size: 50px"
title=""
class="{{ theme.theme.icon }}"></i>
</div> </div>
{% endfor %}
<div class="card shadow mb-4"> </div>
<div class="card-header py-3"> </div>
<h6 class="m-0 font-weight-bold text-primary">Themes</h6> </div>
</div> <div class="card shadow mb-4">
<div class="py-3"> <div class="card-header py-3">
<div class="container"> <h6 class="m-0 font-weight-bold text-primary">Attachments</h6>
<div class="row" id="cards"> </div>
{% for theme in object.dreamtheme_set.all %} <div class="py-3">
<div class="card"> <div class="container">
<i title="{{ theme.theme }}" style="display: inline; color: {{ theme.theme.color }}; font-size: 50px;" title="" class="{{ theme.theme.icon }}"></i> <ul>
</div> {% for attachment in object.dreammedia_set.all %}
{% endfor %} <li>
</div> <a href="{{ attachment.media.url }}">{{ attachment.basename }}</a>
</div> </li>
</div> {% endfor %}
</ul>
<div class="card shadow mb-4"> </div>
<div class="card-header py-3"> </div>
<h6 class="m-0 font-weight-bold text-primary">Attachments</h6> </div>
</div> </div>
<div class="py-3"> {% endblock content %}
<div class="container">
<ul>
{% for attachment in object.dreammedia_set.all %}
<li><a href="{{ attachment.media.url }}">{{ attachment.basename }}</a></li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endblock %}

View file

@ -1,28 +1,35 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Moods</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Moods</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered"
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> id="dataTable"
<thead> width="100%"
<tr> cellspacing="0">
<th>Name <i>(Value)</i></th> <thead>
</tr> <tr>
</thead> <th>
<tbody> Name <i>(Value)</i>
{% for mood in object_list %} </th>
<tr onclick="window.location.href='{% url "mood:mood_edit" mood.id %}'"> </tr>
<td><i data-order="{{ mood.value }}" style="color:{{ mood.color }};" class="{{ mood.icon }}"></i> {{ mood }} <i>({{ mood.value }})</i></td> </thead>
</tr> <tbody>
{% endfor %} {% for mood in object_list %}
</tbody> <tr onclick="window.location.href='{% url "mood:mood_edit" mood.id %}'">
</table> <td>
</div> <i data-order="{{ mood.value }}"
</div> style="color:{{ mood.color }}"
</div> class="{{ mood.icon }}"></i> {{ mood }} <i>({{ mood.value }})</i>
</td>
{% endblock %} </tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock content %}

View file

@ -1,16 +1,17 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Delete {{ object.time }} Notification?</h6>
<h6 class="m-0 font-weight-bold text-primary">Delete {{ object.time }} Notification?</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <p>Are you sure you wish to delete this notification? This cannot be undone.</p>
<p>Are you sure you wish to delete this notification? This cannot be undone.</p> <form action="" method="post">
<form action="" method="POST">{% csrf_token %}<button class="form-control btn-danger" type="submit">Delete Notification</button></form> {% csrf_token %}
</div> <button class="form-control btn-danger" type="submit">Delete Notification</button>
</div> </form>
</div> </div>
</div>
{% endblock %} </div>
{% endblock content %}

View file

@ -1,30 +1,40 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
{% if form.errors %}
{% if form.errors %} {% for field in form %}
{% for field in form %} {% for error in field.errors %}
{% for error in field.errors %} <div class="alert alert-danger" role="alert">{{ field.name }}: {{ error }}</div>
<div class="alert alert-danger" role="alert"> {% endfor %}
{{ field.name }}: {{ error }} {% endfor %}
</div> {% endif %}
{% endfor %} <div class="card shadow mb-4">
{% endfor %} <div class="card-header py-3">
{% endif %} <h6 class="m-0 font-weight-bold text-primary">Edit {{ object.time }}</h6>
<div class="card shadow mb-4"> </div>
<div class="card-header py-3"> <div class="card-body">
<h6 class="m-0 font-weight-bold text-primary">Edit {{ object.time }}</h6> <form action="" method="post">
</div> {% csrf_token %}
<div class="card-body"> <div class="table-responsive">
<form action="" method="POST"> <table>
{% csrf_token %} <tr>
<div class="table-responsive"> <th>
<table> <label for="id_time">Time:</label>
<tr><th><label for="id_time">Time:</label></th><td><input type="time" name="time" value="{% if object.time %}{{ object.time|date:"H:i" }}{% else %}12:00{% endif %}" maxlength="64" required id="id_time"></td></tr> </th>
</table> <td>
</div> <input type="time"
<button style="margin-top: 20px;" class="form-control btn-primary" type="submit">Save</button> name="time"
</form> value="{% if object.time %}{{ object.time|date:"H:i" }}{% else %}12:00{% endif %}"
</div> maxlength="64"
</div> required
id="id_time">
{% endblock %} </td>
</tr>
</table>
</div>
<button style="margin-top: 20px"
class="form-control btn-primary"
type="submit">Save</button>
</form>
</div>
</div>
{% endblock content %}

View file

@ -1,28 +1,29 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Daily Notifications</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Daily Notifications</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered"
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> id="dataTable"
<thead> width="100%"
<tr> cellspacing="0">
<th>Time</th> <thead>
</tr> <tr>
</thead> <th>Time</th>
<tbody> </tr>
{% for notification in object_list %} </thead>
<tr onclick="window.location.href='{% url "mood:notification_edit" notification.id %}'"> <tbody>
<td>{{ notification.time }}</td> {% for notification in object_list %}
</tr> <tr onclick="window.location.href='{% url "mood:notification_edit" notification.id %}'">
{% endfor %} <td>{{ notification.time }}</td>
</tbody> </tr>
</table> {% endfor %}
</div> </tbody>
</div> </table>
</div> </div>
</div>
{% endblock %} </div>
{% endblock content %}

View file

@ -1,16 +1,19 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6>
<h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <p>
<p>Are you sure you wish to delete {{ object }}? This cannot be undone. Mood entries that are associated with this activity will not be deleted.</p> Are you sure you wish to delete {{ object }}? This cannot be undone. Mood entries that are associated with this activity will not be deleted.
<form action="" method="POST">{% csrf_token %}<button class="form-control btn-danger" type="submit">Delete Activity</button></form> </p>
</div> <form action="" method="post">
</div> {% csrf_token %}
</div> <button class="form-control btn-danger" type="submit">Delete Activity</button>
</form>
{% endblock %} </div>
</div>
</div>
{% endblock %}

View file

@ -1,30 +1,63 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6>
<h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <form action="" method="post">
<form action="" method="POST"> {% csrf_token %}
{% csrf_token %} <div class="table-responsive">
<div class="table-responsive"> <table>
<table> <tr>
<tr><th><label for="id_name">Name:</label></th><td><input type="text" name="name" value="{{ object.name }}" maxlength="64" required id="id_name"></td></tr> <th>
<tr><th><label for="id_icon">Icon:</label></th><td><input style="visibility: hidden;" class="icp icp-auto" type="text" name="icon" value="{{ object.icon }}" maxlength="64" required id="id_icon"></td></tr> <label for="id_name">Name:</label>
<tr><th><label for="id_color">Color:</label></th><td><input type="text" </th>
id="id_color" <td>
class="form-control colorfield_field jscolor" <input type="text"
name="color" name="name"
value="{{ object.color }}" value="{{ object.name }}"
placeholder="{{ object.color }}" maxlength="64"
data-jscolor="{hash:true,width:225,height:150,required:true}" required
required /></td></tr> id="id_name">
</table> </td>
</div> </tr>
<button style="margin-top: 20px;" class="form-control btn-primary" type="submit">Save</button> <tr>
</form> <th>
</div> <label for="id_icon">Icon:</label>
</div> </th>
<td>
{% endblock %} <input style="visibility: hidden"
class="icp icp-auto"
type="text"
name="icon"
value="{{ object.icon }}"
maxlength="64"
required
id="id_icon">
</td>
</tr>
<tr>
<th>
<label for="id_color">Color:</label>
</th>
<td>
<input type="text"
id="id_color"
class="form-control colorfield_field jscolor"
name="color"
value="{{ object.color }}"
placeholder="{{ object.color }}"
data-jscolor="{hash:true,width:225,height:150,required:true}"
required />
</td>
</tr>
</table>
</div>
<button style="margin-top: 20px"
class="form-control btn-primary"
type="submit">Save</button>
</form>
</div>
</div>
{% endblock content %}

View file

@ -1,28 +1,33 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Themes</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Themes</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered"
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> id="dataTable"
<thead> width="100%"
<tr> cellspacing="0">
<th>Name</th> <thead>
</tr> <tr>
</thead> <th>Name</th>
<tbody> </tr>
{% for theme in object_list %} </thead>
<tr onclick="window.location.href='{% url "dreams:theme_edit" theme.id %}'"> <tbody>
<td><i data-order="{{ theme }}" style="color:{{ theme.color }};" class="{{ theme.icon }}"></i> {{ theme }}</td> {% for theme in object_list %}
</tr> <tr onclick="window.location.href='{% url "dreams:theme_edit" theme.id %}'">
{% endfor %} <td>
</tbody> <i data-order="{{ theme }}"
</table> style="color:{{ theme.color }}"
</div> class="{{ theme.icon }}"></i> {{ theme }}
</div> </td>
</div> </tr>
{% endfor %}
{% endblock %} </tbody>
</table>
</div>
</div>
</div>
{% endblock content %}

View file

@ -1,78 +1,66 @@
{% include "frontend/header_admin.html" with title=title styles=styles %} {% include "frontend/header_admin.html" with title=title styles=styles %}
{% include "frontend/sidebar.html" with title=title %} {% include "frontend/sidebar.html" with title=title %}
<!-- Content Wrapper -->
<!-- Content Wrapper --> <div id="content-wrapper" class="d-flex flex-column">
<div id="content-wrapper" class="d-flex flex-column"> <!-- Main Content -->
<div id="content">
<!-- Main Content --> {% include "frontend/topbar.html" with user=user %}
<div id="content"> <!-- Begin Page Content -->
<div class="container-fluid">
{% include "frontend/topbar.html" with user=user %} <!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<!-- Begin Page Content --> <h1 class="h3 mb-2 text-gray-800">{{ title }}</h1>
<div class="container-fluid"> <div>
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-2 text-gray-800">{{ title }}</h1>
<div>
{% for button in buttons %} {% for button in buttons %}
<a href="{{ button.0 }}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-{{ button.2 }} fa-sm text-white-50"></i> {{ button.1 }}</a> <a href="{{ button.0 }}"
class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-{{ button.2 }} fa-sm text-white-50"></i> {{ button.1 }}</a>
{% endfor %} {% endfor %}
</div>
</div>
<p class="mb-4">{{ subtitle }}</p>
{% block "content" %}
{% endblock %}
</div> </div>
<!-- /.container-fluid -->
</div> </div>
<!-- End of Main Content --> <p class="mb-4">{{ subtitle }}</p>
{% block content %}{% endblock content %}
<!-- Footer -->
<footer class="sticky-footer bg-white">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Brought to you by <a href="https://kumi.website">Kumi</a> |
Source code available on <a href="https://git.private.coffee/kumi/kumify.git">Private.coffee Git</a></span>
</div>
</div>
</footer>
<!-- End of Footer -->
</div> </div>
<!-- End of Content Wrapper --> <!-- /.container-fluid -->
</div> </div>
<!-- End of Page Wrapper --> <!-- End of Main Content -->
<!-- Footer -->
<!-- Scroll to Top Button--> <footer class="sticky-footer bg-white">
<a class="scroll-to-top rounded" href="#page-top"> <div class="container my-auto">
<i class="fas fa-angle-up"></i> <div class="copyright text-center my-auto">
</a> <span>Brought to you by <a href="https://kumi.website">Kumi</a> |
Source code available on <a href="https://git.private.coffee/kumi/kumify.git">Private.coffee Git</a></span>
<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" href="{% url "logout" %}">Logout</a>
</div>
</div> </div>
</div> </div>
</footer>
{% include "frontend/footer.html" with scripts=scripts %} <!-- End of Footer -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<!-- Logout Modal-->
<div class="modal fade"
id="logoutModal"
tabindex="-1"
role="dialog"
aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" href="{% url "logout" %}">Logout</a>
</div>
</div>
</div>
{% include "frontend/footer.html" with scripts=scripts %}

View file

@ -1,6 +1,6 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% load dashboard %} {% load dashboard %}
{% block "content" %} {% block content %}
{% dashboard as dashboard %} {% dashboard as dashboard %}
{{ dashboard | safe }} {{ dashboard | safe }}
{% endblock "content" %} {% endblock content %}

View file

@ -1,27 +1,17 @@
{% load static %} {% load static %}
<!-- Bootstrap core JavaScript--> <!-- Bootstrap core JavaScript-->
<script src="{% static "frontend/vendor/jquery/jquery.min.js" %}"></script> <script src="{% static "frontend/vendor/jquery/jquery.min.js" %}"></script>
<script src="{% static "frontend/vendor/bootstrap/js/bootstrap.bundle.min.js" %}"></script> <script src="{% static "frontend/vendor/bootstrap/js/bootstrap.bundle.min.js" %}"></script>
<!-- Core plugin JavaScript--> <!-- Core plugin JavaScript-->
<script src="{% static "frontend/vendor/jquery-easing/jquery.easing.min.js" %}"></script> <script src="{% static "frontend/vendor/jquery-easing/jquery.easing.min.js" %}"></script>
<!-- Custom scripts for all pages--> <!-- Custom scripts for all pages-->
<script src="{% static "frontend/js/sb-admin-2.min.js" %}"></script> <script src="{% static "frontend/js/sb-admin-2.min.js" %}"></script>
<script src="{% static "frontend/js/bosskey.js" %}"></script> <script src="{% static "frontend/js/bosskey.js" %}"></script>
<!-- Page level plugins --> <!-- Page level plugins -->
<script src="{% static "frontend/vendor/datatables/jquery.dataTables.min.js" %}"></script> <script src="{% static "frontend/vendor/datatables/jquery.dataTables.min.js" %}"></script>
<script src="{% static "frontend/vendor/datatables/dataTables.bootstrap4.min.js" %}"></script> <script src="{% static "frontend/vendor/datatables/dataTables.bootstrap4.min.js" %}"></script>
<script src="{% static "frontend/js/datatables-demo.js" %}"></script> <script src="{% static "frontend/js/datatables-demo.js" %}"></script>
<!-- Page level custom scripts --> <!-- Page level custom scripts -->
{% for script in scripts %} {% for script in scripts %}<script src="{{ script }}"></script>{% endfor %}
<script src="{{ script }}"></script>
{% endfor %}
</body> </body>
</html>
</html>

View file

@ -1,3 +1,2 @@
</div> </div>
{% include "frontend/footer.html" with scripts=scripts %}
{% include "frontend/footer.html" with scripts=scripts %}

View file

@ -1,30 +1,25 @@
{% load static %} {% load static %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8"> <meta name="viewport"
<meta http-equiv="X-UA-Compatible" content="IE=edge"> content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="">
<meta name="description" content=""> <meta name="author" content="">
<meta name="author" content=""> <title>
{% if title %}{{ title }} -{% endif %}
<title>{% if title %}{{ title }} - {% endif %}Kumify</title> Kumify</title>
<!-- Custom fonts for this template -->
<!-- Custom fonts for this template --> <link href="https://fa.kumi.systems/css/all.min.css"
<link href="https://fa.kumi.systems/css/all.min.css" rel="stylesheet" type="text/css"> rel="stylesheet"
<link type="text/css">
href="https://googledonts.private.coffee/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" <link href="https://googledonts.private.coffee/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet"> rel="stylesheet">
<!-- Custom styles for this template -->
<!-- Custom styles for this template --> <link href="{% static "frontend/css/sb-admin-2.min.css" %}" rel="stylesheet">
<link href="{% static "frontend/css/sb-admin-2.min.css" %}" rel="stylesheet"> <link href="{% static "frontend/vendor/datatables/dataTables.bootstrap4.min.css" %}" rel="stylesheet">
<link href="{% static "frontend/vendor/datatables/dataTables.bootstrap4.min.css" %}" rel="stylesheet"> <!-- Custom styles for this page -->
{% for style in styles %}<link href="{{ style }}" rel="stylesheet">{% endfor %}
<!-- Custom styles for this page --> </head>
{% for style in styles %}
<link href="{{ style }}" rel="stylesheet">
{% endfor %}
</head>

View file

@ -1,6 +1,4 @@
{% include "frontend/header.html" with styles=styles title=title %} {% include "frontend/header.html" with styles=styles title=title %}
<body id="page-top"> <body id="page-top">
<!-- Page Wrapper --> <!-- Page Wrapper -->
<div id="wrapper"> <div id="wrapper">

View file

@ -1,28 +1,25 @@
{% load navigation %} {% load navigation %}
<!-- Sidebar -->
<!-- Sidebar --> <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion"
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar"> id="accordionSidebar">
<!-- Sidebar - Brand -->
<!-- Sidebar - Brand --> <a class="sidebar-brand d-flex align-items-center justify-content-center"
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="/"> href="/">
<div class="sidebar-brand-icon rotate-n-15"> <div class="sidebar-brand-icon rotate-n-15">
<i class="fas fa-laugh-wink"></i> <i class="fas fa-laugh-wink"></i>
</div> </div>
<div class="sidebar-brand-text mx-3">Kumify</div> <div class="sidebar-brand-text mx-3">Kumify</div>
</a> </a>
<!-- Divider -->
<!-- Divider --> <hr class="sidebar-divider my-0">
<hr class="sidebar-divider my-0"> {% autoescape off %}
{% sidebar_nav %}
{% autoescape off %}{% sidebar_nav %}{% endautoescape %} {% endautoescape %}
<!-- Divider -->
<!-- Divider --> <hr class="sidebar-divider d-none d-md-block">
<hr class="sidebar-divider d-none d-md-block"> <!-- Sidebar Toggler (Sidebar) -->
<div class="text-center d-none d-md-inline">
<!-- Sidebar Toggler (Sidebar) --> <button class="rounded-circle border-0" id="sidebarToggle"></button>
<div class="text-center d-none d-md-inline"> </div>
<button class="rounded-circle border-0" id="sidebarToggle"></button> </ul>
</div> <!-- End of Sidebar -->
</ul>
<!-- End of Sidebar -->

View file

@ -1,47 +1,57 @@
<!-- Topbar --> <!-- Topbar -->
<nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow"> <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
<!-- Sidebar Toggle (Topbar) -->
<!-- Sidebar Toggle (Topbar) --> <form class="form-inline">
<form class="form-inline"> <button id="sidebarToggleTop"
<button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3"> class="btn btn-link d-md-none rounded-circle mr-3">
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</button> </button>
</form> </form>
<!-- Topbar Navbar -->
<!-- Topbar Navbar --> <ul class="navbar-nav ml-auto">
<ul class="navbar-nav ml-auto"> <!-- Nav Item - User Information -->
<!-- Nav Item - User Information --> <li class="nav-item dropdown no-arrow">
<li class="nav-item dropdown no-arrow"> <a class="nav-link dropdown-toggle"
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" href="#"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> id="userDropdown"
<span class="mr-2 d-none d-lg-inline text-gray-600 small">{% if request.uset.get_full_name %}{{ request.user.get_full_name }}{% else %}{{ request.user.username }}{% endif %}</span> role="button"
<img class="img-profile rounded-circle" data-toggle="dropdown"
src="img/undraw_profile.svg"> aria-haspopup="true"
</a> aria-expanded="false">
<!-- Dropdown - User Information --> <span class="mr-2 d-none d-lg-inline text-gray-600 small">
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" {% if request.uset.get_full_name %}
aria-labelledby="userDropdown"> {{ request.user.get_full_name }}
<a class="dropdown-item" href="#"> {% else %}
<i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> {{ request.user.username }}
Profile {% endif %}
</a> </span>
<a class="dropdown-item" href="#"> <img class="img-profile rounded-circle" src="img/undraw_profile.svg">
<i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i> </a>
Settings <!-- Dropdown - User Information -->
</a> <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
<a class="dropdown-item" href="#"> aria-labelledby="userDropdown">
<i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i> <a class="dropdown-item" href="#">
Activity Log <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
</a> Profile
<div class="dropdown-divider"></div> </a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal"> <a class="dropdown-item" href="#">
<i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i> <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>
Logout Settings
</a> </a>
</div> <a class="dropdown-item" href="#">
</li> <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>
Activity Log
</ul> </a>
<div class="dropdown-divider"></div>
</nav> <a class="dropdown-item"
<!-- End of Topbar --> href="#"
data-toggle="modal"
data-target="#logoutModal">
<i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
Logout
</a>
</div>
</li>
</ul>
</nav>
<!-- End of Topbar -->

View file

@ -1,16 +1,19 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6>
<h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <p>
<p>Are you sure you wish to delete {{ object }}? This cannot be undone. Mood entries that are associated with this activity will not be deleted.</p> Are you sure you wish to delete {{ object }}? This cannot be undone. Mood entries that are associated with this activity will not be deleted.
<form action="" method="POST">{% csrf_token %}<button class="form-control btn-danger" type="submit">Delete Activity</button></form> </p>
</div> <form action="" method="post">
</div> {% csrf_token %}
</div> <button class="form-control btn-danger" type="submit">Delete Activity</button>
</form>
{% endblock %} </div>
</div>
</div>
{% endblock content %}

View file

@ -1,11 +1,11 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4"> <div class="card shadow mb-4">
<div class="card-header py-3"> <div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6> <h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="" method="POST"> <form action="" method="post">
{% csrf_token %} {% csrf_token %}
<div class="table-responsive"> <div class="table-responsive">
<table> <table>
@ -71,4 +71,4 @@
</form> </form>
</div> </div>
</div> </div>
{% endblock %} {% endblock content %}

View file

@ -1,28 +1,33 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Activities</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Activities</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered"
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> id="dataTable"
<thead> width="100%"
<tr> cellspacing="0">
<th>Name</th> <thead>
</tr> <tr>
</thead> <th>Name</th>
<tbody> </tr>
{% for activity in object_list %} </thead>
<tr onclick="window.location.href='{% url "mood:activity_edit" activity.id %}'"> <tbody>
<td><i data-order="{{ activity }}" style="color:{{ activity.color }};" class="{{ activity.icon }}"></i> {{ activity }}</td> {% for activity in object_list %}
</tr> <tr onclick="window.location.href='{% url "mood:activity_edit" activity.id %}'">
{% endfor %} <td>
</tbody> <i data-order="{{ activity }}"
</table> style="color:{{ activity.color }}"
</div> class="{{ activity.icon }}"></i> {{ activity }}
</div> </td>
</div> </tr>
{% endfor %}
{% endblock %} </tbody>
</table>
</div>
</div>
</div>
{% endblock content %}

View file

@ -1,5 +1,4 @@
{% load mood_stats %} {% load mood_stats %}
<!-- Mood calendar heatmap --> <!-- Mood calendar heatmap -->
<div class="row"> <div class="row">
<div class="col-xl-12 mb-4"> <div class="col-xl-12 mb-4">

View file

@ -1,40 +1,83 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
{% if form.errors %}
{% if form.errors %} {% for field in form %}
{% for field in form %} {% for error in field.errors %}
{% for error in field.errors %} <div class="alert alert-danger" role="alert">{{ field.name }}: {{ error }}</div>
<div class="alert alert-danger" role="alert"> {% endfor %}
{{ field.name }}: {{ error }} {% endfor %}
</div> {% endif %}
{% endfor %} <div class="card shadow mb-4">
{% endfor %} <div class="card-header py-3">
{% endif %} <h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6>
<div class="card shadow mb-4"> </div>
<div class="card-header py-3"> <div class="card-body">
<h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6> <form action="" method="post">
</div> {% csrf_token %}
<div class="card-body"> <div class="table-responsive">
<form action="" method="POST"> <table>
{% csrf_token %} <tr>
<div class="table-responsive"> <th>
<table> <label for="id_name">Name:</label>
<tr><th><label for="id_name">Name:</label></th><td><input type="text" name="name" value="{{ object.name }}" maxlength="64" required id="id_name"></td></tr> </th>
<tr><th><label for="id_icon">Icon:</label></th><td><input style="visibility: hidden;" class="icp icp-auto" type="text" name="icon" value="{{ object.icon }}" maxlength="64" required id="id_icon"></td></tr> <td>
<tr><th><label for="id_color">Color:</label></th><td><input type="text" <input type="text"
id="id_color" name="name"
class="form-control colorfield_field jscolor" value="{{ object.name }}"
name="color" maxlength="64"
value="{{ object.color }}" required
placeholder="{{ object.color }}" id="id_name">
data-jscolor="{hash:true,width:225,height:150,required:true}" </td>
required /></td></tr> </tr>
<tr><th><label for="id_value">Value:</label></th><td><input name="value" type="number" step="1" value="{{ object.value }}" required id="id_value"></td></tr> <tr>
</table> <th>
</div> <label for="id_icon">Icon:</label>
<button style="margin-top: 20px;" class="form-control btn-primary" type="submit">Save</button> </th>
</form> <td>
</div> <input style="visibility: hidden"
</div> class="icp icp-auto"
type="text"
{% endblock %} name="icon"
value="{{ object.icon }}"
maxlength="64"
required
id="id_icon">
</td>
</tr>
<tr>
<th>
<label for="id_color">Color:</label>
</th>
<td>
<input type="text"
id="id_color"
class="form-control colorfield_field jscolor"
name="color"
value="{{ object.color }}"
placeholder="{{ object.color }}"
data-jscolor="{hash:true,width:225,height:150,required:true}"
required />
</td>
</tr>
<tr>
<th>
<label for="id_value">Value:</label>
</th>
<td>
<input name="value"
type="number"
step="1"
value="{{ object.value }}"
required
id="id_value">
</td>
</tr>
</table>
</div>
<button style="margin-top: 20px"
class="form-control btn-primary"
type="submit">Save</button>
</form>
</div>
</div>
{% endblock content %}

View file

@ -1,28 +1,35 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Moods</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Moods</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered"
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> id="dataTable"
<thead> width="100%"
<tr> cellspacing="0">
<th>Name <i>(Value)</i></th> <thead>
</tr> <tr>
</thead> <th>
<tbody> Name <i>(Value)</i>
{% for mood in object_list %} </th>
<tr onclick="window.location.href='{% url "mood:mood_edit" mood.id %}'"> </tr>
<td><i data-order="{{ mood.value }}" style="color:{{ mood.color }};" class="{{ mood.icon }}"></i> {{ mood }} <i>({{ mood.value }})</i></td> </thead>
</tr> <tbody>
{% endfor %} {% for mood in object_list %}
</tbody> <tr onclick="window.location.href='{% url "mood:mood_edit" mood.id %}'">
</table> <td>
</div> <i data-order="{{ mood.value }}"
</div> style="color:{{ mood.color }}"
</div> class="{{ mood.icon }}"></i> {{ mood }} <i>({{ mood.value }})</i>
</td>
{% endblock %} </tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock content %}

View file

@ -1,16 +1,17 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Delete {{ object.time }} Notification?</h6>
<h6 class="m-0 font-weight-bold text-primary">Delete {{ object.time }} Notification?</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <p>Are you sure you wish to delete this notification? This cannot be undone.</p>
<p>Are you sure you wish to delete this notification? This cannot be undone.</p> <form action="" method="POST">
<form action="" method="POST">{% csrf_token %}<button class="form-control btn-danger" type="submit">Delete Notification</button></form> {% csrf_token %}
</div> <button class="form-control btn-danger" type="submit">Delete Notification</button>
</div> </form>
</div> </div>
</div>
{% endblock %} </div>
{% endblock content %}

View file

@ -1,30 +1,40 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
{% if form.errors %}
{% if form.errors %} {% for field in form %}
{% for field in form %} {% for error in field.errors %}
{% for error in field.errors %} <div class="alert alert-danger" role="alert">{{ field.name }}: {{ error }}</div>
<div class="alert alert-danger" role="alert"> {% endfor %}
{{ field.name }}: {{ error }} {% endfor %}
</div> {% endif %}
{% endfor %} <div class="card shadow mb-4">
{% endfor %} <div class="card-header py-3">
{% endif %} <h6 class="m-0 font-weight-bold text-primary">Edit {{ object.time }}</h6>
<div class="card shadow mb-4"> </div>
<div class="card-header py-3"> <div class="card-body">
<h6 class="m-0 font-weight-bold text-primary">Edit {{ object.time }}</h6> <form action="" method="post">
</div> {% csrf_token %}
<div class="card-body"> <div class="table-responsive">
<form action="" method="POST"> <table>
{% csrf_token %} <tr>
<div class="table-responsive"> <th>
<table> <label for="id_time">Time:</label>
<tr><th><label for="id_time">Time:</label></th><td><input type="time" name="time" value="{% if object.time %}{{ object.time|date:"H:i" }}{% else %}12:00{% endif %}" maxlength="64" required id="id_time"></td></tr> </th>
</table> <td>
</div> <input type="time"
<button style="margin-top: 20px;" class="form-control btn-primary" type="submit">Save</button> name="time"
</form> value="{% if object.time %}{{ object.time|date:"H:i" }}{% else %}12:00{% endif %}"
</div> maxlength="64"
</div> required
id="id_time">
{% endblock %} </td>
</tr>
</table>
</div>
<button style="margin-top: 20px"
class="form-control btn-primary"
type="submit">Save</button>
</form>
</div>
</div>
{% endblock content %}

View file

@ -1,28 +1,29 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Daily Notifications</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Daily Notifications</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-bordered"
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> id="dataTable"
<thead> width="100%"
<tr> cellspacing="0">
<th>Time</th> <thead>
</tr> <tr>
</thead> <th>Time</th>
<tbody> </tr>
{% for notification in object_list %} </thead>
<tr onclick="window.location.href='{% url "mood:notification_edit" notification.id %}'"> <tbody>
<td>{{ notification.time }}</td> {% for notification in object_list %}
</tr> <tr onclick="window.location.href='{% url "mood:notification_edit" notification.id %}'">
{% endfor %} <td>{{ notification.time }}</td>
</tbody> </tr>
</table> {% endfor %}
</div> </tbody>
</div> </table>
</div> </div>
</div>
{% endblock %} </div>
{% endblock content %}

View file

@ -1,64 +1,58 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% load images %} {% load images %}
{% block "content" %} {% block content %}
<div class="row">
<div class="row"> <!-- Entry details -->
<div class="col-xl-8 col-lg-7">
<!-- Entry details --> <div class="card shadow mb-4">
<div class="col-xl-8 col-lg-7"> <!-- Card Header - Dropdown -->
<div class="card shadow mb-4"> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<!-- Card Header - Dropdown --> <h6 class="m-0 font-weight-bold text-primary">Mood stats</h6>
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> </div>
<h6 class="m-0 font-weight-bold text-primary">Mood stats</h6> <!-- Card Body -->
<div class="card-body">
</div> <iframe id="plot" src="plot/" width="800px" height="450px"></iframe>
<!-- Card Body --> </div>
<div class="card-body"> </div>
<iframe id="plot" src="plot/" width="800px" height="450px"></iframe> <div class="card shadow mb-4">
</div> <!-- Card Header - Dropdown -->
</div> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<div class="card shadow mb-4"> <h6 class="m-0 font-weight-bold text-primary">Mood stats</h6>
<!-- Card Header - Dropdown --> </div>
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> <!-- Card Body -->
<h6 class="m-0 font-weight-bold text-primary">Mood stats</h6> <div class="card-body">
<iframe id="plot" src="pies/" width="800px" height="450px"></iframe>
</div> </div>
<!-- Card Body --> </div>
<div class="card-body"> </div>
<iframe id="plot" src="pies/" width="800px" height="450px"></iframe> <div class="col-xl-4 col-lg-5">
</div> <div class="card shadow mb-4">
</div> <!-- Card Header - Dropdown -->
</div> <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Activities</h6>
<div class="col-xl-4 col-lg-5"> </div>
<div class="card shadow mb-4"> <!-- Card Body -->
<!-- Card Header - Dropdown --> <div class="card-body">
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between"> <table>
<h6 class="m-0 font-weight-bold text-primary">Activities</h6> <tr>
</div> <th>Activity</th>
<!-- Card Body --> <th>7 days</th>
<div class="card-body"> <th>1 month</th>
<table> <th>1 year</th>
<tr> </tr>
<th>Activity</th> {% for activity, counts in activities.items %}
<th>7 days</th> <tr onclick="window.location.href='activity/{{ activity.id }}/'">
<th>1 month</th> <td style="color:{{ activity.color }};">
<th>1 year</th> <i class="{{ activity.icon }}"></i><b> {{ activity }}</b>
</tr> </td>
{% for activity, counts in activities.items %} <td style="text-align: right;">{{ counts.weekly }}</td>
<tr onclick="window.location.href='activity/{{ activity.id }}/'"> <td style="text-align: right;">{{ counts.monthly }}</td>
<td style="color:{{ activity.color }};"><i class="{{ activity.icon }}"></i><b> {{ activity }}</b></td> <td style="text-align: right;">{{ counts.yearly }}</td>
<td style="text-align: right;">{{ counts.weekly }}</td> </tr>
<td style="text-align: right;">{{ counts.monthly }}</td> {% endfor %}
<td style="text-align: right;">{{ counts.yearly }}</td> </table>
</tr> </div>
{% endfor %} </div>
</table> </div>
</div> </div>
</div> {% endblock content %}
</div>
</div>
{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% load images %} {% load images %}
{% block "content" %} {% block content %}
<div class="row"> <div class="row">
@ -32,4 +32,4 @@
</div> </div>
{% endblock %} {% endblock content %}

View file

@ -1,16 +1,17 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6>
<h6 class="m-0 font-weight-bold text-primary">Delete {{ object }}</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <p>Are you sure you wish to delete this status? This cannot be undone.</p>
<p>Are you sure you wish to delete this status? This cannot be undone.</p> <form action="" method="POST">
<form action="" method="POST">{% csrf_token %}<button class="form-control btn-danger" type="submit">Delete Status</button></form> {% csrf_token %}
</div> <button class="form-control btn-danger" type="submit">Delete Status</button>
</div> </form>
</div> </div>
</div>
{% endblock %} </div>
{% endblock content %}

View file

@ -1,6 +1,6 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% load mood_categories %} {% load mood_categories %}
{% block "content" %} {% block content %}
{% if form.errors %} {% if form.errors %}
{% for field in form %} {% for field in form %}
{% for error in field.errors %} {% for error in field.errors %}
@ -13,7 +13,7 @@
<h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6> <h6 class="m-0 font-weight-bold text-primary">Edit {{ object.name }}</h6>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="" method="POST" enctype="multipart/form-data"> <form action="" method="post" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
<div class="table-responsive"> <div class="table-responsive">
<table> <table>
@ -122,4 +122,4 @@
</form> </form>
</div> </div>
</div> </div>
{% endblock %} {% endblock content %}

View file

@ -1,34 +1,46 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="card shadow mb-4">
<div class="card shadow mb-4"> <div class="card-header py-3">
<div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Your Moods</h6>
<h6 class="m-0 font-weight-bold text-primary">Your Moods</h6> </div>
</div> <div class="card-body">
<div class="card-body"> <div class="table-responsive">
<div class="table-responsive"> <table data-order="[[ 0, &quot;desc&quot; ]]"
<table data-order="[[ 0, &quot;desc&quot; ]]" class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> class="table table-bordered"
<thead> id="dataTable"
<tr> width="100%"
<th>Timestamp</th> cellspacing="0">
<th>Mood</th> <thead>
<th>Activities</th> <tr>
<th>Title</th> <th>Timestamp</th>
</tr> <th>Mood</th>
</thead> <th>Activities</th>
<tbody> <th>Title</th>
{% for status in object_list %} </tr>
<tr onclick="window.location.href='{% url "mood:status_view" status.id %}'"> </thead>
<td data-order="{{ status.timestamp | date:"U" }}">{{ status.timestamp }}</td> <tbody>
<td><i data-order="{{ status.mood.value }}" style="color:{{ status.mood.color }};" class="{{ status.mood.icon }}"></i> {{ status.mood }}</td> {% for status in object_list %}
<td>{% for activity in status.statusactivity_set.all %}<i title="{{ activity.activity }}{% if activity.comment %} - {{ activity.comment }}{% endif %}" style="color:{{ activity.activity.color }};" class="{{ activity.activity.icon }}"></i> {% endfor %}</td> <tr onclick="window.location.href='{% url "mood:status_view" status.id %}'">
<td>{{ status.short_text }}</td> <td data-order="{{ status.timestamp | date:"U" }}">{{ status.timestamp }}</td>
</tr> <td>
{% endfor %} <i data-order="{{ status.mood.value }}"
</tbody> style="color:{{ status.mood.color }}"
</table> class="{{ status.mood.icon }}"></i> {{ status.mood }}
</div> </td>
</div> <td>
</div> {% for activity in status.statusactivity_set.all %}
<i title="{{ activity.activity }}{% if activity.comment %} - {{ activity.comment }}{% endif %}"
{% endblock %} style="color:{{ activity.activity.color }}"
class="{{ activity.activity.icon }}"></i>
{% endfor %}
</td>
<td>{{ status.short_text }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock content %}

View file

@ -1,5 +1,5 @@
{% extends "frontend/base.html" %} {% extends "frontend/base.html" %}
{% block "content" %} {% block content %}
<div class="row"> <div class="row">
<!-- Entry details --> <!-- Entry details -->
<div class="col-xl-8 col-lg-7"> <div class="col-xl-8 col-lg-7">
@ -74,4 +74,4 @@
</div> </div>
</div> </div>
</div> </div>
{% endblock "content" %} {% endblock content %}