Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Dynamic layout of locations and categories #32

Open
xingyzt opened this issue Mar 3, 2021 · 0 comments
Open

Dynamic layout of locations and categories #32

xingyzt opened this issue Mar 3, 2021 · 0 comments
Labels
Android For Android version enhancement New feature or request iOS For iOS version

Comments

@xingyzt
Copy link
Member

xingyzt commented Mar 3, 2021

In the ahs-app database, the layout is isolated from the articles themselves. The layout is an ordered list of location objects. Each location object has an ordered list of category objects, which in turn hold article IDs. In addition, location and category objects have the properties "title" and "id": The titles are for display (e.g. "General Information") and ids for semi-permanent references (e.g. "General_Info").

Implementing the layout list will allow content editors to add, modify, and delete categories in real time.

Below is a pseudocode for generating the layout from the database.

database := app.database("ahs-app")
locations := database("layout")
snippets := database("snippets")

for each location in locations:
  insert_in_app(location.title,location.id)
  for each category in location.categories:
    insert_in_location(location.id,category.title,category.id)
    for each id in category.articleIDs:
      snippet := snippets[id]
      insert_in_category(category.id,snippet)
      snippet.onclick:
        article := database("articles/"+id)
        show_article(article)
@xingyzt xingyzt added enhancement New feature or request Android For Android version iOS For iOS version labels Mar 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android For Android version enhancement New feature or request iOS For iOS version
Projects
None yet
Development

No branches or pull requests

1 participant