[COMPOST] [ROLES] manage roles and info displayed on compost page + [FRONT] compost show
Goals
Manage visitors access
Breakdown
- info card
- contribution and use history tabs
- no awaiting contributions tab
- no access data
- no edit button
- contribution form
Manage composter access
Breakdown
- info card
- contribution and use history tabs
- awaiting contributions tab
- access data
- edit button
- no contribution form
Manage validated contributor access
Breakdown
- info card
- contribution and use history tabs
- no awaiting contributions tab
- access data
- edit button
- contribution form
Automate compost status
breakdown
auto close filled composts
do not display contribution form on closed composts
Differents informations for different kind of user
- A visitor can’t create a new compost or see all informations of a compost
- A user have more tabs than visitor but can’t see access data if he didn’t make a request *An owner have one more tab for contributions request and more button to edit his compost
Changes
-
app/views/composts/show.html.erb
: added new tabs « waiting-contributions » for owner + make some information hidden for each kind of user of the website -
app/controllers/composts_controller.rb
: add before_action for new -
app/controllers/composts_controller.rb
: add before_action for create
Hotfixes
- added default value and safe check of compost filling
- added safe check before picture display
Tests
-
as a visitor I can only see the info tab of the compost page : PASSED -
as a logged user I can access the 3 tabs of compost page : infos & contrib & use history : PASSED -
as the owner of a compost I can access the tab with awaiting contributions : PASSED -
as a visitor who hasn't contributed to a compost I can not see the access data : PASSED -
as a visitor who has contributed to a compost I not see the access data : PASSED -
as the composter I can see the access data : PASSED -
as the composter I can see the edit button : PASSED -
as a user who is not the composter I cannot see the edit button : PASSED -
as the composter I can not see the contribution form : PASSED -
as any user I can not see the contribution form of a closed compost : PASSED -
as the composter if I accept a contribution leading to a 100% filling, the compost switches to close status : PASSED -
informations are hidden for visitor, user or owner: PASSED -
tabs work : PASSED -
visitor can’t create a new compost and is redirect in sign_in page if he pushes the button : PASSED -
visitor can’t contribute to a compost and is redirect in sign_in page if he pushes the button : PASSED -
Users can’t see access-data if he didn’t ask for a contribution : PASSED