<!DOCTYPE html>
<!-- This is a complete example of an image gallery -->

<html lang="en">
  <head>
    <!-- use the head section to define meta data and load css and js files -->

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Gallery</title>

    <script src="js/jquery-2.2.2.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/handlebars-v3.0.3.js"></script>
    
    <!-- 
      These are our javascript files.
      Albums.js contains the data
      gallery.js is the code
    -->
    <script src="js/Albums.js"> </script>
    <script src="js/gallery.js"> </script>

    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/gallery.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

  </head>
  <body>

    <div class="container">

      <!-- page tile -->
      <div class="page-header">
        <h1>My photo albums </h1>
      </div>    

      <!-- A navigation menu that selects different views -->
      <ul class="nav nav-tabs">
            <li role="" class="active"><a href="#" id="albums-tab" >Albums</a></li>
            <li role=""><a href="#" id="photos-tab" >Photos</a></li>
            <li role=""><a href="#" id="slideshow-tab" >Slideshow</a></li>
          </ul>
      <br/><br/>


      <!-- the content section is empty as we will fill it 
            via javascript and templates -->
      <div id="content"  class="container-fluid"  role="main">
      </div>
  </div> <!-- / container -->

<!-- Here are our Templates -->


<!-- this is the template for the albums view -->
<!-- 
    it displays the albums in a bootstrap grid format
    with one item for each album (using the {{#each}} template expression. 
    Each album is displayed with a thumbnail image, a name and 
    the number of photos (using the {{photos.length}} template expression, see my lecture for more details)
-->
<script id="albums-template" type="text/x-handlebars-template">
  <div class="row">

    {{#each albums}}
    <div class="col-xs-12 col-md-3"> 
        <div class="album-thumbnail"  data-id="{{@index}}">
          <img class="crop-img" src="{{thumbnail}}" alt=""/> 
            
          <div class="caption">
              <h4> {{name}} </h4>
              <p>{{photos.length}} photos</p>
          </div>
         </div>
    </div> <!-- / col -->

    {{/each}}

  </div> <!-- / row -->
</script>

<!-- this is the template for the photos view of a single album -->
<!-- 
    like albums view it uses a bootstrap grid format to display the photos in an album
    
    Each photos is displayed with anumbnail image, a name and 
    a description
-->
<script id="photos-template" type="text/x-handlebars-template">
  <div class="row">
    <!-- xs-12 : small display shows a single column (taking up 12 grid columns)-->
    <!-- md-3 : medium and up displays use 3 grid columns per column -->

    {{#each photos}}
    <div class="col-xs-12 col-md-3"> 
     <div class="photo-thumbnail"  data-id="{{@index}}">
        <img class="crop-img" src="{{src}}" alt=""/> 
          
         <div class="caption">
            <h3>{{title}}</h3>
            <p>{{description}}</p>
         </div>
      </div>
       
    </div> <!-- / col -->
    {{/each}}

  </div> <!-- / row -->
</script>

<!-- this is the template for the view a single photo -->
<!-- 
    It is displayed as a large image with title and description
-->
<script id="photo-template" type="text/x-handlebars-template">
  <div class="row">
    <div class="col-xs-12 col-md-12"> 
        <img class="large-img" src="{{src}}" alt=""/> 
          
        <div class="caption">
            <h3>{{title}}</h3>
            <p>{{description}}</p>
        </div>
      </div> <!-- / col -->

  </div> <!-- / row -->
</script>

<!-- this is the template for the slideshow view of a single album -->
<!-- 
    It uses the carousel view, which is quite complex, see my lecture for details
-->
<script id="slideshow-template" type="text/x-handlebars-template">
  <div class="row">
    <div class="col-md-6">

      <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">

        <ol class="carousel-indicators">
          <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
          <li data-target="#carousel-example-generic" data-slide-to="1"></li>
          <li data-target="#carousel-example-generic" data-slide-to="2"></li>
        </ol>

  
       <!-- Wrapper for slides -->
        <div class="carousel-inner" role="listbox">

          {{#each photos}}
            <div class="item {{#if @first}}active{{/if}}">
             <img class="carousel-img" src="{{src}}" alt=""/> 
            <div class="carousel-caption">
              Image caption
            </div>
          </div> <!-- / carousel item -->
          {{/each}}

        </div>

        <!-- 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>

    </div> <!-- / carousel --> 
  </div> <!-- / col -->
</div> <!-- / row -->
</script>







  </body>
</html>