
<?php $__env->startSection('subtitle'); ?>
Game Loadouts
<?php $__env->stopSection(); ?>

<?php $__env->startSection('description'); ?>
Game Loadouts contains Titanfall, Battlefield 4 (BF4), and Call of Duty Ghosts (COD Ghosts) loadouts for which you can find the best way to outfit your favorite weapons.
<?php $__env->stopSection(); ?>

<?php $__env->startSection('sub-header'); ?>
<div id="home">
    <div id="intro" style="padding-top:50px;padding-bottom:50px;text-align:left;">
        <div class="container">
            <div class="col-md-8 col-md-offset-2">
                <h2 style="margin-top:0; margin-bottom: 20px;">Enter a weapon to find loadouts</h2>
                <?php echo Form::open(array('action' => 'WeaponController@parseSearch', 'id' => 'searchForm')); ?>
                <div class="input-group">
                    <input type="text" class="form-control input-lg" name="query" id="autocomplete-ajax" autofocus autocomplete="off" placeholder="e.g. ACE 23 / Battlefield 4" />
                    <span class="input-group-btn">
                        <button class="input-lg btn btn-primary" type="submit" style="font-size: 18px;">
                        Search
                        </button>
                    </span>
                </div>
                <?php echo Form::close(); ?>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<?php if(HelperController::adsEnabled()): ?>
<div class="col-md-12">
	<div class="top-ad-box">
		<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- Game Loadouts Leaderboard -->
		<ins class="adsbygoogle"
		style="display:block"
		data-ad-client="ca-pub-9067954073014278"
		data-ad-slot="1230654771"
		data-ad-format="auto"></ins>
		<script>
			( adsbygoogle = window.adsbygoogle || []).push({});
		</script>
	</div>
</div>
<?php endif; ?>
<div class="row">
    <div class="col-md-8">
        <h2>What is Game Loadouts?</h2>
        <span class="line"> <span class="sub-line"></span> </span>
        <p>Game Loadouts is a portal for finding the best ways to outfit your weapons in your favorite video games.</p>
        <p>This website comes in handy when you need to complete challenges with various weapons and need to know the best attachment combination for that weapon.</p>
        <p>It is also great for fine-tuning your favorite gun to help improve your gameplay. This will save you rounds of trial and error to find the best loadout.</p>
    </div>
    <div class="col-md-4">
    	<?php if(Auth::guest() || Auth::user() -> role == 'Guest'): ?>
        <h2>Login</h2>
        <span class="line"> <span class="sub-line"></span> </span>
        <?php echo Form::open(array('action' => 'UserController@login', 'id' => 'logInForm', 'class' => 'form-horizontal')); ?>
        <fieldset>
            <div class="form-group">
                <div class="col-md-12">
                    <?php echo Form::text('emailOrUsername', '', array('class' => 'form-control input-lg', 'placeholder' => 'Username or Email', 'required' => '')); ?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-12">
                    <?php echo Form::password('password', array('class' => 'form-control input-lg', 'placeholder' => 'Password', 'required' => '')); ?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-12">
                    <label class="control-label" style="padding-top: 0" for="remember"> <?php echo Form::checkbox('remember', 'remember', false, array('class' => 'checkbox-inline', 'id' => 'remember')); ?>
                        Keep me logged in </label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-12">
                    <button type="reset" class="btn btn-default">
                        Cancel
                    </button>
                    <button type="submit" class="btn btn-primary">
                        Login
                    </button>
                    <a href="<?php echo route('reminder'); ?>" class="btn btn-primary pull-right">
                        Forgot Password
                    </a>
                </div>
            </div>
        </fieldset>
        <?php echo Form::close(); ?>
        <h3>Don't have an account?</h3>
        <p>You can <a href="<?php echo route('register'); ?>">register</a> for free.</p>
        <?php else: ?>
        	<h2>Hello <?php echo Auth::user() -> username; ?></h2>
            <span class="line"> <span class="sub-line"></span> </span>
            <?php if($recentLoadout): ?>
                <?php
                    $weapon = Weapon::findOrFail($recentLoadout -> weapon_id);
                ?>
                <p>Your <a href="<?php echo route('showLoadout', array(urlencode($weapon -> game_id), urlencode($weapon -> name), $recentLoadout -> id)); ?>">last loadout</a> was for <?php echo link_to_route('showLoadouts', $weapon -> name, array(urlencode($weapon -> game_id), urlencode($weapon -> name))); ?> in <?php echo link_to_route('showGame', $weapon -> game_id, urlencode($weapon -> game_id)); ?> on <?php echo date('m/d/Y', strtotime($recentLoadout -> pivot -> updated_at )); ?>.</p>
                    <a class="block loadoutSmall" href="<?php echo route('showLoadout', array(urlencode($weapon -> game_id), urlencode($weapon -> name), $recentLoadout -> id)); ?>">
                         <div class="row">
                             <div class="col-md-12">
                                 <img src="<?php echo asset($weapon -> thumb_url); ?>" alt="<?php echo $weapon -> name; ?>" class="pull-right" style="max-height: 30px;" />
                                 <h4 class="weaponSmall theme-color"><?php echo $weapon -> name; ?></h4>
                             </div>
                         </div>
                            <?php foreach(Loadout::findOrFail($recentLoadout -> id) -> attachments as $attachment): ?>
                            <div class="attachmentSmall">
                                <img src="<?php echo asset($attachment -> thumb_url); ?>" alt="<?php echo $attachment -> name; ?>" />
                                <?php echo $attachment -> name; ?>
                            </div>
                            <?php endforeach; ?>
                        <div class="clearfix"></div>
                    </a>  
                          
            <?php else: ?>
                <p>You have not submitted any loadouts yet. You can start by searching for a weapon in the search box.</p>
            <?php endif; ?>
        <?php endif; ?>
    </div>
