Opened 13 years ago

Last modified 13 years ago

#188 closed defect (FIXED)

Media attachments

Reported by: joar Owned by: Christopher Allan Webber
Priority: minor Milestone: 0.0.5
Component: programming Keywords:
Cc: Parent Tickets:

Description

Make it possible to submit an attachment with a media file.



Change History (8)

comment:1 by joar, 13 years ago

Owner: changed from Joar Wandborg to Christopher Webber
Status: NewFeedback
Merge request at
`https://gitorious.org/mediagoblin/mediagoblin/merge\_requests/14 <https://gitorious.org/mediagoblin/mediagoblin/merge_requests/14>`_

Cheers,



comment:2 by Christopher Allan Webber, 13 years ago

Owner: changed from Christopher Webber to Joar Wandborg
Hiya Joar!

So this is looking good, but there's one big problem with it: even
if you disable attachments, the attachment fields still show up in
the submit form, which isn't good!

What I'd prefer instead is to have a button that appears on the
sidebar when you're logged in that says "add attachments"... this
link should link to a separate view that, assuming you're the
relevant user, will let you append a new attachment to the image.

Does that make sense?

This is looking good, though!



comment:3 by joar, 13 years ago

``config_spec.ini`` contains this row

::

    allow_attachments = boolean(default=False)

which should be valid according to
`http://www.voidspace.org.uk/python/configobj.html#mentioning-default-values <http://www.voidspace.org.uk/python/configobj.html#mentioning-default-values>`_.
I know that ``templates/mediagoblin/submit/start.html`` does a
straight ``{% if allow_attachments %}``. Still, it shows.

I'm at a loss for concrete possible causes.



comment:4 by joar, 13 years ago

Owner: changed from Joar Wandborg to Christopher Webber

comment:4 by Christopher Allan Webber, 13 years ago

Owner: changed from Christopher Webber to Joar Wandborg
Okay. I looked it over. I was wrong! Sorry I did a bad review
earlier where I skimmed the code as opposed to testing it out.

It looks like it correctly shows / doesn't show in the attachment
in the form to me.

So a few things:


-  Maybe instead of attachment-%s we should do ['media\_entries',
   entry['\_id'], 'attachments', filename]... in other words, instead
   of:

   ::

                   attachment_public_filepath = mg_globals.public_store.get_unique_filepath( 
                       ['media_entries',
                        unicode('attachment-%s' % entry['_id']),
                        secure_filename(request.POST['attachment'].filename)])


do:

::

                    attachment_public_filepath = mg_globals.public_store.get_unique_filepath( 
                        ['media_entries', entry['_id'], 'attachments',
                         secure_filename(request.POST['attachment'].filename)])


-  Do you think we should provide a way to add attachments
   post-submission? Like more than one? And also deleting
   attachments?

So I was thinking I'd be okay with deferring that last bit of
functionality to another ticket, but now that I think of it there's
a bit of a risk of doing so. Ideally, users shouldn't be able to
submit things that hit the public\_store until their media clears
the processing step, and this writes to the public store
immediately... I'm not sure I'm okay with that.

Hence my thoughts that maybe we should have "add attachments"
support that's available **after** submission and processing
clears. A button could appear in the sidebar of a media entry view
page after things clear saying you can add attachments.

Does that make sense? What do you think?



comment:5 by joar, 13 years ago

Owner: changed from Joar Wandborg to Christopher Webber
Updated merge request!

Feel free to make any changes and/or merge :)

Feedback much appreciated!

`https://gitorious.org/mediagoblin/mediagoblin/merge\_requests/14 <https://gitorious.org/mediagoblin/mediagoblin/merge_requests/14>`_



comment:6 by Christopher Allan Webber, 13 years ago

Status: FeedbackClosed
Looks good to me! Merged!



comment:7 by Will Kahn-Greene, 13 years ago

The original url for this bug was http://bugs.foocorp.net/issues/482 .

Note: See TracTickets for help on using tickets.