Skip to content
Snippets Groups Projects
Commit f6c3facf authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Format List Cleanup (#720)

- Simplify format-list logic with LESS.
- Use CSS to insert commas between formats on record view.
parent 38b52938
Branches
Tags
No related merge requests found
Showing
with 35 additions and 21 deletions
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
text-decoration: none; text-decoration: none;
} }
.record .format::after { content: ", "; }
.result .record .format::after,
.record .format:last-child::after { content: ""; }
.marc-row-LEADER, .marc-row-LEADER,
.marc-row-006, .marc-row-006,
.marc-row-007, .marc-row-007,
......
...@@ -63,6 +63,11 @@ ...@@ -63,6 +63,11 @@
.checkbox { padding: 0; } .checkbox { padding: 0; }
.media-left { padding-right: 0; } .media-left { padding-right: 0; }
} }
.format {
&:extend(.label);
&:extend(.label-info);
}
} }
.result.embedded { .result.embedded {
......
...@@ -36,6 +36,10 @@ label.list-group-item { ...@@ -36,6 +36,10 @@ label.list-group-item {
} }
.list-group-item.title {font-weight: bold;} .list-group-item.title {font-weight: bold;}
.sidebar .facet a {text-decoration: none;} .sidebar .facet a {text-decoration: none;}
.sidebar .format {
&:extend(.label);
&:extend(.label-info);
}
.top-row .applied { .top-row .applied {
font-weight: bold; font-weight: bold;
&:hover { &:hover {
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
<?=str_replace('class="', 'class="label label-info ', $this->record($this->driver)->getFormatList())?> <?=$this->record($this->driver)->getFormatList() ?>
<? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?> <? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?>
<span class="status ajax-availability small"> <span class="status ajax-availability small">
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</tr> </tr>
<? endif; ?> <? endif; ?>
<? $formats = $this->driver->getFormats(); if (!empty($formats)): ?> <? if (count($this->driver->getFormats()) > 0): ?>
<tr> <tr>
<th><?=$this->transEsc('Format')?>: </th> <th><?=$this->transEsc('Format')?>: </th>
<td><?=$this->record($this->driver)->getFormatList()?></td> <td><?=$this->record($this->driver)->getFormatList()?></td>
......
<? foreach ($this->driver->getFormats() as $format): ?> <? foreach ($this->driver->getFormats() as $format): ?>
<span class="iconlabel <?=$this->record($this->driver)->getFormatClass($format)?>"><?=$this->transEsc($format)?></span> <span class="format <?=$this->record($this->driver)->getFormatClass($format) ?>"><?=$this->transEsc($format) ?></span>
<? endforeach; ?> <? endforeach; ?>
...@@ -158,7 +158,8 @@ ...@@ -158,7 +158,8 @@
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
<br/> <br/>
<?=str_replace('class="', 'class="label label-info ', $this->record($this->driver)->getFormatList())?>
<?=$this->record($this->driver)->getFormatList() ?>
<? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?> <? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?>
<span class="status ajax-availability hidden"><?=$this->transEsc('Loading')?>...</span> <span class="status ajax-availability hidden"><?=$this->transEsc('Loading')?>...</span>
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<? endif; ?> <? endif; ?>
<? endif; ?> <? endif; ?>
<?=str_replace('class="', 'class="label label-info ', $this->record($this->driver)->getFormatList())?> <?=$this->record($this->driver)->getFormatList() ?>
<? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?> <? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?>
<span class="status ajax-availability hidden"> <span class="status ajax-availability hidden">
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<? $i = 0; foreach ($this->transactions as $resource): ?> <? $i = 0; foreach ($this->transactions as $resource): ?>
<hr/> <hr/>
<? $ilsDetails = $resource->getExtraDetail('ils_details'); ?> <? $ilsDetails = $resource->getExtraDetail('ils_details'); ?>
<div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId())?>" class="row"> <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId())?>" class="row result">
<? if ($this->renewForm): ?> <? if ($this->renewForm): ?>
<? if (isset($ilsDetails['renewable']) && $ilsDetails['renewable'] && isset($ilsDetails['renew_details'])): ?> <? if (isset($ilsDetails['renewable']) && $ilsDetails['renewable'] && isset($ilsDetails['renew_details'])): ?>
<? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $ilsDetails['renew_details']); ?> <? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $ilsDetails['renew_details']); ?>
...@@ -100,8 +100,8 @@ ...@@ -100,8 +100,8 @@
<?=$this->transEsc('by')?>: <?=$this->transEsc('by')?>:
<a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/> <a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/>
<? endif; ?> <? endif; ?>
<? $formats = $resource->getFormats(); if (count($formats) > 0): ?> <? if (count($resource->getFormats()) > 0): ?>
<?=str_replace('class="', 'class="label label-info ', $this->record($resource)->getFormatList())?> <?=$this->record($resource)->getFormatList() ?>
<br/> <br/>
<? endif; ?> <? endif; ?>
<? if (!empty($ilsDetails['volume'])): ?> <? if (!empty($ilsDetails['volume'])): ?>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<hr/> <hr/>
<? $iteration++; ?> <? $iteration++; ?>
<? $ilsDetails = $resource->getExtraDetail('ils_details'); ?> <? $ilsDetails = $resource->getExtraDetail('ils_details'); ?>
<div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="row"> <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="row result">
<? if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?> <? if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?>
<? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?> <? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?>
<input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" /> <input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" />
...@@ -83,8 +83,8 @@ ...@@ -83,8 +83,8 @@
<a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/> <a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/>
<? endif; ?> <? endif; ?>
<? $formats = $resource->getFormats(); if (count($formats) > 0): ?> <? if (count($resource->getFormats()) > 0): ?>
<?=str_replace('class="', 'class="label label-info ', $this->record($resource)->getFormatList())?> <?=$this->record($resource)->getFormatList() ?>
<br/> <br/>
<? endif; ?> <? endif; ?>
<? if (isset($ilsDetails['volume']) && !empty($ilsDetails['volume'])): ?> <? if (isset($ilsDetails['volume']) && !empty($ilsDetails['volume'])): ?>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<hr/> <hr/>
<? $iteration++; ?> <? $iteration++; ?>
<? $ilsDetails = $resource->getExtraDetail('ils_details'); ?> <? $ilsDetails = $resource->getExtraDetail('ils_details'); ?>
<div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="row"> <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="row result">
<? if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?> <? if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?>
<? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?> <? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?>
<input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" /> <input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" />
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
<a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/> <a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/>
<? endif; ?> <? endif; ?>
<? $formats = $resource->getFormats(); if (count($formats) > 0): ?> <? if (count($resource->getFormats()) > 0): ?>
<?=str_replace('class="', 'class="label label-info ', $this->record($resource)->getFormatList())?> <?=$this->record($resource)->getFormatList() ?>
<br/> <br/>
<? endif; ?> <? endif; ?>
<? if (isset($ilsDetails['volume']) && !empty($ilsDetails['volume'])): ?> <? if (isset($ilsDetails['volume']) && !empty($ilsDetails['volume'])): ?>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<hr/> <hr/>
<? $iteration++; ?> <? $iteration++; ?>
<? $ilsDetails = $resource->getExtraDetail('ils_details'); ?> <? $ilsDetails = $resource->getExtraDetail('ils_details'); ?>
<div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="row"> <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="row result">
<? if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?> <? if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?>
<? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?> <? $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?>
<input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" /> <input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" />
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
<a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/> <a href="<?=$this->record($resource)->getLink('author', $listAuthors[0])?>"><?=$this->escapeHtml($listAuthors[0])?></a><? if (count($listAuthors) > 1): ?>, <?=$this->transEsc('more_authors_abbrev')?><? endif; ?><br/>
<? endif; ?> <? endif; ?>
<? $formats = $resource->getFormats(); if (count($formats) > 0): ?> <? if (count($resource->getFormats()) > 0): ?>
<?=str_replace('class="', 'class="label label-info ', $this->record($resource)->getFormatList())?> <?=$this->record($resource)->getFormatList() ?>
<br/> <br/>
<? endif; ?> <? endif; ?>
<? if (isset($ilsDetails['volume']) && !empty($ilsDetails['volume'])): ?> <? if (isset($ilsDetails['volume']) && !empty($ilsDetails['volume'])): ?>
......
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