caption: Remove Sample Content
created: 20260425154726123
modified: 20260426001325778
title: $:/community/recipes/ui/RemoveDemoContent
type: text/vnd.tiddlywiki

\define check-all-recipes()
<$list filter="[field:demo[yes]tag[Recipe]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="yes"/>
</$list>
\end
\define uncheck-all-recipes()
<$list filter="[field:demo[yes]tag[Recipe]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="no"/>
</$list>
\end
\define check-all-recipe-photos()
<$list filter="[field:demo[yes]tag[Recipe]]" variable="t">
<$list filter="[<t>get[photo]!is[blank]]" variable="p">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<p>] }}} text="yes"/>
</$list>
</$list>
\end
\define uncheck-all-recipe-photos()
<$list filter="[field:demo[yes]tag[Recipe]]" variable="t">
<$list filter="[<t>get[photo]!is[blank]]" variable="p">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<p>] }}} text="no"/>
</$list>
</$list>
\end
\define check-all-ingredients()
<$list filter="[field:demo[yes]tag[Ingredient]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="yes"/>
</$list>
\end
\define uncheck-all-ingredients()
<$list filter="[field:demo[yes]tag[Ingredient]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="no"/>
</$list>
\end
\define check-all-ingredient-photos()
<$list filter="[field:demo[yes]tag[Ingredient]]" variable="t">
<$list filter="[<t>get[photo]!is[blank]]" variable="p">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<p>] }}} text="yes"/>
</$list>
</$list>
\end
\define uncheck-all-ingredient-photos()
<$list filter="[field:demo[yes]tag[Ingredient]]" variable="t">
<$list filter="[<t>get[photo]!is[blank]]" variable="p">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<p>] }}} text="no"/>
</$list>
</$list>
\end
\define check-all-categories()
<$list filter="[tag[Category]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="yes"/>
</$list>
\end
\define uncheck-all-categories()
<$list filter="[tag[Category]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="no"/>
</$list>
\end
\define check-all-misc()
<$list filter="[field:demo[yes]is[system]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="yes"/>
</$list>
\end
\define uncheck-all-misc()
<$list filter="[field:demo[yes]is[system]]" variable="t">
<$action-setfield $tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} text="no"/>
</$list>
\end

!! <<t RemoveDemoContent/Recipes/Heading>>

<table class="tc-remove-demo-table">
<thead><tr>
<th style="padding:4px 12px"><<t RemoveDemoContent/Header/Name>></th>
<th style="text-align:center; padding:4px 12px"><$checkbox tiddler="$:/state/community/recipes/remove-demo-section/recipes" field="text" checked="yes" unchecked="no" default="yes" checkactions=<<check-all-recipes>> uncheckactions=<<uncheck-all-recipes>>/> <<t RemoveDemoContent/Header/Recipe>></th>
<th style="text-align:center; padding:4px 12px"><$checkbox tiddler="$:/state/community/recipes/remove-demo-section/recipe-photos" field="text" checked="yes" unchecked="no" default="yes" checkactions=<<check-all-recipe-photos>> uncheckactions=<<uncheck-all-recipe-photos>>/> <<t RemoveDemoContent/Header/Photo>></th>
</tr></thead>
<tbody>
<$list filter="[field:demo[yes]tag[Recipe]sort[title]]" variable="recipeTitle">
<tr>
<td><$link to=<<recipeTitle>>/></td>
<td style="text-align:center"><$checkbox tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<recipeTitle>] }}} field="text" checked="yes" unchecked="no" default="yes"/></td>
<td style="text-align:center"><$list filter="[<recipeTitle>get[photo]!is[blank]]" variable="photoTitle"><$checkbox tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<photoTitle>] }}} field="text" checked="yes" unchecked="no" default="yes"/></$list></td>
</tr>
</$list>
</tbody>
</table>

<$list filter="[field:demo[yes]tag[Ingredient]limit[1]]" variable="ignore">

!! <<t RemoveDemoContent/Ingredients/Heading>>

<table class="tc-remove-demo-table">
<thead><tr>
<th style="padding:4px 12px"><<t RemoveDemoContent/Header/Name>></th>
<th style="text-align:center; padding:4px 12px"><$checkbox tiddler="$:/state/community/recipes/remove-demo-section/ingredients" field="text" checked="yes" unchecked="no" default="yes" checkactions=<<check-all-ingredients>> uncheckactions=<<uncheck-all-ingredients>>/> <<t RemoveDemoContent/Header/Ingredient>></th>
<th style="text-align:center; padding:4px 12px"><$checkbox tiddler="$:/state/community/recipes/remove-demo-section/ingredient-photos" field="text" checked="yes" unchecked="no" default="yes" checkactions=<<check-all-ingredient-photos>> uncheckactions=<<uncheck-all-ingredient-photos>>/> <<t RemoveDemoContent/Header/Photo>></th>
</tr></thead>
<tbody>
<$list filter="[field:demo[yes]tag[Ingredient]sort[title]]" variable="t">
<tr>
<td><$link to=<<t>>/></td>
<td style="text-align:center"><$checkbox tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} field="text" checked="yes" unchecked="no" default="yes"/></td>
<td style="text-align:center"><$list filter="[<t>get[photo]!is[blank]]" variable="photoTitle"><$checkbox tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<photoTitle>] }}} field="text" checked="yes" unchecked="no" default="yes"/></$list></td>
</tr>
</$list>
</tbody>
</table>

