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

Upload documents #157

Closed
corani opened this issue Feb 23, 2016 · 12 comments
Closed

Upload documents #157

corani opened this issue Feb 23, 2016 · 12 comments
Labels
Milestone

Comments

@corani
Copy link
Contributor

corani commented Feb 23, 2016

I'd like the ability to upload documents by dropping them on an account page. For example, when I drop a document on the Liabilities:Bank:Credit-Card account page, it should store the document in the document folder, under Liabilities/Bank/Credit-Card/<date>.document-name.ext Probably it should ask to enter a date, if the document doesn't start with one, so you don't need to rename the documents in advance.

@aumayr aumayr added the feature label Feb 23, 2016
@aumayr aumayr added this to the v0.3.0 milestone Feb 23, 2016
aumayr added a commit that referenced this issue Feb 23, 2016
- Drop-targets are account names in tree-tables and the header of the
  Account view page.
- Uploads to <document-root>/<Account/Subaccount/...>/<filename>
@aumayr
Copy link
Member

aumayr commented Feb 23, 2016

@corani I implemented a first version of this. Works on account names in tree-tables and the header of the Account view. If a file is dragged over such an area, the background of that area changes to light blue to indicate that a file can be dropped here.

Things missing:

  • Check if the document option is set, valid, and writeable
  • Check if filename already contains date, and if not show a popup, etc.
  • Automated tests

Can you try it out and give feedback if it does what you intended?

@corani
Copy link
Contributor Author

corani commented Feb 23, 2016

Dropping on tables works great, but the header is a bit narrow. Is there any way to make the drop-target a bit bigger? (e.g. add some padding to the top and bottom of the header)

Some more things:

  • It doesn't warn before overwriting a file
  • Chinese characters (probably all non-latin characters) are stripped

@aumayr
Copy link
Member

aumayr commented Feb 23, 2016

Dropping on tables works great, but the header is a bit narrow. Is there any way to make the drop-target a bit bigger? (e.g. add some padding to the top and bottom of the header)

Will do.

It doesn't warn before overwriting a file

Will implement that in step with the filename-date-check

Chinese characters (probably all non-latin characters) are stripped

I think this is because of https://github.com/aumayr/fava/blob/master/fava/application.py#L115

@corani
Copy link
Contributor Author

corani commented Feb 23, 2016

One more, it should create the correct parent folders if they don't yet exist.

@corani
Copy link
Contributor Author

corani commented Feb 23, 2016

I think this is because of https://github.com/aumayr/fava/blob/master/fava/application.py#L115

Looks like a likely culprit. This is low-prio for me, btw. I can live with latin-only

@corani
Copy link
Contributor Author

corani commented Feb 23, 2016

Hmm, for some reason "data-account-name" has suddenly become empty in the tables, causing the documents to be uploaded to the root...

@corani
Copy link
Contributor Author

corani commented Feb 23, 2016

Reading the beancount manual, I noticed "You may specify this option multiple times if you have many such document archives." Another gotcha. If we need a dialog anyway to ask for the date to put in the filename, maybe also let the user pick the document-root, if there are multiple.

@aumayr aumayr modified the milestones: v0.2.4, v0.3.0 Feb 26, 2016
@aumayr
Copy link
Member

aumayr commented Feb 26, 2016

One more, it should create the correct parent folders if they don't yet exist.

Hmm, for some reason "data-account-name" has suddenly become empty in the tables, causing the documents to be uploaded to the root...

Both fixed in 60e7c4d

@aumayr
Copy link
Member

aumayr commented Feb 26, 2016

Remaining TODOs (will update here):

  • Check if file is overriding an existing file
  • Make drop target in Account view bigger
  • Support multiple root folders
  • Check if directory is existing and if not: create it
  • Check if filename starts with YYYY-MM-DD.
  • Upload multiple documents

@aumayr
Copy link
Member

aumayr commented Feb 27, 2016

@corani I implemented the missing parts. Can you test again?

@corani
Copy link
Contributor Author

corani commented Feb 28, 2016

All confirmed working. Awesome!

@aumayr
Copy link
Member

aumayr commented Feb 28, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants