@extends('theme::template')

@section('banner')
	<div class="nbanner" {{ inject('visual')->url('ad', 4) }} data-position-top="80px">
		<img src="{{ inject('ad')->single(4, 2, 'img') }}" alt="{{ inject('ad')->single(4, 2, 'title') }}">
	</div>
@stop

@section('anchor')
	<div id="anchor">
		<div class="max-all clearfix">
			<span class="anchor">
				<a href="{{ url('/') }}">{{ inject('setting')->langs('system', 'home') }}</a> > 
				<a href="{{ url('/news') }}">{{ inject('setting')->langs('web', 'news_center') }}</a> > 
				<a href="{{ url('/news/'.$news->cates->slug) }}">{{ $news->cates->description->cname }}</a>
			</span>
		</div>
	</div>
@stop

@section('left')
<div class="hidden-xs hidden-sm">
	<h3 class="left-title">{{ inject('setting')->langs('web', 'news_center') }}</h3>
	<ul class="p_c_content mb-20" {{ inject('visual')->url('news-cate') }}>
		@foreach (inject('category')->cate('news') as $value)
			<li data-id="{{ $news->cates->id }}" data-value-id="{{ $value->id }}" @if($value->id == $rootId ) class="active" @endif>
				<div class="p_c_title1">
					<a href="{{ $value->present()->url('news') }}" title="{{ $value->description->cname }}">
						<span>{{ $value->description->cname }}</span>
					</a>
					@if(!$value->children->isEmpty())
					<span class="p_arrbtm"></span>
					@endif
				</div>

				@if(!$value->children->isEmpty())
				<ul class="deep-2">
					@foreach ($value->children as $val)
						<li>
							<div class="p_c_title2 {{ $val->slug == $news->cates->slug ? 'active' : ''}}">
								<a href="{{ $val->present()->url('news') }}"><span>{{ $val->description->cname }}</span></a>
							</div>
						</li>
					@endforeach
				</ul>
				@endif
			</li>
		@endforeach
	</ul>
</div>


<div class="page-wrap-left xymob-menu-click">
    <div class="xymob-left-close-btn"><i class="icon-font icon-close"></i></div>
    <div class="xypg-left">
        <div class="xypg-left-box xypg-left-menu">
            <div class="xypg-left-title">
                <h3>{{ inject('setting')->langs('web', 'news_center') }}</h3>
            </div>
            <div class="xypg-left-con">
                <ul class="xypg-left-nav" {{ inject('visual')->url('news-cate') }}>
					@foreach (inject('category')->cate('news') as $value)
                    <li>
                        <a href="{{ $value->present()->url('news') }}" title="{{ $value->cname }}">{{ $value->cname }}</a>
                        <div class="first-nav-btn"></div>
						@if(!$value->children->isEmpty())
						<ul class="xypg-left-subnav">
							@foreach ($value->children as $val)
							<li><a href="{{ $val->present()->url('news') }}">{{ $val->cname }}</a></li>
							@endforeach
						</ul>
						@endif
                    </li>
					@endforeach
                </ul>
            </div>
        </div>
        
    </div>
</div>

<div class="page-mob-tool">
    <ul>
        <li class="xymob-page-navbtn"><span></span></li>
        <li class="xymob-page-backtop"><i class="icon-font icon-top"></i></li>
    </ul>
</div>

@include('theme::common.left_side')
@stop

@section('right')
<div class="news-detail" {{ inject('visual')->url('news', $news) }}>
	<h1 class="title">
		{{ $news->description->title or '' }}
		<div class="time-text">{{ $news->created_at }}</div>
	</h1>
	<div class="content no-border">
    	{!! contentTag($news->description->content) !!}
    </div>
	<div class="tags-list-detail">
		<span>{{ inject('setting')->langs('system', 'related_labels') }}：</span>
		@foreach ($tags as $value)
		<a href="{{ url('/tag/'.$value->slug) }}">{{ $value->description->name or $value->name }}</a>
		@endforeach
	</div>
	<ul id="page-next-prev">
		<li>
			<span>{{ inject('setting')->langs('system', 'previous') }}：</span>
			{!! inject('list')->pageNextPrev('news', $news->pid, $news->id, 'prev') !!}
		</li>
		<li>
			<span>{{ inject('setting')->langs('system', 'next') }}：</span>
			{!! inject('list')->pageNextPrev('news', $news->pid, $news->id, 'next') !!}
		</li>
	</ul>
</div>
@include('theme::common.comment', ['model_type' => 'news', 'model_id' => $news->id])
@stop

