JairoDanielMT commited on
Commit
b647e89
1 Parent(s): 701cf50

correcion del suitelet

Browse files
Files changed (1) hide show
  1. app/templates/Suitelet.html.j2 +94 -79
app/templates/Suitelet.html.j2 CHANGED
@@ -2,84 +2,99 @@
2
  {% import "components.html.j2" as ui %}
3
 
4
  {% block content %}
5
- <h1>Suitelet 路 {{ doc.metadata.description or doc.metadata.script_type }}</h1>
6
- <p class="muted">Procesos de UI y rutas Suitelet.</p>
7
-
8
- {{ ui.metadata_block(doc.metadata) }}
9
- {{ ui.summary_block(doc.summary) }}
10
-
11
- {% if doc.flow %}
12
- <div class="section">
13
- <h2>Flujo de Ejecuci贸n</h2>
14
- {% if doc.flow.get %}
15
- <h3>GET</h3>
16
- <p>{{ doc.flow.get }}</p>
17
- {% endif %}
18
- {% if doc.flow.post %}
19
- <h3>POST</h3>
20
- <p>{{ doc.flow.post }}</p>
21
- {% endif %}
22
- </div>
23
- {% endif %}
24
-
25
- {% if doc.inputs %}
26
- {{ ui.table_block("Par谩metros GET", doc.inputs.get_parameters, [
27
- {"field": "name", "title": "Nombre"},
28
- {"field": "description", "title": "Descripci贸n"},
29
- {"field": "type", "title": "Tipo"}
30
- ]) }}
31
- {{ ui.table_block("Par谩metros POST", doc.inputs.post_parameters, [
32
- {"field": "name", "title": "Nombre"},
33
- {"field": "description", "title": "Descripci贸n"},
34
- {"field": "type", "title": "Tipo"}
35
- ]) }}
36
- {{ ui.list_block("Validaciones", doc.inputs.validations) }}
37
- {% endif %}
38
-
39
- {% if doc.form %}
40
- {{ ui.table_block("Campos del formulario", doc.form.fields, [
41
- {"field": "id", "title": "ID"},
42
- {"field": "label", "title": "Etiqueta"},
43
- {"field": "type", "title": "Tipo"},
44
- {"field": "default", "title": "Valor"}
45
- ]) }}
46
- {{ ui.table_block("Grupos de campos", doc.form.field_groups, [
47
- {"field": "id", "title": "ID"},
48
- {"field": "label", "title": "Etiqueta"},
49
- {"field": "fields", "title": "Campos"}
50
- ]) }}
51
- {{ ui.table_block("Botones", doc.form.buttons, [
52
- {"field": "id", "title": "ID"},
53
- {"field": "label", "title": "Etiqueta"},
54
- {"field": "action", "title": "Acci贸n"}
55
- ]) }}
56
- {% endif %}
57
-
58
- {% if doc.logic %}
59
- {{ ui.table_block("B煤squedas", doc.logic.searches, [
60
- {"field": "type", "title": "Tipo"},
61
- {"field": "filters", "title": "Filtros"},
62
- {"field": "columns", "title": "Columnas"}
63
- ]) }}
64
- {{ ui.table_block("Operaciones con registros", doc.logic.record_operations, [
65
- {"field": "type", "title": "Operaci贸n"},
66
- {"field": "record", "title": "Record"},
67
- {"field": "details", "title": "Detalles"}
68
- ]) }}
69
- {{ ui.list_block("Side effects", doc.logic.side_effects) }}
70
- {% endif %}
71
-
72
- {% if doc.errors is mapping %}
73
- {{ ui.table_block("Errores", doc.errors.explicit_checks, [
74
- {"field": "location", "title": "Ubicaci贸n"},
75
- {"field": "description", "title": "Descripci贸n"}
76
- ]) }}
77
- {{ ui.list_block("Manejo de excepciones", doc.errors.exception_handling) }}
78
- {% else %}
79
- {{ ui.table_block("Errores", doc.errors, [
80
- {"field": "location", "title": "Ubicaci贸n"},
81
- {"field": "description", "title": "Descripci贸n"}
82
- ]) }}
83
- {% endif %}
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  {% endblock %}
 
2
  {% import "components.html.j2" as ui %}
3
 
4
  {% block content %}
