Parcourir la source

#1 - Experimental layout.

AntonLV il y a 13 ans
Parent
commit
a572a94d4c

+ 3 - 3
inc/classes/BxDolCmts.php

@@ -495,8 +495,7 @@ class BxDolCmts extends BxDol
            return '';
 
         $iCmtId= isset($_REQUEST['CmtId']) ? bx_process_input($_REQUEST['CmtId'], BX_DATA_INT) : 0;
-
-        return 'list will be here';
+        return $this->getPlusedBy($iCmtId);
     }
 
     function actionCmtsGet () {
@@ -720,7 +719,8 @@ class BxDolCmts extends BxDol
 		return array(
 			$oProfile->getDisplayName(), 
 			$oProfile->getUrl(), 
-			$oProfile->getIcon()
+			$oProfile->getIcon(),
+			$oProfile->getUnit()
 		);
     }
 

+ 6 - 0
inc/classes/BxDolCmtsQuery.php

@@ -242,6 +242,12 @@ class BxDolCmtsQuery extends BxDolDb
         return false;
     }
 
+    function getRatedBy ($iSystemId, $iCmtId)
+    {
+    	$sQuery = $this->prepare("SELECT `cmt_rate_author_id` FROM `{$this->_sTableTrack}` WHERE `cmt_system_id`=? AND `cmt_id`=?", $iSystemId, $iCmtId);
+    	return $this->getColumn($sQuery);
+    }
+
     function deleteAuthorComments ($iAuthorId)
     {
         $isDelOccured = 0;

+ 9 - 2
inc/js/classes/BxDolCmts.js

@@ -356,8 +356,15 @@ BxDolCmts.prototype.togglePlusedByPopup = function(oLink, iCmtId) {
         oData,
         function (s) {
 			$this._loadingInContent(oLink, false);
-			
-			alert(s);
+
+			var oPopup = $(s).hide(); 
+
+	    	$('#' + oPopup.attr('id')).remove();
+	        oPopup.prependTo('body').dolPopup({
+	        	pointer:{
+	    			el:$(oLink)
+	    		}
+	        });
         }
 	);
 };

+ 2 - 2
modules/boonex/english/data/langs/system.xml

@@ -1162,8 +1162,8 @@ Please click "Continue" below to navigate to the home page of the site.]]></stri
 	<string name="_buried"><![CDATA[buried]]></string>
 	<string name="_toggle"><![CDATA[toggle]]></string>
 	<string name="_see_more"><![CDATA[see more]]></string>
-	<string name="_cmt_point"><![CDATA[plus]]></string>
-	<string name="_cmt_points"><![CDATA[pluses]]></string>
+	<string name="_N_point"><![CDATA[<span>{0}</span> plus]]></string>
+	<string name="_N_points"><![CDATA[<span>{0}</span> pluses]]></string>
 	<string name="_Plus"><![CDATA[Plus]]></string>
 	<string name="_Plused_by_popup"><![CDATA[Plused by]]></string>
 	<string name="_Minus"><![CDATA[Minus]]></string>

+ 1 - 1
template/comment.html

@@ -20,7 +20,7 @@
 				</bx_if:show_reply_to>
 				<span class="bullet">&#183;</span><a class="__style_prefix__-ago" href="__view_link__">__ago__</a>
 				<bx_if:show_rate_count>
-					<span class="bullet">&#183;</span><a class="__style_prefix__-points" href="javascript:void(0)" onclick="__js_object__.togglePlusedByPopup(this, __id__); return false;" title="<bx_text:_Plused_by_popup />"><span>__points_num__</span>&nbsp;__points_txt__</a>
+					<span class="bullet">&#183;</span><a class="__style_prefix__-points" href="javascript:void(0)" onclick="__js_object__.togglePlusedByPopup(this, __id__); return false;" title="<bx_text:_Plused_by_popup />">__points__</a>
 				</bx_if:show_rate_count>
 			</span>
 		</div>

+ 4 - 4
template/comment_actions.html

@@ -1,15 +1,15 @@
 <div class="__style_prefix__-actions bx-def-margin-thd-top">
 	<bx_if:show_reply>
-		<a class="__style_prefix__-comment-reply bx-def-margin-sec-left-auto bx-def-font-grayed" href="javascript:void(0)" onclick="__js_object__.toggleReply(this, __id__); return false;" title="__text__"><i class="sys-icon reply"></i></a>
+		<a class="__style_prefix__-comment-reply bx-def-margin-sec-left-auto" href="javascript:void(0)" onclick="__js_object__.toggleReply(this, __id__); return false;" title="__text__"><i class="sys-icon reply"></i></a>
 	</bx_if:show_reply>
 	<bx_if:show_rate>
-		<a class="__style_prefix__-comment-vote bx-def-margin-sec-left-auto bx-def-font-grayed" title="<bx_text:_Plus />" href="javascript:void(0)" onclick="__js_object__.cmtRate(this, __id__, 1)" title="<bx_text:_Plus />"><i class="sys-icon plus"></i></a>
+		<a class="__style_prefix__-comment-vote bx-def-margin-sec-left-auto" title="<bx_text:_Plus />" href="javascript:void(0)" onclick="__js_object__.cmtRate(this, __id__, 1)" title="<bx_text:_Plus />"><i class="sys-icon plus"></i></a>
 		<!--
-		<a class="__style_prefix__-comment-vote bx-def-margin-sec-left-auto bx-def-font-grayed" title="<bx_text:_Minus />" href="javascript:void(0)" onclick="__js_object__.cmtRate(this, __id__, -1)" title="<bx_text:_Minus />"><i class="sys-icon minus"></i></a>
+		<a class="__style_prefix__-comment-vote bx-def-margin-sec-left-auto" title="<bx_text:_Minus />" href="javascript:void(0)" onclick="__js_object__.cmtRate(this, __id__, -1)" title="<bx_text:_Minus />"><i class="sys-icon minus"></i></a>
 		-->
 	</bx_if:show_rate>
 	<bx_if:show_manage>
