From 7ef32c3e39021de2d0a5df150d65910b5376a48e Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Wed, 2 Dec 2015 14:10:54 -0500 Subject: [PATCH] Collection view ajax tabs fixed. Some style adjustments too. --- .../templates/collection/view.phtml | 56 ++++++++++--------- themes/bootstrap3/templates/record/view.phtml | 38 ++++++------- 2 files changed, 49 insertions(+), 45 deletions(-) diff --git a/themes/bootstrap3/templates/collection/view.phtml b/themes/bootstrap3/templates/collection/view.phtml index 8f9e9047502..eb032151297 100644 --- a/themes/bootstrap3/templates/collection/view.phtml +++ b/themes/bootstrap3/templates/collection/view.phtml @@ -57,34 +57,38 @@ <? if (count($this->tabs) > 0): ?> <a name="tabnav"></a> - <ul class="recordTabs nav nav-tabs"> - <? foreach ($this->tabs as $tab => $obj): ?> - <? // add current tab to breadcrumbs if applicable: - $desc = $obj->getDescription(); - $tab_classes = array(); - if (0 === strcasecmp($this->activeTab, $tab)) { - $tab_classes[] = 'active'; - $this->layout()->breadcrumbs .= ' <li class="active">' . $this->transEsc($desc) . '</li>'; - $activeTabObj = $obj; - } - if (!$obj->isVisible()) { $tab_classes[] = 'hidden'; } - if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; } - ?> - <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>> - <a id="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"><?=$this->transEsc($desc)?></a> - </li> - <? endforeach; ?> - </ul> - <? endif; ?> - + <div class="record-tabs"> + <ul class="nav nav-tabs"> + <? foreach ($this->tabs as $tab => $obj): ?> + <? // add current tab to breadcrumbs if applicable: + $desc = $obj->getDescription(); + $tab_classes = array(); + if (0 === strcasecmp($this->activeTab, $tab)) { + if (!$this->ajaxTabs || !$obj->supportsAjax()) { + $tab_classes[] = 'active'; + } + $tab_classes[] = 'initiallyActive'; + $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>'; + $activeTabObj = $obj; + } + if (!$obj->isVisible()) { $tab_classes[] = 'hidden'; } + if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; } + ?> + <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>> + <a class="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"><?=$this->transEsc($desc)?></a> + </li> + <? endforeach; ?> + </ul> - <div class="tab-content record-tabs collectionDetails<?=$tree ? 'Tree' : ''?>"> - <? if (!$this->ajaxTabs || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?> - <div class="tab-pane active <?=$this->activeTab ?>-tab"> - <?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?> + <div class="tab-content collectionDetails<?=$tree ? 'Tree' : ''?>"> + <? if (!$this->ajaxTabs || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?> + <div class="tab-pane active <?=$this->activeTab ?>-tab"> + <?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?> + </div> + <? endif; ?> </div> - <? endif ?> - </div> + </div> + <? endif; ?> <?=$this->driver->supportsCoinsOpenURL()?'<span class="Z3988" title="'.$this->escapeHtmlAttr($this->driver->getCoinsOpenURL()).'"></span>':''?> </div> diff --git a/themes/bootstrap3/templates/record/view.phtml b/themes/bootstrap3/templates/record/view.phtml index 934cfb6fb68..8a5c087c174 100644 --- a/themes/bootstrap3/templates/record/view.phtml +++ b/themes/bootstrap3/templates/record/view.phtml @@ -53,28 +53,28 @@ <a name="tabnav"></a> <div class="record-tabs"> <ul class="nav nav-tabs"> - <? foreach ($this->tabs as $tab => $obj): ?> - <? // add current tab to breadcrumbs if applicable: - $desc = $obj->getDescription(); - $tab_classes = array(); - if (0 === strcasecmp($this->activeTab, $tab)) { - if (!$this->ajaxTabs || !$obj->supportsAjax()) { - $tab_classes[] = 'active'; + <? foreach ($this->tabs as $tab => $obj): ?> + <? // add current tab to breadcrumbs if applicable: + $desc = $obj->getDescription(); + $tab_classes = array(); + if (0 === strcasecmp($this->activeTab, $tab)) { + if (!$this->ajaxTabs || !$obj->supportsAjax()) { + $tab_classes[] = 'active'; + } + $tab_classes[] = 'initiallyActive'; + $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>'; + $activeTabObj = $obj; } - $tab_classes[] = 'initiallyActive'; - $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>'; - $activeTabObj = $obj; - } - if (!$obj->isVisible()) { $tab_classes[] = 'hidden'; } - if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; } - ?> - <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>> - <a class="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"><?=$this->transEsc($desc)?></a> - </li> - <? endforeach; ?> + if (!$obj->isVisible()) { $tab_classes[] = 'hidden'; } + if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; } + ?> + <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>> + <a class="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"><?=$this->transEsc($desc)?></a> + </li> + <? endforeach; ?> </ul> - <div class="tab-content record-tabs"> + <div class="tab-content"> <? if (!$this->ajaxTabs || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?> <div class="tab-pane active <?=$this->activeTab ?>-tab"> <?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?> -- GitLab