<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */
global $post;

$post_type = get_post_type($post->ID);
if ($post_type != 'petition') {
    $petition_id = get_post_meta($post->ID, $post_type . '_post_id', true);
} else {
    $petition_id = $post->ID;
}

// get custom sign button label
$sign_button_text           = conikal_custom_sign_label_button($petition_id, __('Sign this petition', 'campoal'));

$supporter_number           = conikal_get_supporter_donors_number($petition_id);
$goal                       = $supporter_number->goal;
$sign_num                   = $supporter_number->sign;
$author_name                = conikal_get_author_name($post->post_author);
$title                      = get_the_title($petition_id);
?>

<!-- SIGN IN AND SIGN UP MODAL -->
<div class="ui tiny modal prompt-action" id="prompt-action<?php echo esc_attr($petition_id) ?>" data-id="<?php echo esc_attr($petition_id) ?>" data-load="0">
    <i class="close icon"></i>
    <div class="content">
        <h2 class="ui center aligned header">
        <?php echo sprintf(esc_html__('Today: %s is counting on you
', 'campoal'), $author_name) ?>
        </h2>
        <p class="font large aligncenter">
            <?php echo sprintf( esc_html__('%1$s needs your help with “%2$s”. Join %1$s and %3$s supporters today.', 'campoal'), $author_name, $title, conikal_format_number('%!,0i', $sign_num) ) ?>        
        </p>
        <div class="ui hidden divider"></div>
            <a href="#content<?php echo esc_attr($petition_id) ?>" class="ui primary fluid big button letSign" data-id="<?php echo esc_attr($petition_id) ?>"><?php echo conikal_custom_icon('sign') ?><?php echo esc_html($sign_button_text); ?></a>
    </div>
</div>