From 1cabdfa41f50bd67f5d82886fd091354bf55eda3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 22 Oct 2021 16:20:54 +0200 Subject: [PATCH] variable cleanup, more consistent button placement --- db_channel.sh | 12 +++++++----- page_channel.sh | 5 ++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/db_channel.sh b/db_channel.sh index 1533481..1df83fe 100755 --- a/db_channel.sh +++ b/db_channel.sh @@ -7,14 +7,18 @@ include_dbchannel="$0" # ID NAME DESCRIPTION LOGO THEME AUTHORS DESCR_CACHE FUTUREUSE # == GLOBALS == -unset CHANNEL_ID CHANNEL_NAME CHANNEL_DESCRIPTION CHANNEL_LOGO CHANNEL_THEME \ - CHANNEL_AUTHORS CHANNEL_DESCR_CACHE CHANNEL_FUTUREUSE +UNSET_CHANNEL='unset \ + CHANNEL_ID CHANNEL_NAME CHANNEL_DESCRIPTION CHANNEL_LOGO CHANNEL_THEME \ + CHANNEL_AUTHORS CHANNEL_DESCR_CACHE CHANNEL_FUTUREUSE +' LOCAL_CHANNEL='local \ CHANNEL_ID CHANNEL_NAME CHANNEL_DESCRIPTION CHANNEL_LOGO CHANNEL_THEME \ CHANNEL_AUTHORS CHANNEL_DESCR_CACHE CHANNEL_FUTUREUSE ' +eval "$UNSET_CHANNEL" + chan_db="$_DATA/channels.db" read_channel() { @@ -42,9 +46,7 @@ read_channel() { CHANNEL_AUTHORS="$(UNSTRING "$CHANNEL_AUTHORS")" CHANNEL_DESCR_CACHE="$(UNSTRING "$CHANNEL_DESCR_CACHE")" else - unset CHANNEL_ID CHANNEL_NAME CHANNEL_DESCRIPTION CHANNEL_LOGO \ - CHANNEL_THEME CHANNEL_AUTHORS CHANNEL_DESCR_CACHE \ - CHANNEL_FUTUREUSE + eval "$UNSET_CHANNEL" return 1 fi } diff --git a/page_channel.sh b/page_channel.sh index 1720276..f2d0738 100755 --- a/page_channel.sh +++ b/page_channel.sh @@ -73,11 +73,10 @@ if [ "$CHANNEL_ID" -a "$action" = edit ]; then elif [ "$CHANNEL_ID" ]; then vid_db="$_DATA/$CHANNEL_ID/videos.db" yield_page "$CHANNEL_NAME" "channel" <<-EOF - [nav [a href="../" Channels] - [span $(HTML "${CHANNEL_NAME:-(Unnamed Channel)}")] - $(AUTHOR && printf ' - [a href="edit" edit]') - ] + [nav [a href="../" Channels] - [span $(HTML "${CHANNEL_NAME:-(Unnamed Channel)}")]] [h1 .name $(HTML "$CHANNEL_NAME")] [div .description . ${CHANNEL_DESCR_CACHE}] + $(AUTHOR && printf '[a .button href="edit" edit]') [h1 .videos Videos] [div .videos . $( AUTHOR && printf ' -- 2.39.2