Add current values when moving/duplicate a task to another project and add a loading icon

This commit is contained in:
Frederic Guillot 2015-07-20 21:10:09 -04:00
parent 32aab02549
commit 8cd1e6f4c1
5 changed files with 51 additions and 34 deletions

View File

@ -248,6 +248,7 @@ class TaskFinder extends Base
project_has_categories.name AS category_name,
swimlanes.name AS swimlane_name,
projects.name AS project_name,
projects.default_swimlane,
columns.title AS column_title,
users.username AS assignee_username,
users.name AS assignee_name,

View File

@ -20,18 +20,23 @@
array('data-redirect="'.$this->url->href('taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'dst_project_id' => 'PROJECT_ID')).'"'),
'task-reload-project-destination'
) ?>
<span class="loading-icon" style="display: none">&nbsp;<i class="fa fa-spinner fa-spin"></i></span>
<?= $this->form->label(t('Swimlane'), 'swimlane_id') ?>
<?= $this->form->select('swimlane_id', $swimlanes_list, $values) ?>
<p class="form-help"><?= t('Current swimlane: %s', $task['swimlane_name'] ?: $task['default_swimlane']) ?></p>
<?= $this->form->label(t('Column'), 'column_id') ?>
<?= $this->form->select('column_id', $columns_list, $values) ?>
<p class="form-help"><?= t('Current column: %s', $task['column_title']) ?></p>
<?= $this->form->label(t('Category'), 'category_id') ?>
<?= $this->form->select('category_id', $categories_list, $values) ?>
<p class="form-help"><?= t('Current category: %s', $task['category_name'] ?: e('no category')) ?></p>
<?= $this->form->label(t('Assignee'), 'owner_id') ?>
<?= $this->form->select('owner_id', $users_list, $values) ?>
<p class="form-help"><?= t('Current assignee: %s', ($task['assignee_name'] ?: $task['assignee_username']) ?: e('not assigned')) ?></p>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>

View File

@ -20,18 +20,23 @@
array('data-redirect="'.$this->url->href('taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'dst_project_id' => 'PROJECT_ID')).'"'),
'task-reload-project-destination'
) ?>
<span class="loading-icon" style="display: none">&nbsp;<i class="fa fa-spinner fa-spin"></i></span>
<?= $this->form->label(t('Swimlane'), 'swimlane_id') ?>
<?= $this->form->select('swimlane_id', $swimlanes_list, $values) ?>
<p class="form-help"><?= t('Current swimlane: %s', $task['swimlane_name'] ?: $task['default_swimlane']) ?></p>
<?= $this->form->label(t('Column'), 'column_id') ?>
<?= $this->form->select('column_id', $columns_list, $values) ?>
<p class="form-help"><?= t('Current column: %s', $task['column_title']) ?></p>
<?= $this->form->label(t('Category'), 'category_id') ?>
<?= $this->form->select('category_id', $categories_list, $values) ?>
<p class="form-help"><?= t('Current category: %s', $task['category_name'] ?: e('no category')) ?></p>
<?= $this->form->label(t('Assignee'), 'owner_id') ?>
<?= $this->form->select('owner_id', $users_list, $values) ?>
<p class="form-help"><?= t('Current assignee: %s', ($task['assignee_name'] ?: $task['assignee_username']) ?: e('not assigned')) ?></p>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>

File diff suppressed because one or more lines are too long

View File

@ -273,8 +273,14 @@ var Kanboard = (function() {
$(".sidebar-expand").hide();
});
// Reload page when a destination project is changed
var reloading_project = false;
$("select.task-reload-project-destination").change(function() {
window.location = $(this).data("redirect").replace(/PROJECT_ID/g, $(this).val());
if (! reloading_project) {
$(".loading-icon").show();
reloading_project = true;
window.location = $(this).data("redirect").replace(/PROJECT_ID/g, $(this).val());
}
});
// Datepicker translation