mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
multiple site -> supporters
This commit is contained in:
parent
2f432281a3
commit
e1a4c4b5c9
4 changed files with 24 additions and 15 deletions
6
app.rb
6
app.rb
|
@ -119,6 +119,12 @@ end
|
||||||
|
|
||||||
post '/settings/create_child' do
|
post '/settings/create_child' do
|
||||||
require_login
|
require_login
|
||||||
|
|
||||||
|
if !current_site.plan_feature(:unlimited_site_creation)
|
||||||
|
flash[:error] = 'Cannot create a new site with your current plan, please become a supporter.'
|
||||||
|
redirect '/settings#sites'
|
||||||
|
end
|
||||||
|
|
||||||
site = Site.new
|
site = Site.new
|
||||||
|
|
||||||
site.parent_site_id = parent_site.id
|
site.parent_site_id = parent_site.id
|
||||||
|
|
|
@ -920,9 +920,9 @@ class Site < Sequel::Model
|
||||||
end
|
end
|
||||||
|
|
||||||
def plan_type
|
def plan_type
|
||||||
return 'free' if values[:plan_type].nil?
|
return 'free' if owner.values[:plan_type].nil?
|
||||||
return 'supporter' if values[:plan_type].match /^plan_/
|
return 'supporter' if owner.values[:plan_type].match /^plan_/
|
||||||
values[:plan_type]
|
owner.values[:plan_type]
|
||||||
end
|
end
|
||||||
|
|
||||||
def latest_events(current_page=1, limit=10)
|
def latest_events(current_page=1, limit=10)
|
||||||
|
|
|
@ -252,4 +252,3 @@ end
|
||||||
def res
|
def res
|
||||||
JSON.parse last_response.body, symbolize_names: true
|
JSON.parse last_response.body, symbolize_names: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
<h3>Create New Site</h3>
|
<h3>Create New Site</h3>
|
||||||
|
|
||||||
|
<% if current_site.plan_feature(:unlimited_site_creation) %>
|
||||||
<p>You can now create new sites that are linked to this account! All of your sites will share the free space you have available.</p>
|
<p>You can now create new sites that are linked to this account! All of your sites will share the free space you have available.</p>
|
||||||
|
|
||||||
<form action="/settings/create_child" method="POST">
|
<form action="/settings/create_child" method="POST">
|
||||||
|
@ -30,3 +31,6 @@
|
||||||
<input class="btn-Action" type="submit" value="Create New Site">
|
<input class="btn-Action" type="submit" value="Create New Site">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<% else %>
|
||||||
|
<p>Multiple site creation is only available for supporter accounts. <a href="/plan">Upgrade now</a>!</p>
|
||||||
|
<% end %>
|
Loading…
Add table
Reference in a new issue