Skip to content

Instantly share code, notes, and snippets.

@l02162010
Created June 1, 2016 05:19
Show Gist options
  • Save l02162010/f19ee0254d89bc32342f65f31c1db80e to your computer and use it in GitHub Desktop.
Save l02162010/f19ee0254d89bc32342f65f31c1db80e to your computer and use it in GitHub Desktop.
<% items.forEach(function(item) { %>
<tr>
<td width="200px">
<% if(item.photo) { %>
<img src="/photo/<%- item.photo %>" style="width: 100%; max-height: 100px;">
<% } else { %>
<img src="/img/default.jpg" style="width: 100%; max-height: 100px;">
<% } %>
<input type="file" name="photo">
</td>
<td>
<select class="form-control" name="type"> 
<option selected><%- item.type %></option>
<option>特餐</option>
<option>飯類</option>
<option>麵食</option>
<option>水餃</option>
<option>炸物</option>
<option>湯類</option>
<option>飲料</option>
</select>
</td>
<td>
<input type="text" name="name" class="form-control" value="<%- item.name %>" required>
</td>
<td>
<div class="form-group form-inline">
<label>Big</label>
<input type="number" name="priceBig" class="form-control" value="<%- item.price.big %>"
required>
</div>
<div class="form-group form-inline">
<label>Small</label>
<input type="number" name="priceSmall" class="form-control"
value="<%- item.price.small %>" required>
</div>
</td>
<td>
<div class="btn-group">
<button class="btn btn-default update" type="button" data-id="<%- item.id %>">
UPDATE
</button>
<button class="btn btn-danger delete" type="button" data-id="<%- item.id %>">
DELETE
</button>
</div>
</td>
</tr>
<% }) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment