Allow index entries that have no ruleid to associate themselves with a chapter.

master
Pacman Ghost 3 years ago
parent 42a1b16709
commit bf6ed9534b
  1. 2
      asl_rulebook2/webapp/static/SearchResult.js
  2. 5
      asl_rulebook2/webapp/tests/fixtures/full/Kampfgruppe Scherer.index

@ -145,6 +145,8 @@ gMainApp.component( "index-sr", {
// should state which chapter it came from, but this is way overkill for what we need. Instead,
// we look at the ruleid and infer the chapter ID from the first letter (nb: we need to be careful
// handle things like "KGP SSR 2" or "RB CG2".
if ( this.sr.chapter_id )
return this.sr.chapter_id ;
let target = getPrimaryTarget( this.sr ) ;
if ( ! target )
return null ;

@ -3,6 +3,11 @@
{ "title": "Flugfeld Security Blocks, Sector G or Haarnadelkurve Block Bonus",
"content": "Flugfeld Security Blocks: Blocks 4, 9, 14 and 17. See KGS CG1.",
"ruleids": [ "KGS_CG1" ]
},
{ "title": "No ruleid",
"subtitle": "But is part of KGS.",
"chapter_id": "KGS"
}
]

Loading…
Cancel
Save