Skip to content

Commit

Permalink
v1.0.3.9 done
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercreagh committed Jan 29, 2023
1 parent a7fc0b2 commit 07c0482
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 123 deletions.
8 changes: 8 additions & 0 deletions src/com_xbbooks/site/models/bookreviews.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ protected function getListQuery() {
public function getItems() {
$items = parent::getItems();
$tagsHelper = new TagsHelper;

$app = Factory::getApplication();
$revs = array();
for ($i = 0; $i < count($items); $i++) {
$revs[$i] = $items[$i]->id;
}
$app->setUserState('bookreviews.sortorder', $revs);

foreach ($items as $i=>$item) {
$item->tags = $tagsHelper->getItemTags('com_xbbooks.review' , $item->id);
}
Expand Down
46 changes: 19 additions & 27 deletions src/com_xbbooks/site/views/book/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,40 +127,23 @@
<?php endif; ?>
</div>
<div class="row-fluid">
<div class="span5">
<?php if ((!$item->publisher=='') || (!$hide_empty)) : ?>
<?php if ((!$item->publisher=='') || (!$hide_empty)) : ?>
<div class="span5">
<div class="pull-left xbnit xbmr10"><?php echo Text::_('XBCULTURE_PUBLISHER').': '; ?></div>
<div class="pull-left" style="margin:2px 0 0 0;">
<?php echo (!$item->publisher=='') ? $item->publisher : '<span class="xbnit">'.Text::_('XBBOOKS_UNKNOWN').'</span>'; ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
<?php if ((!$item->orig_lang=='') || (!$hide_empty)) : ?>
</div>
<div class="span1"></div>
<?php endif; ?>
<?php if ((!$item->orig_lang=='') || (!$hide_empty)) : ?>
<div class= "span6">
<div class="pull-left xbnit xbmr10"><?php echo Text::_('XBBOOKS_ORIG_LANG').': '; ?></div>
<div class="pull-left" style="margin:2px 0 0 0;">
<?php echo (!$item->orig_lang=='') ? $item->orig_lang : '<span class="xbnit">'.Text::_('XBBOOKS_UNKNOWN').'</span>'; ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
</div>
<div class="span1"></div>
<div class= "span6">
<?php if ((!$item->edition=='') || (!$hide_empty)) : ?>
<div class="pull-left xbnit xbmr10"><?php echo Text::_('XBCULTURE_EDITION').': '; ?></div>
<div class="pull-left" style="margin:2px 0 0 0;">
<?php echo (!$item->edition=='') ? $item->edition : '<span class="xbnit">'.Text::_('XBBOOKS_UNKNOWN').'</span>'; ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
<?php if ((!$item->format=='') || (!$hide_empty)) : ?>
<div class="pull-left xbnit xbmr10"><?php echo Text::_('XBCULTURE_FORMAT').': '; ?></div>
<div class="pull-left" style="margin:2px 0 0 0;">
<?php echo (!$item->format=='') ? $item->format : '<span class="xbnit">'.Text::_('XBBOOKS_UNKNOWN').'</span>'; ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
<!-- insert reading notes here -->
</div>
</div>
<?php endif; ?>
</div>
<?php if ((($item->mencnt + $item->othcnt + $item->ccnt + $item->gcnt) > 0) || (!$hide_empty)) : ?>
<hr />
Expand Down Expand Up @@ -261,6 +244,11 @@
<?php else:
echo Text::_('unknown');
endif; ?>
<?php if ((!$item->format=='') || (!$hide_empty)) : ?>
<p><span class="bnit xbmr10"><?php echo Text::_('XBCULTURE_FORMAT').': '; ?></span>&nbsp;
<?php echo (!$item->format=='') ? $item->format : '<span class="xbnit">'.Text::_('XBBOOKS_UNKNOWN').'</span>'; ?>
</p>
<?php endif; ?>
</div>
<div class="span4">
<?php if (($item->last_read) && ($item->last_read <> $item->first_read)) : ?>
Expand All @@ -269,6 +257,11 @@
<?php $datefmt = xbCultureHelper::getDateFmt($item->last_read, 'D jS M Y');
echo HtmlHelper::date($item->last_read , $datefmt) ; ?>
<?php endif; ?>
<?php if ((!$item->edition=='') || (!$hide_empty)) : ?>
<p><span class="xbnit xbmr10"><?php echo Text::_('XBCULTURE_EDITION').': '; ?></span>
<?php echo (!$item->edition=='') ? $item->edition : '<span class="xbnit">'.Text::_('XBBOOKS_UNKNOWN').'</span>'; ?>
</p>
<?php endif; ?>
</div>
<div class="span4">
<span class="xbnit xbgrey"><?php echo Text::_('XBCULTURE_CATALOGUED').': '.HtmlHelper::date($item->created ,'jS M Y'); ?>
Expand Down Expand Up @@ -326,7 +319,6 @@
} else { //summary doesn't get shown here if there is a review - OK????
echo $rev->review;
} ?>
<?php //TODO extlinks?>
<div class="row-fluid">
<?php if($this->show_rcat) : ?>
<div class="span4">
Expand Down
28 changes: 16 additions & 12 deletions src/com_xbbooks/site/views/booklist/tmpl/compact.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*******
* @package xbBooks
* @filesource site/views/booklist/tmpl/compact.php
* @version 1.0.3.6 23rd January 2023
* @version 1.0.3.9 29th January 2023
* @author Roger C-O
* @copyright Copyright (c) Roger Creagh-Osborne, 2021
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -33,8 +33,7 @@

?>
<style type="text/css" media="screen">
.xbpvmodal .modal-body {max-height: calc(100vh - 190px); }
.xbpvmodal .modal-body iframe { max-height:calc(100vh - 270px);}
.xbpvmodal .modal-content {padding:15px;max-height:calc(100vh - 190px); overflow:scroll; }
</style>
<div class="xbculture ">
<?php if(($this->header['showheading']) || ($this->header['title'] != '') || ($this->header['text'] != '')) {
Expand Down Expand Up @@ -187,36 +186,41 @@
<script>
jQuery(document).ready(function(){
//for preview modals
// Load view vith AJAX
jQuery('#ajax-ppvmodal').on('show', function () {
// Load view vith AJAX
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalppv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbpeople&view=person&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-ppvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-bpvmodal').on('show', function () {
// Load view vith AJAX
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalbpv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=book&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-bpvmodal').on('hidden', function () {
jQuery('#ajax-ppvmodal,#ajax-bpvmodal').on('hidden', function () {
document.location.reload(true);
})
});
</script>
<!-- preview modal windows -->
<div class="modal fade xbpvmodal" id="ajax-ppvmodal" style="max-width:800px">
<div class="modal-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
style="opacity:unset;line-height:unset;border:none;">&times;</button>
<h4 class="modal-title" style="margin:5px;">Preview Person</h4>
</div>
<div class="modal-content">
<!-- Ajax content will be loaded here -->
</div>
</div>
</div>
<div class="modal fade xbpvmodal" id="ajax-bpvmodal" style="max-width:1000px">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
style="opacity:unset;line-height:unset;border:none;">&times;</button>
<h4 class="modal-title" style="margin:5px;">Preview Book</h4>
</div>
<div class="modal-dialog">
<div class="modal-content">
<!-- Ajax content will be loaded here -->
</div>
</div>
</div>


17 changes: 3 additions & 14 deletions src/com_xbbooks/site/views/booklist/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,28 +314,17 @@
<script>
jQuery(document).ready(function(){
//for preview modals
// Load view vith AJAX
jQuery('#ajax-ppvmodal').on('show', function () {
// Load view vith AJAX
//jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalppv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbpeople&view=person&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-ppvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-bpvmodal').on('show', function () {
// Load view vith AJAX
//jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalbpv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=book&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-bpvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-rpvmodal').on('show', function () {
// Load view vith AJAX
//jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalrpv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=review&layout=default&tmpl=component&id='+window.pvid);
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=bookreview&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-rpvmodal').on('hidden', function () {
jQuery('#ajax-ppvmodal,#ajax-bpvmodal,#ajax-rpvmodal').on('hidden', function () {
document.location.reload(true);
})
});
Expand Down
62 changes: 27 additions & 35 deletions src/com_xbbooks/site/views/booklist/tmpl/detailslist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*******
* @package xbBooks
* @filesource site/views/booklist/tmpl/detailslist.php
* @version 1.0.3.6 23rd January 2023
* @version 1.0.3.9 29th January 2023
* @author Roger C-O
* @copyright Copyright (c) Roger Creagh-Osborne, 2021
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -46,8 +46,7 @@

?>
<style type="text/css" media="screen">
.xbpvmodal .modal-body {max-height: calc(100vh - 190px); }
.xbpvmodal .modal-body iframe { max-height:calc(100vh - 270px);}
.xbpvmodal .modal-content {padding:15px;max-height:calc(100vh - 190px); overflow:scroll; }
</style>
<div class="xbculture ">
<?php if(($this->header['showheading']) || ($this->header['title'] != '') || ($this->header['text'] != '')) {
Expand Down Expand Up @@ -307,77 +306,70 @@
<script>
jQuery(document).ready(function(){
//for preview modals
// Load view vith AJAX
jQuery('#ajax-ppvmodal').on('show', function () {
// Load view vith AJAX
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalppv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbpeople&view=person&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-ppvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-gpvmodal').on('show', function () {
// Load view vith AJAX
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalgpv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbpeople&view=group&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-gpvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-cpvmodal').on('show', function () {
// Load view vith AJAX
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalcpv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbpeople&view=character&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-cpvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-bpvmodal').on('show', function () {
// Load view vith AJAX
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalbpv&tmpl=component');
})
jQuery('#ajax-bpvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-rpvmodal').on('show', function () {
// Load view vith AJAX
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalrpv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=book&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-rpvmodal').on('hidden', function () {
jQuery('#ajax-bpvmodal,#ajax-ppvmodal,#ajax-gpvmodal,#ajax-cpvmodal').on('hidden', function () {
document.location.reload(true);
})
});
</script>
<!-- preview modal windows -->
<div class="modal fade xbpvmodal" id="ajax-ppvmodal" style="max-width:800px">
<div class="modal-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
style="opacity:unset;line-height:unset;border:none;">&times;</button>
<h4 class="modal-title" style="margin:5px;">Preview Person</h4>
</div>
<div class="modal-content">
<!-- Ajax content will be loaded here -->
</div>
</div>
</div>
<div class="modal fade xbpvmodal" id="ajax-gpvmodal" style="max-width:800px">
<div class="modal-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
style="opacity:unset;line-height:unset;border:none;">&times;</button>
<h4 class="modal-title" style="margin:5px;">Preview Group</h4>
</div>
<div class="modal-content">
<!-- Ajax content will be loaded here -->
</div>
</div>
</div>
<div class="modal fade xbpvmodal" id="ajax-cpvmodal" style="max-width:800px">
<div class="modal-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
style="opacity:unset;line-height:unset;border:none;">&times;</button>
<h4 class="modal-title" style="margin:5px;">Preview Character</h4>
</div>
<div class="modal-content">
<!-- Ajax content will be loaded here -->
</div>
</div>
</div>
<div class="modal fade xbpvmodal" id="ajax-bpvmodal" style="max-width:1000px">
<div class="modal-dialog">
<div class="modal-content">
<!-- Ajax content will be loaded here -->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"
style="opacity:unset;line-height:unset;border:none;">&times;</button>
<h4 class="modal-title" style="margin:5px;">Preview Book</h4>
</div>
</div>
</div>
<div class="modal fade xbpvmodal" id="ajax-rpvmodal" style="max-width:1000px">
<div class="modal-dialog">
<div class="modal-content">
<!-- Ajax content will be loaded here -->
</div>
</div>
</div>

26 changes: 7 additions & 19 deletions src/com_xbbooks/site/views/bookreview/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,17 @@
</span>
<?php endif; ?>
<br /><span class="xb09" style="color:darkgray;">
reviewed on <?php echo HtmlHelper::date($item->rev_date ,'d M Y');?>
<span class="xbnit"><?php echo Text::_('reviewed on'); ?></span> <?php echo HtmlHelper::date($item->rev_date ,'d M Y');?>
<span class="xbnit"><?php echo Text::_('reviewed by'); ?></span><?php echo $item->reviewer; ?>
</span>
</div>
</div>
<h3><?php echo $item->title; ?></h3>
<h4><span class="xbnit"><?php echo Text::_('XBBOOKS_REVIEWOF'); ?></span>"
<a href="<?php echo XbbooksHelperRoute::getBookLink($item->book_id); ?>"
<?php if (!empty($item->edauths)) : ?>
class="xbpop xbcultpop xbhover" data-trigger="hover" tabindex="<?php echo $item->id; ?>"
title data-original-title="Author/Editor" data-content="<?php echo strip_tags($item->edauths); ?>"
<?php endif; ?>
><?php echo $item->book_title; ?></a>"&nbsp;
<a href="<?php echo XbbooksHelperRoute::getBookLink($item->book_id); ?>"><?php echo $item->book_title; ?></a>"&nbsp;
<a href="" class="xbpv" data-toggle="modal" data-target="#ajax-bpvmodal"
onclick="window.pvid=<?php echo $item->book_id; ?>;"><i class="far fa-eye"></i></a>&nbsp;
<span class="xbnit"><?php echo Text::_('XBCULTURE_BY'); ?></span>
<?php echo $item->reviewer; ?>
<?php echo $item->edauths; ?>
</h4>
<div class="clearfix"></div>
<?php if (trim($item->summary)!='') {
Expand Down Expand Up @@ -152,7 +147,7 @@ class="xbpop xbcultpop xbhover" data-trigger="hover" tabindex="<?php echo $item-
<?php endif; ?>
</div>
<a href="<?php echo $brlink.$rev->id; ?>"><b><?php echo $rev->title; ?></b></a>
by <?php echo $rev->created_by_alias.', '.HtmlHelper::date($rev->created ,'d M Y'); ?>
by <?php echo $rev->reviewer.', '.HtmlHelper::date($rev->created ,'d M Y'); ?>
<br />
<?php endif; ?>
<?php endforeach; ?>
Expand Down Expand Up @@ -195,21 +190,14 @@ class="xbpop xbcultpop xbhover" data-trigger="hover" tabindex="<?php echo $item-
<p><?php echo XbcultureHelper::credit('xbBooks');?></p>
<script>
jQuery(document).ready(function(){
//for preview modals
//for preview modals Load view vith AJAX
jQuery('#ajax-ppvmodal').on('show', function () {
// Load view vith AJAX
//jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalppv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbpeople&view=person&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-ppvmodal').on('hidden', function () {
document.location.reload(true);
})
jQuery('#ajax-bpvmodal').on('show', function () {
// Load view vith AJAX
//jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=booklist&layout=modalbpv&tmpl=component');
jQuery(this).find('.modal-content').load('/index.php?option=com_xbbooks&view=book&layout=default&tmpl=component&id='+window.pvid);
})
jQuery('#ajax-bpvmodal').on('hidden', function () {
jQuery('#ajax-ppvmodal,#ajax-bpvmodal').on('hidden', function () {
document.location.reload(true);
})
});
Expand Down
Loading

0 comments on commit 07c0482

Please sign in to comment.