Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Background and Alignment to dynamic character sheet #395

Closed
ashf opened this issue May 19, 2020 · 3 comments · Fixed by #459
Closed

Add Background and Alignment to dynamic character sheet #395

ashf opened this issue May 19, 2020 · 3 comments · Fixed by #459
Assignees
Labels
area/application Task related to orcpub application itself enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@ashf
Copy link

ashf commented May 19, 2020

Currently the only way to see a character's background and alignment is via the edit screen or exporting as a pdf. Ideally they'd show up here:

image

@datdamnzotz datdamnzotz added area/application Task related to orcpub application itself enhancement New feature or request labels May 28, 2020
@sudonotpseudo
Copy link

I'll try to knock this shortly.

@datdamnzotz
Copy link

datdamnzotz commented Sep 30, 2020

Character summary screen - "Characters" (/pages/dnd/5e/characters) - is built via a call to /dnd/5e/character-summaries which returns EDN list of characters

Via route

"character-summaries" dnd-e5-char-summary-list-route}}

Via map

{:get `character-summary-list}]

character-summary-list or character-summaries produces:

[{:db/id 17592186470293, :orcpub.dnd.e5.character/classes [{:db/id 17592232375062, :orcpub.dnd.e5.character/level 14, :orcpub.dnd.e5.character/class-name "Paladin", :orcpub.dnd.e5.character/subclass-name "Oath of Vengeance"}], 

character-summary-list has a Datomic query I can't seem to figure out how to include the characters alignment and background.

(defn character-summary-list [{:keys [db body conn identity] :as request}]
(let [username (:user identity)
user (find-user-by-username-or-email db username)
following-ids (map :db/id (:orcpub.user/following user))
following-usernames (following-usernames db following-ids)
results (d/q '[:find (pull ?e [:db/id
::se/summary
::se/owner])
:in $ [?idents ...]
:where
[?e ::se/owner ?idents]]
db
(concat
[(:orcpub.user/username user)
(:orcpub.user/email user)]
following-usernames))
characters (mapv
(fn [[{:keys [:db/id ::se/owner ::se/summary]}]]
(assoc
summary
:db/id id
::se/owner (if (= owner (:orcpub.user/email user))
(:orcpub.user/username user)
owner)))
results)]
{:status 200 :body characters}))

Help needed to populate the character list with alignment and backgound (/pages/dnd/5e/characters)
image

@datdamnzotz datdamnzotz added the help wanted Extra attention is needed label Sep 30, 2020
@datdamnzotz
Copy link

Related #467

@datdamnzotz datdamnzotz modified the milestones: 2.5.0.19, 2.5.0.18 Nov 23, 2020
@datdamnzotz datdamnzotz linked a pull request Nov 23, 2020 that will close this issue
5 tasks
@datdamnzotz datdamnzotz removed a link to a pull request Nov 23, 2020
5 tasks
@datdamnzotz datdamnzotz modified the milestones: 2.5.0.18, 2.5.0.19 Nov 23, 2020
datdamnzotz added a commit that referenced this issue Nov 23, 2020
…t-to-dynamic-charactersheet

Partial implementation of #395 Add Background and Alignment to Edit screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/application Task related to orcpub application itself enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants