neocities/views/site.erb
2014-07-03 14:03:35 -05:00

182 lines
No EOL
7.8 KiB
Text

<div class="header-Outro with-site-image">
<% if flash.keys.length > 0 %>
<div class="row content">
<div class="alert txt-Center">
<p style="padding:5px">
<% flash.keys.each do |key| %>
<%= flash[key] %>
<% end %>
</p>
</div>
</div>
<% end %>
<div class="row content">
<div class="col col-50 signup-Area large">
<div class="signup-Form">
<fieldset class="content">
<a href="//<%= site.host %>"><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="//<%= site.host %>"><%= site.host %></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="/site/<%= site.username %>.rss"><span>RSS/Atom Feed</span></a>
<br>
<a href="http://facebook.com/sharer.php?u=<%= Rack::Utils.build_query(u: "http://#{site.host}") %>" target="_blank">Facebook</a>
<br>
<a href="https://twitter.com/intent/tweet?<%= Rack::Utils.build_query(text: "#{site.title}: http://#{site.host}") %>">Twitter</a>
<br>
<a href="http://www.reddit.com/submit?<%= Rack::Utils.build_query(title: "#{site.title}", url: "http://#{site.host}" )%>" target="_blank">Reddit</a>
<br>
<a href="http://www.tumblr.com/share?<%= Rack::Utils.build_query(v: 3, u: "http://#{site.host}", t: "#{site.title}") %>" target="_blank">Tumblr</a>
<br>
<a href="http://www.stumbleupon.com/submit?<%= Rack::Utils.build_query(url: "http://#{site.host}", title: "#{site.title}") %>" target="_blank">StumbleUpon</a>
<br>
<a href="http://del.icio.us/post?<%= Rack::Utils.build_query(url: "http://#{site.host}", title: "#{site.title}") %>" target="_blank">Del.ici.ous</a>
<br>
<a href="https://plus.google.com/share?<%= Rack::Utils.build_query(url: "http://#{site.host}") %>" 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 @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} %>
<% if site != current_site %>
<div class="report">
<a href="#report" data-toggle="modal">Report</a> |
<% if current_site && current_site.is_blocking?(site) %>
<a href="#">Unblock</a>
<% else %>
<a href="#block" data-toggle="modal">Block</a>
<% end %>
</div>
<% end %>
</div>
</div></div>
</div>
<div class="modal hide fade" id="report" tabindex="-1" role="dialog" aria-labelledby="reportLabel" aria-hidden="true">
<form method="POST" action="/site/<%= site.username %>/report">
<input type="hidden" value="<%= csrf_token %>" name="csrf_token">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">x</button>
<h3 id="reportLabel">Report Site</h3>
</div>
<div class="modal-body">
<p>
What is the reason you are reporting this site?
<select name="type" class="input-Area">
<option value="spam">Site is spamming</option>
<option value="phishing">Site is being used for a phishing attack</option>
<option value="abusive">Site is abusive or threatening</option>
<option value="harassment">Site is harassing other sites</option>
<option value="content">Site contains inappropriate/illegal content</option>
<option value="other">Other</option>
</select>
</p>
<p>Comments:</p>
<textarea name="comments" type="text" style="width: 400px"></textarea>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button type="submit" class="btn btn-Action">Report</button>
</div>
</form>
</div>
<div class="modal hide fade" id="block" tabindex="-1" role="dialog" aria-labelledby="blockLabel" aria-hidden="true">
<form method="POST" action="/site/<%= site.username %>/block">
<input type="hidden" value="<%= csrf_token %>" name="csrf_token">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal" aria-hidden="true">x</button>
<h3 id="blockLabel">Block Site</h3>
</div>
<div class="modal-body">
<p>You are going to block this site. This will do the following:</p>
<ul>
<li>You will no longer see this site in searches.</li>
<li>Site will no longer see your site in searches.</li>
<li>Site will not be able to comment on your site profile.</li>
<li>Any comments this site has posted to your profile will not be displayed.</li>
</ul>
<p>Are you sure you want to do this?</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button type="submit" class="btn btn-Action">Block Site</button>
</div>
</form>
</div>