This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/admin/template_store/index.html.erb

96 lines
3.8 KiB
Plaintext
Raw Normal View History

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>
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">
<% @templates.each do |template| %>
<li>
<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">
<b class="item-name"><%= template['title'] %></b>
<span class="item-price">Free</span>
</span>
</a>
<% 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 %>
</li>
<% end %>
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
<script type="text/javascript">
(function(){
$("a.download-link").on(clickEvent,function(){
if($(this).attr("disabled") == "disabled")return false;
var el = $(this);
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
$.ajax({
url : "<%= admin_template_store_download_theme_path %>",
data : el.data(),
dataType : "json",
type : "post"
}).done(function(data){
if(data.success){
el.removeClass('btn-info').addClass('btn-success').text("Installed");
}
}).fail(function(){
el.removeClass('btn-info').addClass('btn-danger').text("Error, please try again.").removeAttr('disabled');
})
})
})()
</script>