-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(relations): list relations under tabs #1276
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! We should discuss in JFX if this should be the default. An "ALL" tab would definitly make sene.
Regarding the problem with all relations being listed after a change: do you already know what we need to change to fix that? Mabye we have to refactor the list_relations.html
template a bit and pass the target as an argument...
Didn't look into the code, but from HTML inspection I noticed that the new relations are in the correct div (as in they have the expected id element) but missing the necessary classes ( Fixed this bug and now new relations are getting added in the correct place automatically. Will force push now. |
120c40e
to
035b1aa
Compare
look into keeping both options |
035b1aa
to
62100cd
Compare
4dc44f2
to
3f75d7f
Compare
@b1rger I tried to override the person template to use the tabbed view of relations for sample_project - 3f75d7f It looks like it displays the relations in tabs and via the block.super call, it also displays the relations in the grouped list format and I can't quite figure out how to skip the overridden template in Am I doing something wrong here? |
Sorry, I'm not quite sure what you want to achieve. Why don't you drop the |
Because your template (https://github.com/acdh-oeaw/apis-core-rdf/blob/main/apis_core/relations/templates/apis_core/apis_entities/abstractentity_detail.html) invokes I am thinking that it would work if the relations table had their own block that gets overridden by the different templates.... |
3f75d7f
to
07139e1
Compare
Modified PR to provide tabbed listing as a separate template. Used in sample project Person (Place and Group use the default listing)
Anchor elements/scrolling - will implement as part of another PR
The current templates to list relations - both default and tabbed do not contain a header column |
07139e1
to
991fd42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please move the introduction of the
relations-include
block into a separate PR - I'm not sure what the "To Be Done" in one of the commit messges means - does it mean that this PR is still a draft and those things will be implemented? Or should those todos be implemented after the PR is merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change if I override col-one
in my ontology (to point to the tabs relation template,- in the inheritance chain the call to block.super
includes the col-one
from the templates in relations first - which includes default listing of relations.
This allows me to only override the part that includes the relations template within col-one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please move the introduction of the
relations-include
block into a separate PR
Considering I cannot override the relations template correctly (i.e. with the default and the alternative horizontal tab template both including block.super
call in col-one
), I think it should be part of this PR. But if you strongly feel that it doesn't belong here, please convince me too.
- I'm not sure what the "To Be Done" in one of the commit messges means - does it mean that this PR is still a draft and those things will be implemented? Or should those todos be implemented after the PR is merged?
Oops that was meant for me - shouldn't have sent it with the PR for review. It's now removed, thanks!
991fd42
to
10b3a52
Compare
Maybe a quote from a recent article can convince you:
Additionally, the 2-line change of adding the |
I'm not sure if we talk about the same change. I'm talking about the addition of the |
Yep I misunderstood. This change checks if a specific target group exists because, when this file is included under the ALL tab The template function So along the lines of your earlier comment - do you think I should treat this as a separate "bug" even though if I can't reproduce the bug without this PR? |
5db43c6
to
42c2e7d
Compare
42c2e7d
to
b34c4df
Compare
{% for target in possible_targets %} | ||
<div class="tab-pane container" | ||
id="reltab_{{ object.id }}_{{ target.name }}" | ||
hx-swap-oob="true">{% include "relations/list_relations.html" %}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is still a hx-swap-oob
leftover
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
facepalm Fixed now.
b34c4df
to
6ece796
Compare
Displays the relations in a tabbed view with ALL tab appearing in the beginning, followed by the other target groups. closes #489
Person - view and edit pages list relations in a tabbed format by overriding relations-include block in col-one
6ece796
to
59e311e
Compare
This pull request includes an update to the
list_relations_include.html
template to enhance the user interface by switching from a card layout to a tabbed navigation layout.UI Improvements:
apis_core/relations/templates/relations/list_relations_include.html
: Replaced the card layout with a tabbed navigation layout to improve the user experience. The new layout uses Bootstrap's tab component to organize relation targets into tabs.closes #489
TO DISCUSS
This is not implemented in this pull request.When new relations are created, they should be added to the correct element so that they are not displayed under all tabsAfter new relations are created, they appear correctly in the active tab but need a refresh for them to appear in the ALL tab.