<label for="quantity">$(l10n quantity)</label>
<label for="remidy">$(l10n remidy)</label>
<label for="quantity_weekly">$(l10n quantity_weekly)</label>
+<p>
<input id="quantity" name="quantity" value="${mpx[quantity]}" placeholder="$(l10n quantity)">
<textarea id="remidy" name="remidy" placeholder="$(l10n remidy)">${mpx[remidy]}</textarea>
<input id="quantity_weekly" name="quantity_weekly" value="${mpx[quantity_weekly]}" placeholder="$(l10n quantity_weekly)">
+</p>
+
+$( for n in {0..10}; do
+ if [ "$n" -eq 0 -o -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ]; then
+ printf '<input type="checkbox" checked="checked">'
+ else
+ printf '<input type="checkbox">'
+ fi
+ printf '<p>
+ <input class="quantity" name="quantity" placeholder="%s" value="%s">
+ <textarea class="remidy" name="remidy" placeholder="%s">%s</textarea>
+ <input class="quantity_weekly" name="quantity_weekly" placeholder="%s" value="%s">
+ </p>
+ ' "$(l10n quantity)" "${mpx[quantity$n]}" \
+ "$(l10n remidy)" "${mpx[remidy$n]}" \
+ "$(l10n quantity_weekly)" "${mpx[quantity_weekly$n]}"
+done )
-<label for="quantity1">$(l10n quantity)</label>
-<label for="remidy1">$(l10n remidy)</label>
-<label for="quantity_weekly1">$(l10n quantity_weekly)</label>
-<input id="quantity1" name="quantity1" value="${mpx[quantity1]}" placeholder="$(l10n quantity)">
-<textarea id="remidy1" name="remidy1" placeholder="$(l10n remidy)">${mpx[remidy1]}</textarea>
-<input id="quantity_weekly1" name="quantity_weekly1" value="${mpx[quantity_weekly1]}" placeholder="$(l10n quantity_weekly)">
<br>
<p class="indicator_codes">
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-. ${0%/*}/attendees.css.sh
+. ${0%/*}/cards.css.sh
cat <<EOF
/**/
+body {padding-bottom: 3em; }
.prescription {
display: inline-block;
margin: 1em -1% 0 2%; padding: 0;
border: 1px solid #888;
overflow: hidden;
+ vertical-align: top;
}
form.prescription { padding-top: 1ex;}
.prescription .description { width: 100%; position: relative;}
.description * { margin-right: -.625ex; vertical-align: top; }
.description label {vertical-align: bottom;}
- .description label[for=quantity1],
- .description label[for=remidy1],
- .description label[for=quantity_weekly1] {display: none;}
.description label[for=quantity] { width: 20%;}
- .description #quantity,
- .description #quantity1 { width: 20%; height: 3em; text-align: center;}
.description label[for=remidy] { width: 60%; }
- .description #remidy,
- .description #remidy1 { width: 60%; height: 3em;}
.description label[for=quantity_weekly] { width: 20%;}
+ .description #quantity,
+ .description .quantity { width: 20%; height: 3em; text-align: center;}
+ .description #remidy,
+ .description .remidy { width: 60%; height: 3em;}
.description #quantity_weekly,
- .description #quantity_weekly1 { width: 20%; height: 3em; text-align: center;}
+ .description .quantity_weekly { width: 20%; height: 3em; text-align: center;}
+
+ .description input[type=checkbox] { display: none; }
+ .description input[type=checkbox] + p { display: none; }
+ .description input:checked + p { display: inline-block; }
+ .description input:checked + p + input { display: block;}
+ .description input:checked + p + input:after {
+ display: block; width: 3ex;
+ background-color: #FFF;
+ border: 1px solid black;
+ margin-top: .25em;
+ text-align: center;
+ content: '+';
+ }
+ .description input:checked + p + input:checked,
+ .description input:checked { display: none; }
.description .indicator_codes {display: inline-block; width: 20%; padding: 0; padding-top: 1.5ex;}
.description label[for=indicator],
item_name[number]="Nr."
item_name[signature]="Un­ter­schrift"
item_name[weekly]="p. Woche"
+item_name[notes]="Notizen"
${mpx[housecall]:+<span class="catalogue">$(l10n housecall)</span>}
${mpx[report]:+<span class="catalogue">$(l10n report)</span>}
- <ul>
- ${mpx[remidy]:+ <li>${mpx[quantity]} ${mpx[remidy]} ${mpx[quantity_weekly]:+($mpx[quantity_weekly] $(l10n weekly))}</li>}
- ${mpx[remidy1]:+<li>${mpx[quantity1]} ${mpx[remidy1]} ${mpx[quantity_weekly1]:+($mpx[quantity_weekly1] $(l10n weekly))}</li>}
- </ul>
+ <ul>$(for n in '' {0..10}; do
+ [ -n "${mpx[remidy$n]}" ] && \
+ printf '<li>%s %s %s</li>' "${mpx[quantity$n]}" \
+ "${mpx[remidy$n]}" \
+ "${mpx[quantity_weekly$n]:+($mpx[quantity_weekly$n] $(l10n weekly))}"
+ done)</ul>
${mpx[indicator]:+<span class="indicator"><label>$(l10n indicator):</label>${mpx[indicator]}</span>}
${mpx[icd10]:+<span class="icd10"> <label>$(l10n icd10):</label>${mpx[icd10]}</span>}
--><div class="section prescriptions">
<h3>$(l10n prescriptions)</h3>
<ul>
- $(find "$_DATA/prescriptions/" -name "${id%.vcf}.*.mpx" \
+ $(declare -A mpx
+ find "$_DATA/prescriptions/" -name "${id%.vcf}.*.mpx" \
| while read pfile; do
- printf '%s\t%s\t%s\n'
- printf '<li><a href="?p=prescriptions&client=%s#%s" >%s: %s - %s%s</a></li>' \
- "${id}" \
- "${id}" \
- "$(sed -nr 's;^date:(.+)$;\1;p' "$pfile")" \
- "$(sed -nr 's;^indicator:(.+)$;\1;p' "$pfile")" \
- "$(sed -nr 's;^quantity:(.+) ?$;\1x ;p' "$pfile")$(sed -nr 's;^remidy:(.+)$;\1;p' "$pfile")" \
- "$(sed -nr 's;^quantity1:(.+) ?$;,\1x ;p' "$pfile")$(sed -nr 's;^remidy1:(.+)$;\1;p' "$pfile")"
+ mpx=(); cat "$pfile" |while read -r line; do
+ val="${line#*:}"
+ mpx[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")"
+ done
+ printf '<li><a href="?p=prescriptions&client=%s#%s" >%s: %s - %s</a></li>' \
+ "${id}" "${pfile##*/}" "${mpx[date]}" "${mpx[indicator]}" \
+ "$([ -n "${mpx[remidy]}" ] && printf '%s %s' "${mpx[quantity]}" "${mpx[remidy]}"
+ for n in {0..10}; do
+ [ -n "${mpx[remidy${n}]}" ] && printf ', %s %s' "${mpx[quantity${n}]}" "${mpx[remidy${n}]}"
+ done
+ )"
done |sort -r
)
</ul>
</fieldset>
<fieldset class="description">
-
-<label for="quantity">$(l10n quantity)</label>
-<label for="remidy">$(l10n remidy)</label>
-<label for="quantity_weekly">$(l10n quantity_weekly)</label>
-<span id="quantity">${mpx[quantity]}</span>
-<span id="remidy">${mpx[remidy]}</span>
-<span id="quantity_weekly">${mpx[quantity_weekly]}</span>
-
-<label for="quantity1">$(l10n quantity)</label>
-<label for="remidy1">$(l10n remidy)</label>
-<label for="quantity_weekly1">$(l10n quantity_weekly)</label>
-<span id="quantity1">${mpx[quantity1]}</span>
-<span id="remidy1">${mpx[remidy1]}</span>
-<span id="quantity_weekly1">${mpx[quantity_weekly1]}</span>
-
+ <label for="quantity">$(l10n quantity)</label>
+ <label for="remidy">$(l10n remidy)</label>
+ <label for="quantity_weekly">$(l10n quantity_weekly)</label>
+ <span id="quantity">${mpx[quantity]}</span>
+ <span id="remidy">${mpx[remidy]}</span>
+ <span id="quantity_weekly">${mpx[quantity_weekly]}</span>
+$( for n in {0..10}; do
+ [ -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ] \
+ && printf '
+ <span id="quantity">%s</span>
+ <span id="remidy">%s</span>
+ <span id="quantity_weekly">%s</span>
+ ' "${mpx[quantity$n]}" "${mpx[remidy$n]}" "${mpx[quantity_weekly$n]}"
+done )
<br>
<p class="indicator_codes">
<label for="indicator">$(l10n indicator)</label>