<?php echo wp_kses( $args['before_widget'], wp_kses_allowed_html( 'post' ) ); ?>

<?php if ( ! empty( $instance['title'] ) ) : ?>
    <?php echo wp_kses( $args['before_title'], wp_kses_allowed_html( 'post' ) ); ?>
    <?php echo esc_attr( $instance['title'] ); ?>
    <?php echo wp_kses( $args['after_title'], wp_kses_allowed_html( 'post' ) ); ?>
<?php endif; ?>

<div id="compare-controller" data-ng-controller="CompareController">
	<div class="property-micro" data-ng-repeat="property in properties">

        <a data-ng-href="{{ property.permalink }}" >
            <img src="/" data-ng-src="{{ property.src }}" class="attachment-thumb wp-post-image" alt="{{ property.title }}">
        </a>
        
        <h3>
            <a data-ng-href="{{ property.permalink }}">{{ property.title }}</a>
        </h3>

        <div class="property-micro-actions">
        	<a class="property-micro-actions-remove" data-ng-click="remove(property.id)">
        		<i class="fa fa-times"></i>
        	</a>
        </div><!-- /.property-micro-actions -->
    </div><!-- /.property-micro -->

    <div data-ng-show="!properties.length" class="nothing-found">
    	<?php echo __( 'No properties found.', 'realia' ); ?>
    </div>

    <?php $compare_page = get_theme_mod( 'realia_general_compare_page', null ); ?>
    <?php if ( ! empty( $compare_page ) ) : ?>
        <div data-ng-show="properties.length">
        	<a data-ng-href="<?php echo get_permalink( $compare_page ); ?>?ids={{ get_ids() }}" class="btn"><?php echo __( 'Compare', 'realia' ); ?></a>
        </div>
    <?php endif; ?>
</div><!-- /#compare-controller -->

<?php echo wp_kses( $args['after_widget'], wp_kses_allowed_html( 'post' ) ); ?>