-		<a class="__style_prefix__-comment-manage bx-def-margin-sec-left-auto bx-def-font-grayed" href="javascript:void(0)" onclick="__js_object__.toggleManagePopup(this, __id__); return false;" title="<bx_text:_Manage />"><i class="sys-icon cog"></i></a>
+		<a class="__style_prefix__-comment-manage bx-def-margin-sec-left-auto" href="javascript:void(0)" onclick="__js_object__.toggleManagePopup(this, __id__); return false;" title="<bx_text:_Manage />"><i class="sys-icon cog"></i></a>
 		<div id="__popup_id__" class="__style_prefix__-comment-manage" style="display:none;">__popup_text__</div>
 	</bx_if:show_manage>
 </div>

+ 7 - 0
template/comment_pb_list.html

@@ -0,0 +1,7 @@
+<div class="__style_prefix__-pb-list">
+	<div class="__style_prefix__-pb-list-cnt">
+		<bx_repeat:list>
+			__user_unit__
+		</bx_repeat:list>
+	</div>
+</div>

+ 1 - 0
template/comment_plused_by.html

@@ -0,0 +1 @@
+<div id="__id__" class="__style_prefix__-plused-by" style="display:none;">__content__</div>

+ 19 - 4
template/css/cmts.css

@@ -138,6 +138,11 @@
     span.cmt-reply-to span.bullet:first-child {
 		display: none;
     }
+    span.cmt-reply-to a.cmt-points span {
+		display: inline;
+    	float: none;
+    }
+    
     span.cmt-posted-ago {
         text-transform: lovercase;
     }
@@ -179,14 +184,12 @@
     /*--- Comment Actions ---*/
 	div.cmt-actions {
 		position: relative;
+		min-height: 22px;
 		text-align: right;
 	}
 	div.cmt-actions a {
 		text-decoration: none;
     }
-    div.cmt-actions a:hover {
-		color: #006699;
-    }
     div.cmt-actions i.sys-icon {
     	font-size: 1.5em;
 	}
@@ -195,6 +198,17 @@
     	text-align: left;
     }
 
+    /*--- Comment Plused By ---*/
+    div.cmt-pb-list {
+		max-height: 200px;
+    	min-width: 185px;
+    	overflow: auto;
+    }
+    div.cmt-pb-list div.bx-persons-unit {
+		float: none;
+    	margin-right: 0px;
+    }
+
     /*--- Add Comment/Reply Styles ---*/
     div.cmt-reply {
 		position: relative;
@@ -209,7 +223,8 @@
     	margin-bottom: 20px;
 	}
     li.cmt div.cmt-reply-bottom {
-    	margin-top: 20px;
+    	margin-top: 0px;
+    	margin-bottom: 20px;
     }
 	div.cmt-post-reply {
         position: relative;

+ 32 - 1
template/scripts/BxBaseCmtsView.php

@@ -261,6 +261,8 @@ class BxBaseCmtsView extends BxDolCmts {
         			'style_prefix' => $this->_sStylePrefix,
         			'js_object' => $this->_sJsObjName,
         			'id' => $r['cmt_id'],
+        			'points' => _t($r['cmt_rate'] == 1 || $r['cmt_rate'] == -1 ? '_N_point' : '_N_points', $r['cmt_rate']),
+        	
 		        	'points_num' => $r['cmt_rate'],
 		        	'points_txt' => _t($r['cmt_rate'] == 1 || $r['cmt_rate'] == -1 ? '_cmt_point' : '_cmt_points'),
         		)
@@ -289,6 +291,35 @@ class BxBaseCmtsView extends BxDolCmts {
         return $this->_getPostReplyForm($iCmtParentId, $sText, $sFunction);
     }
 
+    function getPlusedBy($iCmtId)
+    {
+    	$oTemplate = BxDolTemplate::getInstance();
+
+    	$aTmplUsers = array();
+
+    	$aUserIds = $this->_oQuery->getRatedBy($this->_aSystem['system_id'], $iCmtId);
+    	foreach($aUserIds as $iUserId) {
+    		list($sUserName, $sUserUrl, $sUserIcon, $sUserUnit) = $this->_getAuthorInfo($iUserId);
+			$aTmplUsers[] = array('user_unit' => $sUserUnit);
+    	}
+
+    	$sContent = $oTemplate->parseHtmlByName('comment_pb_list.html', array(
+    		'style_prefix' => $this->_sStylePrefix,
+    		'bx_repeat:list' => $aTmplUsers
+    	));
+
+    	bx_import('BxTemplStudioFunctions');
+        $sContent = BxTemplStudioFunctions::getInstance()->transBox($oTemplate->parseHtmlByName('comment_manage.html', array(
+        	'content' => $sContent
+        )));
+
+        return $oTemplate->parseHtmlByName('comment_plused_by.html', array(
+        	'style_prefix' => $this->_sStylePrefix,
+        	'id' => $this->_sSystem . '-plused-by' . $iCmtId,
+        	'content' => $sContent
+        ));
+    }
+
     /**
      * private functions
      */
@@ -385,7 +416,7 @@ class BxBaseCmtsView extends BxDolCmts {
         		)
         	),
         	'bx_if:show_rate' => array(
-				'condition' => $this->isRatable(),
+				'condition' => $this->isRatable() && $this->isRateAllowed(),
         		'content' => array(
         			'js_object' => $this->_sJsObjName,
         			'style_prefix' => $this->_sStylePrefix,