summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/css/app.css30
-rw-r--r--lib/helper.php5
-rw-r--r--locales/fr_FR/translations.php1
-rw-r--r--locales/pl_PL/translations.php1
-rw-r--r--models/base.php2
-rw-r--r--models/schema.php5
-rw-r--r--models/task.php6
-rw-r--r--templates/board_index.php4
-rw-r--r--templates/board_public.php4
-rw-r--r--templates/task_edit.php3
-rw-r--r--templates/task_new.php3
-rw-r--r--templates/task_show.php3
12 files changed, 65 insertions, 2 deletions
diff --git a/assets/css/app.css b/assets/css/app.css
index 36411fe0..123ad305 100644
--- a/assets/css/app.css
+++ b/assets/css/app.css
@@ -115,6 +115,7 @@ input[type="checkbox"] {
border: 1px solid #ccc;
}
+input[type="number"],
input[type="date"],
input[type="email"],
input[type="tel"],
@@ -130,6 +131,7 @@ input[type="text"] {
appearance: none;
}
+input[type="number"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
@@ -142,6 +144,10 @@ textarea:focus {
box-shadow: 0 0 8px rgba(82, 168, 236, 0.6);
}
+input[type="number"] {
+ width: 50px;
+}
+
textarea {
border: 1px solid #ccc;
padding: 3px;
@@ -494,11 +500,35 @@ div.task a:hover {
text-decoration: underline;
}
+#infos,
+div.task {
+ position: relative;
+}
+
+.task-score {
+ font-weight: bold;
+ position: absolute;
+}
+
+div.task .task-score {
+ font-size: 1.5em;
+ right: 5px;
+ top: 0;
+}
+
+/* task view */
article.task li {
margin-left: 20px;
list-style-type: square;
}
+article .task-score {
+ font-size: 1.9em;
+ right: 10px;
+ top: 5px;
+}
+
+/* task colors */
tr td.task-blue,
.task-blue {
background-color: rgb(219, 235, 255);
diff --git a/lib/helper.php b/lib/helper.php
index 22121015..50071be1 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -230,3 +230,8 @@ function form_date($name, $values = array(), array $errors = array(), array $att
{
return form_input('date', $name, $values, $errors, $attributes, $class);
}
+
+function form_number($name, $values = array(), array $errors = array(), array $attributes = array(), $class = '')
+{
+ return form_input('number', $name, $values, $errors, $attributes, $class);
+}
diff --git a/locales/fr_FR/translations.php b/locales/fr_FR/translations.php
index 97e26212..6e3ef8ef 100644
--- a/locales/fr_FR/translations.php
+++ b/locales/fr_FR/translations.php
@@ -186,4 +186,5 @@ return array(
'Timezone' => 'Fuseau horaire',
'Sorry, I didn\'t found this information in my database!' => 'Désolé, je n\'ai pas trouvé cette information dans ma base de données !',
'Page not found' => 'Page introuvable',
+ 'Story Points' => 'Complexité',
);
diff --git a/locales/pl_PL/translations.php b/locales/pl_PL/translations.php
index 915ff412..aaadb510 100644
--- a/locales/pl_PL/translations.php
+++ b/locales/pl_PL/translations.php
@@ -186,4 +186,5 @@ return array(
'Timezone' => 'Strefa czasowa',
//'Sorry, I didn\'t found this information in my database!' => '',
//'Page not found' => '',
+ //'Story Points' => '',
);
diff --git a/models/base.php b/models/base.php
index e512e9db..0a565f51 100644
--- a/models/base.php
+++ b/models/base.php
@@ -17,7 +17,7 @@ require __DIR__.'/schema.php';
abstract class Base
{
const APP_VERSION = 'master';
- const DB_VERSION = 4;
+ const DB_VERSION = 5;
const DB_FILENAME = 'data/db.sqlite';
private static $dbInstance = null;
diff --git a/models/schema.php b/models/schema.php
index 66571bbe..e06271b3 100644
--- a/models/schema.php
+++ b/models/schema.php
@@ -2,6 +2,11 @@
namespace Schema;
+function version_5($pdo)
+{
+ $pdo->exec("ALTER TABLE tasks ADD column score INTEGER");
+}
+
function version_4($pdo)
{
$pdo->exec("ALTER TABLE config ADD column timezone TEXT DEFAULT 'UTC'");
diff --git a/models/task.php b/models/task.php
index e227cc95..e542e8e0 100644
--- a/models/task.php
+++ b/models/task.php
@@ -40,6 +40,7 @@ class Task extends Base
self::TABLE.'.owner_id',
self::TABLE.'.position',
self::TABLE.'.is_active',
+ self::TABLE.'.score',
\Model\Project::TABLE.'.name AS project_name',
\Model\Board::TABLE.'.title AS column_title',
\Model\User::TABLE.'.username'
@@ -71,6 +72,7 @@ class Task extends Base
self::TABLE.'.owner_id',
self::TABLE.'.position',
self::TABLE.'.is_active',
+ self::TABLE.'.score',
\Model\Board::TABLE.'.title AS column_title',
\Model\User::TABLE.'.username'
)
@@ -95,7 +97,7 @@ class Task extends Base
{
return $this->db
->table(self::TABLE)
- ->columns('tasks.id', 'title', 'color_id', 'project_id', 'owner_id', 'column_id', 'position', 'users.username')
+ ->columns('tasks.id', 'title', 'color_id', 'project_id', 'owner_id', 'column_id', 'position', 'score', 'users.username')
->join('users', 'id', 'owner_id')
->eq('project_id', $project_id)
->eq('column_id', $column_id)
@@ -179,6 +181,7 @@ class Task extends Base
new Validators\Required('column_id', t('The column is required')),
new Validators\Integer('column_id', t('This value must be an integer')),
new Validators\Integer('owner_id', t('This value must be an integer')),
+ new Validators\Integer('score', t('This value must be an integer')),
new Validators\Required('title', t('The title is required')),
new Validators\MaxLength('title', t('The maximum length is %d characters', 200), 200),
));
@@ -200,6 +203,7 @@ class Task extends Base
new Validators\Required('column_id', t('The column is required')),
new Validators\Integer('column_id', t('This value must be an integer')),
new Validators\Integer('owner_id', t('This value must be an integer')),
+ new Validators\Integer('score', t('This value must be an integer')),
new Validators\Required('title', t('The title is required')),
new Validators\MaxLength('title', t('The maximum length is %d characters', 200), 200),
));
diff --git a/templates/board_index.php b/templates/board_index.php
index ff10a70b..7a3f8ec1 100644
--- a/templates/board_index.php
+++ b/templates/board_index.php
@@ -52,6 +52,10 @@
<?php endif ?>
</span>
+ <?php if ($task['score']): ?>
+ <span class="task-score"><?= Helper\escape($task['score']) ?></span>
+ <?php endif ?>
+
<div class="task-title">
<?= Helper\escape($task['title']) ?>
</div>
diff --git a/templates/board_public.php b/templates/board_public.php
index ac9e80ae..16c69ce2 100644
--- a/templates/board_public.php
+++ b/templates/board_public.php
@@ -29,6 +29,10 @@
<?php endif ?>
</span>
+ <?php if ($task['score']): ?>
+ <span class="task-score"><?= Helper\escape($task['score']) ?></span>
+ <?php endif ?>
+
<div class="task-title">
<?= Helper\escape($task['title']) ?>
</div>
diff --git a/templates/task_edit.php b/templates/task_edit.php
index 633ac9ae..c4f806fd 100644
--- a/templates/task_edit.php
+++ b/templates/task_edit.php
@@ -20,6 +20,9 @@
<?= Helper\form_label(t('Assignee'), 'owner_id') ?>
<?= Helper\form_select('owner_id', $users_list, $values, $errors) ?><br/>
+ <?= Helper\form_label(t('Story Points'), 'score') ?>
+ <?= Helper\form_number('score', $values, $errors) ?><br/>
+
<?= Helper\form_label(t('Description'), 'description') ?>
<?= Helper\form_textarea('description', $values, $errors) ?><br/>
diff --git a/templates/task_new.php b/templates/task_new.php
index e418748c..dd2ba3b4 100644
--- a/templates/task_new.php
+++ b/templates/task_new.php
@@ -20,6 +20,9 @@
<?= Helper\form_label(t('Assignee'), 'owner_id') ?>
<?= Helper\form_select('owner_id', $users_list, $values, $errors) ?><br/>
+ <?= Helper\form_label(t('Story Points'), 'score') ?>
+ <?= Helper\form_number('score', $values, $errors) ?><br/>
+
<?= Helper\form_label(t('Description'), 'description') ?>
<?= Helper\form_textarea('description', $values, $errors) ?><br/>
diff --git a/templates/task_show.php b/templates/task_show.php
index f09f249e..fffacf74 100644
--- a/templates/task_show.php
+++ b/templates/task_show.php
@@ -8,6 +8,9 @@
<section>
<h3><?= t('Details') ?></h3>
<article id="infos" class="task task-<?= $task['color_id'] ?>">
+ <?php if ($task['score']): ?>
+ <span class="task-score"><?= Helper\escape($task['score']) ?></span>
+ <?php endif ?>
<ul>
<li>
<?= dt('Created on %B %e, %G at %k:%M %p', $task['date_creation']) ?>