</div>
<div class="row">
	<div class="col-md-12">
		 <h2>Popular Loadouts</h2>
		 <span class="line"> <span class="sub-line"></span> </span>
		<div class="row">
		<?php foreach($topLoadoutsPerGame as $game): ?>
		    <div class="col-md-4">
				<a class="loadoutSmall block" href="<?php echo route('showGame', urlencode($game -> id)); ?>">
						<h3 class="weaponSmall theme-color" style="margin: 0px 0 3px 0">
							<?php if(strlen($game -> id) < 17): ?>
							  <?php echo $game -> id; ?>
							<?php else: ?>
							  <?php echo $game -> short_name; ?>
							<?php endif; ?>
							<small class="pull-right" style="margin: 6px 0 0 0">All Loadouts</small>
						</h3>
					<img src="<?php echo $game -> thumb_url; ?>" alt="<?php echo $game -> id; ?>" style="width:100%;" />
		        </a>
				<?php 
		        $loadoutCount = 1;
		        $accordianId = "accordian" . preg_replace("/[\s]/", '', $game -> id);
		        ?>
		        <div class="panel-group" id="<?php echo $accordianId; ?>">
		        <?php foreach($game -> topLoadouts as $loadout): ?>
				    <?php
				    $count = $loadout -> count;
				    $loadout = Loadout::findOrFail($loadout -> id);
				    
				    ?>
				   	<div class="panel">
					    <div class="loadoutSmall" style="margin:0">
					      	<h4 class="panel-title">
					        	<a data-toggle="collapse" data-parent="#<?php echo $accordianId; ?>" href="#collapse<?php echo $loadout -> id; ?>">
				    				<h4 class="weaponSmall theme-color"><?php echo Weapon::findOrFail($loadout -> weapon_id) -> name; ?> <small class="pull-right"> (<?php echo $count; ?> votes)</small></h4> 
				   				</a>
				   			</h4>
				   		</div>
				   		<div id="collapse<?php echo $loadout -> id; ?>" class="panel-collapse collapse <?php if($loadoutCount++ == 1): ?>in<?php endif; ?>">
				    		<a class="loadoutSmall block" href="<?php echo route('showLoadout', array(urlencode($game -> id), urlencode(Weapon::findOrFail($loadout -> weapon_id) -> name), urlencode($loadout ->id))); ?>"> 
					    	<?php foreach($loadout -> attachments as $attachment): ?>
						    <div class="attachmentSmall">
						        <img src="<?php echo asset($attachment -> thumb_url); ?>" alt="<?php echo $attachment -> name; ?>" />
						        <?php echo $attachment -> name; ?>
						    </div> <?php endforeach; ?>
								<div class="row">
									<div class="col-md-12">
										<button class="btn btn-primary pull-right" style="margin: 5px 0 0 0;" href="<?php echo route('showLoadout', array(urlencode($game -> id), urlencode(Weapon::findOrFail($loadout -> weapon_id) -> name), urlencode($loadout ->id))); ?>">
                        					<span class="glyphicon glyphicon-screenshot"></span> View Loadout
                    					</button>
									</div>
								</div>
							</a>
				    	</div>
					</div>
			    <?php endforeach; ?>
		    	</div>
		    </div>
	    <?php endforeach; ?>
		</div>
	</div>
</div>
<div class="row">
    <div class="col-md-8">
        <h2>Site News</h2>
        <span class="line"> <span class="sub-line"></span> </span>
        
        
        
        <?php for($i = 0; $i < 1; $i++): ?>
		<div class="item">
			<h4><a href="<?php echo $items[$i]->get_permalink(); ?>" class="green-a"><?php echo $items[$i]->get_title(); ?></a></h4>
			<p><?php echo $items[$i] -> get_description(); ?></p>
			<p><small>Posted on <?php echo $items[$i]->get_date('j F Y | g:i a'); ?></small></p>
		</div>
        <?php endfor; ?>
        
        
        
        
       <p>View more news on the <a href="http://blog.gameloadouts.com">Game Loadouts Blog</a>.</p>
    </div>
    <?php if(HelperController::adsEnabled()): ?>
	<div class="col-md-4">
		<div class="right-ad-box">
			<style>
				.game-loadouts-responsive-sidebar {
					width: 300px;
					height: 250px;
				}
			</style>
			<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
			<!-- Game Loadouts Responsive Sidebar -->
			<ins class="adsbygoogle game-loadouts-responsive-sidebar"
			style="display:inline-block"
			data-ad-client="ca-pub-9067954073014278"
			data-ad-slot="2846988777"></ins>
			<script>
				( adsbygoogle = window.adsbygoogle || []).push({});
			</script>
		</div>
	</div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<!-- <script type="text/javascript" src="<?php echo asset('rs-plugin/js/jquery.themepunch.plugins.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo asset('rs-plugin/js/jquery.themepunch.revolution.min.js'); ?>"></script> -->
<script type="text/javascript" src="/poll/ajax-poll.php"></script>
<script>

$('#autocomplete-ajax').autocomplete({
    serviceUrl: '/search_weapons',
    onSearchStart: function () {
    	$(this).attr('autocomplete', 'off');
    }
});


$('#autocomplete-ajax').focus(function() {
	$('#autocomplete-ajax').attr('autocomplete', 'off');
});
$(document).ready(function() {
    $('#autocomplete-ajax').attr('autocomplete', 'off');
});

</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>