@extends('principal::master')


@section('title')
	Blog
@stop

@section('content')
<div class="container new-container">
  <h1 class="title">{{ $new->title }}</h1>
  <p class=date>{{ $new->humanDate }}</p>

      
  @if(count($gallery) > 0)
  <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">
      @foreach($gallery as $key => $item)
        <div class="item {{ $key == 0 ? 'active' : '' }}">
          @if($item->type == 'video')
            <div class="embed-responsive embed-responsive-16by9">
              <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/{{ $item->resource }}"></iframe>
            </div>
          @else
            <img class="img-responsive" src="{{ $item->resource }}" alt="">
            <div class="carousel-caption">
              {{ $item->title }}
            </div>
          @endif
        </div>
      @endforeach

    <!-- Controls -->
    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
      <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
      <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
      <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
      <span class="sr-only">Next</span>
    </a>
  </div>
  @else
    <img class="img-responsive" src="{{ asset($new->intro_image) }}">
  @endif
  <hr>
  <ol class="breadcrumb">
    <li><a href="{{ route('home') }}">Inicio</a></li>
    <li><a href="{{ route('news') }}">Blog</a></li>
    <li class="active">{{ $new->title }}</li>
  </ol>
  {{ $new->full_text }}
</div>
@stop