internationalscholarsprogram commited on
Commit
f0a4b23
Β·
1 Parent(s): a94f84a

Update handbook engine with latest local changes

Browse files
app/services/normalizer.py CHANGED
@@ -131,7 +131,7 @@ def normalize_section(
131
  if layout_norm == "doc_v1" and isinstance(section_json.get("blocks"), list):
132
  blocks.extend(_normalize_doc_v1(section_json["blocks"], skip_title=title))
133
  # Post-process breakdown section for Relocation Cost layout
134
- if key_norm == "program_features_breakdown":
135
  blocks = _postprocess_breakdown(blocks, section_json["blocks"])
136
  # Post-process Tier sections for sub-bullet/checkmark styling
137
  if key_norm in ("summary_of_universities_cosigner", "summary_of_universities"):
@@ -612,7 +612,7 @@ def _postprocess_breakdown(
612
  for i, rb in enumerate(raw_blocks):
613
  if not isinstance(rb, dict):
614
  continue
615
- if rb.get("type") == "subheading" and "relocation" in str(rb.get("text", "")).lower():
616
  found_reloc = True
617
  continue
618
  if found_reloc and rb.get("type") == "table_v1" and raw_reloc_table is None:
@@ -628,7 +628,7 @@ def _postprocess_breakdown(
628
  blk = blocks[i]
629
 
630
  # ── Detect "Relocation Cost" heading ──
631
- if (blk.block_type == "heading_2"
632
  and "relocation" in blk.data.get("text", "").lower()):
633
 
634
  # Banner heading with page break
 
131
  if layout_norm == "doc_v1" and isinstance(section_json.get("blocks"), list):
132
  blocks.extend(_normalize_doc_v1(section_json["blocks"], skip_title=title))
133
  # Post-process breakdown section for Relocation Cost layout
134
+ if key_norm in {"program_features_breakdown", "isp_academic_specifications", "relocation_cost_breakdown"}:
135
  blocks = _postprocess_breakdown(blocks, section_json["blocks"])
136
  # Post-process Tier sections for sub-bullet/checkmark styling
137
  if key_norm in ("summary_of_universities_cosigner", "summary_of_universities"):
 
612
  for i, rb in enumerate(raw_blocks):
613
  if not isinstance(rb, dict):
614
  continue
615
+ if rb.get("type") in {"heading", "subheading"} and "relocation" in str(rb.get("text", "")).lower():
616
  found_reloc = True
617
  continue
618
  if found_reloc and rb.get("type") == "table_v1" and raw_reloc_table is None:
 
628
  blk = blocks[i]
629
 
630
  # ── Detect "Relocation Cost" heading ──
631
+ if (blk.block_type in {"heading_1", "heading_2"}
632
  and "relocation" in blk.data.get("text", "").lower()):
633
 
634
  # Banner heading with page break
app/static/css/print.css CHANGED
@@ -1215,7 +1215,8 @@ table.programs td a,
1215
  }
1216
 
1217
  .sec-how .hb-heading-2 {
1218
- color: #C00000;
 
1219
  }
1220
 
1221
  .sec-qualification .hb-heading-2,
@@ -1347,6 +1348,38 @@ table.programs td a,
1347
  font-size: 9.5pt;
1348
  }
1349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1350
  .hb-merged-note {
1351
  font-size: 9.5pt;
1352
  line-height: 1.4;
 
1215
  }
1216
 
1217
  .sec-how .hb-heading-2 {
1218
+ color: #1a1a1a;
1219
+ margin-top: 10pt;
1220
  }
1221
 
1222
  .sec-qualification .hb-heading-2,
 
1348
  font-size: 9.5pt;
1349
  }
1350
 
1351
+ .sec-relocation-cost-breakdown .hb-table,
1352
+ .sec-relocation-cost-breakdown .hb-table.hb-relocation-table {
1353
+ margin: 0 0 10pt;
1354
+ border-collapse: collapse;
1355
+ table-layout: fixed;
1356
+ width: 100%;
1357
+ }
1358
+
1359
+ .sec-relocation-cost-breakdown .hb-table th,
1360
+ .sec-relocation-cost-breakdown .hb-table td,
1361
+ .sec-relocation-cost-breakdown .hb-table.hb-relocation-table th,
1362
+ .sec-relocation-cost-breakdown .hb-table.hb-relocation-table td {
1363
+ vertical-align: top;
1364
+ padding: 4pt 8pt;
1365
+ border: 0.75pt solid #CBD5E1;
1366
+ font-size: 9.5pt;
1367
+ line-height: 1.35;
1368
+ }
1369
+
1370
+ .sec-relocation-cost-breakdown .hb-table th,
1371
+ .sec-relocation-cost-breakdown .hb-table.hb-relocation-table th {
1372
+ background: #1c75bc;
1373
+ color: #ffffff;
1374
+ font-weight: 700;
1375
+ text-transform: uppercase;
1376
+ }
1377
+
1378
+ .sec-relocation-cost-breakdown .hb-table tbody tr:nth-child(even) td,
1379
+ .sec-relocation-cost-breakdown .hb-table.hb-relocation-table tbody tr:nth-child(even) td {
1380
+ background: #eef5fb;
1381
+ }
1382
+
1383
  .hb-merged-note {
1384
  font-size: 9.5pt;
1385
  line-height: 1.4;