add views display/search, and improve initial site suggestions

This commit is contained in:
Kyle Drake 2014-09-15 16:48:19 -07:00
parent df4cf8a3d6
commit 5cb988b3e7
6 changed files with 56 additions and 16 deletions

View file

@ -81,7 +81,11 @@
</div>
<div style="float: right">
<a href="/site/<%= site.username %>">
<%= site.hits %> hit<%= site.hits == 1 ? '' : 's' %>
<% if params[:sort_by] == 'hits' %>
<%= site.hits %> hit<%= site.hits == 1 ? '' : 's' %>
<% else %>
<%= site.views %> view<%= site.views == 1 ? '' : 's' %>
<% end %>
</a>
</div>
</div>

View file

@ -31,11 +31,7 @@
<p>
You aren't following any websites yet! Once you do, updates will show up here and you can like and comment on them.
<% if @suggestions.length > 0 %>
Here are some website suggestions based on your tags, or <a href="/browse">check out all the sites on Neocities!</a>
<% else %>
Want to find some sites to follow? <a href="/browse">Check out all the sites on Neocities!</a>
<% end %>
Here are some website suggestions for you. Want to find some sites to follow? <a href="/browse">Check out all the sites on Neocities!</a>
</p>
</div>
@ -45,8 +41,9 @@
<a href="//<%= suggested_site.host %>">
<img src="<%= suggested_site.screenshot_url('index.html', '270x162') %>">
</a>
<span class="caption">
<a href="/site/<%= suggested_site.username %>"><%= suggested_site.title %></a></span>
<span class="caption">
<a href="/site/<%= suggested_site.username %>"><%= suggested_site.title %></a>
</span>
</div>
<% suggested_site.tags.each do |tag| %>
<a class="tag" href="/browse?tag=<%= Rack::Utils.escape tag.name %>"><%= tag.name %></a>
@ -67,6 +64,7 @@
<% end %>
</div>
<div class="col col-50">
<div><strong><%= site.views_english %></strong> unique views</div>
<div><strong><%= site.hits_english %></strong> hits</div>
<div><strong><%= site.follows_dataset.count %></strong> followers</div>
<div><strong><%= site.tips_dataset.count %></strong> tips ($<%= site.tip_amount %>)</div>

View file

@ -22,6 +22,7 @@
<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.views_english %></strong> <span>views</span></div>
<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> -->