Recurring tasks (#847): template cleanup

This commit is contained in:
Frederic Guillot 2015-05-10 14:36:17 -04:00
parent b51d41f331
commit c9dcd70617
10 changed files with 96 additions and 130 deletions

View File

@ -360,11 +360,11 @@ class Board extends Base
{
$task = $this->getTask();
$this->response->html($this->template->render('board/recurrence', array(
$this->response->html($this->template->render('task/recurring_info', array(
'task' => $task,
'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
)));
)));
}
}

View File

@ -1,18 +0,0 @@
<section class="tooltip-large">
<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PENDING): ?>
<?= t('Recurrent task is scheduled to generate') ?><br/>
<?php endif ?>
<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
<?= t('Recurrent task has been generated') ?><br/>
<?php endif ?>
<?= t('Trigger to generate recurrent task: %s', $recurrence_trigger_list[$task['recurrence_trigger']]) ?><br/>
<?= t('Factor to calculate new due date: %s', $task['recurrence_factor']) ?><br/>
<?= t('Timeframe to calculate new due date: %s', $recurrence_timeframe_list[$task['recurrence_timeframe']]) ?><br/>
<?= t('Base date to calculate new due date: %s', $recurrence_basedate_list[$task['recurrence_basedate']]) ?><br/>
<?php if ($task['recurrence_parent']): ?>
<?= t('Recurrent task created by: %s', $task['recurrence_parent']) ?><br/>
<?php endif ?>
<?php if ($task['recurrence_child']): ?>
<?= t('Created recurrent task: %s', $task['recurrence_child']) ?><br/>
<?php endif ?>
</section>

View File

