neocities/views/site.erb

107 lines
5.1 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 && current_site != site %>
<% is_following = current_site.is_following?(site) %>
<a id="followLink" href="#" onclick="Site.toggleFollow(<%= site.id %>, '<%= csrf_token %>')" class="btn-Action <%= is_following ? '' : 'follow' %>">
<span><%= is_following ? '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 %>
<% latest_events = site.latest_events %>
<% if 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: latest_events} %>
<% 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} %>
<%== 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>