<div class="icon32 icon32-posts-folio" id="icon-edit"><br></div>
<h2><?php _e("Featureds Games", THEMEMAKERS_THEME_FOLDER_NAME) ?></h2>


<form id="featured_games" name="featured_games" method="post">
    <ul id="featured_games_list">


        <?php if (!empty($featured_games)): ?>
            <?php foreach ($featured_games as $post_id) : ?>
                <?php
                $post = get_post($post_id);
                $featured_image_width = 313;
                $featured_image_height = 220;
                $permalink = get_permalink($post_id);
                $terms = wp_get_post_terms($post_id, 'cons');
                $featured_image = "";
                if (has_post_thumbnail($post_id)) {
                    $featured_image = ThemeMakersHelper::get_post_featured_image($post_id, 'gallery_thumb');
                }
                ?>

                <li>
                    <input type="button" value="Remove from features" class="remove_from_features_button" /><br />
                    <a href="<?php echo $permalink ?>" target="_blank">
                        <img src="<?php echo $featured_image ?>" width="<?php echo $featured_image_width ?>" height="<?php echo $featured_image_height ?>" alt="" />
                    </a>

                    <div class="caption">
                        <span class="date"><?php echo $post->post_date ?></span>
                        <h5 class="title"><a href="<?php echo $permalink ?>"><?php echo $post->post_title ?></a></h5>
                        <div class="description"><?php echo $post->post_excerpt ?></div>
                        <div class="platform-teaser">
                            <?php if (!empty($terms)): ?>
                                <?php foreach ($terms as $term) : ?>
                                    <?php $cons_color = get_taxonomy_term_type('cons', $term->term_id); ?>
                                    <a style="background-color: <?php echo $cons_color ?>" class="game_console" href="<?php bloginfo('url') ?>/?cons=<?php echo $term->slug ?>"><?php echo $term->name ?></a>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </div><!--/ .platform-teaser-->
                    </div><!--/ .caption-->
                    <div class="clear"></div>
                    <input type="hidden" name="featured_games[]" value="<?php echo $post_id ?>" />
                </li>

            <?php endforeach; ?>
        <?php endif; ?>


    </ul>

    <br />

    <a class="admin-button button-small button-yellow button_save_featured_games" href="#">Save featureds games</a>

</form>

<br />

<input type="text" value="" placeholder="enter game name here ..."  id="games_search_name" />&nbsp;<input type="button" value="Search" id="games_search_button" /><br />
<br />
<div id="games_search_results">
    <ul></ul>
</div>