@ -5,11 +5,11 @@
<li><i class="fa fa-user"></i> <?= $this->a(t('Change assignee'), 'board', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-tag"></i> <?= $this->a(t('Change category'), 'board', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-align-left"></i> <?= $this->a(t('Change description'), 'task', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-refresh fa-rotate-90"></i> <?= $this->a(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-pencil-square-o"></i> <?= $this->a(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-comment-o"></i> <?= $this->a(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-code-fork"></i> <?= $this->a(t('Add a link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-pencil-square-o"></i> <?= $this->a(t('Edit this task'), 'task', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-camera"></i> <?= $this->a(t('Add a screenshot'), 'board', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-refresh fa-rotate-90"></i> <?= $this->a(t('Edit recurrence'), 'task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-popover') ?></li>
<li><i class="fa fa-close"></i> <?= $this->a(t('Close this task'), 'task', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => 'board'), false, 'task-board-popover') ?></li>
</ul>
</span>

View File

@ -80,43 +80,16 @@
<?= $this->a(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?>
</li>
<?php endif ?>
<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_NONE): ?>
<?php if (! isset($not_editable) && $task['recurrence_status'] != \Model\Task::RECURE_STATUS_NONE): ?>
<li>
<?= t('No recurrent task is scheduled to generate') ?>
</li>
<?php endif ?>
<?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_NONE): ?>
<li>
<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PENDING): ?>
<?= t('Recurrent task is scheduled to generate') ?>
<?php endif ?>
<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
<?= t('Recurrent task has been generated') ?>
<?php endif ?>
<ul>
<li>
<?= t('Trigger to generate recurrent task: %s', $recurrence_trigger_list[$task['recurrence_trigger']]) ?></stong>
</li>
<li>
<?= t('Factor to calculate new due date: %s', $task['recurrence_factor']) ?></stong>
</li>
<li>
<?= t('Timeframe to calculate new due date: %s', $recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></stong>
</li>
<li>
<?= t('Base date to calculate new due date: %s', $recurrence_basedate_list[$task['recurrence_basedate']]) ?></stong>
</li>
</ul>
</li>
<?php endif ?>
<?php if ($task['recurrence_parent']): ?>
<li>
<?= t('Recurrent task created by: %s', $task['recurrence_parent']) ?>
</li>
<?php endif ?>
<?php if ($task['recurrence_child']): ?>
<li>
<?= t('Created recurrent task: %s', $task['recurrence_child']) ?>
<strong><?= t('Recurring information') ?></strong>
<?= $this->render('task/recurring_info', array(
'task' => $task,
'recurrence_trigger_list' => $recurrence_trigger_list,
'recurrence_timeframe_list' => $recurrence_timeframe_list,
'recurrence_basedate_list' => $recurrence_basedate_list,
)) ?>
</li>
<?php endif ?>
</ul>

View File

@ -1,85 +1,52 @@
<div class="page-header">
<h2><?= t('Edit recurrence') ?></h2>
</div>
<section id="task-section">
<?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_NONE): ?>
<div class="listing">
<?= $this->render('task/recurring_info', array(
'task' => $task,
'recurrence_trigger_list' => $recurrence_trigger_list,
'recurrence_timeframe_list' => $recurrence_timeframe_list,
'recurrence_basedate_list' => $recurrence_basedate_list,
)) ?>
</div>
<?php endif ?>
<?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_PROCESSED): ?>
<form method="post" action="<?= $this->u('task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<form method="post" action="<?= $this->u('task', 'recurrence', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => $ajax)) ?>" autocomplete="off">
<?= $this->formCsrf() ?>
<div class="form-column">
<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
<ul>
<li><?= t('Recurrent task has been generated') ?>
<ul>
<li>
<?= t('Trigger to generate recurrent task: %s', $recurrence_trigger_list[$task['recurrence_trigger']]) ?></stong>
</li>
<li>
<?= t('Factor to calculate new due date: %s', $task['recurrence_factor']) ?></stong>
</li>
<li>
<?= t('Timeframe to calculate new due date: %s', $recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></stong>
</li>
<li>
<?= t('Base date to calculate new due date: %s', $recurrence_basedate_list[$task['recurrence_basedate']]) ?></stong>
</li>
</ul>
</li>
</ul>
<?php endif ?>
<?php if ($task['recurrence_parent'] || $task['recurrence_child']): ?>
<ul>
<?php if ($task['recurrence_parent']): ?>
<li>
<?= t('Recurrent task created by: %s', $task['recurrence_parent']) ?>
</li>
<?php endif ?>
<?php if ($task['recurrence_child']): ?>
<li>
<?= t('Created recurrent task: %s', $task['recurrence_child']) ?>
</li>
<?php endif ?>
</ul>
<?php endif ?>
<?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_PROCESSED): ?>
<?= $this->formCsrf() ?>
<?= $this->formHidden('id', $values) ?>
<?= $this->formHidden('project_id', $values) ?>
<?= $this->formLabel(t('Generate recurrent task'), 'recurrence_status') ?>
<?= $this->formSelect('recurrence_status', $recurrence_status_list, $values, $errors) ?> </br>
<?= $this->formSelect('recurrence_status', $recurrence_status_list, $values, $errors) ?>
<?= $this->formLabel(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?>
<?= $this->formSelect('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?> </br>
<?= $this->formSelect('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?>
<?= $this->formLabel(t('Factor to calculate new due date'), 'recurrence_factor') ?>
<?= $this->formNumber('recurrence_factor', $values, $errors) ?> </br>
<?= $this->formNumber('recurrence_factor', $values, $errors) ?>
<?= $this->formLabel(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?>
<?= $this->formSelect('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?> </br>
<?= $this->formSelect('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?>
<?= $this->formLabel(t('Base date to calculate new due date'), 'recurrence_basedate') ?>
<?= $this->formSelect('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?> </br>
<?= $this->formSelect('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?>
<?php endif ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
</div>
<?php if ($ajax): ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
<?php else: ?>
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php endif ?>
</div>
</form>
<div class="form-actions">
<?php if ($task['recurrence_status'] != \Model\Task::RECURE_STATUS_PROCESSED): ?>
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?php endif ?>
<?php if ($ajax): ?>
<?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id'])) ?>
<?php else: ?>
<?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php endif ?>
</div>
</form>
</section>
<?php endif ?>

View File

@ -1,6 +1,6 @@
<section id="main" class="public-task">
<?= $this->render('task/details', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('task/details', array('task' => $task, 'project' => $project, 'not_editable' => true)) ?>
<p class="pull-right"><?= $this->a(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p>

View File

@ -0,0 +1,37 @@
<ul>
<?php if ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PENDING): ?>
<li><?= t('Recurrent task is scheduled to be generated') ?></li>
<?php elseif ($task['recurrence_status'] == \Model\Task::RECURE_STATUS_PROCESSED): ?>
<li><?= t('Recurrent task has been generated') ?>
<ul>
<li>
<?= t('Trigger to generate recurrent task: ') ?><strong><?= $this->e($recurrence_trigger_list[$task['recurrence_trigger']]) ?></strong>
</li>
<li>
<?= t('Factor to calculate new due date: ') ?><strong><?= $this->e($task['recurrence_factor']) ?></strong>
</li>
<li>
<?= t('Timeframe to calculate new due date: ') ?><strong><?= $this->e($recurrence_timeframe_list[$task['recurrence_timeframe']]) ?></strong>
</li>
<li>
<?= t('Base date to calculate new due date: ') ?><strong><?= $this->e($recurrence_basedate_list[$task['recurrence_basedate']]) ?></strong>
</li>
</ul>
</li>
<?php endif ?>
<?php if ($task['recurrence_parent'] || $task['recurrence_child']): ?>
<?php if ($task['recurrence_parent']): ?>
<li>
<?= t('Recurrent task created by: ') ?>
<?= $this->a('#'.$task['recurrence_parent'], 'task', 'show', array('task_id' => $task['recurrence_parent'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
<?php if ($task['recurrence_child']): ?>
<li>
<?= t('Created recurrent task: ') ?>
<?= $this->a('#'.$task['recurrence_child'], 'task', 'show', array('task_id' => $task['recurrence_child'], 'project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
<?php endif ?>
</ul>

View File

@ -1,4 +1,11 @@
<?= $this->render('task/details', array('task' => $task, 'project' => $project, 'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(), 'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(), 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList())) ?>
<?= $this->render('task/details', array(
'task' => $task,
'project' => $project,
'recurrence_trigger_list' => $this->task->getRecurrenceTriggerList(),
'recurrence_timeframe_list' => $this->task->getRecurrenceTimeframeList(),
'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(),
)) ?>
<?= $this->render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?>
<?= $this->render('task/show_description', array('task' => $task)) ?>
<?= $this->render('tasklink/show', array('task' => $task, 'links' => $links, 'link_label_list' => $link_label_list)) ?>

View File

@ -641,14 +641,14 @@ div.ui-tooltip {
margin-bottom: 0px;
}
.tooltip-tasklinks li {
list-style-type: none;
}
.column-tooltip {
color: #999;
font-size: 0.95em;
}
.ui-tooltip ul {
margin-left: 20px;
}
/* header */
header {
margin-top: 10px;

View File

@ -68,11 +68,11 @@ div.ui-tooltip {
margin-bottom: 0px;
}
.tooltip-tasklinks li {
list-style-type: none;
}
.column-tooltip {
color: #999;
font-size: 0.95em;
}
.ui-tooltip ul {
margin-left: 20px;
}