mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Fix delete when child site is destroyed, also hide destroyed records
from list
This commit is contained in:
parent
276a8a0eb7
commit
fa53929e66
2 changed files with 2 additions and 2 deletions
|
@ -208,7 +208,7 @@ class Site < Sequel::Model
|
||||||
one_to_many :archives
|
one_to_many :archives
|
||||||
|
|
||||||
def account_sites_dataset
|
def account_sites_dataset
|
||||||
Site.where(Sequel.|({id: owner.id}, {parent_site_id: owner.id})).order(:parent_site_id.desc, :username)
|
Site.where(Sequel.|({id: owner.id}, {parent_site_id: owner.id})).order(:parent_site_id.desc, :username).exclude(is_deleted: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def account_sites
|
def account_sites
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<h2>Delete Site</h2>
|
<h2>Delete Site</h2>
|
||||||
<div>
|
<div>
|
||||||
<% if @site.parent? && @site.children.count > 0 %>
|
<% if @site.parent? && @site.children_dataset.where(is_deleted: false, is_deleted: false).count > 0 %>
|
||||||
<p>
|
<p>
|
||||||
You cannot delete the parent site without deleting the children sites first.
|
You cannot delete the parent site without deleting the children sites first.
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Add table
Reference in a new issue