Skip to main content

rumtk_web/utils/
defaults.rs

1/*
2 * rumtk attempts to implement HL7 and medical protocols for interoperability in medicine.
3 * This toolkit aims to be reliable, simple, performant, and standards compliant.
4 * Copyright (C) 2025  Luis M. Santos, M.D. <lsantos@medicalmasses.com>
5 * Copyright (C) 2025  Ethan Dixon
6 * Copyright (C) 2025  MedicalMasses L.L.C. <contact@medicalmasses.com>
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20 */
21use crate::utils::ConstTextMap;
22use phf_macros::phf_ordered_map;
23/*
24   TextMap
25*/
26pub static DEFAULT_TEXT_MAP: ConstTextMap = phf_ordered_map!();
27
28/*
29   IP
30*/
31pub const DEFAULT_LOCAL_LISTENING_ADDRESS: &str = "127.0.0.1:3000";
32pub const DEFAULT_OUTBOUND_LISTENING_ADDRESS: &str = "0.0.0.0:3000";
33
34/*
35   Misc
36*/
37pub const DEFAULT_TEXT_ITEM: &str = "default";
38pub const DEFAULT_CONTACT_ITEM: &str = "company";
39pub const DEFAULT_NO_TEXT: &str = "";
40pub const DEFAULT_JOB_LOADER_NAME: &str = "job_loader";
41pub const DEFAULT_HTMX_SWAP_MODE: &str = "outerHTML";
42pub const DEFAULT_PROGRESS_MODE: &str = "hidden";
43
44/*
45    Options
46*/
47pub const OPT_INVERTED_DIRECTION: &str = "inverted";
48
49/*
50   Params
51*/
52pub const PARAMS_ID: &str = "id";
53pub const PARAMS_TITLE: &str = "title";
54pub const PARAMS_TYPE: &str = "type";
55pub const PARAMS_CSS_CLASS: &str = "class";
56pub const PARAMS_SOCIAL_LIST: &str = "social_list";
57pub const PARAMS_ITEM: &str = "item";
58pub const PARAMS_INVERTED: &str = "inverted";
59pub const PARAMS_SECTION: &str = "section";
60pub const PARAMS_FUNCTION: &str = "function";
61pub const PARAMS_SOURCE_URL: &str = "source";
62pub const PARAMS_TARGET: &str = "target";
63pub const PARAMS_SIZE: &str = "size";
64pub const PARAMS_CONTENTS: &str = "contents";
65pub const PARAMS_MODULE: &str = "module";
66pub const PARAMS_ENDPOINT: &str = "endpoint";
67pub const PARAMS_ELEMENT: &str = "element";
68pub const PARAMS_SWAP_MODE: &str = "swap_mode";
69pub const PARAMS_PROGRESS_MODE: &str = "progress_mode";
70
71/*
72   CONF SECTIONS
73*/
74pub const SECTION_TEXT: &str = "text";
75pub const SECTION_PERSONNEL: &str = "personnel";
76pub const SECTION_CONTACT: &str = "contact";
77pub const SECTION_TITLES: &str = "titles";
78pub const SECTION_API: &str = "api";
79pub const SECTION_SOCIALS: &str = "socials";
80pub const SECTION_SERVICES: &str = "services";
81pub const SECTION_PRODUCTS: &str = "products";
82pub const SECTION_LINKS: &str = "links";
83pub const SECTION_MODULES: &str = "modules";
84pub const SECTION_ENDPOINTS: &str = "endpoints";
85pub const SECTION_ALT: &str = "alt";
86pub const SECTION_DEFAULT: &str = "default";
87
88/*
89   Content Types
90*/
91pub const CONTENT_TYPE_PDF: &str = "application/pdf";
92pub const CONTENT_TYPE_HTML: &str = "text/html";
93
94/*
95   Form Data Types
96*/
97pub const FORM_DATA_TYPE_PDF: &str = "pdf";
98pub const FORM_DATA_TYPE_HTML: &str = "html";
99pub const FORM_DATA_TYPE_MARKDOWN: &str = "markdown";
100pub const FORM_DATA_TYPE_DEFAULT: &str = "text";
101
102/*
103   LANGUAGES
104*/
105pub const LANG_EN: &str = "en";
106pub const LANG_ES: &str = "es";
107
108/*
109   Icon
110*/
111pub const DEFAULT_ICON_STYLE: &str = "fa-solid";
112
113/*
114   Robots.txt
115*/
116pub const DEFAULT_ROBOT_TXT: &str = r"
117User-agent: *
118Disallow: /static/
119";
120
121/*
122   JS Module Types
123*/
124pub const DEFAULT_SCRIPT: &str = "default";
125pub const DEFAULT_SCRIPT_MODULE: &str = "module";
126pub const DEFAULT_SCRIPT_IMPORT: &str = "import";
127
128/*
129    Assets
130 */
131pub const DEFAULT_APP_CONFIG: &str = "./app.json";
132pub const DEFAULT_LOGO_SOURCE: &str = "/static/img/logo.webp";
133
134/*
135    Slices
136 */
137pub const DEFAULT_EMPTY_PARAMS: &[(&str, &str); 1] = &[("", "")];
138
139/*
140    Elements
141 */
142pub const ELEMENT_INPUT: &str = "input";
143pub const ELEMENT_LABEL: &str = "label";
144pub const ELEMENT_SELECT: &str = "select";