@(message: String,books : List[models.Book], conditions : List[models.Condition],
requests : List[models.CurrentRequest], bookSelected : Long , price : String ,conditionSelected : Long )
@implicitFieldConstructor = @{ helper.FieldConstructor(twitterBootstrapInput.render) }

@main("My Requests") {
    
    
   <div class="container">
  <div class="row main-features">
    <br>
    <div class="span7">
      <div class="well">
        <h3>Create a Book Request</h3>
        @helper.form(action = routes.CurrentRequest.newRequest()) {
        
        <div class="span2">
          <span class="label label-inverse">Book </span> 
        </div>
         <div class="span4">
          
          <select name="bookKey" name="bookKey" >
            @for(book <- books) {
             <option value=@book.getPrimaryKey() 
              @if(bookSelected == book.getPrimaryKey()){selected}>@book.getTitle()</option>
             }
           
          </select>
        
        </div>
         <table class="table table-condensed table-striped">
          <thead>
            <tr>
              
              <th>
                <span class="label label-info">Version </span> 
              </th>
              <th>
                <span class="label label-info">ISBN </span> 
              </th>
              <th>
                <span class="label label-info">Bookstore Price </span> 
              </th>
              <th>
                <span class="label label-info">Cover </span> 
              </th>
              <th></th>
            </tr>
          </thead>
          
          <tbody>
            <tr>
               @for(book <- books) {
               @if(bookSelected == book.getPrimaryKey()){ 
              <td>
                <label>
                  <b>@book.getEdition()</b> 
                </label>
              </td>
              <td>
                <label>
                  <b>@book.getIsbn()</b> 
                </label>
              </td>
              <td>
                <label>
                  <b>@book.getBookStorePrice()</b> 
                </label>
              </td>
              <td>
                 <img src="http://covers.openlibrary.org/b/isbn/@book.getIsbn()-S.jpg"> 
              </td>
              
              }}
            </tr>
            
          </tbody>
        </table>
        
         <div class="span2">
          <span class="label label-inverse">Condition</span> 
        </div>
         <div class="span4">
           <select name="conditionKey">
          @for(condition <- conditions) {
            <option @if(conditionSelected == condition.getPrimaryKey()){ selected } 
            value=@condition.getPrimaryKey()>@condition.getName()</option>
          }
           </select>
        </div>
        <div class="span2">
          <span class="label label-inverse">Price</span> 
        </div>
         <div class="span3">
          <input name="price" type="text" value="@price" class="input-medium"> <br>
        <br>
         
        
        </div>        
          
          <br>
          <br>
         
      
        
        <div class="span5">
            <input type="submit" class="btn btn-primary btn-large btn-block" id="newRequest" value="Create New Request" />
        </div>
        }
        <br>
        <br> 
        <br>
        <br>
        <br>
        <br>
        <br>   
      </div>
    </div> 
    <div class="span7">
    <p>
    @message
    </p>
    </div>
    <div class="span7">
     <table class="table table-condensed table-striped">
        <thead>
          <tr>
            <th>
              <span class="label label-info">Book </span> 
            </th>
            <th>
              <span class="label label-info">Condition </span> 
            </th>
            <th>
              <span class="label label-info">Request Price </span> 
            </th>
            <th></th>
          </tr>
        </thead>
        <tbody>
         @for(request <- requests) {
         <tr>
            <td>
              @request.getBook().getTitle()
            </td>
            
            <td>
               @request.getCondition().getName()
            </td>
            <td>
              <input type="text" value=@request.getPrice() class="input-medium"> 
            </td>
            <td>
              <div class="btn-group">
                <a class="btn btn-small btn-primary">Update</a>
               
              </div>
            </td>
          </tr>
         
            
            } 
        
          
          
        </tbody>
      </table>
      @if(requests.size() ==0){ No Current Requests}
      
    
       
    </div>
  </div>
</div>
}
 