Skip to content
Snippets Groups Projects
Commit 37793d26 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #64573 bootstrap on article view

parent 7399476c
Branches
Tags
3 merge requests!3297WIP: Master,!3037Master,!2988Dev#64573 templates pour l interface publique libraire bootstrap
Pipeline #5829 failed with stage
in 26 minutes and 32 seconds
<a name="Top"></a>
<?php
echo $this->partial('cms/article_partial.phtml', ['article' => $this->article]);
?>
<table style="width:100%">
<tr>
<td style="text-align:left"><a href="javascript:history.back()"><?php echo $this->_('Retour') ?></a></td>
<td style="text-align:right"><a href="#Top"><?php echo $this->_('Haut') ?></a></td>
</tr>
</table>
echo $this->renderArticle($this->article);
<?php
/**
* Copyright (c) 2012-2018, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_RenderArticle extends ZendAfi_View_Helper_BaseHelper {
public function renderArticle($article) {
$html = [$this->_tag('a',
'',
['name' => 'Top']),
$this->view->partial('cms/article_partial.phtml', ['article' => $article]),
$this->_tag('table',
$this->_tag('tr',
$this->_tag('td',
$this->view->tagAnchor('javascript:history.back()',
$this->_('Retour')),
['style' => 'text-align: left'])
. $this->_tag('td',
$this->view->tagAnchor('#Top',
$this->_('Haut')),
['style' => 'text-align: left'])))];
return implode($html);
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2018, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Intonation_View_RenderArticle extends ZendAfi_View_Helper_BaseHelper {
public function renderArticle($article) {
$body_content = [$this->view->tagEditArticle($article),
$this->_tag('h2',
$article->getTitre(),
['class' => 'card-title']),
$this->_tag('p',
$article->getAuthorName(),
['title' => $this->_('Auteur de l\'article "%s".', $article->getAuthorName()),
'class' => 'card-subtitle text-muted']),
$this->_badges($article),
$this->_tag('p',
$this->view->article_ReplaceWidgets($article->getFullContent()),
['class' => 'card-text']),
];
$body = $this->_tag('div',
implode($body_content),
['class' => 'card-body']);
return $this->_tag('div',
$body,
['class' => 'card card_article']);
}
protected function _badges($article) {
return $this->view->renderArticleBadges($article);
}
}
\ No newline at end of file
......@@ -45,35 +45,6 @@ class Intonation_View_RenderArticles extends ZendAfi_View_Helper_BaseHelper {
protected function _htmlForArticle($article) {
$body_content = [$this->view->tagEditArticle($article),
$this->_tag('h2',
$article->getTitre(),
['class' => 'card-title']),
$this->_tag('p',
$article->getAuthorName(),
['title' => $this->_('Auteur de l\'article "%s".', $article->getAuthorName()),
'class' => 'card-subtitle text-muted']),
$this->_badges($article),
$this->_tag('p',
$this->view->article_ReplaceWidgets($article->getFullContent()),
['class' => 'card-text']),
];
$body = $this->_tag('div',
implode($body_content),
['class' => 'card-body']);
return $this->_tag('div',
$body,
['class' => 'card card_article']);
}
protected function _badges($article) {
return $this->view->renderArticleBadges($article);
return $this->view->renderArticle($article);
}
}
\ No newline at end of file
......@@ -1695,4 +1695,20 @@ class TemplatesCmsListActionTest extends TemplatesIntonationTestCase {
$this->dispatch('/opac/cms/list/title/language/articles/7-6/id_profil/72', true);
$this->assertXPathContentContains('//main//div', 'Parlez-vous français ?');
}
}
class TemplatesCmsArticleViewTest extends TemplatesIntonationTestCase {
/** @test */
public function dispatchShouldRenderParlerVousFrançais() {
$this->fixture('Class_Article',
['id' => 7,
'titre' => 'Parlez-vous français ?',
'contenu' => '<p>Une b...</p>']);
$this->dispatch('/opac/cms/articleview/id/7/id_profil/72', true);
$this->assertXPathContentContains('//main//div', 'Parlez-vous français ?');
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment