Adding some extensions and appearance improvements.
This commit is contained in:
parent
ec720743b3
commit
479d8eecc0
13 changed files with 506 additions and 12 deletions
|
|
@ -5,6 +5,7 @@
|
|||
{% block content %}
|
||||
|
||||
<form method="POST" class="circles-add-form">
|
||||
{% if returnto %}<input type="hidden" name="returnto" value="{{ returnto }}">{% endif %}
|
||||
<div>
|
||||
<label>#</label>
|
||||
<input type="number" name="code" placeholder="00000" required="" maxlength="6" value="{{ pl.code if pl else '' }}" />
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
{% block content %}
|
||||
<p>Showing: <strong>{{ cat }}</strong></p>
|
||||
|
||||
<div>
|
||||
<p>Show by:</p>
|
||||
<fieldset>
|
||||
<legend>Show by:</legend>
|
||||
<p><strong>Type</strong>:
|
||||
{% set typ_list = [
|
||||
'INTJ', 'INTP', 'INFJ', 'INFP', 'ENTJ', 'ENTP',
|
||||
|
|
@ -26,7 +26,9 @@
|
|||
{% for t in range(1, 13) %}
|
||||
<a href="/circles/area-{{ t }}">{{ t }}</a> ·
|
||||
{% endfor %}
|
||||
<a href="/circles/no-area">Unassigned</a>
|
||||
</p>
|
||||
<p><a href="/circles/stats">Stats</a> · <a href="/circles/new">Add new</a>.</p>
|
||||
</div>
|
||||
|
||||
{% if count > people.count() %}
|
||||
|
|
@ -42,7 +44,10 @@
|
|||
|
||||
<ul class="circles-list">
|
||||
{% for p in people %}
|
||||
<li class="circles-{{ 'red' if p.status == -1 else 'green' if p.status == 2 else 'yellow' if p.status == 1 else 'orange' }}">{{ p.code }} – {{ p.display_name }} – {{ p.type }} – {% if p.area %}Area {{ p.area }}{% else %}No area{% endif %} (<a href="/circles/edit/{{ p.code }}">edit</a>)</li>
|
||||
<li class="circles-{{ 'red' if p.status == -1 else 'green' if p.status == 2 else 'yellow' if p.status == 1 else 'orange' }}">
|
||||
<span class="circles-li-code">{{ p.code }}</span>
|
||||
<span>{{ p.display_name }} – {{ p.type }} – {% if p.area %}Area {{ p.area }}{% else %}No area{% endif %} (<a href="/circles/edit/{{ p.code }}">edit</a>)</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<ul>
|
||||
<li>All people: <strong>{{ count }}</strong></li>
|
||||
<li>People by type:</li>
|
||||
<ul>
|
||||
<ul class="wrap_responsive_cells_narrow">
|
||||
{% for k in typed_count.items() %}
|
||||
<li>{{ k[0] }}: <strong>{{ k[1] }}</strong></li>
|
||||
{% endfor %}
|
||||
|
|
@ -19,5 +19,12 @@
|
|||
<li>{{ k[0] }}: <strong>{{ k[1] }}</strong></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<li>People by area:</li>
|
||||
<ul class="wrap_responsive_cells_narrow">
|
||||
{% for k in area_count.items() %}
|
||||
<li>Area {{ k[0] }}: <strong>{{ k[1] }}</strong></li>
|
||||
{% endfor %}
|
||||
<li>No area: <strong>{{ no_area_count }}</strong></li>
|
||||
</ul>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
|
|
|||
59
templates/contactnova/list.html
Normal file
59
templates/contactnova/list.html
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}List of contacts – {{ app_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>Showing: <strong>{{ cat }}</strong> · <a href="/kt/new">New contact</a></p>
|
||||
|
||||
<fieldset>
|
||||
<legend>Show by:</legend>
|
||||
<p><strong>Letter</strong>:
|
||||
{% set typ_list = 'ABCDEFGHIJKLMNOPQRSTUVWYZ' %}
|
||||
{% for t in typ_list %}
|
||||
<a href="/kt/{{ t }}">{{ t }}</a> ·
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p>
|
||||
<a href="/kt/">All</a> ·
|
||||
<a href="/kt/expired">Expired</a> ·
|
||||
<a href="/kt/ok">Sane</a>
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
{% if count > people.count() %}
|
||||
<p>Showing <strong>{{ people.count() }}</strong> people of <strong>{{ count }}</strong> total.</p>
|
||||
{% if count > pageno * 50 %}
|
||||
<p><a href="?page={{ pageno + 1 }}" rel="nofollow">Next page</a>{% if pageno > 1 %} · <a href="?page={{ pageno - 1 }}" rel="nofollow">Prev page</a>{% endif %}</p>
|
||||
{% elif pageno > 1 %}
|
||||
<a href="?page={{ pageno - 1 }}" rel="nofollow">Prev page</a></p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p><strong>{{ count }}</strong> people.</p>
|
||||
{% endif %}
|
||||
|
||||
<table class="contactnova-list">
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in people %}
|
||||
<tr class="contactnova-status_{{ p.status }}">
|
||||
<td><span class="material-icons">{{ p.status_str() }}</span></td>
|
||||
<td class="contactnova-col-code"><a href="/kt/{{ p.code }}">{{ p.code }}</a></td>
|
||||
<td>{{ p.display_name }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if count > people.count() %}
|
||||
<p>Showing <strong>{{ people.count() }}</strong> people of <strong>{{ count }}</strong> total.</p>
|
||||
{% if count > pageno * 50 %}
|
||||
<p><a href="?page={{ pageno + 1 }}" rel="nofollow">Next page</a>{% if pageno > 1 %} · <a href="?page={{ pageno - 1 }}" rel="nofollow">Prev page</a>{% endif %}</p>
|
||||
{% elif pageno > 1 %}
|
||||
<a href="?page={{ pageno - 1 }}" rel="nofollow">Prev page</a></p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p><strong>{{ count }}</strong> people.</p>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
72
templates/contactnova/new.html
Normal file
72
templates/contactnova/new.html
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Create new contact – {{ app_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="POST" class="circles-add-form">
|
||||
{% if returnto %}<input type="hidden" name="returnto" value="{{ returnto }}">{% endif %}
|
||||
{% if not pl %}
|
||||
<div>
|
||||
<label>Letter</label>
|
||||
<select id="ktCodeLetter" name="letter">
|
||||
<option value="-" disabled="" selected="">(Choose)</option>
|
||||
{% set typ_list = 'ABCDEFGHIJKLMNOPQRSTUVWYZ' %}
|
||||
{% for t in typ_list %}
|
||||
<option value="{{ t }}">{{ t }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<label>Code</label>
|
||||
<strong id="ktNewCode">---</strong>
|
||||
</div>
|
||||
<div>
|
||||
<label>Display name</label>
|
||||
<input name="display_name" maxlength="50"{% if pl %} value="{{ pl.display_name }}"{% endif %}>
|
||||
</div>
|
||||
<div>
|
||||
<label>Status</label>
|
||||
<select name="status">
|
||||
{% set statuses = {
|
||||
0: 'Variable',
|
||||
1: 'OK',
|
||||
2: 'Issues',
|
||||
} %}
|
||||
{% for k, v in statuses.items() %}
|
||||
<option value="{{ k }}"{% if pl and pl.status == k %} selected=""{% endif %}>{{ v }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>Issues</label>
|
||||
<textarea maxlength="500" name="issues">{{ pl and pl.issues }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label>Description</label>
|
||||
<textarea maxlength="5000" name="description">{{ pl and pl.description }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label>Due</label>
|
||||
<input name="due" required="" type="date" value="{{ pl.due if pl else pl_date }}" min="2020-01-01" />
|
||||
</div>
|
||||
<input type="submit" id="ktSubmit" value="Save">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
{% if not pl %}
|
||||
ktSubmit.disabled = true;
|
||||
{% endif %}
|
||||
ktCodeLetter.onchange = function(){
|
||||
let x = new XMLHttpRequest;
|
||||
x.open('GET', '/kt/_newcode/' + ktCodeLetter.value);
|
||||
x.onreadystatechange = () => {
|
||||
if (x.readyState === XMLHttpRequest.DONE && x.status == 200) {
|
||||
ktNewCode.textContent = x.responseText;
|
||||
ktSubmit.disabled = false;
|
||||
}
|
||||
};
|
||||
x.send();
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
24
templates/contactnova/single.html
Normal file
24
templates/contactnova/single.html
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Contact {{ p.code }} – {{ app_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ p.code }}</h1>
|
||||
|
||||
<p>aka: <strong>{{ p.display_name }}</strong></p>
|
||||
|
||||
{% if p.issues %}
|
||||
<p class="contactnova-issues">{{ p.issues }}</p>
|
||||
{% endif %}
|
||||
|
||||
<p class="contactnova-description">
|
||||
{{ p.description or "No description available." |linebreaks }}
|
||||
</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p>Expires: {{ p.due.strftime('%B %-d, %Y') }}</p>
|
||||
|
||||
<p><a href="/kt/">Back</a> · <a href="/kt/edit/{{ p.code }}?returnto=/kt/{{ p.code }}">Edit contact</a></p>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -7,7 +7,10 @@
|
|||
{% block content %}
|
||||
<h1>{{ p.title }}</h1>
|
||||
|
||||
<div class="jump-to-actions"><a href="#page-actions">{{ T('jump-to-actions') }}</a></div>
|
||||
<div class="jump-to-actions">
|
||||
<span>{{ T('last-changed') }} {{ rev.human_pub_date() }}</span> ·
|
||||
<a href="#page-actions">{{ T('jump-to-actions') }}</a>
|
||||
</div>
|
||||
|
||||
{% block history_nav %}{% endblock %}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue