Pluralized file criteria, cleaned up CSS and removed dead code

This commit is contained in:
Robb Ebright 2018-01-03 18:57:02 -05:00
parent 91906e5b5d
commit 927fcbc42d
5 changed files with 22 additions and 56 deletions

View File

@ -67,6 +67,7 @@ class PlaylistController extends Zend_Controller_Action
if ($formIsValid) { if ($formIsValid) {
$this->view->poolCount = $obj->getListofFilesMeetCriteria()['count']; $this->view->poolCount = $obj->getListofFilesMeetCriteria()['count'];
} }
$this->view->showPoolCount = true;
$this->view->html = $this->view->render('playlist/update.phtml'); $this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $obj->getName(); $this->view->name = $obj->getName();
$this->view->description = $obj->getDescription(); $this->view->description = $obj->getDescription();

View File

@ -361,8 +361,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$this->setDecorators(array( $this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/smart-block-criteria.phtml', "openOption"=> $openSmartBlockOption, array('ViewScript', array('viewScript' => 'form/smart-block-criteria.phtml', "openOption"=> $openSmartBlockOption,
'criteriasLength' => count($this->getCriteriaOptions()), 'poolCount' => $files['count'], 'modRowMap' => $modRowMap, 'criteriasLength' => count($this->getCriteriaOptions()), 'modRowMap' => $modRowMap))
'showPoolCount' => $showPoolCount))
)); ));
} }

View File

@ -119,37 +119,6 @@
<?php } ?> <?php } ?>
</dd> </dd>
<?php
// this will never run due to refactoring of playlist controller. it is replaced with code in update.phtml
if ($this->showPoolCount) { ?>
<div class='sp_text_font sp_text_font_bold'>
<span id='sp_pool_count' class='sp_text_font sp_text_font_bold'>
<?php
if ($this->poolCount > 1) {
echo $this->poolCount;
?>
<?php echo _("files meet the criteria")?>
</span>
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
<?php
} else if ($this->poolCount == 1) {
echo $this->poolCount;
?>
<?php echo _("file meets the criteria")?>
</span>
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
<?php
} else {
?>
0 <?php echo " "._("files meet the criteria")?>
</span>
<span class='sp-warning-icon' id='sp_pool_count_icon'></span>
<?php
}
?>
</div>
<?php } ?>
</dl> </dl>
</form> </form>

View File

@ -2,35 +2,29 @@
$items = $this->contents; $items = $this->contents;
$isStaticSmartBlock = ($this->obj instanceof Application_Model_Block && $this->obj->isStatic()); $isStaticSmartBlock = ($this->obj instanceof Application_Model_Block && $this->obj->isStatic());
$isPlaylist = ($this->obj instanceof Application_Model_Playlist); $isPlaylist = ($this->obj instanceof Application_Model_Playlist);
if ($this->poolCount) { ?> ?>
<div class='sp_text_font sp_text_font_bold'> <div class='sp_text_font sp_text_font_bold'>
<span id='sp_pool_count' class='sp_text_font sp_text_font_bold'> <?php
<?php if ($this->poolCount) { ?>
if ($this->poolCount > 1) { <span id='sp_pool_count' class='sp_text_font sp_text_font_bold'>
echo $this->poolCount; <?php
?> if ($this->poolCount > 0) {
<?php echo _("files meet the criteria")?> echo $this->poolCount;
</span> echo ngettext(" file meets the criteria", " files meets the criteria", $this->poolCount);
}
?>
</span>
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span> <span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
<?php <?php
} else if ($this->poolCount == 1) { }
echo $this->poolCount; else if ($this->showPoolCount){
?> ?>
<?php echo _("file meets the criteria")?> <span class='sp-warning-icon' id='sp_pool_count_icon'></span>
</span> <?php echo _("No files meet the criteria");
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
<?php
} else {
?>
0 <?php echo " "._("files meet the criteria")?>
</span>
<span class='sp-warning-icon' id='sp_pool_count_icon'></span>
<?php
} }
?> ?>
</div> </div>
<?php } <?php
if (count($items) && ($isStaticSmartBlock || $isPlaylist)) : ?> if (count($items) && ($isStaticSmartBlock || $isPlaylist)) : ?>
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach($items as $item) : <?php foreach($items as $item) :

View File

@ -739,6 +739,7 @@ input.input_text.sp_extra_input_text{
.sp_text_font_bold{ .sp_text_font_bold{
font-weight: bold; font-weight: bold;
color: white;
} }
.sp-ui-button-icon-only { .sp-ui-button-icon-only {
@ -782,6 +783,8 @@ input.input_text.sp_extra_input_text{
.sp-closed{ .sp-closed{
border-width: 0 0 0 !important; border-width: 0 0 0 !important;
} }
/***** SMART BLOCK SPECIFIC STYLES END *****/ /***** SMART BLOCK SPECIFIC STYLES END *****/
label { label {