massive update

This commit is contained in:
2019-01-08 16:09:15 +05:00
parent ad71e72294
commit 39916fa5fb
22 changed files with 1260 additions and 70 deletions

View File

@ -0,0 +1,41 @@
{% extends 'base.html' %}
{% block content %}
<div class="container">
<h3>Добавить подразделение</h3>
<form method="post">
<div class="form-group">
<label for="code">Код</label>
<input class="form-control" id="code" name="code" required type="text">
</div>
<div class="form-group">
<label for="ent_id">Предприятие</label>
<select class="form-control" id="ent_id" name="ent_id" required>
{% for item in enterpises %}
<option value="{{ item.id }}">{{ item.contact_info.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label for="name">Название подразделения</label>
<input class="form-control" id="name" name="name" required type="text">
</div>
<div class="form-group">
<label for="short_name">Краткое название</label>
<input class="form-control" id="short_name" name="short_name" required type="text">
</div>
<div class="form-group">
<label for="email">Email</label>
<input class="form-control" id="email" name="email" type="email">
</div>
<div class="form-group">
<label for="activities">Виды деятельности</label>
<select class="form-control" id="activities" name="activities" required multiple>
{% for activity in activities %}
<option value="{{ activity.id }}">{{ activity.name }}</option>
{% endfor %}
</select>
</div>
<button type="submit" class="btn btn-primary">Отправить</button>
</form>
</div>
{% endblock %}

View File

@ -0,0 +1,213 @@
{% extends 'base.html' %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-4">Код</div>
<div class="col-8">{{ div.contact_info.code }}</div>
</div>
<div class="row">
<div class="col-4">Имя</div>
<div class="col-8">{{ div.contact_info.code }}</div>
</div>
<div class="row">
<div class="col-4">Краткое имя</div>
<div class="col-8">{{ div.contact_info.short_name }}</div>
</div>
<div class="row">
<div class="col-4">Email</div>
<div class="col-8">{{ div.contact_info.email }}</div>
</div>
<div class="row">
<h6>Руководители</h6>
<table class="table">
<thead>
<tr>
<th scope="col">
Id
</th>
<th scope="col">
Фамилия
</th>
<th scope="col">
Имя
</th>
<th scope="col">
Отчество
</th>
<th scope="col">
Дата заступления
</th>
<th scope="col">
Дата снятия
</th>
<th scope="col">
</th>
</tr>
</thead>
<tbody>
{% for item in div.contact_info.head %}
<tr>
<th scope="row">
{{ item.id }}
</th>
<td>
{{ item.last_name }}
</td>
<td>
{{ item.first_name }}
</td>
<td>
{{ item.second_name }}
</td>
<td>
{{ item.date_of_start }}
</td>
<td>
{% if not item.date_of_end %}
---
{% else %}
{{ item.date_of_end }}
{% endif %}
</td>
<td>
{% if not item.date_of_end %}
<b>Активен</b>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="row">
<h6>Телефоны</h6>
<table class="table">
<thead>
<tr>
<th scope="col">
Id
</th>
<th scope="col">
Номер
</th>
<th scope="col">
Дата заступления
</th>
<th scope="col">
Дата снятия
</th>
<th scope="col">
</th>
</tr>
</thead>
<tbody>
{% for item in div.contact_info.phone_numbers %}
<tr>
<th scope="row">
{{ item.id }}
</th>
<td>
{{ item.number }}
</td>
<td>
{{ item.date_of_start }}
</td>
<td>
{% if not item.date_of_end %}
---
{% else %}
{{ item.date_of_end }}
{% endif %}
</td>
<td>
{% if not item.date_of_end %}
<b>Активен</b>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="row">
<h6>Местоположения</h6>
<table class="table">
<thead>
<tr>
<th scope="col">
Id
</th>
<th scope="col">
Страна
</th>
<th scope="col">
Город
</th>
<th scope="col">
Улица
</th>
<th scope="col">
Здание
</th>
<th scope="col">
Комната
</th>
<th scope="col">
Дата заступления
</th>
<th scope="col">
Дата снятия
</th>
<th scope="col">
</th>
</tr>
</thead>
<tbody>
{% for item in div.contact_info.locations %}
<tr>
<th scope="row">
{{ item.id }}
</th>
<td>
{{ item.country }}
</td>
<td>
{{ item.city }}
</td>
<td>
{{ item.street }}
</td>
<td>
{{ item.house }}
</td>
<td>
{{ item.room }}
</td>
<td>
{{ item.date_of_start }}
</td>
<td>
{% if not item.date_of_end %}
---
{% else %}
{{ item.date_of_end }}
{% endif %}
</td>
<td>
{% if not item.date_of_end %}
<b>Активен</b>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,46 @@
{% extends 'base.html' %}
{% block content %}
<div class="container">
<table class="table">
<thead>
<tr>
<th scope="col">
Id
</th>
<th scope="col">
Имя
</th>
<th scope="col">
Краткое имя
</th>
<th scope="col">
Email
</th>
<th scope="col">
</th>
</tr>
</thead>
<tbody>
{% for item in data %}
<tr>
<th scope="row">
{{ item.id }}
</th>
<td>
{{ item.name }}
</td>
<td>
{{ item.short_name }}
</td>
<td>
{{ item.contact_info.email }}
</td>
<td>
<a href="{{ url_for('enterprise_details', ent_id=item.id) }}">Детали</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}