188 lines
6.4 KiB
HTML
188 lines
6.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Импорт задач — Bitmine</title>
|
|
<style>
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
background: #f5f5f5;
|
|
padding: 20px;
|
|
}
|
|
.container { max-width: 1200px; margin: 0 auto; }
|
|
h1 { color: #333; margin-bottom: 20px; }
|
|
.card {
|
|
background: white;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
padding: 24px;
|
|
margin-bottom: 20px;
|
|
}
|
|
.form-group { margin-bottom: 20px; }
|
|
label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
select {
|
|
width: 100%;
|
|
padding: 12px;
|
|
border: 1px solid #ddd;
|
|
border-radius: 6px;
|
|
font-size: 14px;
|
|
background: white;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-top: 16px;
|
|
}
|
|
th, td {
|
|
padding: 12px;
|
|
text-align: left;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
th { background: #f8f9fa; }
|
|
.btn {
|
|
background: #007bff;
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 24px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
}
|
|
.btn:hover { background: #0056b3; }
|
|
.btn-success { background: #28a745; }
|
|
.btn-success:hover { background: #218838; }
|
|
.btn-secondary { background: #6c757d; }
|
|
.btn-secondary:hover { background: #545b62; }
|
|
.error {
|
|
background: #ffebee;
|
|
color: #c62828;
|
|
padding: 16px;
|
|
border-radius: 8px;
|
|
margin-bottom: 20px;
|
|
}
|
|
.back-link {
|
|
display: inline-block;
|
|
margin-bottom: 20px;
|
|
color: #007bff;
|
|
text-decoration: none;
|
|
}
|
|
.select-all {
|
|
margin-bottom: 16px;
|
|
}
|
|
.task-count {
|
|
color: #666;
|
|
margin-left: 8px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<a href="/api/redmine/tasks" class="back-link">← Назад к списку задач</a>
|
|
|
|
<h1>📥 Импорт задач из Redmine в Bitrix24</h1>
|
|
|
|
{% if error.is_some() %}
|
|
<div class="error">{{ error.as_ref().unwrap() }}</div>
|
|
{% endif %}
|
|
|
|
<form method="POST" action="/import">
|
|
<div class="card">
|
|
<div class="form-group">
|
|
<label for="project_id">📁 Выберите проект в Bitrix24 для импорта:</label>
|
|
<select name="project_id" id="project_id" required>
|
|
<option value="">-- Выберите проект --</option>
|
|
{% for project in projects %}
|
|
<option value="{{ project.id }}">{{ project.name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2>Выберите задачи для импорта</h2>
|
|
|
|
<div class="select-all">
|
|
<label>
|
|
<input type="checkbox" id="select-all" onchange="toggleAll(this)">
|
|
Выбрать все <span class="task-count">({{ tasks.len() }} задач)</span>
|
|
</label>
|
|
</div>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 40px;">✓</th>
|
|
<th>№</th>
|
|
<th>Тема</th>
|
|
<th>Статус</th>
|
|
<th>Проект</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for task in tasks %}
|
|
<tr>
|
|
<td>
|
|
<input type="checkbox" name="task_ids" value="{{ task.id }}">
|
|
</td>
|
|
<td>{{ task.id }}</td>
|
|
<td>{{ task.subject }}</td>
|
|
<td>
|
|
<span class="status status-{{ task.status_class }}" style="padding: 4px 12px; border-radius: 12px; font-size: 12px;">
|
|
{{ task.status_name }}
|
|
</span>
|
|
</td>
|
|
<td>
|
|
{% match task.project %}
|
|
{% when Some(proj) %}{{ proj }}
|
|
{% when None %}—
|
|
{% endmatch %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<button type="submit" class="btn btn-success">🚀 Импортировать выбранные задачи</button>
|
|
<a href="/api/redmine/tasks" class="btn btn-secondary">Отмена</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
async function submitImport(event) {
|
|
event.preventDefault();
|
|
const formData = new FormData(event.target);
|
|
const data = {
|
|
project_id: formData.get('project_id'),
|
|
task_ids: Array.from(formData.getAll('task_ids'))
|
|
};
|
|
|
|
const response = await fetch('/import', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(data)
|
|
});
|
|
|
|
window.location.href = '/import/result';
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.status-new { background: #e3f2fd; color: #1976d2; }
|
|
.status-progress { background: #fff3e0; color: #f57c00; }
|
|
.status-resolved { background: #e8f5e9; color: #388e3c; }
|
|
.status-closed { background: #f5f5f5; color: #616161; }
|
|
</style>
|
|
</body>
|
|
</html>
|