2012-11-28 09:27:23 +00:00
|
|
|
|
2012-12-05 05:46:10 +00:00
|
|
|
|
|
|
|
<div class="wrapper">
|
|
|
|
<div id="toolbar">
|
|
|
|
<div class="filter fn">
|
|
|
|
<span class="label">Price</span>
|
|
|
|
<div class="drop-menu ui">
|
|
|
|
<a href="" class="controller">
|
|
|
|
<span class="option-default">All</span>
|
|
|
|
<span class="arrow down"></span>
|
|
|
|
</a>
|
|
|
|
<ul class="option-list">
|
|
|
|
<li><a class="option-item" href="">All</a></li>
|
|
|
|
<li><a class="option-item" href="">15,000</a></li>
|
|
|
|
<li><a class="option-item" href="">20,000</a></li>
|
|
|
|
<li><a class="option-item" href="">25,000</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2014-01-06 06:47:44 +00:00
|
|
|
|
2012-12-05 05:46:10 +00:00
|
|
|
<div class="filter fn">
|
|
|
|
<span class="label">Category</span>
|
|
|
|
<div class="drop-menu ui">
|
|
|
|
<a href="" class="controller">
|
|
|
|
<span class="option-default">All</span>
|
|
|
|
<span class="arrow down"></span>
|
|
|
|
</a>
|
|
|
|
<ul class="option-list">
|
|
|
|
<li><a class="option-item" href="">All</a></li>
|
|
|
|
<li><a class="option-item" href="">National Taiwan University</a></li>
|
|
|
|
<li><a class="option-item" href="">Category 1</a></li>
|
|
|
|
<li><a class="option-item" href="">Category 2</a></li>
|
|
|
|
<li><a class="option-item" href="">Category 3</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="filter fn">
|
|
|
|
<span class="label">Sort by</span>
|
|
|
|
<div class="drop-menu ui">
|
|
|
|
<a href="" class="controller">
|
|
|
|
<span class="option-default">Date</span>
|
|
|
|
<span class="arrow down"></span>
|
2012-11-28 09:27:23 +00:00
|
|
|
</a>
|
2012-12-05 05:46:10 +00:00
|
|
|
<ul class="option-list">
|
|
|
|
<li><a class="option-item" href="">Date</a></li>
|
|
|
|
<li><a class="option-item" href="">Popular</a></li>
|
|
|
|
<li><a class="option-item" href="">Recent Upload</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="item-list">
|
|
|
|
<ul class="clearfix">
|
2012-12-06 15:20:27 +00:00
|
|
|
<% @templates.each do |template| %>
|
|
|
|
<li>
|
2014-01-06 06:47:44 +00:00
|
|
|
<a href="<%= admin_template_store_template_path(template["_slugs"][0]) %>">
|
|
|
|
<img src="<%= @store + template['preview']['preview']['thumb']['url'] %>" class="item-thumb" />
|
|
|
|
<span class="item-info">
|
2012-12-06 15:20:27 +00:00
|
|
|
<b class="item-name"><%= template['title'] %></b>
|
|
|
|
<span class="item-price">Free</span>
|
|
|
|
</span>
|
2014-01-06 06:47:44 +00:00
|
|
|
</a>
|
2014-01-23 21:01:21 +00:00
|
|
|
<% if @design_ids.include?(template["_id"]["$oid"]) %>
|
|
|
|
<%= link_to "Installed", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-success download-link', "disabled"=>"disabled", "data-name"=>template['title'], "data-slug"=>template["_slugs"][0], "data-id"=>template["_id"]["$oid"] %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to "Download", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-primary download-link', "data-name"=>template['title'], "data-slug"=>template["_slugs"][0], "data-id"=>template["_id"]["$oid"] %>
|
|
|
|
<% end %>
|
2012-12-06 15:20:27 +00:00
|
|
|
</li>
|
|
|
|
<% end %>
|
2014-01-06 06:47:44 +00:00
|
|
|
|
2012-12-05 05:46:10 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2012-11-28 09:27:23 +00:00
|
|
|
</div>
|
2012-11-28 18:02:37 +00:00
|
|
|
|
2014-01-06 06:47:44 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
(function(){
|
|
|
|
$("a.download-link").on(clickEvent,function(){
|
2014-01-23 21:01:21 +00:00
|
|
|
if($(this).attr("disabled") == "disabled")return false;
|
|
|
|
var el = $(this);
|
2014-01-06 06:47:44 +00:00
|
|
|
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
|
|
|
$.ajax({
|
|
|
|
url : "<%= admin_template_store_download_theme_path %>",
|
2014-01-23 21:01:21 +00:00
|
|
|
data : el.data(),
|
2014-01-06 06:47:44 +00:00
|
|
|
dataType : "json",
|
2014-01-23 21:01:21 +00:00
|
|
|
type : "post"
|
|
|
|
}).done(function(data){
|
|
|
|
if(data.success){
|
2014-01-06 06:47:44 +00:00
|
|
|
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
|
|
|
}
|
2014-01-23 21:01:21 +00:00
|
|
|
}).fail(function(){
|
|
|
|
el.removeClass('btn-info').addClass('btn-danger').text("Error, please try again.").removeAttr('disabled');
|
2014-01-06 06:47:44 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})()
|
|
|
|
</script>
|