Organization-based filtering for posts
Context
https://github.com/user-attachments/assets/f00b4a63-7407-4f41-8e8a-b1094f5587aa
This functionality complements the existing category filtering and allows filtering offers by organizations and categories at the same time .
Changes implemented
I have added an organization filtering system in the post listing interface (both offers and inquiries) that:
- Uses the existing application design pattern based on
has_scopeto maintain consistency and follow Rails best practices - Integrates seamlessly with the existing filtering system, allowing combinations with other filters (category, text search)
- Correctly persists filtering parameters between requests
- Improves the UX by keeping the button for creating new posts visible regardless of applied filters
At the technical level, the implementation follows the MVC architecture:
- Model: Addition of the
by_organizationscope in thePostmodel (base class forOfferandInquiry) - Controller: Integration of the new scope in
PostsController, preserving existing filtering logic - View: Modification of filtering partials to include the organization selector, with behavior consistent with the category selector
Benefits for users
- Users can filter content by specific organization, allowing faster access to relevant posts
- Administrators of multiple time banks can visualize and manage posts by organization
- Users can combine filters (e.g., category + organization) for more precise searches
Next steps
This implementation lays the groundwork for future related improvements:
- Saving filtering preferences per user
- Evolving towards an advanced filtering system with more options
@sseerrggii @gmartincor @franpb14 Are we sure we want this feature? 🤔 Not sure if I get the use-case.
Hi @markets yes! @gmartincor is working on #789
In order to facilitate exchanges between organizations we need the ability to filter ofers/demands by organization