<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */

global $campoal_options;
global $post;
$view_counter = isset($campoal_options['conikal_view_counter_field']) ? $campoal_options['conikal_view_counter_field'] : 1;

$give_prefix 		= '_give_';

$id             = $post->ID;
$address        = get_post_meta($id, $give_prefix . 'address', true);
$city           = get_post_meta($id, $give_prefix . 'city', true);
$state          = get_post_meta($id, $give_prefix . 'state', true);
$country        = get_post_meta($id, $give_prefix . 'country', true);
$category       =  wp_get_post_terms($id, $give_prefix . 'category');
?>
<div class="ui basic vertical segment">
    <div class="ui grid font small">
        <div class="eleven wide column petition-location">
            <?php if ($country || $state || $city) { ?>
            <div class="truncate text grey"><i class="<?php echo esc_attr(($country || $state || $city) ? 'map marker' : 'tag') ?> icon"></i>
                <?php echo esc_html($city ? $city . ', ' : '') . esc_html($state ? $state . ', ' : '') . esc_html($country ? $country : ''); ?>
            </div>
            <?php } ?>
        </div>
        <div class="five wide right aligned column petition-view">
            <?php if ($view_counter == 1 && function_exists('conikal_get_post_views')) { ?>
                <div class="text grey"><i class="eye icon"></i><?php echo sprintf(esc_html__('%s view', 'campoal'), conikal_format_number('%!,0i', (int) conikal_get_post_views($id), true)) ?></div>
            <?php } ?>
        </div>
    </div>
</div>