{{- range $i, $p := $sr.Sent.Persons -}}
-
- {{- if $i -}}
- ,
- {{ end -}}
- {{- $person := Person $p.Reference -}}
- {{- $person.Name -}}
-
+ {{ if and $i (eq $i (Minus (len $sr.Sent.Persons) 1)) }}
+ und
+ {{ else if $i }}
+ ,
+ {{ end }}
+ {{- $person := Person $p.Reference -}}
+ {{- $person.Name -}}
+ {{- end -}}
+
+
+ {{- if $model.IsDraft.IsTrue -}}
+
+
+
+ {{- else -}}
+
{{- end -}}
-
{{- if $sr.Received -}}
{{- range $i, $p := $sr.Received.Persons -}}
-
- {{- if $i -}}
- ,
- {{ end -}}
- {{- $person := Person $p.Reference -}}
- {{- $person.Name -}}
-
+ {{ if and $i (eq $i (Minus (len $sr.Received.Persons) 1)) }}
+ und
+ {{ else if $i }}
+ ,
+ {{ end }}
+ {{- $person := Person $p.Reference -}}
+ {{- $person.Name -}}
{{- end -}}
{{- else -}}
diff --git a/views/transform/main.js b/views/transform/main.js
index 1988559..f988862 100644
--- a/views/transform/main.js
+++ b/views/transform/main.js
@@ -5,6 +5,7 @@ import "../public/js/alpine.min.js";
import "../public/js/htmx.min.js";
import "../public/js/htmx-response-targets.js";
import { Previewer } from "pagedjs";
+import { ToolTip } from "./tool-tip.js";
const ATTR_XSLT_ONLOAD = "script[xslt-onload]";
const ATTR_XSLT_TEMPLATE = "xslt-template";
@@ -157,152 +158,6 @@ class ScrollButton extends HTMLElement {
}
}
-class ToolTip extends HTMLElement {
- static get observedAttributes() {
- return ["position", "timeout"];
- }
-
- constructor() {
- super();
- this._tooltipBox = null;
- this._timeout = 200;
- this._hideTimeout = null;
- this._hiddenTimeout = null;
- }
-
- connectedCallback() {
- this.classList.add(
- "w-full",
- "h-full",
- "relative",
- "block",
- "leading-none",
- "[&>*]:leading-normal",
- );
- const dataTipElem = this.querySelector(".data-tip");
- const tipContent = dataTipElem ? dataTipElem.innerHTML : "Tooltip";
-
- if (dataTipElem) {
- dataTipElem.classList.add("hidden");
- }
-
- this._tooltipBox = document.createElement("div");
- this._tooltipBox.innerHTML = tipContent;
- this._tooltipBox.className = [
- "opacity-0",
- "hidden",
- "absolute",
- "px-2",
- "py-1",
- "text-sm",
- "text-white",
- "bg-gray-900",
- "rounded",
- "shadow",
- "z-10",
- "whitespace-nowrap",
- "transition-all",
- "duration-200",
- "font-sans",
- ].join(" ");
-
- this.appendChild(this._tooltipBox);
-
- this._updatePosition();
-
- this.addEventListener("mouseenter", () => this._showTooltip());
- this.addEventListener("mouseleave", () => this._hideTooltip());
- }
-
- attributeChangedCallback(name, oldValue, newValue) {
- if (name === "position" && this._tooltipBox) {
- this._updatePosition();
- }
- if (name === "timeout" && newValue) {
- this._timeout = parseInt(newValue) || 200;
- }
- }
-
- _showTooltip() {
- clearTimeout(this._hideTimeout);
- clearTimeout(this._hiddenTimeout);
- this._tooltipBox.classList.remove("hidden");
- setTimeout(() => {
- this._tooltipBox.classList.remove("opacity-0");
- this._tooltipBox.classList.add("opacity-100");
- }, 16);
- }
-
- _hideTooltip() {
- this._hideTimeout = setTimeout(() => {
- this._tooltipBox.classList.remove("opacity-100");
- this._tooltipBox.classList.add("opacity-0");
- this._hiddenTimeout = setTimeout(() => {
- this._tooltipBox.classList.add("hidden");
- }, this._timeout + 100);
- }, this._timeout);
- }
-
- _updatePosition() {
- this._tooltipBox.classList.remove(
- "bottom-full",
- "left-1/2",
- "-translate-x-1/2",
- "mb-2", // top
- "top-full",
- "mt-2", // bottom
- "right-full",
- "-translate-y-1/2",
- "mr-2",
- "top-1/2", // left
- "left-full",
- "ml-2", // right
- );
-
- const pos = this.getAttribute("position") || "top";
-
- switch (pos) {
- case "bottom":
- this._tooltipBox.classList.add(
- "top-full",
- "left-1/2",
- "transform",
- "-translate-x-1/2",
- "mt-0.5",
- );
- break;
- case "left":
- this._tooltipBox.classList.add(
- "right-full",
- "top-1/2",
- "transform",
- "-translate-y-1/2",
- "mr-0.5",
- );
- break;
- case "right":
- this._tooltipBox.classList.add(
- "left-full",
- "top-1/2",
- "transform",
- "-translate-y-1/2",
- "ml-0.5",
- );
- break;
- case "top":
- default:
- // top as default
- this._tooltipBox.classList.add(
- "bottom-full",
- "left-1/2",
- "transform",
- "-translate-x-1/2",
- "mb-0.5",
- );
- }
- }
-}
-
function Startup() {
let pagedPreviewer = null;
const positionedIntervals = [];
diff --git a/views/transform/site.css b/views/transform/site.css
index 857cae4..881b806 100644
--- a/views/transform/site.css
+++ b/views/transform/site.css
@@ -87,6 +87,26 @@
@apply font-bold text-red-500;
}
+ .diagonal-strike {
+ @apply relative inline-block;
+ }
+
+ .diagonal-strike::before {
+ @apply border-slate-50 border-t-[3px];
+ position: absolute;
+ content: "";
+ left: 10%;
+ top: 50%;
+ right: 0;
+ width: 60%;
+
+ -webkit-transform: rotate(-65deg);
+ -moz-transform: rotate(-65deg);
+ -ms-transform: rotate(-65deg);
+ -o-transform: rotate(-65deg);
+ transform: rotate(-65deg);
+ }
+
.text {
@apply font-serif relative;
}
diff --git a/views/transform/tool-tip.js b/views/transform/tool-tip.js
new file mode 100644
index 0000000..d04cebb
--- /dev/null
+++ b/views/transform/tool-tip.js
@@ -0,0 +1,138 @@
+export class ToolTip extends HTMLElement {
+ static get observedAttributes() {
+ return ["position", "timeout"];
+ }
+
+ constructor() {
+ super();
+ this._tooltipBox = null;
+ this._timeout = 200;
+ this._hideTimeout = null;
+ this._hiddenTimeout = null;
+ }
+
+ connectedCallback() {
+ this.classList.add("relative", "block", "leading-none", "[&>*]:leading-normal");
+ const dataTipElem = this.querySelector(".data-tip");
+ const tipContent = dataTipElem ? dataTipElem.innerHTML : "Tooltip";
+
+ if (dataTipElem) {
+ dataTipElem.classList.add("hidden");
+ }
+
+ this._tooltipBox = document.createElement("div");
+ this._tooltipBox.innerHTML = tipContent;
+ this._tooltipBox.className = [
+ "opacity-0",
+ "hidden",
+ "absolute",
+ "px-2",
+ "py-1",
+ "text-sm",
+ "text-white",
+ "bg-gray-900",
+ "rounded",
+ "shadow",
+ "z-10",
+ "whitespace-nowrap",
+ "transition-all",
+ "duration-200",
+ "font-sans",
+ ].join(" ");
+
+ this.appendChild(this._tooltipBox);
+
+ this._updatePosition();
+
+ this.addEventListener("mouseenter", () => this._showTooltip());
+ this.addEventListener("mouseleave", () => this._hideTooltip());
+ }
+
+ attributeChangedCallback(name, oldValue, newValue) {
+ if (name === "position" && this._tooltipBox) {
+ this._updatePosition();
+ }
+ if (name === "timeout" && newValue) {
+ this._timeout = parseInt(newValue) || 200;
+ }
+ }
+
+ _showTooltip() {
+ clearTimeout(this._hideTimeout);
+ clearTimeout(this._hiddenTimeout);
+ this._tooltipBox.classList.remove("hidden");
+ setTimeout(() => {
+ this._tooltipBox.classList.remove("opacity-0");
+ this._tooltipBox.classList.add("opacity-100");
+ }, 16);
+ }
+
+ _hideTooltip() {
+ this._hideTimeout = setTimeout(() => {
+ this._tooltipBox.classList.remove("opacity-100");
+ this._tooltipBox.classList.add("opacity-0");
+ this._hiddenTimeout = setTimeout(() => {
+ this._tooltipBox.classList.add("hidden");
+ }, this._timeout + 100);
+ }, this._timeout);
+ }
+
+ _updatePosition() {
+ this._tooltipBox.classList.remove(
+ "bottom-full",
+ "left-1/2",
+ "-translate-x-1/2",
+ "mb-2", // top
+ "top-full",
+ "mt-2", // bottom
+ "right-full",
+ "-translate-y-1/2",
+ "mr-2",
+ "top-1/2", // left
+ "left-full",
+ "ml-2", // right
+ );
+
+ const pos = this.getAttribute("position") || "top";
+
+ switch (pos) {
+ case "bottom":
+ this._tooltipBox.classList.add(
+ "top-full",
+ "left-1/2",
+ "transform",
+ "-translate-x-1/2",
+ "mt-0.5",
+ );
+ break;
+ case "left":
+ this._tooltipBox.classList.add(
+ "right-full",
+ "top-1/2",
+ "transform",
+ "-translate-y-1/2",
+ "mr-0.5",
+ );
+ break;
+ case "right":
+ this._tooltipBox.classList.add(
+ "left-full",
+ "top-1/2",
+ "transform",
+ "-translate-y-1/2",
+ "ml-0.5",
+ );
+ break;
+ case "top":
+ default:
+ // top as default
+ this._tooltipBox.classList.add(
+ "bottom-full",
+ "left-1/2",
+ "transform",
+ "-translate-x-1/2",
+ "mb-0.5",
+ );
+ }
+ }
+}
diff --git a/xml/optionalbool.go b/xml/optionalbool.go
index cda46fb..a1e9a68 100644
--- a/xml/optionalbool.go
+++ b/xml/optionalbool.go
@@ -13,6 +13,14 @@ const (
False
)
+func (b OptionalBool) IsTrue() bool {
+ return b == True
+}
+
+func (b OptionalBool) IsFalse() bool {
+ return b == False || b == Unspecified
+}
+
func (b *OptionalBool) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
var attr struct {
Value string `xml:"value,attr"`