76 lines
2.8 KiB
HTML
76 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
{% load compress %}
|
|
|
|
{% block head %}
|
|
<script defer src="{% static "scripts/stimulus.umd.js" %}"></script>
|
|
<script type="module" defer src="{% static "scripts/index.js" %}"></script>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<article>
|
|
{% if employee.archived %}
|
|
<p class="--archived"><em>This employee is currently Archived</em></p>
|
|
{% endif %}
|
|
<hgroup>
|
|
<h1>{{employee}}</h1>
|
|
<h2>Hire Date: {{employee.hire_date}}</h2>
|
|
<details class="menu">
|
|
<summary class="menu__title">Options</summary>
|
|
<dl class="menu__items">
|
|
<dt><a href="{% url 'employee-update' employee.pk %}">Update Employee details</a></dt>
|
|
<dt><a href="{% url 'employee-archive' employee.pk %}">Archive Employee</a></dt>
|
|
<dt><a href="{% url 'employee-delete' employee.pk %}">Delete Employee</a></dt>
|
|
</dl>
|
|
</details>
|
|
</hgroup>
|
|
<section>
|
|
<p>
|
|
<strong>Title</strong>: {{employee.title}}</br>
|
|
<strong>Department</strong>: {{employee.department}}</br>
|
|
<strong>Manager</strong>: {{employee.manager}}
|
|
</p>
|
|
<p><strong>Initial comments</strong>:<p>
|
|
<blockquote>{{employee.initial_comments|linebreaksbr}}</blockquote>
|
|
</section>
|
|
<section id="events">
|
|
<h3>Employee Events</h3>
|
|
{% for event in employee.event_set.all %}
|
|
<div class="today__event">
|
|
<strong class="today__date">{{event.date|date:"D, M j"}}</strong>
|
|
<span>{{event.name}}</span>
|
|
<span class="today__time">{{event.time|time:"TIME_FORMAT"}}</span>
|
|
<span><a href="{% url 'event-update' event.pk %}">Edit</a></span>
|
|
</div>
|
|
{% empty %}
|
|
<p><em>No events for employee.</em></p>
|
|
{% endfor %}
|
|
</section>
|
|
<section id="todos">
|
|
<h3>To-do's</h3>
|
|
{% include "board/todo_list.html" with todo_list=employee.todo_set.all %}
|
|
{% if not employee.archived %}
|
|
<p>
|
|
<a class="action-button" href="{% url 'todo-create' employee.pk %}">Add a to-do</a>
|
|
</p>
|
|
{% endif %}
|
|
</section>
|
|
<section>
|
|
<h3>Log</h3>
|
|
<p>
|
|
<a class="action-button" href="{% url 'entry-create' employee.pk %}">Add an Entry</a>
|
|
</p>
|
|
{% regroup employee.logentry_set.all by created_at.date as activity %}
|
|
{% for date in activity %}
|
|
<h5>{{date.grouper|date:"D, M j"}}</h5>
|
|
{% for entry in date.list %}
|
|
<p class="activity__item">
|
|
<span>{{entry.created_at|time:"TIME_FORMAT"}}</span>
|
|
<span>{{entry.notes}}</span>
|
|
<span><a href="{% url 'entry-update' employee.pk entry.pk %}">Edit</a></span>
|
|
</p>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</section>
|
|
</article>
|
|
{% endblock %} |