Move and clean some templates to a subfolder

This commit is contained in:
Frédéric Guillot
2014-11-20 20:26:21 -05:00
parent b84edaaf13
commit 11b6381cc0
19 changed files with 59 additions and 58 deletions

View File

@@ -25,7 +25,7 @@ class Config extends Base
$params['errors'] = array(); $params['errors'] = array();
$params['config_content_for_layout'] = $this->template->load($template, $params); $params['config_content_for_layout'] = $this->template->load($template, $params);
return $this->template->layout('config_layout', $params); return $this->template->layout('config/layout', $params);
} }
/** /**
@@ -59,7 +59,7 @@ class Config extends Base
*/ */
public function index() public function index()
{ {
$this->response->html($this->layout('config_about', array( $this->response->html($this->layout('config/about', array(
'db_size' => $this->config->getDatabaseSize(), 'db_size' => $this->config->getDatabaseSize(),
'title' => t('Settings').' > '.t('About'), 'title' => t('Settings').' > '.t('About'),
))); )));
@@ -74,7 +74,7 @@ class Config extends Base
{ {
$this->common('application'); $this->common('application');
$this->response->html($this->layout('config_application', array( $this->response->html($this->layout('config/application', array(
'languages' => $this->config->getLanguages(), 'languages' => $this->config->getLanguages(),
'timezones' => $this->config->getTimezones(), 'timezones' => $this->config->getTimezones(),
'date_formats' => $this->dateParser->getAvailableFormats(), 'date_formats' => $this->dateParser->getAvailableFormats(),
@@ -91,7 +91,7 @@ class Config extends Base
{ {
$this->common('board'); $this->common('board');
$this->response->html($this->layout('config_board', array( $this->response->html($this->layout('config/board', array(
'default_columns' => implode(', ', $this->board->getDefaultColumns()), 'default_columns' => implode(', ', $this->board->getDefaultColumns()),
'title' => t('Settings').' > '.t('Board settings'), 'title' => t('Settings').' > '.t('Board settings'),
))); )));
@@ -106,7 +106,7 @@ class Config extends Base
{ {
$this->common('webhook'); $this->common('webhook');
$this->response->html($this->layout('config_webhook', array( $this->response->html($this->layout('config/webhook', array(
'title' => t('Settings').' > '.t('Webhook settings'), 'title' => t('Settings').' > '.t('Webhook settings'),
))); )));
} }
@@ -118,7 +118,7 @@ class Config extends Base
*/ */
public function api() public function api()
{ {
$this->response->html($this->layout('config_api', array( $this->response->html($this->layout('config/api', array(
'title' => t('Settings').' > '.t('API'), 'title' => t('Settings').' > '.t('API'),
))); )));
} }

View File

@@ -21,7 +21,7 @@ class File extends Base
{ {
$task = $this->getTask(); $task = $this->getTask();
$this->response->html($this->taskLayout('file_new', array( $this->response->html($this->taskLayout('file/new', array(
'task' => $task, 'task' => $task,
'max_size' => ini_get('upload_max_filesize'), 'max_size' => ini_get('upload_max_filesize'),
))); )));
@@ -75,7 +75,7 @@ class File extends Base
$file = $this->file->getById($this->request->getIntegerParam('file_id')); $file = $this->file->getById($this->request->getIntegerParam('file_id'));
if ($file['task_id'] == $task['id']) { if ($file['task_id'] == $task['id']) {
$this->response->html($this->template->load('file_open', array( $this->response->html($this->template->load('file/open', array(
'file' => $file 'file' => $file
))); )));
} }
@@ -132,7 +132,7 @@ class File extends Base
$task = $this->getTask(); $task = $this->getTask();
$file = $this->file->getById($this->request->getIntegerParam('file_id')); $file = $this->file->getById($this->request->getIntegerParam('file_id'));
$this->response->html($this->taskLayout('file_remove', array( $this->response->html($this->taskLayout('file/remove', array(
'task' => $task, 'task' => $task,
'file' => $file, 'file' => $file,
))); )));

View File

@@ -1,7 +1,7 @@
<section id="main"> <section id="main">
<section class="sidebar-container" id="config-section"> <section class="sidebar-container" id="config-section">
<?= Helper\template('config_sidebar') ?> <?= Helper\template('config/sidebar') ?>
<div class="sidebar-content"> <div class="sidebar-content">
<?= $config_content_for_layout ?> <?= $config_content_for_layout ?>

View File

@@ -2,13 +2,13 @@
<h2><?= t('Attach a document') ?></h2> <h2><?= t('Attach a document') ?></h2>
</div> </div>
<form action="?controller=file&amp;action=save&amp;task_id=<?= $task['id'] ?>" method="post" enctype="multipart/form-data"> <form action="<?= Helper\u('file', 'save', array('task_id' => $task['id'])) ?>" method="post" enctype="multipart/form-data">
<?= Helper\form_csrf() ?> <?= Helper\form_csrf() ?>
<input type="file" name="files[]" multiple /> <input type="file" name="files[]" multiple />
<div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? Helper\format_bytes($max_size) : $max_size ?></div> <div class="form-help"><?= t('Maximum size: ') ?><?= is_integer($max_size) ? Helper\format_bytes($max_size) : $max_size ?></div>
<div class="form-actions"> <div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?> <?= t('or') ?>
<a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
</div> </div>
</form> </form>

View File

@@ -0,0 +1,6 @@
<div class="page-header">
<h2><?= Helper\escape($file['name']) ?></h2>
<div class="task-file-viewer">
<img src="<?= Helper\u('file', 'image', array('file_id' => $file['id'], 'task_id' => $file['task_id'])) ?>" alt="<?= Helper\escape($file['name']) ?>"/>
</div>
</div>

View File

@@ -0,0 +1,15 @@
<div class="page-header">
<h2><?= t('Remove a file') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this file: "%s"?', Helper\escape($file['name'])) ?>
</p>
<div class="form-actions">
<?= Helper\a(t('Yes'), 'file', 'remove', array('task_id' => $task['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?>
<?= t('or') ?>
<?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<?php if (! empty($files)): ?>
<div id="attachments" class="task-show-section">
<div class="page-header">
<h2><?= t('Attachments') ?></h2>
</div>
<ul class="task-show-files">
<?php foreach ($files as $file): ?>
<li>
<?= Helper\a(Helper\escape($file['name']), 'file', 'download', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?>
<span class="task-show-file-actions">
<?php if ($file['is_image']): ?>
<?= Helper\a(t('open'), 'file', 'open', array('task_id' => $task['id'], 'file_id' => $file['id']), false, 'file-popover') ?>,
<?php endif ?>
<?= Helper\a(t('remove'), 'file', 'confirm', array('task_id' => $task['id'], 'file_id' => $file['id'])) ?>
</span>
</li>
<?php endforeach ?>
</ul>
</div>
<?php endif ?>

View File

@@ -1,6 +0,0 @@
<div class="page-header">
<h2><?= Helper\escape($file['name']) ?></h2>
<div class="task-file-viewer">
<img src="?controller=file&amp;action=image&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $file['task_id'] ?>" alt="<?= Helper\escape($file['name']) ?>"/>
</div>
</div>

View File

@@ -1,14 +0,0 @@
<div class="page-header">
<h2><?= t('Remove a file') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this file: "%s"?', Helper\escape($file['name'])) ?>
</p>
<div class="form-actions">
<a href="?controller=file&amp;action=remove&amp;task_id=<?= $task['id'] ?>&amp;file_id=<?= $file['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
<?= t('or') ?> <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
</div>
</div>

View File

@@ -1,23 +0,0 @@
<?php if (! empty($files)): ?>
<div id="attachments" class="task-show-section">
<div class="page-header">
<h2><?= t('Attachments') ?></h2>
</div>
<ul class="task-show-files">
<?php foreach ($files as $file): ?>
<li>
<a href="?controller=file&amp;action=download&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
<span class="task-show-file-actions">
<?php if ($file['is_image']): ?>
<a href="?controller=file&amp;action=open&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>" class="file-popover"><?= t('open') ?></a>,
<?php endif ?>
<a href="?controller=file&amp;action=confirm&amp;file_id=<?= $file['id'] ?>&amp;task_id=<?= $task['id'] ?>"><?= t('remove') ?></a>
</span>
</li>
<?php endforeach ?>
</ul>
</div>
<?php endif ?>

View File

@@ -3,5 +3,5 @@
<?= Helper\template('task_show_description', array('task' => $task)) ?> <?= Helper\template('task_show_description', array('task' => $task)) ?>
<?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?> <?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?>
<?= Helper\template('task_timesheet', array('timesheet' => $timesheet)) ?> <?= Helper\template('task_timesheet', array('timesheet' => $timesheet)) ?>
<?= Helper\template('file_show', array('task' => $task, 'files' => $files)) ?> <?= Helper\template('file/show', array('task' => $task, 'files' => $files)) ?>
<?= Helper\template('task_comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?> <?= Helper\template('task_comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?>

View File

@@ -527,7 +527,7 @@ nav .active a {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 140%; font-size: 140%;
border-bottom: 1px dotted #DF5353; border-bottom: 1px dotted #ccc;
} }
.page-header h2 a { .page-header h2 a {

View File

@@ -61,7 +61,7 @@ nav .active a {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 140%; font-size: 140%;
border-bottom: 1px dotted #DF5353; border-bottom: 1px dotted #ccc;
} }
.page-header h2 a { .page-header h2 a {