Replace calendar component by vanilla javascript
This commit is contained in:
@@ -16,6 +16,23 @@ use Kanboard\Formatter\TaskCalendarFormatter;
|
||||
*/
|
||||
class CalendarHelper extends Base
|
||||
{
|
||||
/**
|
||||
* Render calendar component
|
||||
*
|
||||
* @param string $checkUrl
|
||||
* @param string $saveUrl
|
||||
* @return string
|
||||
*/
|
||||
public function render($checkUrl, $saveUrl)
|
||||
{
|
||||
$params = array(
|
||||
'checkUrl' => $checkUrl,
|
||||
'saveUrl' => $saveUrl,
|
||||
);
|
||||
|
||||
return '<div class="js-calendar" data-params=\''.json_encode($params, JSON_HEX_APOS).'\'></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get formatted calendar task due events
|
||||
*
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<section id="main">
|
||||
<?= $this->projectHeader->render($project, 'CalendarController', 'show') ?>
|
||||
<calendar save-url="<?= $this->url->href('CalendarController', 'save', array('project_id' => $project['id'])) ?>"
|
||||
check-url="<?= $this->url->href('CalendarController', 'project', array('project_id' => $project['id'])) ?>">
|
||||
</calendar>
|
||||
|
||||
<?= $this->calendar->render(
|
||||
$this->url->href('CalendarController', 'project', array('project_id' => $project['id'])),
|
||||
$this->url->href('CalendarController', 'save', array('project_id' => $project['id']))
|
||||
) ?>
|
||||
|
||||
</section>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
<calendar check-url="<?= $this->url->href('CalendarController', 'user', array('user_id' => $user['id'])) ?>"
|
||||
save-url="<?= $this->url->href('CalendarController', 'save') ?>"></calendar>
|
||||
<?= $this->calendar->render(
|
||||
$this->url->href('CalendarController', 'user', array('user_id' => $user['id'])),
|
||||
$this->url->href('CalendarController', 'save')
|
||||
) ?>
|
||||
|
||||
Reference in New Issue
Block a user