Assignee change from the board is now a popover
This commit is contained in:
@@ -20,7 +20,7 @@ body {
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-family: HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
font-smoothing: antialiased;
|
font-smoothing: antialiased;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
@@ -883,3 +883,23 @@ tr td.task-orange,
|
|||||||
max-width: 700px;
|
max-width: 700px;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* modal box */
|
||||||
|
#popover-container {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
#popover-content {
|
||||||
|
position: fixed;
|
||||||
|
width: 70%;
|
||||||
|
margin: 0 0 0 -35%;
|
||||||
|
left: 50%;
|
||||||
|
top: 5%;
|
||||||
|
padding: 15px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,19 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Open assignee popover
|
||||||
|
$(".task-user a").click(function(e) {
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
var taskId = $(this).parent().parent().attr("data-task-id");
|
||||||
|
|
||||||
|
$.get("?controller=board&action=assign&task_id=" + taskId, function(data) {
|
||||||
|
popover_show(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Redirect to the task details page
|
// Redirect to the task details page
|
||||||
$("[data-task-id]").each(function() {
|
$("[data-task-id]").each(function() {
|
||||||
$(this).click(function() {
|
$(this).click(function() {
|
||||||
@@ -137,6 +150,20 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show popup
|
||||||
|
function popover_show(content)
|
||||||
|
{
|
||||||
|
$("body").append('<div id="popover-container"><div id="popover-content">' + content + '</div></div>');
|
||||||
|
|
||||||
|
$("#popover-container").click(function() {
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#popover-content").click(function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Initialization
|
// Initialization
|
||||||
$(function() {
|
$(function() {
|
||||||
board_load_events();
|
board_load_events();
|
||||||
|
|||||||
@@ -60,16 +60,30 @@ class Board extends Base
|
|||||||
if (! $project) $this->notfound();
|
if (! $project) $this->notfound();
|
||||||
$this->checkProjectPermissions($project['id']);
|
$this->checkProjectPermissions($project['id']);
|
||||||
|
|
||||||
$this->response->html($this->template->layout('board_assign', array(
|
if ($this->request->isAjax()) {
|
||||||
'errors' => array(),
|
|
||||||
'values' => $task,
|
$this->response->html($this->template->load('board_assign', array(
|
||||||
'users_list' => $this->project->getUsersList($project['id']),
|
'errors' => array(),
|
||||||
'projects' => $projects,
|
'values' => $task,
|
||||||
'current_project_id' => $project['id'],
|
'users_list' => $this->project->getUsersList($project['id']),
|
||||||
'current_project_name' => $project['name'],
|
'projects' => $projects,
|
||||||
'menu' => 'boards',
|
'current_project_id' => $project['id'],
|
||||||
'title' => t('Change assignee').' - '.$task['title'],
|
'current_project_name' => $project['name'],
|
||||||
)));
|
)));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$this->response->html($this->template->layout('board_assign', array(
|
||||||
|
'errors' => array(),
|
||||||
|
'values' => $task,
|
||||||
|
'users_list' => $this->project->getUsersList($project['id']),
|
||||||
|
'projects' => $projects,
|
||||||
|
'current_project_id' => $project['id'],
|
||||||
|
'current_project_name' => $project['name'],
|
||||||
|
'menu' => 'boards',
|
||||||
|
'title' => t('Change assignee').' - '.$task['title'],
|
||||||
|
)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -48,4 +48,9 @@ class Request
|
|||||||
{
|
{
|
||||||
return isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST';
|
return isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isAjax()
|
||||||
|
{
|
||||||
|
return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,4 +72,4 @@
|
|||||||
</td>
|
</td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user