{foreach from=$categories item=cCategory} {if $cCategory->data.category_parent eq 0}
joined.obj_category_file folder='categoryView'}{else}background-image:url({$vars.resourcesUrl}challengeicon-default.png);{/if}">
{if is_object($cCategory->joined.obj_categoryaccess)} {if $cCategory->joined.obj_categoryaccess->getData('showClosed')}
{"Closed"|gettext}
{/if} {/if}

{if is_object($cCategory->joined.obj_categoryaccess)} {if $cCategory->joined.obj_categoryaccess->getData('showClosed')} {"This challenge is now closed"|gettext} {else if $cCategory->data.category_archived == Category::STATUS_ARCHIVED} {"Archived challenge"|gettext} {else} {"Challenge"|gettext} {/if} {/if}

{Translation::t($cCategory, 'category_name')}

{if $cCategory->hasVotingWallet()}
{if $cCategory->getAccess()->getData('votingScheme') eq 'up' || $categoryaccess->getData('votingScheme') eq 'updown'} {if $allowanceLeftValue != 1} {"You have %s votes remaining in this challenge"|gettext|sprintf:$cCategory->getAllowanceLeft()} {else} {"You have 1 vote remaining in this challenge"|gettext} {/if} {else if $cCategory->getAccess()->getData('votingScheme') eq 'pointsAward'} {if $allowanceLeftValue != 1} {if $cCategory->getAccess()->getData('renameScoring')} {"You have %s votes remaining in this challenge"|gettext|sprintf:$cCategory->getAllowanceLeft()} {else} {"You have %s points remaining in this challenge"|gettext|sprintf:$cCategory->getAllowanceLeft()} {/if} {else} {if $cCategory->getAccess()->getData('renameScoring')} {"You have 1 vote remaining in this challenge"|gettext} {else} {"You have 1 point remaining in this challenge"|gettext} {/if} {/if} {else if $cCategory->getAccess()->getData('votingScheme') eq 'stars'} {if $allowanceLeftValue != 1} {"You can rate %s more ideas in this challenge"|gettext|sprintf:$cCategory->getAllowanceLeft()} {else} {"You can rate 1 more idea in this challenge"|gettext} {/if} {/if}
{/if}

{$cCategory->getDescriptionOutput()}

{"Ideas"|gettext}
{$cCategory->stats.ideasPlusChildren}
{if is_object($cCategory->joined.obj_categoryaccess)}
joined.obj_categoryaccess) && $cCategory->joined.obj_categoryaccess->getData('blindVoting')}data-tip="{"Blind voting is enabled"|gettext}"{/if}>
{"Votes"|gettext}
{if is_object($cCategory->joined.obj_categoryaccess) && !$cCategory->joined.obj_categoryaccess->getData('blindVoting')} {$cCategory->stats.votesPlusChildren} {else}   {/if}
{/if}
{"Comments"|gettext}
{$cCategory->stats.commentsPlusChildren}
{"Participants"|gettext}
{$cCategory->stats.usersPlusChildren}
{"More"|gettext} >
{if $cCategory->data.category_phased} {assign var='phases' value=$cCategory->tempData.phaseList} {if (Translation::loadTranslations($phases))}{* To prevent array output. WARNING: This is inefficient, multiple DB calls to get all the translations *}{/if}
{if $cCategory->data.category_phased} {if $cCategory->phasesNotStarted()} {assign var=firstPhase value=$cCategory->getFirstPhase()} {"First phase starts in"|gettext} {$firstPhase->startsIn()} {elseif $cCategory->allPhasesCompleted()} {"All phases completed"|gettext} {else} {"Phase"|gettext} {$cCategory->getPhasePosition()} {"out of"|gettext} {$cCategory->getPhaseCount()} {/if} {/if}
{assign var='phases' value=$cCategory->tempData.phaseList} {if (Translation::loadTranslations($phases))}{* To prevent array output *}{/if}
{foreach from=$phases item=cPhase name=phaseLoop} {if is_object($cPhase->joined.access)} {if is_object($cPhase->joined.access)} {assign var='accessData' value=$cPhase->joined.access->getData()} {/if} {/if} {assign var=stagePlace value='before'} {if strtotime($cPhase->data.phase_startdate) gte strtotime($cCategory->tempData.phase->getEndDate())} {assign var=stagePlace value='after'} {elseif $cPhase->data.phase_id eq $cCategory->tempData.phase->data.phase_id} {assign var=stagePlace value='current'} {/if} {*{if $smarty.foreach.phaseLoop.first}
{/if}*}
{assign var=startTime value=$cPhase->data.phase_startdate|strtotime} {assign var=endTime value=$cPhase->data.phase_enddate|strtotime} {assign var=duration value=$endTime-$startTime} {*
*}
{foreachelse}
There are no challenges to display.
{/foreach}
{/if}
{/if} {/foreach}