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

feat: add new form to referenceonlist #35

Merged
merged 3 commits into from
Jun 28, 2023
Merged

Conversation

b1rger
Copy link
Contributor

@b1rger b1rger commented Jun 15, 2023

This PR adds a form to the referenceonlist view that allows to add new references.

@b1rger b1rger force-pushed the birger/form-to-referenceonlist branch 3 times, most recently from 03b4ba8 to d070618 Compare June 27, 2023 08:47
@b1rger b1rger marked this pull request as ready for review June 27, 2023 08:49
@b1rger b1rger requested a review from a team June 27, 2023 08:49
Copy link
Collaborator

@sennierer sennierer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works on my setup apart from a CSS issue.
when selecting an item the text in the box is not wrapped. According to a colleague more capable of CSS than I am thats because the text is meant to be truncated but thats not working when the parent modal is set to relativ width (100%) and that is not correctly handed through the whole structure.
Deselecting the select2-selection--single class fixes the problem. It introduces the nowrap

If this is difficult to fix, I think we can all live with that, just wanted to mention it.

screenshot_bibsonomy_1

This commit introduces a `ReferenceNewForm`, which is a basic form for
References. This form is added to the ReferenceOnListView.
The form is also included in the ReferenceOnListView template. It uses
htmx, so the page does not have to reload if a new entry is added.
To make this work, there is a `reinit_select2.html` partial which works
around bugs with the dal/select2 implementation in and htmx.
Another fix is in the `fix_select2_bootstrap_focus.html` partial: if we
want to load a view with a select2 form via a modal, we have to override
a function to prevent the bootstrap modal from stealing the focus.
This commit adds a small javascript snipplet to the
`reference_list.html` template which autofills the bibsonomy forms
`bibs_url` field with the data from the last added bibsonomy.
This commit introduces a `link_to_reference_on` reference tag, which can
be used to include link to the referenceonview from other modules. The
tag expects a model instance as argument. It then creates a link to the
reference on view. If the `modal` argument is passed to the templatetag,
the created link uses htmx to fill a modal with the id #modal-here
@b1rger b1rger force-pushed the birger/form-to-referenceonlist branch from d070618 to 72a3bce Compare June 28, 2023 08:20
@b1rger
Copy link
Contributor Author

b1rger commented Jun 28, 2023

works on my setup apart from a CSS issue.

ah, thanks! I fixed the problem by adding another partial containing the styledefinition:

<style>
.select2-selection__rendered{
  word-wrap: break-word !important;
  text-overflow: inherit !important;
  white-space: normal !important;
}
</style>

@b1rger b1rger merged commit 0ba85eb into dev Jun 28, 2023
@b1rger b1rger deleted the birger/form-to-referenceonlist branch July 4, 2023 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants