- Markdown supported in column description.
- Project > Edit Board and Project Summary pages now show description as tooltip. - Project > Edit Board shows textarea with markdown preview. Edit column also shows markdown preview. - Fixed bug while adding a new column inserts description as column limit.
This commit is contained in:
committed by
Frederic Guillot
parent
6fbcbfb001
commit
77a307e4ff
@@ -283,7 +283,7 @@ class Board extends Base
|
|||||||
|
|
||||||
if ($valid) {
|
if ($valid) {
|
||||||
|
|
||||||
if ($this->board->addColumn($project['id'], $data['title'],$data['description'])) {
|
if ($this->board->addColumn($project['id'], $data['title'],$data['task_limit'],$data['description'])) {
|
||||||
$this->session->flash(t('Board updated successfully.'));
|
$this->session->flash(t('Board updated successfully.'));
|
||||||
$this->response->redirect('?controller=board&action=edit&project_id='.$project['id']);
|
$this->response->redirect('?controller=board&action=edit&project_id='.$project['id']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class Board extends Base
|
|||||||
$values = array(
|
$values = array(
|
||||||
'project_id' => $project_id,
|
'project_id' => $project_id,
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'task_limit' => $task_limit,
|
'task_limit' => intval($task_limit),
|
||||||
'position' => $this->getLastColumnPosition($project_id) + 1,
|
'position' => $this->getLastColumnPosition($project_id) + 1,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
);
|
);
|
||||||
@@ -140,7 +140,7 @@ class Board extends Base
|
|||||||
{
|
{
|
||||||
return $this->db->table(self::TABLE)->eq('id', $column_id)->update(array(
|
return $this->db->table(self::TABLE)->eq('id', $column_id)->update(array(
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'task_limit' => $task_limit,
|
'task_limit' => intval($task_limit),
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,16 +6,20 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= t('Column title') ?></th>
|
<th><?= t('Column title') ?></th>
|
||||||
<th><?= t('Description') ?></th>
|
|
||||||
<th><?= t('Task limit') ?></th>
|
<th><?= t('Task limit') ?></th>
|
||||||
<th><?= t('Actions') ?></th>
|
<th><?= t('Actions') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($columns as $column): ?>
|
<?php foreach ($columns as $column): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="column-30"><?= $this->e($column['title']) ?></td>
|
<td class="column-60"><?= $this->e($column['title']) ?>
|
||||||
<td><?= $this->e($column['description']) ?></td>
|
<?php if (! empty($column['description'])): ?>
|
||||||
|
<span class="column-tooltip" title="<?= $this->markdown($column['description']) ?>">
|
||||||
|
<i class="fa fa-info-circle"></i>
|
||||||
|
</span>
|
||||||
|
<?php endif ?>
|
||||||
|
</td>
|
||||||
<td class="column-10"><?= $this->e($column['task_limit']) ?></td>
|
<td class="column-10"><?= $this->e($column['task_limit']) ?></td>
|
||||||
<td class="column-20">
|
<td class="column-30">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<?= $this->a(t('Edit'), 'board', 'editColumn', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
|
<?= $this->a(t('Edit'), 'board', 'editColumn', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
|
||||||
@@ -48,8 +52,28 @@
|
|||||||
|
|
||||||
<?= $this->formLabel(t('Title'), 'title') ?>
|
<?= $this->formLabel(t('Title'), 'title') ?>
|
||||||
<?= $this->formText('title', $values, $errors, array('required', 'maxlength="50"')) ?>
|
<?= $this->formText('title', $values, $errors, array('required', 'maxlength="50"')) ?>
|
||||||
|
|
||||||
|
<?= $this->formLabel(t('Task limit'), 'task_limit') ?>
|
||||||
|
<?= $this->formNumber('task_limit', $values, $errors) ?>
|
||||||
|
|
||||||
<?= $this->formLabel(t('Description'), 'description') ?>
|
<?= $this->formLabel(t('Description'), 'description') ?>
|
||||||
<?= $this->formTextarea('description', $values, $errors) ?>
|
|
||||||
|
<div class="form-tabs">
|
||||||
|
<ul class="form-tabs-nav">
|
||||||
|
<li class="form-tab form-tab-selected">
|
||||||
|
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
|
||||||
|
</li>
|
||||||
|
<li class="form-tab">
|
||||||
|
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="write-area">
|
||||||
|
<?= $this->formTextarea('description', $values, $errors) ?>
|
||||||
|
</div>
|
||||||
|
<div class="preview-area">
|
||||||
|
<div class="markdown"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
|
<div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
|||||||
@@ -16,7 +16,24 @@
|
|||||||
<?= $this->formNumber('task_limit', $values, $errors) ?>
|
<?= $this->formNumber('task_limit', $values, $errors) ?>
|
||||||
|
|
||||||
<?= $this->formLabel(t('Description'), 'description') ?>
|
<?= $this->formLabel(t('Description'), 'description') ?>
|
||||||
<?= $this->formTextarea('description', $values, $errors) ?>
|
|
||||||
|
<div class="form-tabs">
|
||||||
|
<ul class="form-tabs-nav">
|
||||||
|
<li class="form-tab form-tab-selected">
|
||||||
|
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
|
||||||
|
</li>
|
||||||
|
<li class="form-tab">
|
||||||
|
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="write-area">
|
||||||
|
<?= $this->formTextarea('description', $values, $errors) ?>
|
||||||
|
</div>
|
||||||
|
<div class="preview-area">
|
||||||
|
<div class="markdown"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></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"/>
|
||||||
|
|||||||
@@ -24,13 +24,11 @@
|
|||||||
<?= $this->a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-creation-popover', t('Add a new task')) ?>
|
<?= $this->a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-creation-popover', t('Add a new task')) ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
<?= $this->e($column['title']) ?>
|
||||||
<?php if (! empty($column['description'])): ?>
|
<?php if (! empty($column['description'])): ?>
|
||||||
<span class="column-tooltip" title="<?= $this->e($column['description']) ?>">
|
<span class="column-tooltip pull-right" title="<?= $this->markdown($column['description']) ?>">
|
||||||
<?= $this->e($column['title']) ?>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php else: ?>
|
|
||||||
<?= $this->e($column['title']) ?>
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if ($column['task_limit']): ?>
|
<?php if ($column['task_limit']): ?>
|
||||||
|
|||||||
@@ -41,15 +41,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<table class="table-stripped">
|
<table class="table-stripped">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="column-30"><?= t('Column') ?></th>
|
<th class="column-60"><?= t('Column') ?></th>
|
||||||
<th><?= t('Description') ?></th>
|
|
||||||
<th class="column-20"><?= t('Task limit') ?></th>
|
<th class="column-20"><?= t('Task limit') ?></th>
|
||||||
<th class="column-20"><?= t('Active tasks') ?></th>
|
<th class="column-20"><?= t('Active tasks') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($stats['columns'] as $column): ?>
|
<?php foreach ($stats['columns'] as $column): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $this->e($column['title']) ?></td>
|
<td><?= $this->e($column['title']) ?>
|
||||||
<td><?= $this->e($column['description']) ?></td>
|
<?php if (! empty($column['description'])): ?>
|
||||||
|
<span class="column-tooltip" title="<?= $this->markdown($column['description']) ?>">
|
||||||
|
<i class="fa fa-info-circle"></i>
|
||||||
|
</span>
|
||||||
|
<?php endif ?></td>
|
||||||
<td><?= $column['task_limit'] ?: '∞' ?></td>
|
<td><?= $column['task_limit'] ?: '∞' ?></td>
|
||||||
<td><?= $column['nb_active_tasks'] ?></td>
|
<td><?= $column['nb_active_tasks'] ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -63,3 +63,8 @@ div.ui-tooltip {
|
|||||||
.tooltip-large {
|
.tooltip-large {
|
||||||
width: 550px;
|
width: 550px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.column-tooltip {
|
||||||
|
color: #999;
|
||||||
|
font-size: 0.95em;
|
||||||
|
}
|
||||||
|
|||||||
@@ -188,6 +188,13 @@ var Kanboard = (function() {
|
|||||||
$("form").submit();
|
$("form").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Tooltip for column description
|
||||||
|
$(".column-tooltip").tooltip({
|
||||||
|
content: function(e) {
|
||||||
|
return '<div class="markdown">'+$(this).attr("title")+'</div>';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);
|
$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);
|
||||||
|
|
||||||
Kanboard.InitAfterAjax();
|
Kanboard.InitAfterAjax();
|
||||||
|
|||||||
@@ -50,13 +50,6 @@ Kanboard.Board = (function() {
|
|||||||
// Description popover
|
// Description popover
|
||||||
$(".task-description-popover").click(on_popover);
|
$(".task-description-popover").click(on_popover);
|
||||||
|
|
||||||
// Tooltip for column description
|
|
||||||
$(".column-tooltip").tooltip({
|
|
||||||
content: function(e) {
|
|
||||||
return $(this).attr("title");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Tooltips for tasks
|
// Tooltips for tasks
|
||||||
$(".task-board-tooltip").tooltip({
|
$(".task-board-tooltip").tooltip({
|
||||||
track: false,
|
track: false,
|
||||||
@@ -279,6 +272,7 @@ Kanboard.Board = (function() {
|
|||||||
filter_load_events();
|
filter_load_events();
|
||||||
keyboard_shortcuts();
|
keyboard_shortcuts();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user