144 lines
2.9 KiB
Plaintext
144 lines
2.9 KiB
Plaintext
|
<style type="text/css">
|
||
|
.color-bar {
|
||
|
margin: 0px;
|
||
|
padding: 0px;
|
||
|
}
|
||
|
.color-bar .color{
|
||
|
display: inline-block;
|
||
|
width: 30px;
|
||
|
height: 10px;
|
||
|
margin: 0px;
|
||
|
padding: 0px;
|
||
|
}
|
||
|
.tag-bar {
|
||
|
margin: 0px;
|
||
|
padding: 0px;
|
||
|
}
|
||
|
.tag-bar .tag{
|
||
|
display: inline-block;
|
||
|
}
|
||
|
.template-info{
|
||
|
width: 100%;
|
||
|
font-size: 15px;
|
||
|
line-height: 25px;
|
||
|
}
|
||
|
.template-info th{
|
||
|
width: 30%;
|
||
|
text-align: left;
|
||
|
}
|
||
|
.template-info tr {
|
||
|
padding : 10px 0;
|
||
|
}
|
||
|
.template-preview{
|
||
|
margin-left: 0;
|
||
|
margin-top: 5px;
|
||
|
}
|
||
|
.template-preview li{
|
||
|
display: inline-block;
|
||
|
}
|
||
|
.template-preview img{
|
||
|
width: 100px;
|
||
|
}
|
||
|
</style>
|
||
|
<table class="template-info">
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<th>Template Number</th>
|
||
|
<td><%= @template.uid %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Created On</th>
|
||
|
<td><%= @template.created_at.strftime("%Y-%m-%d") %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Author</th>
|
||
|
<td><%= User.find(@template.user_id).name rescue "Deleted User" %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Category</th>
|
||
|
<td><%= @template.category.title rescue "" %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Description</th>
|
||
|
<td><%= @template.description %></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Price</th>
|
||
|
<td><%= @template.price %> NTD.</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Published</th>
|
||
|
<td>
|
||
|
<% if @template.allowed %>
|
||
|
<span class="label label-success">Published</span>
|
||
|
<% else %>
|
||
|
<span class="label label-important">Not Published</span>
|
||
|
<% end %>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Sold</th>
|
||
|
<td>
|
||
|
<% if @template.sold %>
|
||
|
<span class="label label-warning">Sold</span>
|
||
|
<% else %>
|
||
|
<span class="label label-info">Not Sold</span>
|
||
|
<% end %>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Colors</th>
|
||
|
<td>
|
||
|
<ul class="color-bar clearfix">
|
||
|
<% @template.colors.each do |color| %>
|
||
|
<li class="color" style="background-color: #<%= color %>"></li>
|
||
|
<% end %>
|
||
|
</ul>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Colors</th>
|
||
|
<td>
|
||
|
<ul class="tag-bar clearfix">
|
||
|
<% @template.tags.each do |tag| %>
|
||
|
<li class="tag"><span class="label label-default"><%= tag.name %></span></li>
|
||
|
<% end %>
|
||
|
</ul>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Preview</th>
|
||
|
<td>
|
||
|
<% if @template.template_image_files.empty? %>
|
||
|
No preview available.
|
||
|
<% else %>
|
||
|
<ul class="template-preview">
|
||
|
<% @template.template_image_files.each do |image| %>
|
||
|
<li><a href="<%= image.image_file.url %>" target="_blank"><img src="<%= image.image_file.url %>" alt=""></a></li>
|
||
|
<% end %>
|
||
|
</ul>
|
||
|
<% end %>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>PSD</th>
|
||
|
<td>
|
||
|
<% if @template.template_psd_file.nil? %>
|
||
|
No PSD available.
|
||
|
<% else %>
|
||
|
<a href="<%= @template.template_psd_file.psd_zip.url %>">Download PSD</a>
|
||
|
<% end %>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>Template Zip</th>
|
||
|
<td>
|
||
|
<% if @template.template_zip.nil? || @template.template_zip.url.nil? %>
|
||
|
No template available.
|
||
|
<% else %>
|
||
|
<a href="<%= @template.template_zip.url %>">Download Template</a>
|
||
|
<% end %>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|