Move category template to a subfolder

This commit is contained in:
Frédéric Guillot
2014-11-13 20:04:34 -05:00
parent 84770123b4
commit e4efc73a90
4 changed files with 14 additions and 11 deletions

View File

@@ -38,7 +38,7 @@ class Category extends Base
{ {
$project = $this->getProjectManagement(); $project = $this->getProjectManagement();
$this->response->html($this->projectLayout('category_index', array( $this->response->html($this->projectLayout('category/index', array(
'categories' => $this->category->getList($project['id'], false), 'categories' => $this->category->getList($project['id'], false),
'values' => array('project_id' => $project['id']), 'values' => array('project_id' => $project['id']),
'errors' => array(), 'errors' => array(),
@@ -70,7 +70,7 @@ class Category extends Base
} }
} }
$this->response->html($this->projectLayout('category_index', array( $this->response->html($this->projectLayout('category/index', array(
'categories' => $this->category->getList($project['id'], false), 'categories' => $this->category->getList($project['id'], false),
'values' => $values, 'values' => $values,
'errors' => $errors, 'errors' => $errors,
@@ -89,7 +89,7 @@ class Category extends Base
$project = $this->getProjectManagement(); $project = $this->getProjectManagement();
$category = $this->getCategory($project['id']); $category = $this->getCategory($project['id']);
$this->response->html($this->projectLayout('category_edit', array( $this->response->html($this->projectLayout('category/edit', array(
'values' => $category, 'values' => $category,
'errors' => array(), 'errors' => array(),
'project' => $project, 'project' => $project,
@@ -120,7 +120,7 @@ class Category extends Base
} }
} }
$this->response->html($this->projectLayout('category_edit', array( $this->response->html($this->projectLayout('category/edit', array(
'values' => $values, 'values' => $values,
'errors' => $errors, 'errors' => $errors,
'project' => $project, 'project' => $project,
@@ -138,7 +138,7 @@ class Category extends Base
$project = $this->getProjectManagement(); $project = $this->getProjectManagement();
$category = $this->getCategory($project['id']); $category = $this->getCategory($project['id']);
$this->response->html($this->projectLayout('category_remove', array( $this->response->html($this->projectLayout('category/remove', array(
'project' => $project, 'project' => $project,
'category' => $category, 'category' => $category,
'title' => t('Remove a category') 'title' => t('Remove a category')

View File

@@ -2,8 +2,10 @@
<h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2> <h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2>
</div> </div>
<form method="post" action="?controller=category&amp;action=update&amp;project_id=<?= $project['id'] ?>" autocomplete="off"> <form method="post" action="<?= Helper\u('category', 'update', array('project_id' => $project['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?> <?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?> <?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_hidden('project_id', $values) ?> <?= Helper\form_hidden('project_id', $values) ?>

View File

@@ -14,10 +14,10 @@
<td> <td>
<ul> <ul>
<li> <li>
<a href="?controller=category&amp;action=edit&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Edit') ?></a> <?= Helper\a(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
</li> </li>
<li> <li>
<a href="?controller=category&amp;action=confirm&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category_id ?>"><?= t('Remove') ?></a> <?= Helper\a(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
</li> </li>
</ul> </ul>
</td> </td>
@@ -27,7 +27,7 @@
<?php endif ?> <?php endif ?>
<h3><?= t('Add a new category') ?></h3> <h3><?= t('Add a new category') ?></h3>
<form method="post" action="?controller=category&amp;action=save&amp;project_id=<?= $project['id'] ?>" autocomplete="off"> <form method="post" action="<?= Helper\u('category', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?> <?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?> <?= Helper\form_hidden('project_id', $values) ?>

View File

@@ -9,8 +9,9 @@
</p> </p>
<div class="form-actions"> <div class="form-actions">
<a href="?controller=category&amp;action=remove&amp;project_id=<?= $project['id'] ?>&amp;category_id=<?= $category['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a> <?= Helper\a(t('Yes'), 'category', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?>
<?= t('or') ?> <a href="?controller=category&amp;project_id=<?= $project['id'] ?>"><?= t('cancel') ?></a> <?= t('or') ?>
<?= Helper\a(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?>
</div> </div>
</div> </div>
</section> </section>