summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-16 18:55:57 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-16 18:55:57 +0100
commit00a38a4be58467654794db404bb7ee69382072fe (patch)
treee90043ea636f0c4ca890d0befeefa9849193fbfc /templates
parentf0d0bd6451fc0fc08c919a2208a9ac6bee3657a1 (diff)
downloadblogs-00a38a4be58467654794db404bb7ee69382072fe.tar.gz
blogs-00a38a4be58467654794db404bb7ee69382072fe.tar.bz2
blogs-00a38a4be58467654794db404bb7ee69382072fe.zip
Extend recent_blogs to allow Read More to create a pop-up of the full post
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/blog_list_post.tpl16
-rwxr-xr-xtemplates/center_list_blog_posts.tpl33
2 files changed, 42 insertions, 7 deletions
diff --git a/templates/blog_list_post.tpl b/templates/blog_list_post.tpl
index fd7c337..9c05bab 100755
--- a/templates/blog_list_post.tpl
+++ b/templates/blog_list_post.tpl
@@ -26,6 +26,13 @@
{/if}
<div class="header">
+ {if $showBlogTitle eq 'y' && $aPost.blogs}
+ <div class="blog-title">
+ {foreach from=$aPost.blogs item=memberBlog key=blogContentId name=blogTitleLoop}
+ {if !$smarty.foreach.blogTitleLoop.first} &bull; {/if}<a href="{$memberBlog.blog_url}">{$memberBlog.title|escape}</a>
+ {/foreach}
+ </div>
+ {/if}
<h2>
{if $aPost.title}
{$aPost.title|escape:html}
@@ -44,7 +51,7 @@
{/if}<br/>
{$aPost.publish_date|default:$aPost.created|bit_long_date}<br />
- {if count($aPost.blogs) > 0}
+ {if $showBlogTitle ne 'y' && count($aPost.blogs) > 0}
{tr}Posted to{/tr}&nbsp;
{foreach from=$aPost.blogs item=memberBlog key=blogContentId name=memberBlogLoop}
<a href="{$memberBlog.blog_url}">{$memberBlog.title}</a>{if $smarty.foreach.memberBlogLoop.total > 1 && !$smarty.foreach.memberBlogLoop.last }, {/if}
@@ -71,7 +78,6 @@
{if $showDescriptionsOnly}
{$aPost.summary|default:$aPost.parsed_description}
- {if $ajax_more}<div id="post_more_{$aPost.post_id}"></div>{/if}
{else}
{$aPost.parsed_data}
{/if}
@@ -90,11 +96,7 @@
{if $showDescriptionsOnly && $aPost.has_more}
{if $spacer}&nbsp; &bull; &nbsp;{/if}
{assign var=spacer value=true}
- {if $ajax_more}
- <a href="javascript:void(0);" onclick="BitAjax.updater( 'post_more_{$aPost.post_id}', '{$smarty.const.BLOGS_PKG_URL}view_post.php', 'blog_id={$aPost.blog_id|default:0}&post_id={$aPost.post_id}&format={if $aPost.summary}data{else}more{/if}&output=ajax' )">{tr}Read More{/tr}</a>
- {else}
- <a class="more" href="{$aPost.display_url}">{tr}Read More&hellip;{/tr}</a>
- {/if}
+ <a class="more" role="button" data-toggle="modal" data-target="#blogPostModal" data-post-title="{$aPost.title|escape}" data-post-url="{$aPost.display_url}" data-fetch-url="{$smarty.const.BLOGS_PKG_URL}view_post.php?post_id={$aPost.post_id}&amp;output=ajax&amp;format=data">{tr}Read More&hellip;{/tr}</a>
{/if}
{if $aPost.trackbacks_from_count}({tr}referenced by{/tr}: {$aPost.trackbacks_from_count} {tr}posts{/tr} / {tr}references{/tr}: {$aPost.trackbacks_to_count} {tr}posts{/tr}){/if}
diff --git a/templates/center_list_blog_posts.tpl b/templates/center_list_blog_posts.tpl
index 5c380e8..b456951 100755
--- a/templates/center_list_blog_posts.tpl
+++ b/templates/center_list_blog_posts.tpl
@@ -35,4 +35,37 @@
{*minifind sort_mode=$sort_mode*}
</div>
+
+<div class="modal fade" id="blogPostModal" tabindex="-1" role="dialog" aria-labelledby="blogPostModalLabel">
+ <div class="modal-dialog modal-lg" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
+ <h4 class="modal-title" id="blogPostModalLabel"></h4>
+ </div>
+ <div class="modal-body">
+ <p class="text-center"><i class="fa fa-spinner fa-spin fa-2x"></i></p>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">{tr}Close{/tr}</button>
+ <a href="#" class="btn btn-primary">{tr}View full post{/tr}</a>
+ </div>
+ </div>
+ </div>
+</div>
+<script>
+$('#blogPostModal').on('show.bs.modal', function(e) {
+ var btn = $(e.relatedTarget);
+ var modal = $(this);
+ modal.find('.modal-title').text(btn.data('postTitle') || '');
+ modal.find('.modal-footer a.btn-primary').attr('href', btn.data('postUrl') || '#');
+ var body = modal.find('.modal-body');
+ body.html('<p class="text-center"><i class="fa fa-spinner fa-spin fa-2x"></i></p>');
+ $.get(btn.data('fetchUrl'), function(html) {
+ body.html(html);
+ }).fail(function() {
+ body.html('<p class="text-danger">{tr}Could not load post.{/tr}</p>');
+ });
+});
+</script>
{/if}