</$list>

<<t RemoveDemoContent/Categories/Lead>>

!! <<t RemoveDemoContent/Categories/Heading>>

<table class="tc-remove-demo-table">
<thead><tr>
<th style="text-align:center; padding:4px 12px"><$checkbox tiddler="$:/state/community/recipes/remove-demo-section/categories" field="text" checked="yes" unchecked="no" default="no" checkactions=<<check-all-categories>> uncheckactions=<<uncheck-all-categories>>/></th>
<th style="padding:4px 12px"><<t RemoveDemoContent/Header/Category>></th>
</tr></thead>
<tbody>
<$list filter="[tag[Category]sort[title]]" variable="catTitle">
<tr>
<td style="text-align:center"><$checkbox tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<catTitle>] }}} field="text" checked="yes" unchecked="no" default="no"/></td>
<td><$link to=<<catTitle>>/></td>
</tr>
</$list>
</tbody>
</table>

<$list filter="[field:demo[yes]is[system]limit[1]]" variable="ignore">

!! <<t RemoveDemoContent/Misc/Heading>>

<<t RemoveDemoContent/Misc/Description>>

<table class="tc-remove-demo-table">
<thead><tr>
<th style="text-align:center; padding:4px 12px"><$checkbox tiddler="$:/state/community/recipes/remove-demo-section/misc" field="text" checked="yes" unchecked="no" default="yes" checkactions=<<check-all-misc>> uncheckactions=<<uncheck-all-misc>>/></th>
<th style="padding:4px 12px"><<t RemoveDemoContent/Header/Tiddler>></th>
</tr></thead>
<tbody>
<$list filter="[field:demo[yes]is[system]sort[title]]" variable="t">
<tr>
<td style="text-align:center"><$checkbox tiddler={{{ [[$:/state/community/recipes/remove-demo/]addsuffix<t>] }}} field="text" checked="yes" unchecked="no" default="yes"/></td>
<td><$link to=<<t>>/></td>
</tr>
</$list>
</tbody>
</table>

</$list>

---

<$button class="tc-btn-default">
<$action-deletetiddler $filter="[field:demo[yes]tag[Recipe]] -[prefix[$:/state/community/recipes/remove-demo/]field:text[no]removeprefix[$:/state/community/recipes/remove-demo/]] +[get[photo]!is[blank]] -[prefix[$:/state/community/recipes/remove-demo/]field:text[no]removeprefix[$:/state/community/recipes/remove-demo/]]"/>
<$action-deletetiddler $filter="[field:demo[yes]tag[Recipe]] -[prefix[$:/state/community/recipes/remove-demo/]field:text[no]removeprefix[$:/state/community/recipes/remove-demo/]]"/>
<$action-deletetiddler $filter="[field:demo[yes]tag[Ingredient]] -[prefix[$:/state/community/recipes/remove-demo/]field:text[no]removeprefix[$:/state/community/recipes/remove-demo/]] +[get[photo]!is[blank]] -[prefix[$:/state/community/recipes/remove-demo/]field:text[no]removeprefix[$:/state/community/recipes/remove-demo/]]"/>
<$action-deletetiddler $filter="[field:demo[yes]tag[Ingredient]] -[prefix[$:/state/community/recipes/remove-demo/]field:text[no]removeprefix[$:/state/community/recipes/remove-demo/]]"/>
<$action-deletetiddler $filter="[prefix[$:/state/community/recipes/remove-demo/]field:text[yes]removeprefix[$:/state/community/recipes/remove-demo/]] +[tag[Category]]"/>
<$action-deletetiddler $filter="[field:demo[yes]is[system]] -[prefix[$:/state/community/recipes/remove-demo/]field:text[no]removeprefix[$:/state/community/recipes/remove-demo/]]"/>
<$action-deletetiddler $filter="[prefix[$:/state/community/recipes/remove-demo/]] [prefix[$:/state/community/recipes/remove-demo-section/]]"/>
<$action-sendmessage $message="tm-close-tiddler" $param="$:/community/recipes/ui/RemoveDemoContent"/>
<<t RemoveDemoContent/SubmitButton>>
</$button>
