<?php

class __Mustache_77d59e4f59f7109b66ea551275d311d6 extends Mustache_Template
{
    private $lambdaHelper;

    public function renderInternal(Mustache_Context $context, $indent = '')
    {
        $this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
        $buffer = '';

        $buffer .= $indent . '<div class="mfa">
';
        $buffer .= $indent . '<section class="mfa-hero"><h2>';
        $value = $context->find('str');
        $buffer .= $this->sectionCb8f383a2510a01082ffa0adf0e4e146($context, $indent, $value);
        $buffer .= '</h2>';
        $value = $context->find('canmanage');
        $buffer .= $this->section413bd1bc7d53e0e670a342bbd844e959($context, $indent, $value);
        $buffer .= '</section>
';
        $value = $context->find('hasawards');
        $buffer .= $this->section9b181d74a704e5d38708508f85e53135($context, $indent, $value);
        $buffer .= '
';
        $value = $context->find('hasawards');
        if (empty($value)) {
            
            $buffer .= $indent . '<section class="mfa-empty"><strong>';
            $value = $context->find('str');
            $buffer .= $this->section21a96eb8b235412594c34366690f631c($context, $indent, $value);
            $buffer .= '</strong></section>';
        }
        $buffer .= '
';
        $buffer .= $indent . '</div>';

        return $buffer;
    }

    private function sectionCb8f383a2510a01082ffa0adf0e4e146(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'myachievements, local_miflora_achievements';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'myachievements, local_miflora_achievements';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section155774d8b51d3a45f095f9cbd2508b5f(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'managebadges, local_miflora_achievements';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'managebadges, local_miflora_achievements';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section413bd1bc7d53e0e670a342bbd844e959(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '<a class="btn btn-primary" href="{{manageurl}}">{{#str}}managebadges, local_miflora_achievements{{/str}}</a>';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= '<a class="btn btn-primary" href="';
                $value = $this->resolveValue($context->find('manageurl'), $context);
                $buffer .= ($value === null ? '' : call_user_func($this->mustache->getEscape(), $value));
                $buffer .= '">';
                $value = $context->find('str');
                $buffer .= $this->section155774d8b51d3a45f095f9cbd2508b5f($context, $indent, $value);
                $buffer .= '</a>';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionB837fbfaaf042867b83df4229671776e(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '<img class="mfa-badgeimage" src="{{imageurl}}" alt="{{badgename}}">';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= '<img class="mfa-badgeimage" src="';
                $value = $this->resolveValue($context->find('imageurl'), $context);
                $buffer .= ($value === null ? '' : call_user_func($this->mustache->getEscape(), $value));
                $buffer .= '" alt="';
                $value = $this->resolveValue($context->find('badgename'), $context);
                $buffer .= ($value === null ? '' : call_user_func($this->mustache->getEscape(), $value));
                $buffer .= '">';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section5a7b782726f59e0788d3c1b43e100e7b(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'awardedby, local_miflora_achievements';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'awardedby, local_miflora_achievements';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function sectionDb8acad0b4f8a52240e84cddb607c8ad(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '<article class="mfa-card">{{#hasimage}}<img class="mfa-badgeimage" src="{{imageurl}}" alt="{{badgename}}">{{/hasimage}}{{^hasimage}}<div class="mfa-icon">{{legacyicon}}</div>{{/hasimage}}<small>{{#str}}awardedby, local_miflora_achievements{{/str}}<strong>{{giver}}</strong></small></article>';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= '<article class="mfa-card">';
                $value = $context->find('hasimage');
                $buffer .= $this->sectionB837fbfaaf042867b83df4229671776e($context, $indent, $value);
                $value = $context->find('hasimage');
                if (empty($value)) {
                    
                    $buffer .= '<div class="mfa-icon">';
                    $value = $this->resolveValue($context->find('legacyicon'), $context);
                    $buffer .= ($value === null ? '' : call_user_func($this->mustache->getEscape(), $value));
                    $buffer .= '</div>';
                }
                $buffer .= '<small>';
                $value = $context->find('str');
                $buffer .= $this->section5a7b782726f59e0788d3c1b43e100e7b($context, $indent, $value);
                $buffer .= '<strong>';
                $value = $this->resolveValue($context->find('giver'), $context);
                $buffer .= ($value === null ? '' : call_user_func($this->mustache->getEscape(), $value));
                $buffer .= '</strong></small></article>';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section9b181d74a704e5d38708508f85e53135(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = '<div class="mfa-grid">{{#awards}}<article class="mfa-card">{{#hasimage}}<img class="mfa-badgeimage" src="{{imageurl}}" alt="{{badgename}}">{{/hasimage}}{{^hasimage}}<div class="mfa-icon">{{legacyicon}}</div>{{/hasimage}}<small>{{#str}}awardedby, local_miflora_achievements{{/str}}<strong>{{giver}}</strong></small></article>{{/awards}}</div>';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= $indent . '<div class="mfa-grid">';
                $value = $context->find('awards');
                $buffer .= $this->sectionDb8acad0b4f8a52240e84cddb607c8ad($context, $indent, $value);
                $buffer .= '</div>';
                $context->pop();
            }
        }
    
        return $buffer;
    }

    private function section21a96eb8b235412594c34366690f631c(Mustache_Context $context, $indent, $value)
    {
        $buffer = '';
    
        if (!is_string($value) && is_callable($value)) {
            $source = 'noachievements, local_miflora_achievements';
            $result = (string) call_user_func($value, $source, $this->lambdaHelper);
            $buffer .= $result;
        } elseif (!empty($value)) {
            $values = $this->isIterable($value) ? $value : array($value);
            foreach ($values as $value) {
                $context->push($value);
                
                $buffer .= 'noachievements, local_miflora_achievements';
                $context->pop();
            }
        }
    
        return $buffer;
    }

}
