Subversion Repositories SmartDukaan

Rev

Rev 24072 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<style>
        .table-striped > tbody > tr:nth-child(odd) > td{
                background: white;
                background-color: white;
        }
        .table-striped > tbody > tr:nth-child(even) > td{
                background: white;
                background-color:white;
        }
        .table-striped > tbody > tr:hover > td,
        .table-striped > tbody > tr:hover {
                background-color: #e98c8f;
                color:white;
        }
        .btn:hover{
                color: grey;
                text-decoration: none;
        }
        .btn-primary:hover{
                color: grey;
                text-decoration: none;
        }
        .vendor-details{
                cursor:pointer;
        }
</style>

<script>
        configureVendorsDropDown();
</script>

<section class="wrapper">            
        <div class="row">
                <div class="col-lg-12">
                        <h3 class="page-header"><i class="icon_document_alt"></i>ITEM</h3>
                        <ol class="breadcrumb">
                                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                                <li><i class="icon_document_alt"></i>ITEMS</li>                                                 
                        </ol>
                </div>
        </div>
        <div>
                <form id="create-item-form">
                        <div class = "row">
                                <div class="col-lg-3 form-group">
                                        <select class="form-control input-sm" id = "vendors" name = "vendors" placeholder="Vendors">
                                                <option value="" disabled selected>Vendors</option>
                                                #foreach($vendor in $vendors)
                                                <option value="$vendor.getId()">$vendor.getName()</option>
                                        #end
                                </select>
                                </div>
                                <div class="col-lg-2 form-group">
                                        <input placeholder="Brand" id="itemBrand" name="itemBrand" type="text" value="" class="form-control input-sm">
                                </div>
                                <div class="col-lg-2 form-group">
                                        <input placeholder="Description" id="description" name="description" type="text" value="" class="form-control input-sm">
                                </div>
                                <div class="col-lg-2 form-group">
                                        <select class="form-control input-sm" id = "types" name = "types" placeholder="Types">
                                                <option value="" disabled selected>Types</option>
                                                #foreach($type in $types)
                                                <option value="$type">$type</option>
                                        #end
                                </select>
                                </div>
                                <div class="col-lg-1 form-group">
                                        <input placeholder="Price" id="price" name="price" type="number" value="0" class="form-control input-sm">
                                </div>
                                <div class="col-lg-2 form-group">
                                        <input class="btn btn-primary" type="submit" value="Create Item">       
                                </div>
                        </div>
                </form>
        </div>
        <div id="items-table">
                <div class="row">
                <div class="col-lg-12">
                        <table class="table table-striped table-advance table-hover">
                                <tbody>
                                        <tr>
                                                <th>Vendor Name</th>
                                                <th>Brand</th>
                                                <th>Description</th>
                                                <th>Type</th>
                                                <th>Price</th>
                                                <th>Created On</th>
                                        </tr>
                                        #if(!$items.isEmpty())
                                                #foreach( $item in $items )
                                                        <tr class="item-details" data="$item.getId()">
                                                                <td>$vendorIdNameMap.get($item.getVendorId())</td>
                                                                <td>$item.getBrand()</td>
                                                                <td>$item.getDescription()</td>
                                                                <td>$item.getType()</td>
                                                                <td>$item.getPrice()</td>
                                                                <td>$item.getFormattedCreateTimestamp()</td>
                                                        </tr>
                                                #end
                                        #else
                                                <tr>
                                                        <td colspan="6" style="text-align:center;">NO MATCHING DATA FOUND FOR CRITERIA</td>
                                                </tr>
                                        #end
                                </tbody>
                        </table>
                </div>
            </div>
    </div>
    #if(!$items.isEmpty())
        <div class="row" id="items-paginated">
                <div class="col-lg-9">
                        <p>Showing <span class="start">$start</span> to <span class="end">$end</span> of <span class="size">$size</span> items</p>
                </div>
                <div class="col-lg-3" style="text-align:right;">
                                <div class="btn-group" style="width:40%">
                                        <button class="btn btn-primary previous" disabled="disabled" style="width:100%">Previous</button>
                                </div>
                                <div class="btn-group" style="width:40%">
                                        #if($end >= $size)
                                                <button class="btn btn-primary next" style="width:100%" disabled="disabled">Next</button>
                                        #else
                                                <button class="btn btn-primary next" style="width:100%">Next</button>
                                        #end
                                </div>
                </div>
            </div>
    #end
</section>
<div id="item-details-container" style="background:white;background-color:white;">
</div>
<script type="text/javascript" src="resources/js/create-item.js?v=${version}"></script>