2012-12-06 15:20:27 +00:00
<% if @template %>
<div class="wrapper">
<div id="toolbar">
<div class="fn"><a class="ui btn" href="/admin/template_store">Back to Store</a></div>
</div>
<div id="content" class="clearfix">
<div class="side">
<div id="item-info">
2014-01-06 06:47:44 +00:00
<%= image_tag "#{@store}#{@template['preview']['preview']['thumb']['url']}", :class => "item-thumb" %>
2012-12-06 15:20:27 +00:00
<h2 class="item-name"><%= @template['title'] %></h2>
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
<ul class="item-extra-info">
2012-12-07 01:07:49 +00:00
<li><span class="title">views</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
<!-- <li><span class="title">color</span><span class="color-tag green"></span></li> -->
2012-12-06 15:20:27 +00:00
</ul>
</div>
</div>
<div class="main clearfix">
<h3>description</h3>
2014-01-06 06:47:44 +00:00
<div id="desc-holder" class="paragraph"><%#= @template['intro'] %></div>
2012-12-06 15:20:27 +00:00
<h3>screen shot</h3>
<div id="screen-shot">
<div class="holder">
2014-01-06 06:47:44 +00:00
2012-12-06 15:20:27 +00:00
</div>
</div>
2012-12-05 05:46:10 +00:00
</div>
2012-11-28 18:02:37 +00:00
</div>
2012-12-06 15:20:27 +00:00
</div>
<% else %>
<div class="wrapper">
<div id="toolbar">
<div class="fn"><a class="ui btn" href="/admin/template_store">Back to Store</a></div>
</div>
<div id="content" class="clearfix">
<div class="side">
<div id="item-info">
2012-12-06 18:37:05 +00:00
<img src="/assets/template/thumb/tb<%= params[:t] %>.jpg" alt="" class="item-thumb">
2012-12-06 15:20:27 +00:00
<h2 class="item-name">Template Name</h2>
<a id="download" href="">free download</a>
<ul class="item-extra-info">
2012-12-07 01:07:49 +00:00
<li><span class="title">views</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
<!-- <li><span class="title">color</span><span class="color-tag green"></span></li> -->
2012-12-06 15:20:27 +00:00
</ul>
</div>
</div>
<div class="main clearfix">
<h3>description</h3>
<div id="desc-holder" class="paragraph">Pixel Union’ s Jitensha defines storefront minimalism. Japanese for “bicycle,” Jitensha offers clean typography and easy usability, including full color, font, logo, and footer customization. With its painless social media and blog integration, Jitensha gorgeously accomodates every aspect of your business. Any questions before you launch? Don’ t hesitate to email us: Support@PixelUnion.net.</div>
<h3>screen shot</h3>
<div id="screen-shot">
<div class="holder">
<img src="" alt="Thumbnail 1" class="preview item-thumb">
<img src="" alt="Thumbnail 2" class="preview item-thumb">
<img src="" alt="Thumbnail 3" class="preview item-thumb">
<img src="" alt="Thumbnail 4" class="preview item-thumb">
<img src="" alt="Thumbnail 5" class="preview item-thumb">
</div>
2012-11-28 18:02:37 +00:00
</div>
</div>
2012-12-05 05:46:10 +00:00
</div>
2012-11-28 18:02:37 +00:00
</div>
2014-01-06 06:47:44 +00:00
<% end %>
<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>
2014-01-23 21:01:21 +00:00