mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +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
|
||||
|
||||
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
|
||||
|
||||
def account_sites
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<h2>Delete Site</h2>
|
||||
<div>
|
||||
<% if @site.parent? && @site.children.count > 0 %>
|
||||
<% if @site.parent? && @site.children_dataset.where(is_deleted: false, is_deleted: false).count > 0 %>
|
||||
<p>
|
||||
You cannot delete the parent site without deleting the children sites first.
|
||||
</p>
|
||||
|
|
Loading…
Add table
Reference in a new issue