1 # Copyright 2015, 2017, 2018 Paul Hänsch
3 # This file is part of Confetti.
5 # Confetti is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # Confetti is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Confetti. If not, see <http://www.gnu.org/licenses/>.
19 list_categories | while read cat; do
20 printf '<li>%s<button type="submit" name="remove" value="%s">%s</button></li>\n' \
21 "$(htmlsafe "$cat")" "$(attribsafe "$cat")" "$(l10n cat_remove)"
27 cats="$(get_categories "$card")"
29 list_categories |while read cat; do
30 printf '<li><label><input %s type="checkbox" name="%s" value="%s">%s</label></li>' \
31 "$(printf %s "$cats" |grep -qF "$cat" && printf 'checked="checked"')" \
32 "$(attribsafe "$card")" "$(attribsafe "$cat")" "$(htmlsafe "$cat")"
38 printf '<li><h2>%s</h2><ul>' "$(htmlsafe "$(get_name "$card")")"
44 <form class="categories" action="?action=edit_categories" method="POST">
45 <input type="submit" class="fakeorder" name="add" value="add" />
46 <h1>$(l10n categories_label)</h1>
47 <input type="hidden" name="page" value="categories"/>
51 <input type="text" name="newcat" placeholder="$(l10n cat_newlabel)">
52 <button type="submit" name="add" value="add">$(l10n cat_add)</button>
57 <form class="namelist" action="?action=update_categories" method="POST">
59 <button type="submit" name="submit" value="submit">$(l10n cat_update)</button>
65 display_catsel "$card"
70 <button type="submit" name="submit" value="submit">$(l10n cat_update)</button>