Template helpers refactoring

This commit is contained in:
Frédéric Guillot
2014-12-28 11:28:50 -05:00
parent 88d84073ae
commit 34d7450d3c
155 changed files with 1605 additions and 1609 deletions

View File

@@ -1,7 +1,7 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('New comment posted by %s', $comment['name'] ?: $comment['username']) ?></h3>
<?= Helper\markdown($comment['comment']) ?>
<?= $this->markdown($comment['comment']) ?>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,7 +1,7 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('Comment updated') ?></h3>
<?= Helper\markdown($comment['comment']) ?>
<?= $this->markdown($comment['comment']) ?>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,5 +1,5 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<p><?= t('New attachment added "%s"', $file['name']) ?></p>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,17 +1,17 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('New sub-task') ?></h3>
<ul>
<li><?= t('Title:') ?> <?= Helper\escape($subtask['title']) ?></li>
<li><?= t('Status:') ?> <?= Helper\escape($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= Helper\escape($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
<li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li>
<li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
<li>
<?= t('Time tracking:') ?>
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
</ul>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,21 +1,21 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('Sub-task updated') ?></h3>
<ul>
<li><?= t('Title:') ?> <?= Helper\escape($subtask['title']) ?></li>
<li><?= t('Status:') ?> <?= Helper\escape($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= Helper\escape($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
<li><?= t('Title:') ?> <?= $this->e($subtask['title']) ?></li>
<li><?= t('Status:') ?> <?= $this->e($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= $this->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
<li>
<?= t('Time tracking:') ?>
<?php if (! empty($subtask['time_spent'])): ?>
<strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php endif ?>
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
</ul>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,4 +1,4 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<ul>
<li>
@@ -14,7 +14,7 @@
<?php if (! empty($task['description'])): ?>
<h2><?= t('Description') ?></h2>
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
<?= $this->markdown($task['description']) ?: t('There is no description.') ?>
<?php endif ?>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,5 +1,5 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<p><?= t('The task #%d have been closed.', $task['id']) ?></p>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,4 +1,4 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<ul>
<li>
@@ -25,19 +25,19 @@
</li>
<li>
<?= t('Column on the board:') ?>
<strong><?= Helper\escape($task['column_title']) ?></strong>
<strong><?= $this->e($task['column_title']) ?></strong>
</li>
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
<?php if ($task['category_name']): ?>
<li>
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
<?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong>
</li>
<?php endif ?>
</ul>
<?php if (! empty($task['description'])): ?>
<h2><?= t('Description') ?></h2>
<?= Helper\markdown($task['description']) ?>
<?= $this->markdown($task['description']) ?>
<?php endif ?>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -5,9 +5,9 @@
<li>
(<strong>#<?= $task['id'] ?></strong>)
<?php if ($application_url): ?>
<a href="<?= $application_url.'?controller=task&action=show&task_id='.$task['id'] ?>"><?= Helper\escape($task['title']) ?></a>
<a href="<?= $application_url.'?controller=task&action=show&task_id='.$task['id'] ?>"><?= $this->e($task['title']) ?></a>
<?php else: ?>
<?= Helper\escape($task['title']) ?>
<?= $this->e($task['title']) ?>
<?php endif ?>
(<?= dt('%B %e, %Y', $task['date_due']) ?>)
<?php if ($task['assignee_username']): ?>
@@ -17,4 +17,4 @@
<?php endforeach ?>
</ul>
<?= Helper\template('notification/footer', array('task' => $task)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@@ -1,11 +1,11 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<ul>
<li>
<?= t('Column on the board:') ?>
<strong><?= Helper\escape($task['column_title']) ?></strong>
<strong><?= $this->e($task['column_title']) ?></strong>
</li>
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
</ul>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,11 +1,11 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<ul>
<li>
<?= t('Column on the board:') ?>
<strong><?= Helper\escape($task['column_title']) ?></strong>
<strong><?= $this->e($task['column_title']) ?></strong>
</li>
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
</ul>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,5 +1,5 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<p><?= t('The task #%d have been opened.', $task['id']) ?></p>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>

View File

@@ -1,4 +1,4 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h2><?= $this->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<ul>
<li>
@@ -25,19 +25,19 @@
</li>
<li>
<?= t('Column on the board:') ?>
<strong><?= Helper\escape($task['column_title']) ?></strong>
<strong><?= $this->e($task['column_title']) ?></strong>
</li>
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
<li><?= t('Task position:').' '.$this->e($task['position']) ?></li>
<?php if ($task['category_name']): ?>
<li>
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
<?= t('Category:') ?> <strong><?= $this->e($task['category_name']) ?></strong>
</li>
<?php endif ?>
</ul>
<?php if (! empty($task['description'])): ?>
<h2><?= t('Description') ?></h2>
<?= Helper\markdown($task['description']) ?: t('There is no description.') ?>
<?= $this->markdown($task['description']) ?: t('There is no description.') ?>
<?php endif ?>
<?= Helper\template('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>