Skip to content

Commit

Permalink
Bugfix html5
Browse files Browse the repository at this point in the history
  • Loading branch information
s-nakajima committed May 19, 2015
1 parent a5cb61f commit 81a0955
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
5 changes: 0 additions & 5 deletions View/BbsArticles/view.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@
<?php echo $this->element('BbsArticles/view_bbs_article', array(
'bbsArticle' => $rootBbsArticle,
'parentBbsArticle' => null,
'headTag' => 'h1'
)); ?>
<?php else : ?>
<?php echo $this->element('BbsArticles/view_bbs_article', array(
'bbsArticle' => $currentBbsArticle,
'parentBbsArticle' => null,
'headTag' => 'h1'
)); ?>
<?php endif; ?>
</div>
Expand All @@ -45,7 +43,6 @@
<?php echo $this->element('BbsArticles/view_bbs_article', array(
'bbsArticle' => $currentBbsArticle,
'parentBbsArticle' => $parentBbsArticle,
'headTag' => 'h2'
)); ?>
</div>
</div>
Expand All @@ -62,14 +59,12 @@
<?php echo $this->element('BbsArticles/view_bbs_article', array(
'bbsArticle' => $childBbsArticle,
'parentBbsArticle' => $bbsArticleChildren[$childBbsArticle['bbsArticleTree']['parentId']],
'headTag' => 'h3'
)); ?>

<?php else : ?>
<?php echo $this->element('BbsArticles/view_bbs_article', array(
'bbsArticle' => $childBbsArticle,
'parentBbsArticle' => $currentBbsArticle,
'headTag' => 'h2'
)); ?>

<?php endif; ?>
Expand Down
13 changes: 10 additions & 3 deletions View/Elements/BbsArticles/view_bbs_article.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/

if ($currentBbsArticle['bbsArticle']['key'] === $bbsArticle['bbsArticle']['key']) {
$headTag = 'h1';
} elseif ((int)$bbsArticle['bbsArticleTree']['rootId'] === 0) {
$headTag = 'h2';
} else {
$headTag = 'h3';
}

?>

<div class="panel-heading">
Expand Down Expand Up @@ -52,9 +61,7 @@
</small>

<div class="pull-right">
<small>
<?php echo $this->Date->dateFormat($bbsArticle['bbsArticle']['created']); ?>
</small>
<?php echo $this->Date->dateFormat($bbsArticle['bbsArticle']['created']); ?>
</div>

<?php if ($headTag === 'h1') : ?>
Expand Down

0 comments on commit 81a0955

Please sign in to comment.