1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Issue #4332 - Bootstrap 5 styling fixes on comments and news templates.

This commit is contained in:
Cameron 2021-02-23 08:59:03 -08:00
parent de097dded3
commit 2ca7ec4597
6 changed files with 99 additions and 12 deletions

View File

@ -259,7 +259,7 @@ class comment_shortcodes extends e_shortcode
$pid = ($this->var['action'] == 'reply') ? $this->var['pid'] : 0; $pid = ($this->var['action'] == 'reply') ? $this->var['pid'] : 0;
$class = "e-comment-submit "; $class = "e-comment-submit ";
$class .= (!empty($parm['class'])) ? $parm['class'] : 'button btn btn-primary e-comment-submit pull-right float-right'; $class .= (!empty($parm['class'])) ? $parm['class'] : 'button btn btn-primary e-comment-submit pull-right float-end float-right';
$options = array( $options = array(
'class' => $class, 'class' => $class,
'data-pid' => $pid, 'data-pid' => $pid,

View File

@ -0,0 +1,86 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
* $Source: /cvs_backup/e107_0.8/e107_themes/templates/comment_template.php,v $
* $Revision$
* $Date$
* $Author$
*/
if (!defined('e107_INIT')) { exit; }
// Shortcode wrappers.
$COMMENT_WRAPPER['item']['COMENT_TIMEDATE'] = '<small>{---}</small>';
$COMMENT_WRAPPER['item']['COMMENT_EDIT'] = '<span class="comment-edit">{---}</span>';
$COMMENT_WRAPPER['item']['COMENT_REPLY'] = '<span class="comment-reply">{---}</span>';
$COMMENT_WRAPPER['item']['COMMENT_AVATAR'] = '<div class="comment-avatar center">{---}</div>';
$COMMENT_WRAPPER['item']['COMMENT_MODERATE'] = '<span class="comment-moderate">{---}</span>';
$COMMENT_WRAPPER['form'] = $COMMENT_WRAPPER['item']; // use the above wrappers for the 'form' as well.
// Templates
$COMMENT_TEMPLATE['form'] = "
{SETIMAGE: w=90&h=90&crop=1}
<div class='comment-box comment-box-form d-flex clearfix'>
<div class='comment-box-left me-3' >
{COMMENT_AVATAR: shape=circle}
</div>
<div class='comment-box-right text-left' >
<div class='P10'>
{AUTHOR_INPUT}
{COMMENT_INPUT}
<div id='commentformbutton' class='mt-2'>
{COMMENT_BUTTON}
{COMMENT_SHARE}
</div>
</div>
</div>
</div>
<div class='clear_b'><!-- --></div>
<hr>";
$COMMENT_TEMPLATE['item'] = '
{SETIMAGE: w=90&h=90&crop=1}
<div class="comment-box-left col-md-2 mb-4">
{COMMENT_AVATAR: shape=circle}
</div>
<div class="comment-box-right col-md-10 mb-4">
<div class="row">
<div class="comment-box-username col-xs-6 col-sm-6 col-md-6">{USERNAME}</div>
<div class="comment-box-date col-xs-6 col-sm-6 col-md-6 text-right text-end text-muted">{COMMENT_TIMEDATE=relative}</div>
</div>
<div class="row-fluid">
<div class="col-xs-12 comment-text" id="{COMMENT_ITEMID}-edit" contentEditable="false" >
<p>
{COMMENT}
</p>
</div>
</div>
<div class="row">
<div class="comment-status col-sm-12 col-md-6">{COMMENT_STATUS}</div>
<div class="comment-moderate col-sm-12 col-md-6 text-right text-end">{COMMENT_RATE} {COMMENT_REPLY} {COMMENT_EDIT} {COMMENT_MODERATE}</div>
</div>
</div>
';
$COMMENT_TEMPLATE['layout'] = '{COMMENTFORM}{COMMENTS} <div style="padding:10px 0px">{MODERATE}</div>';

View File

@ -479,9 +479,10 @@ class comment
// $width2 = 100 - $width; // $width2 = 100 - $width;
// $total_width = "95%"; // $total_width = "95%";
if ($width) if ($width)
{ {
$renderstyle = $COMMENT_TEMPLATE['item_start']; $renderstyle = $COMMENT_TEMPLATE['item_start'];
$renderstyle .= "<div class='media offset".$width." col-md-offset-".$width."' >".$COMMENT_TEMPLATE['item']."</div>"; $renderstyle .= "<div class='row media offset".$width." col-md-".(12 - (int) $width)." col-md-offset-".$width."' >".$COMMENT_TEMPLATE['item']."</div>";
$renderstyle .= $COMMENT_TEMPLATE['item_end']; $renderstyle .= $COMMENT_TEMPLATE['item_end'];
} }
else else

View File

@ -20,7 +20,7 @@
<div class="item col-sm-6"> <div class="item col-sm-6">
<h3>{NEWSTITLE}</h3> <h3>{NEWSTITLE}</h3>
<p>{NEWSMETADIZ: limit=100}</p> <p>{NEWSMETADIZ: limit=100}</p>
<p class="text-right"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p> <p class="text-right text-end"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p>
</div> </div>
</div> </div>
</div> </div>
@ -31,7 +31,7 @@
{NEWSTHUMBNAIL=placeholder} {NEWSTHUMBNAIL=placeholder}
<h3>{NEWS_TITLE}</h3> <h3>{NEWS_TITLE}</h3>
<p>{NEWS_SUMMARY}</p> <p>{NEWS_SUMMARY}</p>
<p class="text-right"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p> <p class="text-right text-end"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p>
</div>'; </div>';
$NEWS_GRID_TEMPLATE['col-md-6']['end'] = '</div>'; $NEWS_GRID_TEMPLATE['col-md-6']['end'] = '</div>';
@ -46,7 +46,7 @@
{NEWSTHUMBNAIL=placeholder} {NEWSTHUMBNAIL=placeholder}
<h3>{NEWS_TITLE}</h3> <h3>{NEWS_TITLE}</h3>
<p>{NEWS_SUMMARY}</p> <p>{NEWS_SUMMARY}</p>
<p class="text-right"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p> <p class="text-right text-end"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p>
</div>'; </div>';
$NEWS_GRID_TEMPLATE['col-md-4']['end'] = $NEWS_GRID_TEMPLATE['col-md-6']['end']; $NEWS_GRID_TEMPLATE['col-md-4']['end'] = $NEWS_GRID_TEMPLATE['col-md-6']['end'];
@ -62,7 +62,7 @@
{NEWSTHUMBNAIL=placeholder} {NEWSTHUMBNAIL=placeholder}
<h3>{NEWS_TITLE}</h3> <h3>{NEWS_TITLE}</h3>
<p>{NEWS_SUMMARY}</p> <p>{NEWS_SUMMARY}</p>
<p class="text-right"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p> <p class="text-right text-end"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p>
</div>'; </div>';
$NEWS_GRID_TEMPLATE['col-md-3']['end'] = $NEWS_GRID_TEMPLATE['col-md-6']['end']; $NEWS_GRID_TEMPLATE['col-md-3']['end'] = $NEWS_GRID_TEMPLATE['col-md-6']['end'];

View File

@ -43,7 +43,7 @@ $NEWS_TEMPLATE['list']['first'] = '
<div class="text-justify"> <div class="text-justify">
</div> </div>
<div class="text-right"> <div class="text-right text-end">
<a href="{NEWS_URL}" class="btn btn-primary">{LAN=LAN_READ_MORE}</a> <a href="{NEWS_URL}" class="btn btn-primary">{LAN=LAN_READ_MORE}</a>
</div> </div>
<hr> <hr>
@ -124,7 +124,7 @@ $NEWS_TEMPLATE['default']['item'] = '
<hr class="news-heading-sep"> <hr class="news-heading-sep">
<div class="row"> <div class="row">
<div class="col-md-6"><small>{GLYPH=user} &nbsp;{NEWSAUTHOR} &nbsp; {GLYPH=time} &nbsp;{NEWSDATE=short} </small></div> <div class="col-md-6"><small>{GLYPH=user} &nbsp;{NEWSAUTHOR} &nbsp; {GLYPH=time} &nbsp;{NEWSDATE=short} </small></div>
<div class="col-md-6 text-right options"><small>{GLYPH=tags} &nbsp;{NEWSTAGS} &nbsp; {GLYPH=folder-open} &nbsp;{NEWSCATEGORY} </small></div> <div class="col-md-6 text-right text-end options"><small>{GLYPH=tags} &nbsp;{NEWSTAGS} &nbsp; {GLYPH=folder-open} &nbsp;{NEWSCATEGORY} </small></div>
</div> </div>
<hr> <hr>
{NEWSIMAGE: item=1} {NEWSIMAGE: item=1}
@ -134,7 +134,7 @@ $NEWS_TEMPLATE['default']['item'] = '
<div class="text-justify"> <div class="text-justify">
{NEWS_BODY} {NEWS_BODY}
</div> </div>
<div class="text-right"> <div class="text-right text-end">
{EXTENDED} {EXTENDED}
</div> </div>
<hr> <hr>
@ -159,7 +159,7 @@ $NEWS_TEMPLATE['2-column']['item'] = '<div class="item col-md-6">
{NEWSTHUMBNAIL=placeholder} {NEWSTHUMBNAIL=placeholder}
<h3>{NEWS_TITLE}</h3> <h3>{NEWS_TITLE}</h3>
<p>{NEWS_SUMMARY}</p> <p>{NEWS_SUMMARY}</p>
<p class="text-right"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p> <p class="text-right text-end"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p>
</div>'; </div>';
$NEWS_TEMPLATE['2-column']['end'] = '</div>'; $NEWS_TEMPLATE['2-column']['end'] = '</div>';

View File

@ -28,7 +28,7 @@ $NEWS_VIEW_TEMPLATE['default']['item'] = '
<div class="view-item"> <div class="view-item">
<div class="row"> <div class="row">
<div class="col-md-6"><small>{GLYPH=user} &nbsp;{NEWSAUTHOR} &nbsp; {GLYPH=time} &nbsp;{NEWSDATE=short} </small></div> <div class="col-md-6"><small>{GLYPH=user} &nbsp;{NEWSAUTHOR} &nbsp; {GLYPH=time} &nbsp;{NEWSDATE=short} </small></div>
<div class="col-md-6 text-right options"><small>{GLYPH=tags} &nbsp;{NEWSTAGS} &nbsp; {GLYPH=folder-open} &nbsp;{NEWSCATEGORY} </small></div> <div class="col-md-6 text-right text-end options"><small>{GLYPH=tags} &nbsp;{NEWSTAGS} &nbsp; {GLYPH=folder-open} &nbsp;{NEWSCATEGORY} </small></div>
</div> </div>
<hr> <hr>