Add feature to be able to upload a file to an issue
Created by: tudorpavel
The idea of this feature is to have the possibility of uploading a file to an issue, not just to comments. This implementation works just for the simpler case of only one file per issue.
Feature requests:
- http://feedback.gitlab.com/forums/176466-general/suggestions/4501700-allow-image-attachments-when-creating-new-issues
- http://feedback.gitlab.com/forums/176466-general/suggestions/4095092-allow-file-uploads-to-an-issue
User Interface
The implementation consists of:
- a slightly modified add/edit issue form
- a slightly modified show issue page
Add/Edit Form
After, without any attachment:
After, with non-image file attachment:
Show page
After, with non-image file attachment:
Implementation
- migration to add attachment column to the issues table
- modify Issue model to add CarrierWave attachment the same way it's done for Note
- add issue
:delete_attachment
route - add attachment code and style in views so it looks and works very similar to the notes attachment
- had to generalize
FilesController#download
to work with any model