<?php
	$slug1 = \Request::segment(2);
	$slug2 = \Request::segment(3);
	$slug3 = \Request::segment(4);
	$pageUrl=$slug1.$slug2.$slug3;
	$cmstaticpage="durhamrtdspageabout";
	 
	$menuTextColor=$community->present()->getMenuColor();
	$menuBoxColor=$community->present()->getMenuBackGroundcolor();
?>

<style type="text/css">
	.cmpages-conatiner {
		background-color:inherit;
	}
	
	.preheader{
		display:none;
	}
	
	.change-youtube-vimeo-btn, .change-own-video-btn{
		display:none;	
	}
</style>

@if(Auth::check())
	<style type="text/css">
		.cmpage-description{
			margin-top:11px;	
		}
		
		.additional-page-container{
			padding-top: 1px;
		}
    </style>
@endif
        
@if(!Auth::check())
        <style type="text/css">
            .navbar-nav > li > a{
                color:{{$menuTextColor}};
            }
            
            .nav > li > a:hover, .nav > li > a:focus{
                background-color: {{$menuBoxColor}} !important;
                color:{{$menuTextColor}};
            }
        </style>
        
        @if($page->show_website_footer==0)
            <style type="text/css">
                 .main-footer{
                    display:none; 
                 }
            </style>
        @endif   
        
        @if($homecontents and $homecontents->header_template_view==1)
        	<style type="text/css">
                 #content-container{
                    margin-top: 20px !important;
                 }
            </style>
        @endif
        
        @if($pageUrl!=$cmstaticpage)
            <!--<div class="cmpage-barrier">
                <div class="container">
                    <a href="{{$community->present()->url()}}" class="cmhomelink">HOME</a> /
                    
                    @if($page->show_page_as_menu==0 and $page->menu_id!=0)
                        <?php $menuName=app('App\\Repositories\\CommunityPagesRepository')->getById($page->menu_id);?>
                        @if($menuName)
                            <strong>{{strtoupper($menuName->title)}}</strong>
                        @endif /
                    @endif
                    <a href="{{$community->present()->url('page')}}/{{$page->slug}}" class="cmpagelink"> {{strtoupper($page->title)}}</a>
                </div>    
            </div>-->
        @endif
@endif
   
@if($page->show_default_header==0)
     <style type="text/css">
        #top{
            display:none !important;
        }
		
		*, body, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
		  font-family: 'Source Sans Pro', sans-serif;
		}
		
		body{
			padding-top: 0px;
		}
     </style>	
@endif

<div class="@if($pageUrl!=$cmstaticpage) cmpages-conatiner @else cmcontainerstaticbig @endif">
   
        	@if($page->html_page==0)
            	 <div class="@if($pageUrl!=$cmstaticpage) container @else cmcontainerstatic @endif">
        <!--<h3 class="cmpages-heading">{{strtoupper($page->title)}}</h3>-->
    	
        			<div class="cmpage-description"> 
        				{!! $page->description !!}
                    </div>
                 </div>       
            @else
            
            	@if($page->html_file=="")
                     <link rel="stylesheet" href="{{\URL::to('/')}}/themes/frontend/default/css/htmleditor/bulma.min.css">
                     <link rel="stylesheet" href="{{\URL::to('/')}}/themes/frontend/default/css/htmleditor/style.css">
                     <link rel="stylesheet" href="{{\URL::to('/')}}/themes/frontend/default/css/htmleditor/fontawesome-all.min.css">
				@endif
                
            	<div class="additional-page-container">
        			<div class="cmpage-description @if($page->html_file=="") page-htmleditor @endif"> 
						<?php
                            //$filePath=url('/').'/pagebuilder/pages/show_'.$page->html_file.".html";
                           // $contents=file_get_contents($filePath);
						   
						   $contents=$page->html_code;
                        ?>   
						{!! communityTranslate($community->id,'page-data-'.$page->id,$contents) !!}	
						
                    </div>
    			</div>    
            @endif    
    	
</div>    
    
@if(!Auth::check())
	<script language="javascript">
        $(document).ready(function(){
            $(".navbar-collapse .navbar-right .cmpage-{{$page->slug}} a").css({"background-color":"{{$menuBoxColor}}","color":"{{$menuTextColor}}"});
			
			$(".navbar-collapse .navbar-right .cmpage-{{$page->slug}} a").addClass('active_menu');
			
			$(".ovrllay-page .current-page-name").show();
			$(".ovrllay-page .current-page-name").html("{{$page->title}}");
        });
    </script>
@endif        
