JairoDanielMT commited on
Commit
ac1c425
verified
1 Parent(s): 7b36b01

Update app/templates/RESTlet.html.j2

Browse files
Files changed (1) hide show
  1. app/templates/RESTlet.html.j2 +19 -21
app/templates/RESTlet.html.j2 CHANGED
@@ -4,45 +4,43 @@
4
  {% block content %}
5
 
6
  {# =========================
7
- VALIDACI脫N RA脥Z (WRAPPER)
8
  ========================= #}
9
- {% if not (doc and doc is mapping and doc.doc and doc.doc is mapping) %}
10
  <div class="alert alert-error">
11
- <strong>Error:</strong> El payload recibido no cumple la estructura esperada (doc, job_id, output).
12
  </div>
13
  {% else %}
14
 
15
- {% set document = doc.doc %}
16
-
17
  <header class="doc-header">
18
  <h1>
19
  RESTlet 路
20
- {{ document.metadata.description
21
- if document.metadata and document.metadata.description
22
- else document.metadata.script_type
23
- if document.metadata
24
  else "Documento sin metadata" }}
25
  </h1>
26
  <p class="doc-header-meta">
27
- SuiteScript {{ document.metadata.suitescript_version if document.metadata else "N/D" }}
28
  </p>
29
  <p class="muted">Documentaci贸n t茅cnica del servicio RESTlet.</p>
30
  </header>
31
 
32
- {% if document.metadata %}
33
- {{ ui.metadata_block(document.metadata) }}
34
  {% else %}
35
  <p class="muted">No se proporcion贸 metadata.</p>
36
  {% endif %}
37
 
38
- {% if document.summary %}
39
- {{ ui.summary_block(document.summary) }}
40
  {% endif %}
41
 
42
  {# ============================================================
43
  ENDPOINTS
44
  ============================================================ #}
45
- {% set endpoints = document.endpoints if document.endpoints and document.endpoints is mapping else {} %}
46
 
47
  <div class="section">
48
  <h2>Endpoints</h2>
@@ -139,13 +137,13 @@
139
  </div>
140
 
141
  {# ================= VALIDACIONES GLOBALES ================= #}
142
- {% if document.validations %}
143
- {{ ui.list_block("Validaciones globales", document.validations) }}
144
  {% endif %}
145
 
146
  {# ================= ERRORES ================= #}
147
- {% if document.errors %}
148
- {{ ui.table_block("Errores", document.errors, [
149
  {"field": "location", "title": "Ubicaci贸n"},
150
  {"field": "description", "title": "Descripci贸n"},
151
  {"field": "throws", "title": "Excepci贸n"}
@@ -153,8 +151,8 @@
153
  {% endif %}
154
 
155
  {# ================= SIDE EFFECTS GLOBALES ================= #}
156
- {% if document.side_effects %}
157
- {{ ui.list_block("Side effects globales", document.side_effects) }}
158
  {% endif %}
159
 
160
  {% endif %}
 
4
  {% block content %}
5
 
6
  {# =========================
7
+ VALIDACI脫N RA脥Z REAL
8
  ========================= #}
9
+ {% if not (doc and doc is mapping) %}
10
  <div class="alert alert-error">
11
+ <strong>Error:</strong> El documento recibido no tiene una estructura v谩lida.
12
  </div>
13
  {% else %}
14
 
 
 
15
  <header class="doc-header">
16
  <h1>
17
  RESTlet 路
18
+ {{ doc.metadata.description
19
+ if doc.metadata and doc.metadata.description
20
+ else doc.metadata.script_type
21
+ if doc.metadata
22
  else "Documento sin metadata" }}
23
  </h1>
24
  <p class="doc-header-meta">
25
+ SuiteScript {{ doc.metadata.suitescript_version if doc.metadata else "N/D" }}
26
  </p>
27
  <p class="muted">Documentaci贸n t茅cnica del servicio RESTlet.</p>
28
  </header>
29
 
30
+ {% if doc.metadata %}
31
+ {{ ui.metadata_block(doc.metadata) }}
32
  {% else %}
33
  <p class="muted">No se proporcion贸 metadata.</p>
34
  {% endif %}
35
 
36
+ {% if doc.summary %}
37
+ {{ ui.summary_block(doc.summary) }}
38
  {% endif %}
39
 
40
  {# ============================================================
41
  ENDPOINTS
42
  ============================================================ #}
43
+ {% set endpoints = doc.endpoints if doc.endpoints and doc.endpoints is mapping else {} %}
44
 
45
  <div class="section">
46
  <h2>Endpoints</h2>
 
137
  </div>
138
 
139
  {# ================= VALIDACIONES GLOBALES ================= #}
140
+ {% if doc.validations %}
141
+ {{ ui.list_block("Validaciones globales", doc.validations) }}
142
  {% endif %}
143
 
144
  {# ================= ERRORES ================= #}
145
+ {% if doc.errors %}
146
+ {{ ui.table_block("Errores", doc.errors, [
147
  {"field": "location", "title": "Ubicaci贸n"},
148
  {"field": "description", "title": "Descripci贸n"},
149
  {"field": "throws", "title": "Excepci贸n"}
 
151
  {% endif %}
152
 
153
  {# ================= SIDE EFFECTS GLOBALES ================= #}
154
+ {% if doc.side_effects %}
155
+ {{ ui.list_block("Side effects globales", doc.side_effects) }}
156
  {% endif %}
157
 
158
  {% endif %}