diff options
20 files changed, 106 insertions, 45 deletions
@@ -36,3 +36,9 @@ Thank you! * Will Kahn-Greene If you think your name should be on this list, let us know! + + +We also are currently borrowing an image in +mediagoblin/static/images/media_thumbs/image.png from the wonderful +people at http://tango.freedesktop.org/ which is in the public +domain... thanks Tango folks!
\ No newline at end of file diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index a270c723..0eb67be4 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -32,6 +32,11 @@ GNU/Linux distro. install. If instead you want to join in as a contributor, see our `Hacking HOWTO <http://wiki.mediagoblin.org/HackingHowto>`_ instead. + There are also many ways to install servers... for the sake of + simplicity, our instructions below describe installing with nginx. + For more recipes, including Apache, see + `our wiki <http://wiki.mediagoblin.org/Deployment>`_. + Prepare System -------------- @@ -165,7 +170,7 @@ And set up the in-package virtualenv:: If you have problems here, consider trying to install virtualenv with the ``--distribute`` or ``--no-site-packages`` options. If - your system's default Python is in the 3.x series you man need to + your system's default Python is in the 3.x series you may need to run ``virtualenv`` with the ``--python=python2.7`` or ``--python=python2.6`` options. @@ -173,7 +178,7 @@ The above provides an in-package install of ``virtualenv``. While this is counter to the conventional ``virtualenv`` configuration, it is more reliable and considerably easier to configure and illustrate. If you're familiar with Python packaging you may consider deploying with -your preferred the method. +your preferred method. Assuming you are going to deploy with FastCGI, you should also install flup:: diff --git a/mediagoblin.ini b/mediagoblin.ini index f10a452f..aee48595 100644 --- a/mediagoblin.ini +++ b/mediagoblin.ini @@ -27,6 +27,9 @@ allow_registration = true ## install other themes. # theme = airy +# Should geotagged images be displayed with a map of the location? +geolocation_map_visible = true + [storage:queuestore] base_dir = %(here)s/user_dev/media/queue diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py index f6a15a12..22375b7f 100644 --- a/mediagoblin/db/mixin.py +++ b/mediagoblin/db/mixin.py @@ -27,6 +27,8 @@ These functions now live here and get "mixed in" into the real objects. """ +import importlib + from mediagoblin import mg_globals from mediagoblin.auth import lib as auth_lib from mediagoblin.tools import common, licenses @@ -112,6 +114,23 @@ class MediaEntryMixin(object): media=self.slug_or_id, **extra_args) + @property + def thumb_url(self): + """Return the thumbnail URL (for usage in templates) + Will return either the real thumbnail or a default fallback icon.""" + # TODO: implement generic fallback in case MEDIA_MANAGER does + # not specify one? + if u'thumb' in self.media_files: + thumb_url = mg_globals.app.public_store.file_url( + self.media_files[u'thumb']) + else: + # no thumbnail in media available. Get the media's + # MEDIA_MANAGER for the fallback icon and return static URL + manager = importlib.import_module(self.media_type) + thumb_url = manager.MEDIA_MANAGER[u'default_thumb'] + thumb_url = mg_globals.app.staticdirector(thumb_url) # use static + return thumb_url + def get_fail_exception(self): """ Get the exception that's appropriate for this error diff --git a/mediagoblin/db/sql/util.py b/mediagoblin/db/sql/util.py index 74b5d73e..bd92393c 100644 --- a/mediagoblin/db/sql/util.py +++ b/mediagoblin/db/sql/util.py @@ -39,7 +39,7 @@ class MigrationManager(object): - migration_registry: where we should find all migrations to run """ - self.name = name + self.name = unicode(name) self.models = models self.session = session self.migration_registry = migration_registry diff --git a/mediagoblin/media_types/image/__init__.py b/mediagoblin/media_types/image/__init__.py index d4720fab..36d7c201 100644 --- a/mediagoblin/media_types/image/__init__.py +++ b/mediagoblin/media_types/image/__init__.py @@ -24,5 +24,5 @@ MEDIA_MANAGER = { # 'mediagoblin.media_types.image.processing'? "sniff_handler": sniff_handler, "display_template": "mediagoblin/media_displays/image.html", - "default_thumb": "images/media_thumbs/image.jpg", + "default_thumb": "images/media_thumbs/image.png", "accepted_extensions": ["jpg", "jpeg", "png", "gif", "tiff"]} diff --git a/mediagoblin/static/css/base.css b/mediagoblin/static/css/base.css index 4120f965..f8a9e014 100644 --- a/mediagoblin/static/css/base.css +++ b/mediagoblin/static/css/base.css @@ -259,6 +259,10 @@ text-align: center; height: 0; } +.hidden { + display: none; +} + .media_sidebar h3 { font-size: 1em; margin: 0 0 5px; diff --git a/mediagoblin/static/images/media_thumbs/image.png b/mediagoblin/static/images/media_thumbs/image.png Binary files differnew file mode 100644 index 00000000..8437a298 --- /dev/null +++ b/mediagoblin/static/images/media_thumbs/image.png diff --git a/mediagoblin/static/js/geolocation-map.js b/mediagoblin/static/js/geolocation-map.js index de49a37d..26d94c5d 100644 --- a/mediagoblin/static/js/geolocation-map.js +++ b/mediagoblin/static/js/geolocation-map.js @@ -31,19 +31,15 @@ $(document).ready(function () { var map = new L.Map('tile-map'); var mqtileUrl = 'http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg'; - var mqtileAttrib = 'Map data © ' - + String(new Date().getFullYear()) - + ' OpenStreetMap contributors, CC-BY-SA.' - + ' Imaging © ' - + String(new Date().getFullYear()) - + ' <a target="_blank" href="http://mapquest.com">MapQuest</a>.'; + var mqtileAttrib = '<a id="osm_license_link">see map license</a>'; var mqtile = new L.TileLayer( mqtileUrl, {maxZoom: 18, attribution: mqtileAttrib, subdomains: '1234'}); - var location = new L.LatLng(latitude, longitude); + map.attributionControl.setPrefix(''); + var location = new L.LatLng(latitude, longitude); map.setView(location, 13).addLayer(mqtile); var marker = new L.Marker(location); diff --git a/mediagoblin/templates/mediagoblin/edit/attachments.html b/mediagoblin/templates/mediagoblin/edit/attachments.html index ee9d5cb7..641306e8 100644 --- a/mediagoblin/templates/mediagoblin/edit/attachments.html +++ b/mediagoblin/templates/mediagoblin/edit/attachments.html @@ -36,12 +36,11 @@ Editing attachments for {{ media_title }} {%- endtrans %}</h1> <div style="text-align: center;" > - <img src="{{ request.app.public_store.file_url( - media.media_files['thumb']) }}" /> + <img src="{{ media.thumb_url }}" /> </div> {% if media.attachment_files|count %} - <h2>Attachments</h2> + <h2>{% trans %}Attachments{% endtrans %}</h2> <ul> {% for attachment in media.attachment_files %} <li> @@ -54,7 +53,7 @@ </ul> {% endif %} - <h2>Add attachment</h2> + <h2>{% trans %]Add attachment{% endtrans %}</h2> {{ wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> <a href="{{ media.url_for_self(request.urlgen) }}">Cancel</a> diff --git a/mediagoblin/templates/mediagoblin/edit/edit.html b/mediagoblin/templates/mediagoblin/edit/edit.html index 3e305ae0..144184df 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit.html +++ b/mediagoblin/templates/mediagoblin/edit/edit.html @@ -34,8 +34,7 @@ <div class="form_box_xl edit_box"> <h1>{% trans media_title=media.title %}Editing {{ media_title }}{% endtrans %}</h1> <div style="text-align: center;" > - <img src="{{ request.app.public_store.file_url( - media.media_files['thumb']) }}" /> + <img src="{{ media.thumb_url }}" /> </div> {{ wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> @@ -46,4 +45,4 @@ </div> </form> -{% endblock %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index 99d3269f..047dd2bb 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -23,12 +23,30 @@ {% if request.user %} {% if request.user.status == 'active' %} <h1>{% trans %}Actions{% endtrans %}</h1> - <p><a href="{{ request.urlgen('mediagoblin.submit.collection') }}"> - {% trans %}Create new collection{% endtrans %} - </a></p> - <p><a href="{{ request.urlgen('mediagoblin.edit.account') }}"> - {%- trans %}Change account settings{% endtrans -%} - </a></p> + <ul> + <li><a href="{{ request.urlgen('mediagoblin.submit.start') }}"> + {%- trans %}Add media{% endtrans -%} + </a></li> + <li><a href="{{ request.urlgen('mediagoblin.submit.collection') }}"> + {%- trans %}Create new collection{% endtrans -%} + </a></li> + <li><a href="{{ request.urlgen('mediagoblin.edit.account') }}"> + {%- trans %}Change account settings{% endtrans -%} + </a></li> + <li><a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel', + user=request.user.username) }}"> + {%- trans %}Media processing panel{% endtrans -%} + </a></li> + {% if request.user.is_admin %} + <li>Admin: + <ul> + <li><a href="{{ request.urlgen('mediagoblin.admin.panel') }}"> + {%- trans %}Media processing panel{% endtrans -%} + </a></li> + </ul> + </li> + {% endif %} + </ul> {% endif %} <h1>{% trans %}Explore{% endtrans %}</h1> {% else %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html index f56ab5ab..9be10321 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html +++ b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html @@ -33,14 +33,13 @@ Really remove {{ media_title }} from {{ collection_title }}? {%- endtrans %} </h1> - + <div style="text-align: center;" > - <img src="{{ request.app.public_store.file_url( - collection_item.get_media_entry.media_files['thumb']) }}" /> + <img src="{{ collection_item.get_media_entry.thumb_url }}" /> </div> - + <br /> - + <p class="delete_checkbox_box"> {{ form.confirm }} <label for="{{ (form.confirm.name) }}">{{ _(form.confirm.label.text) }}</label> diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index ac15dd2f..b870a8ae 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -197,7 +197,9 @@ <p> <a type="submit" href="{{ request.urlgen('mediagoblin.user_pages.media_collect', user=media.get_uploader.username, - media=media._id) }}" class="button_action button_collect" > + media=media._id) }}" + class="button_action button_collect" + title="{% trans %}Add media to collection{% endtrans %}"> </a> </p> {% endif %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_collect.html b/mediagoblin/templates/mediagoblin/user_pages/media_collect.html index a56c9cd3..cefe638b 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media_collect.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media_collect.html @@ -36,12 +36,11 @@ Add {{ title }} to collection {%- endtrans %} </h1> - + <div style="text-align: center;" > - <img src="{{ request.app.public_store.file_url( - media.media_files['thumb']) }}" /> + <img src="{{ media.thumb_url }}" /> </div> - + <br /> <p class="form_field_label"> diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html index a3459206..a3cf0210 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html @@ -31,14 +31,13 @@ Really delete {{ title }}? {%- endtrans %} </h1> - + <div style="text-align: center;" > - <img src="{{ request.app.public_store.file_url( - media.media_files['thumb']) }}" /> + <img src="{{ media.thumb_url }}" /> </div> - + <br /> - + <p class="delete_checkbox_box"> {{ form.confirm }} <label for="{{ (form.confirm.name) }}">{{ _(form.confirm.label.text) }}</label> diff --git a/mediagoblin/templates/mediagoblin/utils/collection_gallery.html b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html index a8742c74..5f8ffea1 100644 --- a/mediagoblin/templates/mediagoblin/utils/collection_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html @@ -31,10 +31,9 @@ {%- if loop.first %} thumb_entry_first {%- elif loop.last %} thumb_entry_last{% endif %}"> <a href="{{ entry_url }}"> - <img src="{{ request.app.public_store.file_url( - media_entry.media_files['thumb']) }}" /> + <img src="{{ media_entry.thumb_url }}" /> </a> - + {% if item.note %} {%- trans note=item.note -%} <br /> diff --git a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html index cd57d1f8..b48678bb 100644 --- a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html +++ b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html @@ -33,6 +33,21 @@ <input type="hidden" id="gps-latitude" value="{{ lat }}" /> </div> + <script> <!-- pop up full OSM license when clicked --> + $(document).ready(function(){ + $("#osm_license_link").click(function () { + $("#osm_attrib").slideToggle("slow"); + }); + }); + </script> + <div id="osm_attrib" class="hidden"><ul><li> + Data ©<a + href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> + contributors + </li><li>Imaging ©<a + href="http://mapquest.com">MapQuest</a></li><li>Maps powered by + <a href="http://leafletjs.com/"> Leaflet</a></li></ul> + </div> <p> <small> {% trans -%} diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index bfd19ee6..b4da5bc1 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -30,8 +30,7 @@ {%- if loop.first %} thumb_entry_first {%- elif loop.last %} thumb_entry_last{% endif %}"> <a href="{{ entry_url }}"> - <img src="{{ request.app.public_store.file_url( - entry.media_files['thumb']) }}" /> + <img src="{{ entry.thumb_url }}" /> </a> {% if entry.title %} <a class="thumb_entry_title" href="{{ entry_url }}">{{ entry.title }}</a> @@ -48,7 +48,7 @@ setup( 'wtforms', 'py-bcrypt', 'nose', - 'werkzeug', + 'werkzeug>=0.7', 'celery==2.5.3', 'kombu==2.1.7', 'jinja2', |