5
+ <header class="doc-header">
6
+ <h1>Suitelet {{ doc.metadata.description or doc.metadata.script_type }}</h1>
7
+ <p class="doc-header-meta">
8
+ SuiteScript {{ doc.metadata.suitescript_version or "N/D" }}
9
+ </p>
10
+ <p class="muted">Procesos de UI y rutas Suitelet.</p>
11
+ </header>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
+ {{ ui.metadata_block(doc.metadata) }}
14
+ {{ ui.summary_block(doc.summary) }}
15
+
16
+ {# ------------------------ FLUJO GET/POST ------------------------ #}
17
+ {% if doc.flow %}
18
+ <div class="section">
19
+ <h2>Flujo de Ejecuci贸n</h2>
20
+
21
+ {% if doc.flow.get %}
22
+ <h3>GET</h3>
23
+ <p>{{ doc.flow.get }}</p>
24
+ {% endif %}
25
+
26
+ {% if doc.flow.post %}
27
+ <h3>POST</h3>
28
+ <p>{{ doc.flow.post }}</p>
29
+ {% endif %}
30
+ </div>
31
+ {% endif %}
32
+
33
+ {# ------------------------ ENTRADAS (inputs) ------------------------ #}
34
+ {% if doc.inputs %}
35
+ {{ ui.table_block("Par谩metros GET", doc.inputs.get_parameters, [
36
+ {"field": "name", "title": "Nombre"},
37
+ {"field": "description", "title": "Descripci贸n"},
38
+ {"field": "type", "title": "Tipo"}
39
+ ]) }}
40
+
41
+ {{ ui.table_block("Par谩metros POST", doc.inputs.post_parameters, [
42
+ {"field": "name", "title": "Nombre"},
43
+ {"field": "description", "title": "Descripci贸n"},
44
+ {"field": "validation", "title": "Validaci贸n"}
45
+ ]) }}
46
+
47
+ {# doc.inputs.validations es una lista de objetos { parameter, validation_rule } #}
48
+ {{ ui.table_block("Validaciones", doc.inputs.validations, [
49
+ {"field": "parameter", "title": "Par谩metro"},
50
+ {"field": "validation_rule", "title": "Regla de validaci贸n"}
51
+ ]) }}
52
+ {% endif %}
53
+
54
+ {# ------------------------ FORMULARIO ------------------------ #}
55
+ {% if doc.form %}
56
+ {{ ui.table_block("Campos del formulario", doc.form.fields, [
57
+ {"field": "id", "title": "ID"},
58
+ {"field": "label", "title": "Etiqueta"},
59
+ {"field": "type", "title": "Tipo"},
60
+ {"field": "default_value", "title": "Valor por defecto"}
61
+ ]) }}
62
+
63
+ {{ ui.table_block("Grupos de campos", doc.form.field_groups, [
64
+ {"field": "id", "title": "ID"},
65
+ {"field": "label", "title": "Etiqueta"},
66
+ {"field": "fields", "title": "Campos"}
67
+ ]) }}
68
+
69
+ {{ ui.table_block("Botones", doc.form.buttons, [
70
+ {"field": "label", "title": "Etiqueta"},
71
+ {"field": "type", "title": "Tipo"}
72
+ ]) }}
73
+ {% endif %}
74
+
75
+ {# ------------------------ L脫GICA ------------------------ #}
76
+ {% if doc.logic %}
77
+ {{ ui.table_block("B煤squedas", doc.logic.searches, [
78
+ {"field": "type", "title": "Tipo"},
79
+ {"field": "filters", "title": "Filtros"},
80
+ {"field": "columns", "title": "Columnas"},
81
+ {"field": "limit", "title": "L铆mite"}
82
+ ]) }}
83
+
84
+ {# record_operations es una lista de strings: usar list_block #}
85
+ {{ ui.list_block("Operaciones con registros", doc.logic.record_operations) }}
86
+
87
+ {{ ui.list_block("Side effects", doc.logic.side_effects) }}
88
+ {% endif %}
89
+
90
+ {# ------------------------ ERRORES ------------------------ #}
91
+ {% if doc.errors is mapping %}
92
+ {# explicit_checks: lista de strings, no de objetos #}
93
+ {{ ui.list_block("Chequeos expl铆citos", doc.errors.explicit_checks) }}
94
+
95
+ {{ ui.list_block("Manejo de excepciones", doc.errors.exception_handling) }}
96
+ {% else %}
97
+ {# fallback por si alg煤n d铆a errors viene como lista simple #}
98
+ {{ ui.list_block("Errores", doc.errors) }}
99
+ {% endif %}
100
  {% endblock %}