public function articles(HTTPRequest $request)
    {
        if (!Security::getCurrentUser()) {
            return $this->makeJsonReponse(401, [
                'message' => 'Unauthorized.'
            ])->setStatusDescription('Unauthorized.');
        }

        $pages = HailPage::get();
        $articles = [['text' => 'Select an article']];
        foreach ($pages as $page) {
            $list = $page->getFullHailList();
            foreach ($list as $item) {
                $link = $item->getLinkForPage($page);
                if ($item->getType() === 'article') {
                    $link = Director::absoluteURL($link);
                }
                $create_at = isset($item->Date) ? $item->Date : $item->DueDate;
                $date = new \DateTime($create_at);
                $name = $date->format('d/m/Y') . ' - ' . $page->Title . ' - ' . $item->Title;
                $articles[] = [
                    'text' => $name,
                    'value' => $link
                ];
            }
        }

        return $this->makeJsonReponse(200, $articles);
    }