+++ /dev/null
-# Copyright 2014, 2015 Paul Hänsch
-#
-# This file is part of Confetti.
-#
-# Confetti is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Confetti is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-
-cat <<EOF
-
-.filter {
- display: block;
- border: solid 1px;
- border-radius: 4px 4px 0 0;
- margin: .5em 2em .25em 2em;
- padding: 0 2ex .5em 2ex;
- background: #EFF;
-}
-
-.filter h1 {
- display: block;
- font-weight: bold;
- font-size: 1.25em;
- border-style: none none solid none;
- border-radius: 4px 4px 0 0;
- border-width: 1px;
- margin: 0 -1.625ex .5em -1.625ex;
- padding: .125em 1ex;
- background: #EEF;
-}
-.filter input[type="text"] {
- width: 100%;
- margin-bottom: .5em;
-}
-.filter fieldset {
- position: relative;
- display: block;
- border: none;
- padding: 0 0 0 12ex;
- margin: 0 0 .5em 0;
-}
-.filter fieldset legend {
- position: absolute;
- font-size: 1em;
- font-weight: bold;
- margin-left: -12ex;
-}
-.filter label {
- display: inline-block;
- vertical-align: top;
- margin: .125em 2ex 0 0;
- white-space: nowrap;
-}
-.filter button {
- margin-top: .5em;
-}
-
-.newcard {
- display: block;
- border: solid 1px;
- border-radius: 0 0 4px 4px;
- margin: .25em 2em 1em 2em;
- padding: .25em 2ex .25em 2ex;
- background: #EFF;
-}
-
-.card {
- display: block;
- position: relative;
- border: solid 1px;
- margin: .25em 2em;
- padding: 0 20ex 0 0;
- overflow: auto;
- background: #FFF;
-}
-.card .control {
- display: inline-block;
- position: absolute;
- top: 0; right: 0;
- text-align: right;
- background: #EEF;
- margin: 0;
- height: 100%;
- width: 20ex;
- max-width: 33%;
- padding: .25em 1ex;
-}
-.card .control .item {
- display: inline-block;
- width: 100%;
- color: #008;
- margin: .25em 0 0 0;
- border: 1px solid black;
- background: #FFF;
-}
-.card .control a.item { padding: .25em .75ex 0 .75ex;}
-.card .control a.item:hover{ border-color: #888;}
-.card .control button.item { text-align: right;}
-.card .control button.item:hover{ border-color: #888;}
-.card .control .item[name=newfield] { width: 85%;}
-.card .control .item[value=addfield] { width: 15%;}
-
-.card .section {
- display: inline-block;
- vertical-align: top;
- float: left;
- width: 20ex;
- min-width: 16.5%;
- min-height: 6em;
- margin: .125em 0 .5ex 0;
- padding: 0 1ex .25em 1ex;
-}
-.card .section:nth-of-type(2n){ background: #EEE;}
-
-.card .section h2, .card .section h3 {
- font-size: 1em;
- display: block;
- font-weight: bold;
- margin: .25em -.5ex .25em -.5ex;
- border-style: none none solid none;
- border-width: 1px;
-}
-.card .section .FN { /* will override h2 */
- font-size: 1.2em;
- margin-top: 0;
-}
-
-.card .section .item {
- display: block;
- max-width: 100%;
- word-wrap: break-word;
-}
-.card .section .item label {
- font-weight: bold;
-}
-
-.card .section textarea.NOTE {
- min-height: 6em;
-}
-.card .section textarea.ADR {
- min-height: 4em;
-}
-
-.card .section .PHOTO {
- width: 100%;
- max-height: 10em;
-}
-.card .section .GENDER { display: inline-block; padding-right: .5ex;}
-.card .section .BDAY { display: inline-block;}
-
-.card .section select {
- display: block;
- background-color: #FFF;
- border: 1px solid black;
-}
-
-.card .section.attendance ul { margin: 0; padding: 0; }
-.card .section.attendance ul li {
- display: block;
- word-wrap: break-word;
-}
-
-.card .section.prescriptions ul { margin: 0; padding: 0; }
-.card .section.prescriptions ul li {
- display: block;
- word-wrap: break-word;
- margin: 0 .25ex;
-}
-
-.card .section.prescriptions { width: 40ex;}
-
-form.card .section input[type=text],
-form.card .section input:not([type]),
-form.card .section textarea,
-form.card .section select {width: 100%;}
-
-form.card .attendance {
- min-width: 66%;
-}
-form.card .attendance label {
- position: relative;
- display: inline-block;
- width: 25ex;
- padding-left: 3ex;
-}
-form.card .attendance label input[type=checkbox] {
- position: absolute;
- margin-left: -3ex;
-}
-
-form.card .insurance input[type=radio] {display: none;}
-form.card .insurance input[type=radio] + label {
- display: inline-block;
- width: 50%;
- padding: .25ex 0;
- text-align: center;
- border: 1px solid black;
-
-}
-form.card .insurance input[type=radio]:checked + label {
- font-weight: bold;
- background-color: #FFF;
- border-width: 1px 1px 0 1px;
-}
-form.card .insurance input[type=radio] + label + input + label + select,
-form.card .insurance input[type=radio] + label + select + input {display: none;}
-form.card .insurance input[type=radio]:checked + label + input + label + select,
-form.card .insurance input[type=radio]:checked + label + select + input {
- display: block;
- border: 1px solid black;
- background-color: #FFF;
- border-width: 0 1px 1px 1px;
- padding: .25ex 0;
- margin-top: -1px;
-}
-
-EOF
-
-# vi:set filetype=css:
+++ /dev/null
-# Copyright 2014 - 2016 Paul Hänsch
-#
-# This file is part of Confetti.
-#
-# Confetti is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Confetti is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-
-check_type(){
- [ "${_GET[filtertype]}" = "$1" ] && echo 'checked="checked"'
-}
-check_order(){
- [ "${_GET[order]}" = "$1" ] && echo 'checked="checked"'
-}
-
-edit="${_GET[edit]}"
-[ \! -f "vcard/$edit" -a \! -f "temp/$edit" ] && edit=''
-[ -z "${_GET[filtertype]}" ] && _GET[filtertype]="any"
-[ -z "${_GET[order]}" ] && _GET[order]="firstname"
-
-cat <<EOF
-<form class="filter" action="?action=filter_card" method="POST">
- <h1>$(l10n filter_label)</h1>
- <input type="hidden" name="page" value="cards"/>
- <input type="text" name="filter" value="$_GET["filter"]" placeholder="$(l10n filter_placeholder)"/>
- <br />
- <fieldset>
- <legend>$(l10n filter_type):</legend>
- <label><input type="radio" name="filtertype" value="any" $(check_type any) >$(l10n filter_all)</label>
- <label><input type="radio" name="filtertype" value="name" $(check_type name) >$(l10n filter_name)</label>
- <label><input type="radio" name="filtertype" value="street" $(check_type street) >$(l10n filter_street)</label>
- <label><input type="radio" name="filtertype" value="zip" $(check_type zip) >$(l10n filter_zip)</label>
- <label><input type="radio" name="filtertype" value="telephone" $(check_type telephone)>$(l10n filter_phone)</label>
- <label><input type="radio" name="filtertype" value="birth" $(check_type birth) >$(l10n filter_birthyear)</label>
- <label><input type="radio" name="filtertype" value="course" $(check_type course) >$(l10n filter_course)</label>
- </fieldset>
- <fieldset>
- <legend>$(l10n filter_order):</legend>
- <label><input type="radio" name="order" value="firstname" $(check_order firstname)>$(l10n filter_firstname)</label>
- <label><input type="radio" name="order" value="lastname" $(check_order lastname) >$(l10n filter_lastname)</label>
- <label><input type="radio" name="order" value="bdate" $(check_order bdate) >$(l10n filter_bdate)</label>
- </fieldset>
- <button type="submit" name="choice" value="new_filter">$(l10n filter_apply)</button>
- <button type="submit" name="choice" value="del_filter">$(l10n filter_cancel)</button>
-</form>
-
-<form class="newcard" action="?action=new_card" method="POST">
- <button type="submit">$(l10n newcard)</button>
-</form>
-
-${edit:+$(edit_card "$edit")}
-EOF
-
-listcards |grep ${edit:+-v} "$edit" \
-| while read card; do
- cat <<-ENDCARD
- <div id="${card}" class="card">
- $(view_card "$card")<!--
- --><div class="control">
- <a class="item" href="?action=edit_card&card=${card}">$(l10n edit)</a>
- <a class="item" href="?action=export_vcard&card=${card}">$(l10n vcf_export)</a>
- </div>
- </div>
- ENDCARD
-done
-
-# vi:set filetype=html:
-case $PROFILE in
-medical)
- . ${0%/*}/attendees.css.sh
-;;
-circus)
- . ${0%/*}/attendees.css.sh
-;;
-esac
+# Copyright 2014, 2015 Paul Hänsch
+#
+# This file is part of Confetti.
+#
+# Confetti is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Confetti is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
+
+cat <<EOF
+
+.filter {
+ display: block;
+ border: solid 1px;
+ border-radius: 4px 4px 0 0;
+ margin: .5em 2em .25em 2em;
+ padding: 0 2ex .5em 2ex;
+ background: #EFF;
+}
+
+.filter h1 {
+ display: block;
+ font-weight: bold;
+ font-size: 1.25em;
+ border-style: none none solid none;
+ border-radius: 4px 4px 0 0;
+ border-width: 1px;
+ margin: 0 -1.625ex .5em -1.625ex;
+ padding: .125em 1ex;
+ background: #EEF;
+}
+.filter input[type="text"] {
+ width: 100%;
+ margin-bottom: .5em;
+}
+.filter fieldset {
+ position: relative;
+ display: block;
+ border: none;
+ padding: 0 0 0 12ex;
+ margin: 0 0 .5em 0;
+}
+.filter fieldset legend {
+ position: absolute;
+ font-size: 1em;
+ font-weight: bold;
+ margin-left: -12ex;
+}
+.filter label {
+ display: inline-block;
+ vertical-align: top;
+ margin: .125em 2ex 0 0;
+ white-space: nowrap;
+}
+.filter button {
+ margin-top: .5em;
+}
+
+.newcard {
+ display: block;
+ border: solid 1px;
+ border-radius: 0 0 4px 4px;
+ margin: .25em 2em 1em 2em;
+ padding: .25em 2ex .25em 2ex;
+ background: #EFF;
+}
+
+.card {
+ display: block;
+ position: relative;
+ border: solid 1px;
+ margin: .25em 2em;
+ padding: 0 20ex 0 0;
+ overflow: auto;
+ background: #FFF;
+}
+.card .control {
+ display: inline-block;
+ position: absolute;
+ top: 0; right: 0;
+ text-align: right;
+ background: #EEF;
+ margin: 0;
+ height: 100%;
+ width: 20ex;
+ max-width: 33%;
+ padding: .25em 1ex;
+}
+.card .control .item {
+ display: inline-block;
+ width: 100%;
+ color: #008;
+ margin: .25em 0 0 0;
+ border: 1px solid black;
+ background: #FFF;
+}
+.card .control a.item { padding: .25em .75ex 0 .75ex;}
+.card .control a.item:hover{ border-color: #888;}
+.card .control button.item { text-align: right;}
+.card .control button.item:hover{ border-color: #888;}
+.card .control .item[name=newfield] { width: 85%;}
+.card .control .item[value=addfield] { width: 15%;}
+
+.card .section {
+ display: inline-block;
+ vertical-align: top;
+ float: left;
+ width: 20ex;
+ min-width: 16.5%;
+ min-height: 6em;
+ margin: .125em 0 .5ex 0;
+ padding: 0 1ex .25em 1ex;
+}
+.card .section:nth-of-type(2n){ background: #EEE;}
+
+.card .section h2, .card .section h3 {
+ font-size: 1em;
+ display: block;
+ font-weight: bold;
+ margin: .25em -.5ex .25em -.5ex;
+ border-style: none none solid none;
+ border-width: 1px;
+}
+.card .section .FN { /* will override h2 */
+ font-size: 1.2em;
+ margin-top: 0;
+}
+
+.card .section .item {
+ display: block;
+ max-width: 100%;
+ word-wrap: break-word;
+}
+.card .section .item label {
+ font-weight: bold;
+}
+
+.card .section textarea.NOTE {
+ min-height: 6em;
+}
+.card .section textarea.ADR {
+ min-height: 4em;
+}
+
+.card .section .PHOTO {
+ width: 100%;
+ max-height: 10em;
+}
+.card .section .GENDER { display: inline-block; padding-right: .5ex;}
+.card .section .BDAY { display: inline-block;}
+
+.card .section select {
+ display: block;
+ background-color: #FFF;
+ border: 1px solid black;
+}
+
+.card .section.attendance ul { margin: 0; padding: 0; }
+.card .section.attendance ul li {
+ display: block;
+ word-wrap: break-word;
+}
+
+.card .section.prescriptions ul { margin: 0; padding: 0; }
+.card .section.prescriptions ul li {
+ display: block;
+ word-wrap: break-word;
+ margin: 0 .25ex;
+}
+
+.card .section.prescriptions { width: 40ex;}
+
+form.card .section input[type=text],
+form.card .section input:not([type]),
+form.card .section textarea,
+form.card .section select {width: 100%;}
+
+form.card .attendance {
+ min-width: 66%;
+}
+form.card .attendance label {
+ position: relative;
+ display: inline-block;
+ width: 25ex;
+ padding-left: 3ex;
+}
+form.card .attendance label input[type=checkbox] {
+ position: absolute;
+ margin-left: -3ex;
+}
+
+form.card .insurance input[type=radio] {display: none;}
+form.card .insurance input[type=radio] + label {
+ display: inline-block;
+ width: 50%;
+ padding: .25ex 0;
+ text-align: center;
+ border: 1px solid black;
+
+}
+form.card .insurance input[type=radio]:checked + label {
+ font-weight: bold;
+ background-color: #FFF;
+ border-width: 1px 1px 0 1px;
+}
+form.card .insurance input[type=radio] + label + input + label + select,
+form.card .insurance input[type=radio] + label + select + input {display: none;}
+form.card .insurance input[type=radio]:checked + label + input + label + select,
+form.card .insurance input[type=radio]:checked + label + select + input {
+ display: block;
+ border: 1px solid black;
+ background-color: #FFF;
+ border-width: 0 1px 1px 1px;
+ padding: .25ex 0;
+ margin-top: -1px;
+}
+
+EOF
+
+# vi:set filetype=css:
+# Copyright 2014 - 2016 Paul Hänsch
+#
+# This file is part of Confetti.
+#
+# Confetti is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Confetti is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
+
+check_type(){
+ [ "${_GET[filtertype]}" = "$1" ] && echo 'checked="checked"'
+}
+check_order(){
+ [ "${_GET[order]}" = "$1" ] && echo 'checked="checked"'
+}
+
+edit="${_GET[edit]}"
+[ \! -f "vcard/$edit" -a \! -f "temp/$edit" ] && edit=''
+[ -z "${_GET[filtertype]}" ] && _GET[filtertype]="any"
+
case $PROFILE in
medical)
view_card=${0%/*}/view_client.sh
edit_card=${0%/*}/edit_client.sh
- . ${0%/*}/clients.html.sh
+ _GET[order]="${_GET[order]:-lastname}"
+ profile_medical=x
;;
circus)
view_card=${0%/*}/view_attendee.sh
edit_card=${0%/*}/edit_attendee.sh
- . ${0%/*}/attendees.html.sh
+ _GET[order]="${_GET[order]:-firstname}"
+ profile_circus=x
;;
esac
+
+cat <<EOF
+<form class="filter" action="?action=filter_card" method="POST">
+ <h1>$(l10n filter_label)</h1>
+ <input type="hidden" name="page" value="cards"/>
+ <input type="text" name="filter" value="$_GET["filter"]" placeholder="$(l10n filter_placeholder)"/>
+ <br />
+ <fieldset>
+ <legend>$(l10n filter_type):</legend>
+ <label><input type="radio" name="filtertype" value="any" $(check_type any) >$(l10n filter_all)</label>
+ <label><input type="radio" name="filtertype" value="name" $(check_type name) >$(l10n filter_name)</label>
+ <label><input type="radio" name="filtertype" value="street" $(check_type street) >$(l10n filter_street)</label>
+ <label><input type="radio" name="filtertype" value="zip" $(check_type zip) >$(l10n filter_zip)</label>
+ <label><input type="radio" name="filtertype" value="telephone" $(check_type telephone)>$(l10n filter_phone)</label>
+ <label><input type="radio" name="filtertype" value="birth" $(check_type birth) >$(l10n filter_birthyear)</label>
+ ${profile_circus:+
+ <label><input type="radio" name="filtertype" value="course" $(check_type course) >$(l10n filter_course)</label>
+ }
+ </fieldset>
+ <fieldset>
+ <legend>$(l10n filter_order):</legend>
+ <label><input type="radio" name="order" value="firstname" $(check_order firstname)>$(l10n filter_firstname)</label>
+ <label><input type="radio" name="order" value="lastname" $(check_order lastname) >$(l10n filter_lastname)</label>
+ <label><input type="radio" name="order" value="bdate" $(check_order bdate) >$(l10n filter_bdate)</label>
+ </fieldset>
+ <button type="submit" name="choice" value="new_filter">$(l10n filter_apply)</button>
+ <button type="submit" name="choice" value="del_filter">$(l10n filter_cancel)</button>
+</form>
+
+<form class="newcard" action="?action=new_card" method="POST">
+ <button type="submit">$(l10n newcard)</button>
+</form>
+
+${edit:+$(edit_card "$edit")}
+EOF
+
+listcards |grep ${edit:+-v} "$edit" \
+| while read card; do
+ cat <<-ENDCARD
+ <div id="${card}" class="card">
+ $(view_card "$card")<!--
+ --><div class="control">
+ <a class="item" href="?action=edit_card&card=${card}">$(l10n edit)</a>
+ <a class="item" href="?action=export_vcard&card=${card}">$(l10n vcf_export)</a>
+ ${profile_medical:+
+ <a class="item" href="?action=new_prescription&client=${card}">$(l10n new_prescription)</a>
+ }
+ </div>
+ </div>
+ ENDCARD
+done
+
+# vi:set filetype=html:
+++ /dev/null
-# Copyright 2014 - 2016 Paul Hänsch
-#
-# This file is part of Confetti.
-#
-# Confetti is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Confetti is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-
-check_type(){
- [ "${_GET[filtertype]}" = "$1" ] && echo 'checked="checked"'
-}
-check_order(){
- [ "${_GET[order]}" = "$1" ] && echo 'checked="checked"'
-}
-
-edit="${_GET[edit]}"
-[ \! -f "vcard/$edit" -a \! -f "temp/$edit" ] && edit=''
-[ -z "${_GET[filtertype]}" ] && _GET[filtertype]="any"
-[ -z "${_GET[order]}" ] && _GET[order]="lastname"
-
-cat <<EOF
-<form class="filter" action="?action=filter_card" method="POST">
- <h1>$(l10n filter_label)</h1>
- <input type="hidden" name="page" value="cards"/>
- <input type="text" name="filter" value="$_GET["filter"]" placeholder="$(l10n filter_placeholder)"/>
- <br />
- <fieldset>
- <legend>$(l10n filter_type):</legend>
- <label><input type="radio" name="filtertype" value="any" $(check_type any) >$(l10n filter_all)</label>
- <label><input type="radio" name="filtertype" value="name" $(check_type name) >$(l10n filter_name)</label>
- <label><input type="radio" name="filtertype" value="street" $(check_type street) >$(l10n filter_street)</label>
- <label><input type="radio" name="filtertype" value="zip" $(check_type zip) >$(l10n filter_zip)</label>
- <label><input type="radio" name="filtertype" value="telephone" $(check_type telephone)>$(l10n filter_phone)</label>
- <label><input type="radio" name="filtertype" value="birth" $(check_type birth) >$(l10n filter_birthyear)</label>
- </fieldset>
- <fieldset>
- <legend>$(l10n filter_order):</legend>
- <label><input type="radio" name="order" value="firstname" $(check_order firstname)>$(l10n filter_firstname)</label>
- <label><input type="radio" name="order" value="lastname" $(check_order lastname) >$(l10n filter_lastname)</label>
- <label><input type="radio" name="order" value="bdate" $(check_order bdate) >$(l10n filter_bdate)</label>
- </fieldset>
- <button type="submit" name="choice" value="new_filter">$(l10n filter_apply)</button>
- <button type="submit" name="choice" value="del_filter">$(l10n filter_cancel)</button>
-</form>
-
-<form class="newcard" action="?action=new_card" method="POST">
- <button type="submit">$(l10n newcard)</button>
-</form>
-
-${edit:+$(edit_card "$edit")}
-EOF
-
-listcards |grep ${edit:+-v} "$edit" \
-| while read card; do
- cat <<-ENDCARD
- <div id="${card}" class="card">
- $(view_card "$card")<!--
- --><div class="control">
- <a class="item" href="?action=edit_card&card=${card}">$(l10n edit)</a>
- <a class="item" href="?action=export_vcard&card=${card}">$(l10n vcf_export)</a>
- <a class="item" href="?action=new_prescription&client=${card}">$(l10n new_prescription)</a>
- </div>
- </div>
- ENDCARD
-done
-
-# vi:set filetype=html: