neocities/views/site.erb

140 lines
7 KiB
Text

<div class="header-Outro with-site-image">
<div class="row content">
<div class="col col-50 signup-Area large">
<div class="signup-Form">
<fieldset class="content">
<a href="http://<%= site.username %>.neocities.org"><img class="screenshot" src="<%= site.screenshot_url('index.html', '348x205') %>" style="width: 358px;height: 215px;"></a>
</fieldset>
</div>
</div>
<div class="col col-50">
<h2 class="eps title-with-badge"><span><%= site.title %></span> <% if site.supporter? && !site.ended_supporter? %><a href="/plan" class="supporter-badge" title="Neocities Supporter"></a> <% end %></h2>
<p class="site-url"><a href="http://<%= site.username %>.neocities.org">http://<%= site.username %>.neocities.org</a></p>
<div class="stats">
<div class="stat"><strong><%= site.hits_english %></strong> <span>hits</span></div>
<div class="stat"><strong><%= site.follows_dataset.count %></strong> <span>followers</span></div>
<div class="stat tips"><strong><%= site.tips_dataset.count %></strong> <span>tips</span></div>
</div>
<div class="actions">
<% if current_site == site %>
<a href="/dashboard" class="btn-Action edit"><span><i class="fa fa-pencil"></i> Edit Site</span></a>
<% end %>
<% if current_site != site %>
<a id="followLink" href="#" onclick="Site.toggleFollow(<%= site.id %>, '<%= csrf_token %>')" class="btn-Action <%= current_site.is_following?(site) ? '' : 'follow' %>">
<span><%= current_site.is_following?(site) ? 'Unfollow' : 'Follow' %></span>
</a>
<!-- <a href="#" class="btn-Action tip"><span>Tip</span></a> -->
<% end %>
<a href="#" id="shareButton" class="btn-Action share" data-container="body" data-toggle="popover" data-placement="bottom" data-content='
<a href="http://facebook.com/sharer.php?u=<%= Rack::Utils.build_query(u: "http://#{site.username}.neocities.org") %>" target="_blank">Facebook</a>
<br>
<a href="https://twitter.com/intent/tweet?<%= Rack::Utils.build_query(text: "This site is awesome: http://#{site.username}.neocities.org") %>">Twitter</a>
<br>
<a href="http://www.reddit.com/submit?<%= Rack::Utils.build_query(title: "#{site.username}.neocities.org", url: "http://#{site.username}.neocities.org" )%>" target="_blank">Reddit</a>
<br>
<a href="http://www.tumblr.com/share?<%= Rack::Utils.build_query(v: 3, u: "http://#{site.username}.neocities.org", t: "#{site.username}.neocities.org") %>" target="_blank">Tumblr</a>
<br>
<a href="http://www.stumbleupon.com/submit?<%= Rack::Utils.build_query(url: "http://#{site.username}.neocities.org", title: "#{site.username}.neocities.org") %>" target="_blank">StumbleUpon</a>
<br>
<a href="http://del.icio.us/post?<%= Rack::Utils.build_query(url: "http://#{site.username}.neocities.org", title: "#{site.username}.neocities.org") %>" target="_blank">Del.ici.ous</a>
<br>
<a href="https://plus.google.com/share?<%= Rack::Utils.build_query(url: "http://#{site.username}.neocities.org") %>" target="_blank">Google+</a>
'>
<span>Share</span></a>
</div>
</div>
</div>
</div>
<div class="container">
<div class="content misc-page columns right-col"><div class="col-left">
<div class="col col-66">
<% if current_site %>
<div class="post-comment">
<form method="POST" action="/site/<%= site.username %>/comment">
<input name="csrf_token" type="hidden" value="<%= csrf_token %>">
<input name="message" type="text" placeholder="Post a message..." autocomplete="off" maxlength="<%= Site::MAX_COMMENT_SIZE %>">
<button class="btn-Action">Post</button>
</form>
</div>
<% end %>
<% if site.latest_events.empty? %>
<div>
<p>No recent activity.</p>
<% if site == current_site %>
<p>
You should <a href="/dashboard">update your site</a>!
</p>
<% end %>
</div>
<% else %>
<%== erb :'_news', layout: false, locals: {site: site, events: site.events_dataset.order(:id.desc).all} %>
<% end %>
</div>
<div class="col col-33">
<h3>Website Stats</h3>
<div class="stats">
<div class="stat">
<span>Last updated</span>
<strong>
<% if site.updated_at.nil? %>
<%= site.created_at.ago.downcase %>
<% else %>
<%= site.updated_at.ago.downcase %>
<% end %>
</strong>
</div>
<div class="stat"><span>Number of updates</span><strong><%= site.changed_count %></strong></div>
<div class="stat"><span>Created</span><strong><%= site.created_at.strftime('%B %-d, %Y') %></strong></div>
</div>
<%== erb :'_follows', layout: false, locals: {site: site, is_current_site: site == current_site} %>
<!--
<h3>Archives</h3>
<div class="archives">
<a href=""><img src="http://neocities.org/site_screenshots/codeventurer.jpg"></a>
<a href=""><img src="http://neocities.org/site_screenshots/codeventurer.jpg"></a>
<a href=""><img src="http://neocities.org/site_screenshots/codeventurer.jpg"></a>
<a href=""><img src="http://neocities.org/site_screenshots/codeventurer.jpg"></a>
<a href="" class="more">See all versions</a>
</div>
-->
<%== erb :'_tags', layout: false, locals: {site: site, is_current_site: site == current_site} %>
<div class="report">
<a href="">Report</a> | <a href="">Block</a>
</div>
</div>
</div></div>
</div>
<div class="modal hide fade" id="shareModal" tabindex="-1" role="dialog" aria-labelledby="shareModalLabel" aria-hidden="true">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">x</button>
<h3 id="shareModalLabel">Share this Site</h3>
</div>
<div class="modal-body">
<p>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="<%= site.username %>.neocities.org is awesome!" data-via="neocitiesweb" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</p>
<p>
<a href="http://www.tumblr.com/share" title="Share on Tumblr" style="display:inline-block; text-indent:-9999px; overflow:hidden; width:61px; height:20px; background:url('http://platform.tumblr.com/v1/share_2.png') top left no-repeat transparent;">Share on Tumblr</a>
</p>
<p>
<a href="http://www.reddit.com/submit" onclick="window.location = 'http://www.reddit.com/submit?url=' + encodeURIComponent(window.location); return false"> <img src="http://www.reddit.com/static/spreddit7.gif" alt="submit to reddit" border="0" /> </a>
</p>
<p>
</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Done</button>
</div>
</div>