theme.blade.php 1.57 KB
<?php

$themes = explode(",",env('themes'));

if($userCurrentTheme != ""){
	if(!in_array($userCurrentTheme, $themes)){$userCurrentTheme = "Default";}
}else{ $userCurrentTheme = "Default"; }

?>

@if(isset($response))
	<script>
		simpleNotification("{{ $response['type'] }}","topRight","{{ $response['message'] }}");
		@if($response['type'] == "success")
			setTimeout(function(){ window.location.reload(); }, 1000);
		@endif
	</script>
@endif

<h4>Select Theme <span class="pull-right"><small>Current Theme - </small>{{ $userCurrentTheme }}</span></h4>
<hr style="margin-bottom: 10px;">

<div class="row">
	@foreach($themes as $theme)
	<div class="col-sm-3">
		<div class="themeBox" style="{{ $theme == $userCurrentTheme ? 'border:1px solid #f30;background-color: #ffe9e9' : '' }}">
			<h4>{{ $theme }}
				@if($theme == $userCurrentTheme)
					<span class="pull-right label label-primary btn-xs">Current Theme</span>
				@else
					<button class="pull-right btn btn-success btn-xs" onclick="changeTheme('{{ $theme }}');return false;">Select Theme</button>
				@endif
			</h4>
			<hr style="margin-top: 10px;margin-bottom: 5px;">
			<div class="text-center">
				<img src="{{ URL::to('assets/themes/'.$theme.'.png') }}" class="img-responsive" alt="" />		
			</div>
		</div>
	</div>
	@endforeach
</div>

<style>
	.themeBox{margin: 10px;padding: 10px !important;border:1px solid #eee;border-radius: 5px;}
	.themeBox:hover{background-color: #eee;}
</style>

<script type="text/javascript">
	function changeTheme(value){
		doAjax('setting/theme?name='+value,'','settingThemeArea','','singlethis','GET');
	}
</script>