Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme upload/download/delete #7209

Merged
merged 19 commits into from
Aug 23, 2016

Conversation

kirrg001
Copy link
Contributor

@kirrg001 kirrg001 commented Aug 16, 2016

closes #7204

Upload, download and delete themes within Ghost.

TODO's

  • add download theme (optional right now)
  • permissions for upload
  • permissions for download
  • add permissions via migration --> admin and owner will get more permissions
  • wait for new gscan version
  • check fix in core/server/api/utils.js
  • update available themes after success upload
  • test upload and activate with Ghost-Admin branch
  • delete unused theme endpoints
  • theme is always downloaded as theme.zip
  • delete theme
  • change download /:name/download
  • add test for migration 007/001
  • ensure migration works
  • go over tmp created files again (e.q. after upload --> /tmp folder is created (the code empties it, but still))
  • test download with Ghost-Admin branch
  • go over TODO's
  • use storage.serve for download?
  • use getStorage('themes')
  • run migration again SQLITE_CONSTRAINT: NOT NULL [IGNORED, because that error was not a real use case, because i've added the delete permissions later]
  • optimise upload theme code for custom storage adapters
  • replace sync operations with async
  • only local file storage for theme uploads for now
  • squash some of the commits
  • fix tests
  • code QA before ready to review

@kirrg001 kirrg001 force-pushed the feature/theme-upload-download branch 10 times, most recently from 4842379 to ee13f7e Compare August 17, 2016 14:28
@kevinansfield kevinansfield mentioned this pull request Aug 17, 2016
14 tasks
@kirrg001 kirrg001 force-pushed the feature/theme-upload-download branch 17 times, most recently from 7e37f3f to 3460c8e Compare August 22, 2016 11:17
@kirrg001 kirrg001 force-pushed the feature/theme-upload-download branch from 9664e3f to 3967048 Compare August 22, 2016 15:27
@kirrg001 kirrg001 force-pushed the feature/theme-upload-download branch 2 times, most recently from 3979daf to 41d117b Compare August 23, 2016 08:49
[ci skip]
@kirrg001 kirrg001 force-pushed the feature/theme-upload-download branch from 41d117b to 4cb9f06 Compare August 23, 2016 08:52
@kirrg001 kirrg001 force-pushed the feature/theme-upload-download branch from 4cb9f06 to 615a4f7 Compare August 23, 2016 09:08
// CASE: serve themes
// serveStatic can't be used to serve themes, because
// download files depending on the route (see `send` npm module)
if (options.isTheme) {

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@kirrg001
Copy link
Contributor Author

ready for review. i kept the history of commits, but i would recommend reading the full diff, because it's not a lot to read and 50% are tests 🎉

@kirrg001 kirrg001 changed the title [WIP] theme upload/download/delete theme upload/download/delete Aug 23, 2016
resource = 'theme';

function getPermissions() {
return utils.findModelFixtures('Permission', {object_type: resource});

This comment was marked as abuse.

This comment was marked as abuse.

kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this pull request Aug 23, 2016
refs TryGhost/Ghost#7204, requires TryGhost/Ghost#7209

- replaces theme dropdown with a table
- adds theme upload modal
    - validates theme mime type
    - prevents upload of `casper.zip` (default Casper theme can't be overwritten)
    - warns if an upload will overwrite an existing theme
    - gives option of immediately activating the uploaded theme or closing after successful upload
- adds theme activation link/action
- adds theme download link/action
- adds theme deletion modal
    - warns about no undo possibility
    - offers possibility to download theme
- modifies mirage config to handle theme changes
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this pull request Aug 23, 2016
refs TryGhost/Ghost#7204, requires TryGhost/Ghost#7209

- replaces theme dropdown with a table
- adds theme upload modal
    - validates theme mime type
    - prevents upload of `casper.zip` (default Casper theme can't be overwritten)
    - warns if an upload will overwrite an existing theme
    - gives option of immediately activating the uploaded theme or closing after successful upload
- adds theme activation link/action
- adds theme download link/action
- adds theme deletion modal
    - warns about no undo possibility
    - offers possibility to download theme
- modifies mirage config to handle theme changes
@ErisDS ErisDS merged commit a91e54c into TryGhost:master Aug 23, 2016
mixonic pushed a commit to mixonic/Ghost that referenced this pull request Oct 28, 2016
refs TryGhost#7204

- added 3 new themes permissions
- change core/client
- add theme upload/download logic
- extended local file storage to serve zips
- added gscan dependency
- add ability to handle the express response within the api layer
- restrict theme upload to local file storage
- added 007 migration
geekhuyang pushed a commit to geekhuyang/Ghost that referenced this pull request Nov 20, 2016
refs TryGhost#7204

- added 3 new themes permissions
- change core/client
- add theme upload/download logic
- extended local file storage to serve zips
- added gscan dependency
- add ability to handle the express response within the api layer
- restrict theme upload to local file storage
- added 007 migration
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.

Theme upload/download
2 participants