Browse Source

Ticket #562 - Minor visibility improvements.

AntonLV 9 years ago
parent
commit
ba1878eb14

+ 2 - 2
modules/boonex/polls/classes/BxPollsTemplate.php

@@ -79,11 +79,11 @@ class BxPollsTemplate extends BxBaseModTextTemplate
         foreach($aSubentries as $aSubentry) {
             $oVotes = BxDolVote::getObjectInstance($CNF['OBJECT_VOTES_SUBENTRIES'], $aSubentry['id']);
 
-            $fPercent = 100 * (float)$aSubentry['votes']/$iTotal;
+            $fPercent = $iTotal > 0 ? 100 * (float)$aSubentry['votes']/$iTotal : 0;
             $aTmplVarsSubentries[] = array(
                 'title' => $aSubentry['title'],
                 'width' => (int)round($fPercent) . '%',
-                'votes' => $oVotes->getCounter(array('show_in_brackets' => false)),
+                'votes' => $oVotes->getCounter(array('show_counter_empty' => true, 'show_counter_in_brackets' => false)),
                 'percent' => _t('_bx_polls_txt_subentry_vote_percent', $iTotal > 0 ? round($fPercent, 2) : 0),
             );
         }

+ 1 - 1
modules/boonex/polls/classes/BxPollsVoteSubentries.php

@@ -53,7 +53,7 @@ class BxPollsVoteSubentries extends BxTemplVote
     {
         $CNF = $this->_oModule->_oConfig->CNF;
 
-        $bShowInBrackets = !isset($aParams['show_in_brackets']) || $aParams['show_in_brackets'] == true;
+        $bShowInBrackets = !isset($aParams['show_counter_in_brackets']) || $aParams['show_counter_in_brackets'] == true;
 
         $iObjectId = $this->getId();
 		$iAuthorId = $this->_getAuthorId();

+ 1 - 1
modules/boonex/polls/template/subentries_results.html

@@ -3,7 +3,7 @@
         <div class="bx-polls-result bx-def-margin-top-auto">
             <div class="bx-polls-result-into">__title__</div>
             <div class="bx-polls-result-graph bx-def-margin-thd-top">
-                <div class="bx-polls-rg-bar bx-def-round-corners" style="width:__width__"></div>
+                <div class="bx-polls-rg-bar bx-def-round-corners" style="width:__width__">&nbsp;</div>
                 <div class="bx-polls-rg-text bx-def-padding-left bx-def-font-middle bx-def-font-grayed">__votes__&nbsp;__percent__</div>
             </div>
         </div>