-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
4507 pray and pay api #4519
4507 pray and pay api #4519
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@albertisfu @mlissner I think a rough version of the API endpoint is done. Apologies for any errors, I mostly followed |
Very cool. Thanks @v-anne. I'll put it on Alberto's backlog for review. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…rtlistener into 4507-pray-and-pay-API
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Sorry about that @ERosendo. I didn't catch that issue in my local testing. I suspect it was caused by the following line in class="btn btn-default btn-xs prayer-button {% if not prayer_eligible %}disabled{% endif %}" |
Don't worry @v-anne @mlissner check out this GIF showing the button's functionality with htmx. This refactor addresses the issues highlighted in #4519 (comment). Let me know your thoughts. |
I like your changes to it. It's easier to see which documents a user has requested. The only suggestion I have is to more clearly disable the button (perhaps by making it unclickable) for documents that users haven't previously requested once their quota is exhausted. This is referring to Attachment 5 and Document 2 in your gif. Also, do the different states of the button have corresponding mouseover text? |
Replaces inline styles on the pray button with class-based styles in `override.css` for better maintainability and consistency.
Creates a reusable HTML fragment for the pray button
Updates the pray_button.html fragment to use the prayer_exists context variable. This provides a visual cue to users by changing the button's style when a document has already been requested.
Adds a custom JS script to the pray button element to provide immediate visual feedback to users upon interaction. This includes updating the button's appearance and incrementing/decrementing a counter to display the total number of prayers.
Yes @v-anne. Here are screenshots: |
Removes `user_prayer_count` and `user_prayer_cost` variables from the `open_prayers` view as they are no longer used in the template.
This looks great! Just want to note a bug I found when testing locally: when trying to toggle a button that is currently untoggled, the mouseover reads "You have reached your daily request limit" even if I haven't exhausted the quota. I can't figure out what's wrong with this code, but for some reason the if statement never trips the "Click to request this document" case. <button type="submit"
class="btn btn-xs {% if prayer_exists %}btn-primary{% else %}btn-default{% endif %}"
data-document-id="{{ document_id }}"
title="{% if prayer_exists %}Click to remove your request.{% elif not prayer_eligible %}You have reached your daily request limit.{% else %}Click to request this document.{% endif %}"
> Edit: never mind, I think it's a limitation of not refreshing the page between each interaction with a button. I think that's fine. |
One last thing -- I think it would be helpful to have an explanation on |
I finally caught up here. I haven't looked at the code, but if everybody's happy and it's behind a waffle, let's merge. @ERosendo or @albertisfu, one of you want to go for it? I think this feature needs a lot of explanation to users before we launch it, both on the top-prayers page, and on the docket pages themselves, but let's get this merged and then we can play with that with some feedback from others. |
Adds logic to check the prayers flag before computing prayer counts and adding them to the recap records.
This commit updates the prayer button template to add a tooltip that displays a message informing the user that they have reached their daily limit.
That's disappointing, but we'll figure it out. Mike, do you know if this PR also created issues with the RECAP extension? On PACER I no longer see the button to save a document to CourtListener. |
Sorry @v-anne :( . @mlissner I found the issue. In commit 09a9dd7, I added HTMX by updating the To avoid this conflict, we should simply include the |
I thought it would be something like that, thanks. I don't think this would also affect the extension, but we could open a new issue if needed for that. |
This is the PR for #4507, adding the API and frontend for the pray-and-pay project. It follows up on #4386 and #4498.