clarify ipfs support, add missing titles for pages

This commit is contained in:
Kyle Drake 2019-01-26 14:44:23 -08:00
parent 556bc9d2be
commit a2677bb930
11 changed files with 32 additions and 4 deletions

View file

@ -1,4 +1,5 @@
get '/dmca' do
@title = 'DMCA'
erb :'dmca'
end
@ -8,6 +9,7 @@ get '/dmca/contact_info' do
end
post '/dmca/contact' do
@title = 'DMCA'
@errors = []
if params[:email].empty? || params[:subject].empty? || params[:urls].empty? || params[:body].empty?

View file

@ -84,6 +84,7 @@ end
get '/welcome' do
require_login
redirect '/' if current_site.supporter?
@title = 'Welcome!'
erb :'welcome', locals: {site: current_site}
end
@ -118,18 +119,26 @@ get '/legal/?' do
end
get '/permanent-web' do
erb :'permanent_web'
redirect '/distributed-web'
end
get '/distributed-web' do
@title = 'The Distributed Web'
erb :'distributed_web'
end
get '/thankyou' do
@title = 'Thank you!'
erb :'thankyou'
end
get '/cli' do
@title = 'Command Line Interface'
erb :'cli'
end
get '/forgot_username' do
@title = 'Forgot Username'
erb :'forgot_username'
end

View file

@ -1,4 +1,5 @@
get '/password_reset' do
@title = 'Password Reset'
redirect '/' if signed_in?
erb :'password_reset'
end
@ -46,6 +47,8 @@ the Neocities Cat
end
get '/password_reset_confirm' do
@title = 'Password Reset Confirm'
if params[:token].nil? || params[:token].strip.empty?
flash[:error] = 'Token cannot be empty.'
redirect '/'

View file

@ -20,6 +20,7 @@ get '/settings/:username/?' do |username|
pass if Site.select(:id).where(username: username).first.nil?
require_login
require_ownership_for_settings
@title = "Site settings for #{username}"
erb :'settings/site'
end

View file

@ -34,6 +34,7 @@ get '/signin/restore' do
redirect '/' unless session[:deleted_site_id]
@site = Site[session[:deleted_site_id]]
redirect '/' if @site.nil?
@title = 'Restore Deleted Site'
erb :'signin/restore'
end

View file

@ -135,6 +135,7 @@ post '/site/:username/set_editor_theme' do
end
get '/site/:username/follows' do |username|
@title = "Sites #{username} follows"
@site = Site[username: username]
not_found if @site.nil?
@sites = @site.followings.collect {|f| f.site}
@ -142,6 +143,7 @@ get '/site/:username/follows' do |username|
end
get '/site/:username/followers' do |username|
@title = "Sites that follow #{username}"
@site = Site[username: username]
not_found if @site.nil?
@sites = @site.follows.collect {|f| f.actioning_site}

View file

@ -1,5 +1,6 @@
get '/site_files/new_page' do
require_login
@title = 'New Page'
erb :'site_files/new_page'
end
@ -218,13 +219,16 @@ get %r{\/site_files\/text_editor\/(.+)} do
end
get '/site_files/allowed_types' do
@title = 'Allowed File Types'
erb :'site_files/allowed_types'
end
get '/site_files/hotlinking' do
@title = 'Hotlinking Information'
erb :'site_files/hotlinking'
end
get '/site_files/mount_info' do
@title = 'Site Mount Information'
erb :'site_files/mount_info'
end

View file

@ -27,5 +27,11 @@
<p>
<code>$ ipfs pin add -r THE_IPFS_CID_FOR_YOUR_SITE</code>
</p>
<% if signed_in? %>
<p>
IPFS archiving is not enabled by default for all sites. If you would like to enable IPFS for your site, please visit your site's <a href="/settings/<%= current_site.username %>">settings</a> and enable it.
</p>
<% end %>
</article>
</div>

View file

@ -27,7 +27,7 @@
<input name="site[ipfs_archiving_enabled]" type="hidden" value="false">
<input name="site[ipfs_archiving_enabled]" type="checkbox" value="true"
<% if @site.ipfs_archiving_enabled == true %>checked<% end %>
> Enable IPFS Archiving
> Enable IPFS Archiving <small>(<a href="/distributed-web">what is this?</a>)</small>
</div>
</div>

View file

@ -1,7 +1,7 @@
<div class="header-Outro with-columns browse-page">
<div class="row content">
<div class="col col-100">
<h1>Sites following <a href="/site/<%= @site.username %>"><%= @site.title %></a></h1>
<h1>Sites that follow <strong><a href="/site/<%= @site.username %>"><%= @site.title %></a></strong></h1>
</div>
</div>
</div>

View file

@ -1,7 +1,7 @@
<div class="header-Outro with-columns browse-page">
<div class="row content">
<div class="col col-100">
<h1>Sites <a href="/site/<%= @site.username %>"><%= @site.title %></a> follows</h1>
<h1>Sites that <a href="/site/<%= @site.username %>"><strong><%= @site.title %></a></strong> follows</h1>
</div>
</div>
</div>