summaryrefslogtreecommitdiff
path: root/app/Template/project_edit
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-02 17:01:27 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-02 17:01:27 -0500
commit3833c12ccce59bcc49c4cfa892401973558f604d (patch)
treeb67b0e10cdc3d42e5626f728206138a444a40ed0 /app/Template/project_edit
parentd49ce63e51f596ad3bf0d02b689aea673cf544f8 (diff)
Refactoring/rewrite of modal boxes handling
Diffstat (limited to 'app/Template/project_edit')
-rw-r--r--app/Template/project_edit/dates.php22
-rw-r--r--app/Template/project_edit/description.php19
-rw-r--r--app/Template/project_edit/general.php36
-rw-r--r--app/Template/project_edit/show.php57
-rw-r--r--app/Template/project_edit/task_priority.php29
5 files changed, 57 insertions, 106 deletions
diff --git a/app/Template/project_edit/dates.php b/app/Template/project_edit/dates.php
deleted file mode 100644
index 1c2c3dd4..00000000
--- a/app/Template/project_edit/dates.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="page-header">
- <h2><?= t('Edit project') ?></h2>
- <ul>
- <li ><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li class="active"><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- </ul>
-</div>
-<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off">
- <?= $this->form->csrf() ?>
- <?= $this->form->hidden('id', $values) ?>
- <?= $this->form->hidden('name', $values) ?>
- <?= $this->form->date(t('Start date'), 'start_date', $values, $errors) ?>
- <?= $this->form->date(t('End date'), 'end_date', $values, $errors) ?>
-
- <div class="form-actions">
- <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
- </div>
-</form>
-
-<p class="alert alert-info"><?= t('Those dates are useful for the project Gantt chart.') ?></p>
diff --git a/app/Template/project_edit/description.php b/app/Template/project_edit/description.php
deleted file mode 100644
index 586ddfcb..00000000
--- a/app/Template/project_edit/description.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<div class="page-header">
- <h2><?= t('Edit project') ?></h2>
- <ul>
- <li><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li class="active"><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- </ul>
-</div>
-<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off">
- <?= $this->form->csrf() ?>
- <?= $this->form->hidden('id', $values) ?>
- <?= $this->form->hidden('name', $values) ?>
- <?= $this->form->textEditor('description', $values, $errors, array('autofocus' => true)) ?>
-
- <div class="form-actions">
- <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
- </div>
-</form>
diff --git a/app/Template/project_edit/general.php b/app/Template/project_edit/general.php
deleted file mode 100644
index c7421477..00000000
--- a/app/Template/project_edit/general.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="page-header">
- <h2><?= t('Edit project') ?></h2>
- <ul>
- <li class="active"><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- </ul>
-</div>
-<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
- <?= $this->form->csrf() ?>
- <?= $this->form->hidden('id', $values) ?>
-
- <?= $this->form->label(t('Name'), 'name') ?>
- <?= $this->form->text('name', $values, $errors, array('required', 'maxlength="50"')) ?>
-
- <?= $this->form->label(t('Identifier'), 'identifier') ?>
- <?= $this->form->text('identifier', $values, $errors, array('maxlength="50"')) ?>
- <p class="form-help"><?= t('The project identifier is optional and must be alphanumeric, example: MYPROJECT.') ?></p>
-
- <hr>
- <div class="form-inline">
- <?= $this->form->label(t('Project owner'), 'owner_id') ?>
- <?= $this->form->select('owner_id', $owners, $values, $errors) ?>
- </div>
-
- <?php if ($this->user->hasProjectAccess('ProjectCreationController', 'create', $project['id'])): ?>
- <hr>
- <?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?>
- <p class="form-help"><?= t('Private projects do not have users and groups management.') ?></p>
- <?php endif ?>
-
- <div class="form-actions">
- <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
- </div>
-</form>
diff --git a/app/Template/project_edit/show.php b/app/Template/project_edit/show.php
new file mode 100644
index 00000000..f574b6f9
--- /dev/null
+++ b/app/Template/project_edit/show.php
@@ -0,0 +1,57 @@
+<div class="page-header">
+ <h2><?= $this->text->e($project['name']) ?> &gt; <?= t('Edit project') ?></h2>
+</div>
+<form method="post" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('id', $values) ?>
+
+ <fieldset>
+ <legend><?= t('General') ?></legend>
+
+ <?= $this->form->label(t('Name'), 'name') ?>
+ <?= $this->form->text('name', $values, $errors, array('required', 'maxlength="50"', 'autofocus', 'tabindex="1"')) ?>
+
+ <?= $this->form->label(t('Identifier'), 'identifier') ?>
+ <?= $this->form->text('identifier', $values, $errors, array('maxlength="50"', 'tabindex="2"')) ?>
+ <p class="form-help"><?= t('The project identifier is optional and must be alphanumeric, example: MYPROJECT.') ?></p>
+
+ <?= $this->form->label(t('Description'), 'description') ?>
+ <?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 3)) ?>
+ </fieldset>
+
+ <fieldset>
+ <legend><?= t('Permissions and ownership') ?></legend>
+
+ <?php if ($this->user->hasProjectAccess('ProjectCreationController', 'create', $project['id'])): ?>
+ <?= $this->form->checkbox('is_private', t('Private project'), 1, $project['is_private'] == 1) ?>
+ <p class="form-help"><?= t('Private projects do not have users and groups management.') ?></p>
+ <?php endif ?>
+
+ <div class="form-inline">
+ <?= $this->form->label(t('Project owner'), 'owner_id') ?>
+ <?= $this->form->select('owner_id', $owners, $values, $errors, array('tabindex="5"')) ?>
+ </div>
+ </fieldset>
+
+ <fieldset>
+ <legend><?= t('Dates') ?></legend>
+
+ <?= $this->form->date(t('Start date'), 'start_date', $values, $errors, array('tabindex="6"')) ?>
+ <?= $this->form->date(t('End date'), 'end_date', $values, $errors, array('tabindex="7"')) ?>
+ </fieldset>
+
+ <fieldset>
+ <legend><?= t('Priorities') ?></legend>
+
+ <?= $this->form->label(t('Default priority'), 'priority_default') ?>
+ <?= $this->form->number('priority_default', $values, $errors, array('tabindex="8"')) ?>
+
+ <?= $this->form->label(t('Lowest priority'), 'priority_start') ?>
+ <?= $this->form->number('priority_start', $values, $errors, array('tabindex="9"')) ?>
+
+ <?= $this->form->label(t('Highest priority'), 'priority_end') ?>
+ <?= $this->form->number('priority_end', $values, $errors, array('tabindex="10"')) ?>
+ </fieldset>
+
+ <?= $this->modal->submitButtons(array('tabindex' => 11)) ?>
+</form>
diff --git a/app/Template/project_edit/task_priority.php b/app/Template/project_edit/task_priority.php
deleted file mode 100644
index 3ef4b3cb..00000000
--- a/app/Template/project_edit/task_priority.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<div class="page-header">
- <h2><?= t('Edit project') ?></h2>
- <ul>
- <li ><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- <li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
- </ul>
-</div>
-<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off">
- <?= $this->form->csrf() ?>
- <?= $this->form->hidden('id', $values) ?>
- <?= $this->form->hidden('name', $values) ?>
-
- <?= $this->form->label(t('Default priority'), 'priority_default') ?>
- <?= $this->form->number('priority_default', $values, $errors) ?>
-
- <?= $this->form->label(t('Lowest priority'), 'priority_start') ?>
- <?= $this->form->number('priority_start', $values, $errors) ?>
-
- <?= $this->form->label(t('Highest priority'), 'priority_end') ?>
- <?= $this->form->number('priority_end', $values, $errors) ?>
-
- <div class="form-actions">
- <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
- </div>
-</form>
-
-<p class="alert alert-info"><?= t('If you put zero to the low and high priority, this feature will be disabled.') ?></p>