2014-01-16 10:15:00 +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">
<%= image_tag "#{@store}#{@template['preview']['preview']['thumb']['url']}", :class => "item-thumb" %>
<h2 class="item-name"><%= @template['title'] %></h2>
2014-01-29 04:33:09 +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 %>
2014-01-16 10:15:00 +00:00
<ul class="item-extra-info">
<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> -->
</ul>
</div>
</div>
<div class="main clearfix">
<h3>description</h3>
<div id="desc-holder" class="paragraph"><%#= @template['intro'] %></div>
<h3>screen shot</h3>
<div id="screen-shot">
<div class="holder">
</div>
</div>
</div>
</div>
</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">
<img src="/assets/template/thumb/tb<%= params[:t] %>.jpg" alt="" class="item-thumb">
<h2 class="item-name">Template Name</h2>
<a id="download" href="">free download</a>
<ul class="item-extra-info">
<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> -->
</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>
</div>
</div>
</div>
</div>
<% end %>
<script type="text/javascript">
(function(){
$("a.download-link").on(clickEvent,function(){
2014-01-29 04:33:09 +00:00
if($(this).attr("disabled") == "disabled")return false;
var el = $(this);
2014-01-16 10:15:00 +00:00
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
$.ajax({
url : "<%= admin_template_store_download_theme_path %>",
2014-01-29 04:33:09 +00:00
data : el.data(),
2014-01-16 10:15:00 +00:00
dataType : "json",
2014-01-29 04:33:09 +00:00
type : "post"
}).done(function(data){
if(data.success){
2014-01-16 10:15:00 +00:00
el.removeClass('btn-info').addClass('btn-success').text("Installed");
}
2014-01-29 04:33:09 +00:00
}).fail(function(){
el.removeClass('btn-info').addClass('btn-danger').text("Error, please try again.").removeAttr('disabled');
2014-01-16 10:15:00 +00:00
})
})
})()
</script>
2014-01-29 04:33:09 +00:00