From e65a92d38a5f49ef58bb100734031652167a3c6e Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Wed, 15 Feb 2023 12:33:13 +0100 Subject: [PATCH] fix. Sidebar manage with wip/publish --- src/var/lib/tyto/program/html.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/var/lib/tyto/program/html.py b/src/var/lib/tyto/program/html.py index 82260c2..30f006b 100644 --- a/src/var/lib/tyto/program/html.py +++ b/src/var/lib/tyto/program/html.py @@ -280,19 +280,27 @@ def create_sidebar(option): hash_uri = tyto.get_filesum(f_uri, False) db_uri = '%s%s.conf'%(db.articles_db, hash_uri) if not os.path.exists(db_uri): - logs.out('25', 'No Database', False) + logs.out('25', line, False) continue # Load article"s database exec(open(db_uri).read(),globals()) # Check wip status and if wip article exists - if not hash_wip == hash_chk: - logs.out("30", '%s "%s"'%(line, title), False) - continue - if not os.path.exists(post_wip): - logs.out("24", 'in wip: %s'%post_wip, False) - continue + if option == 'wip': + if not hash_wip == hash_chk: + logs.out("30", '%s "%s"'%(line, title), False) + continue + if not os.path.exists(post_wip): + logs.out("24", 'in wip: %s'%post_wip, False) + continue + elif option == 'www': + if not hash_www == hash_chk: + logs.out("30", '%s "%s"'%(line, title), False) + continue + if not os.path.exists(post_www): + logs.out("24", 'in www: %s'%post_www, False) + continue # Valid article sidebar_new = True