contentify icon indicating copy to clipboard operation
contentify copied to clipboard

Organizing docs into folders

Open quinn opened this issue 10 years ago • 7 comments

hey all, I'm going to work on this on a fork, but I wanted to check first if there had been any thought or work put into this. If there has I'd love to know about it so I can avoid reinventing the wheel and make sure to use any design decisions that have already been made. Thanks!

quinn avatar May 16 '14 15:05 quinn

Compare url of what I have so far (seems to let you generate folders now): https://github.com/empirical-org/contentify/compare/thyb:gh-pages...empirical-org:gh-pages

quinn avatar May 17 '14 01:05 quinn

Hi Quinn,

Thanks a lot, your message comes at the good timing, I was thinking how to integrate folders when I received this Github issue :)

It's a good start, it looks to do the job, can I start to integrate it and make the UI on top of it? Or are you going to make some improvement and I should wait?

thyb avatar May 17 '14 20:05 thyb

hi thibaud, I was actually going to redo some of this. I was thinking that it would make more sense to put the folder hierarchy into the json rather than storing the full file paths. Does that make sense? I would then modify the document manager a bit to support folders. The other option would be to create a separate controller and manager for folders, but I thought modifying the existing document stuff would be better. I pushed my changes to the compare url above... some of it is my local config junk that i modified which won't be in the actual pull request. let me know what you think.

quinn avatar May 18 '14 14:05 quinn

Super, I think what you've suggested is nice :) Thanks,

Modifying the Document Manager is what I had in mind, it should be the easiest way to support folders. And indeed, having the folder hierarchy directly inside documents.json should be nice.

Are you thinking about something like this ?

{
    "hello_world.md": {
         "name": "README",
         "create": 1397153982210,
         "updated": 1399604201966
    },
    "dir1": {
         "document1.md": {
              "name": "README",
              "create": 1397153982210,
              "updated": 1399604201966
         },
         ...
    }
}

Let me know if you need any help somewhere ;)

thyb avatar May 18 '14 20:05 thyb

Yeah, exactly. I pushed some more stuff. It seems to work right now to create a file / folder in a folder, and I'm working it out now to be able to create folders in folders in folders.. etc.

quinn avatar May 18 '14 21:05 quinn

Added a bit more. any feedback / do you want to try it out now?

quinn avatar May 23 '14 19:05 quinn

Thanks a lot! I merged your version with few improvements.

  • I fixed a bug when you create a folder or a document in a subfolder (it wasn't taking the parents folder to build the path)
  • I added an arian link for navigation in parent folders and icon in the document list

I'm currently searching a way to add a remove folder button somewhere but I don't want something too aggressive that can delete all files of a folder in one click (it could be dangerous ^^)

Keep in touch, Thanks again,

thyb avatar May 31 '14 00:05 thyb