mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GMG-Devel] PDF support


From: Christopher Allan Webber
Subject: Re: [GMG-Devel] PDF support
Date: Thu, 08 Nov 2012 07:22:34 -0600
User-agent: mu4e 0.9.9-dev6; emacs 24.0.92.1

Heya Sebastian, this is really exciting!

I'll just comment on the /mgoblin_media bit for now:

Sebastian Spaeth writes:

> I am giving up for now, but I think merging in this code post-release 
> would be a good foundation to get something better going. My biggest 
> roadblock is the auto-prefixing of "/mgoblin_media" somewhere and I need 
> to track that down.

The part that does this in the codebase is:

    <a href="{{ entry_url }}">
      <img src="{{ request.app.public_store.file_url(
                     entry.media_files['thumb']) }}" />
    </a>

we would need to probably change this to something like:

    <a href="{{ entry_url }}">
      {% if entry.media_files.has_key('thumb') %}
        <img src="{{ request.app.public_store.file_url(
                       entry.media_files['thumb']) }}" />
      {% else %}
        <img src="{{ request.staticdirect(entry.thumb_fallback) }}" />
      {% endif %}
    </a>

where we extended MediaEntry to have a thumb_fallback method that was
able to check the media type's "default_thumb" attribute in the
MEDIA_MANAGER.

This would work.  As a semi-side note, it wouldn't be ideal because it
would only work with a media type that's bundled directly with
MediaGoblin until we allow external plugins/media types to nicely
provide static files.  But we need that functionality anyway, and in the
interim, this should be fine.

 - Chris


reply via email to

[Prev in Thread] Current Thread [Next in Thread]