summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-20 20:26:21 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-20 20:26:21 -0500
commit11b6381cc0f0583a11287202463d20a0ac1ebf00 (patch)
treec973b6686467272ae56914f5e143d09de476d084
parentb84edaaf13ba854290099b0df452f61e9b595a17 (diff)
Move and clean some templates to a subfolder
-rw-r--r--app/Controller/Config.php12
-rw-r--r--app/Controller/File.php6
-rw-r--r--app/Template/config/about.php (renamed from app/Template/config_about.php)0
-rw-r--r--app/Template/config/api.php (renamed from app/Template/config_api.php)0
-rw-r--r--app/Template/config/application.php (renamed from app/Template/config_application.php)0
-rw-r--r--app/Template/config/board.php (renamed from app/Template/config_board.php)0
-rw-r--r--app/Template/config/layout.php (renamed from app/Template/config_layout.php)2
-rw-r--r--app/Template/config/sidebar.php (renamed from app/Template/config_sidebar.php)0
-rw-r--r--app/Template/config/webhook.php (renamed from app/Template/config_webhook.php)0
-rw-r--r--app/Template/file/new.php (renamed from app/Template/file_new.php)4
-rw-r--r--app/Template/file/open.php6
-rw-r--r--app/Template/file/remove.php15
-rw-r--r--app/Template/file/show.php23
-rw-r--r--app/Template/file_open.php6
-rw-r--r--app/Template/file_remove.php14
-rw-r--r--app/Template/file_show.php23
-rw-r--r--app/Template/task_show.php2
-rw-r--r--assets/css/app.css2
-rw-r--r--assets/css/header.css2
19 files changed, 59 insertions, 58 deletions
diff --git a/app/Controller/Config.php b/app/Controller/Config.php
index 3e0b290b..199259d7 100644
--- a/app/Controller/Config.php
+++ b/app/Controller/Config.php
@@ -25,7 +25,7 @@ class Config extends Base
$params['errors'] = array();
$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()
{
- $this->response->html($this->layout('config_about', array(
+ $this->response->html($this->layout('config/about', array(
'db_size' => $this->config->getDatabaseSize(),
'title' => t('Settings').' &gt; '.t('About'),
)));
@@ -74,7 +74,7 @@ class Config extends Base
{
$this->common('application');
- $this->response->html($this->layout('config_application', array(
+ $this->response->html($this->layout('config/application', array(
'languages' => $this->config->getLanguages(),
'timezones' => $this->config->getTimezones(),
'date_formats' => $this->dateParser->getAvailableFormats(),
@@ -91,7 +91,7 @@ class Config extends Base
{
$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()),
'title' => t('Settings').' &gt; '.t('Board settings'),
)));
@@ -106,7 +106,7 @@ class Config extends Base
{
$this->common('webhook');
- $this->response->html($this->layout('config_webhook', array(
+ $this->response->html($this->layout('config/webhook', array(
'title' => t('Settings').' &gt; '.t('Webhook settings'),
)));
}
@@ -118,7 +118,7 @@ class Config extends Base
*/
public function api()
{
- $this->response->html($this->layout('config_api', array(
+ $this->response->html($this->layout('config/api', array(
'title' => t('Settings').' &gt; '.t('API'),
)));
}
diff --git a/app/Controller/File.php b/app/Controller/File.php
index 24db7565..ae44cac0 100644
--- a/app/Controller/File.php
+++ b/app/Controller/File.php
@@ -21,7 +21,7 @@ class File extends Base
{
$task = $this->getTask();
- $this->response->html($this->taskLayout('file_new', array(
+ $this->response->html($this->taskLayout('file/new', array(
'task' => $task,
'max_size' => ini_get('upload_max_filesize'),
)));
@@ -75,7 +75,7 @@ class File extends Base
$file = $this->file->getById($this->request->getIntegerParam('file_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
)));
}
@@ -132,7 +132,7 @@ class File extends Base
$task = $this->getTask();
$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,
'file' => $file,
)));
diff --git a/app/Template/config_about.php b/app/Template/config/about.php
index 3f34f802..3f34f802 100644
--- a/app/Template/config_about.php
+++ b/app/Template/config/about.php
diff --git a/app/Template/config_api.php b/app/Template/config/api.php
index 037ea08d..037ea08d 100644
--- a/app/Template/config_api.php
+++ b/app/Template/config/api.php
diff --git a/app/Template/config_application.php b/app/Template/config/application.php
index c92975bc..c92975bc 100644
--- a/app/Template/config_application.php
+++ b/app/Template/config/application.php
diff --git a/app/Template/config_board.php b/app/Template/config/board.php
index f260d084..f260d084 100644
--- a/app/Template/config_board.php
+++ b/app/Template/config/board.php
diff --git a/app/Template/config_layout.php b/app/Template/config/layout.php
index bafad6bb..e0ac2fa8 100644
--- a/app/Template/config_layout.php
+++ b/app/Template/config/layout.php
@@ -1,7 +1,7 @@
<section id="main">
<section class="sidebar-container" id="config-section">
- <?= Helper\template('config_sidebar') ?>
+ <?= Helper\template('config/sidebar') ?>
<div class="sidebar-content">
<?= $config_content_for_layout ?>
diff --git a/app/Template/config_sidebar.php b/app/Template/config/sidebar.php
index 5870ca81..5870ca81 100644
--- a/app/Template/config_sidebar.php
+++ b/app/Template/config/sidebar.php
diff --git a/app/Template/config_webhook.php b/app/Template/config/webhook.php
index 052a2a99..052a2a99 100644
--- a/app/Template/config_webhook.php
+++ b/app/Template/config/webhook.php
diff --git a/app/Template/file_new.php b/app/Template/file/new.php
index 7f7f1d1c..63c29f1d 100644
--- a/app/Template/file_new.php
+++ b/app/Template/file/new.php
@@ -2,13 +2,13 @@
<h2><?= t('Attach a document') ?></h2>
</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() ?>
<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-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= 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>
</form> \ No newline at end of file
diff --git a/app/Template/file/open.php b/app/Template/file/open.php
new file mode 100644
index 00000000..6106e6f8
--- /dev/null
+++ b/app/Template/file/open.php
@@ -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> \ No newline at end of file
diff --git a/app/Template/file/remove.php b/app/Template/file/remove.php
new file mode 100644
index 00000000..4f655e5a
--- /dev/null
+++ b/app/Template/file/remove.php
@@ -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> \ No newline at end of file
diff --git a/app/Template/file/show.php b/app/Template/file/show.php
new file mode 100644
index 00000000..92a7c100
--- /dev/null
+++ b/app/Template/file/show.php
@@ -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 ?> \ No newline at end of file
diff --git a/app/Template/file_open.php b/app/Template/file_open.php
deleted file mode 100644
index aa181d64..00000000
--- a/app/Template/file_open.php
+++ /dev/null
@@ -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> \ No newline at end of file
diff --git a/app/Template/file_remove.php b/app/Template/file_remove.php
deleted file mode 100644
index af77591c..00000000
--- a/app/Template/file_remove.php
+++ /dev/null
@@ -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> \ No newline at end of file
diff --git a/app/Template/file_show.php b/app/Template/file_show.php
deleted file mode 100644
index 3832a0f5..00000000
--- a/app/Template/file_show.php
+++ /dev/null
@@ -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 ?> \ No newline at end of file
diff --git a/app/Template/task_show.php b/app/Template/task_show.php
index ec5d5da4..a4b49cef 100644
--- a/app/Template/task_show.php
+++ b/app/Template/task_show.php
@@ -3,5 +3,5 @@
<?= Helper\template('task_show_description', array('task' => $task)) ?>
<?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?>
<?= 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)) ?> \ No newline at end of file
diff --git a/assets/css/app.css b/assets/css/app.css
index 0ce83aa4..2894b9ee 100644
--- a/assets/css/app.css
+++ b/assets/css/app.css
@@ -527,7 +527,7 @@ nav .active a {
margin: 0;
padding: 0;
font-size: 140%;
- border-bottom: 1px dotted #DF5353;
+ border-bottom: 1px dotted #ccc;
}
.page-header h2 a {
diff --git a/assets/css/header.css b/assets/css/header.css
index 4fc268cc..c8b820d1 100644
--- a/assets/css/header.css
+++ b/assets/css/header.css
@@ -61,7 +61,7 @@ nav .active a {
margin: 0;
padding: 0;
font-size: 140%;
- border-bottom: 1px dotted #DF5353;
+ border-bottom: 1px dotted #ccc;
}
.page-header h2 a {