%meta{:charset => "UTF-8"} %title=h title %link{:href => "http://ssig33.com/common.css", :media => "screen", :rel => "stylesheet", :type => "text/css"} %meta{:name => "viewport", :content => "width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"} %link{:href => '/feed', :rel => 'alternate', :title => 'feed', :type => "application/rss+xml"} %script{:src => "https://code.jquery.com/jquery-3.1.0.min.js"} %script{:src => "/search.coffee"} %div#all ~@page.html(request) %hr %h4 Site Search %div %input#search #search_area -if Page.where(name: @page.name).order('id desc').count > 1 %h4 Update History of this content %div %ul -Page.where(name: @page.name).order('id desc').each_with_index do |p,i| %li.history - if i == 0 -if @page.id == p.id %a{href: "/#{URI.encode(@page.name)}"} %b #{p.created_at.gmtime} (Latest) -else %a{href: "/#{URI.encode(@page.name)}"} #{p.created_at.gmtime} (Latest) - else -if @page.id == p.id %a{href: "/#{URI.encode(@page.name)}?history_id=#{p.id}"} %b=p.created_at.gmtime -else %a{href: "/#{URI.encode(@page.name)}?history_id=#{p.id}"}=p.created_at.gmtime :javascript if($('.history').length > 3){$('.history').slice(3).hide();$('.history').last().after($('
  • ').html($('more...').click(function(){$('li.history').show();$(this).parent().remove()})))} if($("#created_at").length == 1){ $.getJSON("http://ssig33.com/api.ssig33.com/timestamp?name="+encodeURI('#{@page.name}') , function(data){ var date date = new Date(Date.parse(data["created_at"])) var created_at = date.toGMTString() date = new Date(Date.parse(data["updated_at"])) var updated_at = date.toGMTString() if(created_at == updated_at){ $("#created_at").html("created at: "+created_at) }else{ $("#created_at").html("created at: "+created_at+" updated at: "+updated_at) } }) }