sillsdev / appbuilder-pwa

Progress Web App template for Scripture App Builder
https://software.sil.org/scriptureappbuilder
MIT License
8 stars 22 forks source link

Contents layout can specify book collection #612

Open davidmoore1 opened 6 days ago

davidmoore1 commented 6 days ago

When we get to dual pane and verse by verse, there is more to be done. But for now, it should probably be that if a contents entry is a reference entry, then the layout needs to be examined, if it is present. If it contains one or more layout-collections, then the book collection should be changed to the first one in the list. From contents.xml

   <contents-item id="1">
      <title lang="default">Noah and the Great Flood</title>
      <title lang="es">Noé y el Gran Giluvio</title>
      <audio lang="default">Noah.mp3</audio>
      <image-filename>01_Ge_07_08.png</image-filename>
      <link type="reference" target="GEN.6" />
      <layout mode="single">
        <layout-collection id="ENGWEB"/>
      </layout>
    </contents-item>

In this case, the reference it goes to should also require shifting to ENGWEB book collection.

A two pane or verse by verse layout will contain multiple layout-collection entries. Until we support these modes, just get the first layout collection as the book collection to shift to.

    <contents-item id="8">
      <title lang="default">Crucifixion of Jesus</title>
      <image-filename>JF-Crucifixion-Scene-Large.jpg</image-filename>
      <link type="reference" target="MAT.27.33" />
      <layout mode="two">
        <layout-collection id="ENGWEB"/>
        <layout-collection id="CUKNVS"/>
      </layout>
    </contents-item>

And finally, a reference does not have to include a layout section (Use current layout option). In this case, the entry looks like this:

    <contents-item id="10">
      <title lang="default">Mateo</title>
      <link type="reference" target="MAT" />
    </contents-item>

This would be treated as it currently is implemented, without specifying a book collection and pressing the entry takes you to the reference in the current book collection.