Proposal: Flagging
jacquescrocker opened this issue · 5 comments
allow anyone logged in to flag a project (not just moderators)
moderators would be able to hide a flagged product (with a reason)
If a flag was rejected it could affect the flaggers karma #9
Working on this. I'll push some code and start a PR after I've had some sleep.
Current implementation will allow both projects and users to be reported using the same method. (has_many :reports, as: :reportable
). Reports will be attached to a user/reporter.
The report box. Plan is to also add a link to the project guidelines once it's up. Thoughts on perhaps not including the radio buttons?
Thinking I'll add a '/reports' page and a button in the details panel if that project has been reported and a button on the user's page if they've been reported.
@Wonderbread awesome, thanks!
let's just do a single "Reason" text field, then have it posted as an AuditLog record, with item_type
as 'Flagged'
we could even reuse the audit log form (AuditLogsController#edit) and redirect the user to it after flaggin
basically the simple flow would be:
- click flag btn -> (maybe with a js confirm)
- Post to controller -> AuditLog record gets created (with
item_type
as'flagged'
- redirect to /audit/:id/edit
we can then update the audit log controller auth to allow the owner of that audit log to be able to edit it (instead of just checking for "moderator")
Should all reports go in the audit logs? I feel like that could weigh them down a lot and important things could 'get lost' in the mess.
They way I'm going about it right now is as follows:
- Flag button is clicked
- Report modal/form pops up
- User fills in reason for flagging
- Form POSTs to
reports#create
- Report is validated
- If successful: User is redirected to the report
- If unsuccessful: Either redirected to
reports#edit
or just shown errors on the existing form via AJAX (unsure which way yet)
- Reporter & Moderators can view the report details
- Moderator has options to
- accept report/hide project. the hiding will show up in the audit log as normal
- reject report.
- report is closed (status => accepted|rejected), 'handled_by' is set and it's all reflected on the report page
It's less complicated than the long list makes it seem :)