<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
<!-- Task info table (NICC styled, for embedding in thread emails) -->
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#ffffff; border-left:3px solid #e94560; margin-bottom:16px;">
    <tr>
        <td style="padding:10px 16px; border-bottom:1px solid #f0eeea; font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Tarea</span><br>
            <strong style="color:#1a1a2e;">
                <a href="<?php echo $tpl->url('task', 'tid', $tpl->get('task')->id) ?>" style="color:#e94560; text-decoration:none;">No.<?php echo $tpl->get('task')->id ?></a>
            </strong>
        </td>
    </tr>
    <?php if ($tpl->get('task')->state): ?>
    <tr>
        <td style="padding:10px 16px; border-bottom:1px solid #f0eeea; font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Estado</span><br>
            <?php
            $state = $tpl->get('task')->state;
            $stateColors = ['opened'=>'#1976d2','done'=>'#10b981','closed'=>'#6b7280','rejected'=>'#ef4444'];
            $stateLabels = ['opened'=>'Abierta','done'=>'Cerrada','closed'=>'Cerrada','rejected'=>'Rechazada'];
            $sc = isset($stateColors[$state]) ? $stateColors[$state] : '#7a7a8e';
            $sl = isset($stateLabels[$state]) ? $stateLabels[$state] : $state;
            ?>
            <strong style="color:<?php echo $sc ?>;"><?php echo $sl ?></strong>
        </td>
    </tr>
    <?php endif ?>
    <tr>
        <td style="padding:10px 16px; border-bottom:1px solid #f0eeea; font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Proceso</span><br>
            <span style="color:#1a1a2e;"><?php echo $tpl->get('task')->task_program_name ?: '---' ?></span>
        </td>
    </tr>
    <tr>
        <td style="padding:10px 16px; border-bottom:1px solid #f0eeea; font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Fecha limite</span><br>
            <strong style="color:#1a1a2e;"><?php echo $tpl->get('task')->plan_date ?></strong>
            <?php if ($tpl->get('task')->all_day_event == '0'): ?>
                <span style="color:#7a7a8e;">(<?php echo $tpl->get('task')->start_time ?> - <?php echo $tpl->get('task')->finish_time ?>)</span>
            <?php endif ?>
        </td>
    </tr>
    <tr>
        <td style="padding:10px 16px; border-bottom:1px solid #f0eeea; font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Dias restantes</span><br>
            <strong style="color:#f59e0b; font-size:15px;">
                <?php
                $dr = $tpl->get('days_remaining', 0);
                if ($dr < 0) {
                    echo abs($dr) . ' dia(s) vencida';
                } elseif ($dr == 0) {
                    echo 'Vence HOY';
                } else {
                    echo $dr . ' dia(s)';
                }
                ?>
            </strong>
        </td>
    </tr>
    <tr>
        <td style="padding:10px 16px; border-bottom:1px solid #f0eeea; font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Responsable</span><br>
            <span style="color:#1a1a2e;"><?php echo $tpl->user_name($tpl->get('task')->assignee) ?></span>
        </td>
    </tr>
    <tr>
        <td style="padding:10px 16px; <?php echo $tpl->get('task')->cost ? 'border-bottom:1px solid #f0eeea;' : '' ?> font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Creador</span><br>
            <span style="color:#1a1a2e;"><?php echo $tpl->user_name($tpl->get('task')->original_poster) ?></span>
        </td>
    </tr>
    <?php if ($tpl->get('task')->cost): ?>
    <tr>
        <td style="padding:10px 16px; font-size:13px;">
            <span style="color:#7a7a8e; font-size:10px; text-transform:uppercase; letter-spacing:1px;">Item</span><br>
            <span style="color:#1a1a2e;"><?php echo $tpl->get('task')->cost ?></span>
        </td>
    </tr>
    <?php endif ?>
</table>

<!-- Description -->
<div style="margin-top:12px;">
    <strong style="font-size:14px; color:#1a1a2e;">Descripcion:</strong>
    <div style="background:#ffffff; padding:16px; margin-top:8px; border-left:3px solid #e8e5e0; font-size:14px; color:#3a3a4e; line-height:1.6;">
        <?php echo $tpl->get('task')->content_html ?>
    </div>
</div>
