Skip to content

Refactor item status code and add to item search page - #2220

Open
jim wants to merge 1 commit into
mainfrom
add-checked-out-status-to-search
Open

Refactor item status code and add to item search page#2220
jim wants to merge 1 commit into
mainfrom
add-checked-out-status-to-search

Conversation

@jim

@jim jim commented Aug 2, 2026

Copy link
Copy Markdown
Member
  • Consolidates most of the status display and search code into a single file and names a concept that was always present: borrow status (which is if an item is available, checked out, etc). There are less nested conditionals in a view helper as a result. It also means that we're more consistent about how we were rendering status values for admins.
  • Creates two new helper methods to make working with the statuses in views clearer. We now have item_status_label, member_item_status_label, and borrow_status_label.
  • Adds tooltips to the two status labels in admin views to make it easier to understand what they mean.
  • Finally, adds these status labels to the new item search view.

Consolidates most of the status display and search code into a single file and names a concept that was always present: borrow status. Creates two new helper methods to make working with the statuses in view clearer. we know have item_status_label, member_item_status_label, and borrow_status_label.
@jim
jim requested a review from a team August 2, 2026 21:13
@phinze phinze self-assigned this Aug 2, 2026

@phinze phinze left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great cleanup! Separating borrow status from item status makes everything a lot clearer.

</td>
<td>
<%= item.status.humanize %>
<td class="no-wrap">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tiny thing: this no-wrap doesn't actually attach. The only rule for it is .items-search th.no-wrap in admin.scss, so a td slips right past. Adding td.no-wrap to that selector should do it.

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