neocities/views/home.erb
2017-04-02 20:47:06 -07:00

120 lines
5.6 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header-Outro with-columns">
<div class="row content">
<div class="col col-66">
<h3>Your Feed</h3>
<div class="feed-filter">
<% if !@events.empty? && (site.followings_dataset.count > 0) %>
<a href="/" <% if params[:activity].nil? %>class="selected"<% end %>>All</a>
<a href="/?activity=mine" <% if params[:activity] == 'mine' %>class="selected"<% end %>>Profile Activity</a>
<% end %>
<a href="/activity">Global Activity</a>
</div>
</div>
<div class="col col-32">
<h3>Your Site</h3>
<a href="/dashboard" class="btn-Action edit"><i class="fa fa-edit" title="Edit"></i>Edit Site</a>
</div>
</div>
</div>
<div class="container news-feed">
<div class="content misc-page columns right-col">
<div class="col-left">
<div class="col col-66">
<% if site.site_changed == false || site.changed_count == 0 %>
<div class="welcome">
<h4>Thanks for joining the Neocities community!</h4>
<p>Now start <a href="/dashboard">building your website</a>!</a>
</p>
</div>
<% elsif site.followings_dataset.count == 0 %>
<div class="welcome">
<h4>Welcome to your Neocities news feed!</h4>
<p>
You arent following any websites yet! Once you do, <% if !@events.empty? %>more<% end %> updates will show up here.
Below are some website suggestions for you. For more, <a href="/browse">check out all the sites on Neocities</a>!
</p>
</div>
<% else %>
<%== erb :'site/_profile_comments', locals: {site: site} %>
<div style="margin-bottom: 15px"></div>
<% end %>
<% if !@events.empty? %>
<%== erb :'_news', layout: false, locals: {site: current_site, events: @events} %>
<% end %>
<% if site.followings_dataset.count == 0 %>
<% if !@events.empty? %><h2>Sites to Follow</h2><% end %>
<ul class="row website-Gallery content int-Gall suggestions">
<% @suggestions.each do |suggested_site| %>
<li>
<a href="<%= suggested_site.uri %>" class="neo-Screen-Shot" title="<%= suggested_site.title %>">
<span class="img-Holder" style="background:url(<%= suggested_site.screenshot_url('index.html', '540x405') %>) no-repeat;">
<img src="/img/placeholder.png" alt="<%= suggested_site.title %>" />
</span>
</a>
<div class="title">
<a href="<%= suggested_site.uri %>" title="<%= suggested_site.title %>"><%= suggested_site.title.shorten(30) %></a>
</div>
<div class="site-info">
<div class="username">
<a href="/site/<%= suggested_site.username %>" title="Profile">
<i class="fa fa-user"></i><%= suggested_site.username %>
</a>
</div>
<div class="site-stats">
<a href="/site/<%= suggested_site.username %>">
<span class="show-on-mobile"><i class="fa fa-eye"></i></span>
<%= suggested_site.views.format_large_number %><span class="hide-on-mobile">&nbsp;view<%= suggested_site.views == 1 ? '' : 's' %></span>
</a>
</div>
<div class="site-tags">
<% if suggested_site.tags.count > 0 %>
<i class="fa fa-tag"></i>
<% suggested_site.tags.each_with_index do |tag, index| %>
<a class="" href="/browse?tag=<%= Rack::Utils.escape tag.name %>"><%= tag.name %></a><% if index != suggested_site.tags.length - 1 %>,<% end %>
<% end %>
<% end %>
</div>
</div>
</li>
<% end %>
</ul>
<p class="view-all-sites"><a href="/browse">View all sites <i class="fa fa-angle-double-right"></i></a></p>
<% end %>
</div>
<div class="col col-33">
<div class="news-site-info">
<p class="site-url"><a href="<%= current_site.uri %>" target="_blank"><%= site.title %></a></p>
<div class="stats">
<div class="col col-50">
<% if site.updated_at %>
Last updated<br><strong><%= site.updated_at.ago %></strong>
<% else %>
Your new website!<br><strong><a href="/dashboard"><i class="fa fa-edit" title="Edit"></i> Start Building</a></strong>
<% end %>
</div>
<div class="col col-50">
<div><strong><%= site.views.format_large_number %></strong> views</div>
<div><strong><%= site.follow_count.format_large_number %></strong> follower<%= site.follow_count == 1 ? '' : 's' %></div>
</div>
</div>
</div>
<a href="<%= site.uri %>" class="large-portrait" style="background-image:url(<%= site.screenshot_url('index.html', '540x405') %>);"></a>
<div class="news-profile-button">
<a href="/site/<%= site.username %>" class="btn-Action"><i class="fa fa-user"></i> Profile</a>
<a href="#" id="shareButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'_share', layout: false, locals: {site: current_site} %>'><i class="fa fa-share-alt"></i> Share</a>
</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>
</div>
</div>
</div>