aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mediagoblin.ini3
-rw-r--r--mediagoblin/db/sql/util.py2
-rw-r--r--mediagoblin/static/css/base.css4
-rw-r--r--mediagoblin/static/js/geolocation-map.js10
-rw-r--r--mediagoblin/templates/mediagoblin/root.html30
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html4
-rw-r--r--mediagoblin/templates/mediagoblin/utils/geolocation_map.html15
-rw-r--r--mediagoblin/tools/text.py26
8 files changed, 64 insertions, 30 deletions
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/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/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/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/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/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/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 &copy;<a
+ href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
+ contributors
+ </li><li>Imaging &copy;<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/tools/text.py b/mediagoblin/tools/text.py
index ea231244..96df49d2 100644
--- a/mediagoblin/tools/text.py
+++ b/mediagoblin/tools/text.py
@@ -38,13 +38,12 @@ HTML_CLEANER = Cleaner(
allow_tags=[
'div', 'b', 'i', 'em', 'strong', 'p', 'ul', 'ol', 'li', 'a', 'br',
'pre', 'code'],
- remove_unknown_tags=False, # can't be used with allow_tags
+ remove_unknown_tags=False, # can't be used with allow_tags
safe_attrs_only=True,
- add_nofollow=True, # for now
+ add_nofollow=True, # for now
host_whitelist=(),
whitelist_tags=set([]))
-TAGS_DELIMITER=',';
def clean_html(html):
# clean_html barfs on an empty string
@@ -68,14 +67,12 @@ def convert_to_tag_list_of_dicts(tag_string):
stripped_tag_string = u' '.join(tag_string.strip().split())
# Split the tag string into a list of tags
- for tag in stripped_tag_string.split(
- TAGS_DELIMITER):
-
+ for tag in stripped_tag_string.split(','):
+ tag = tag.strip()
# Ignore empty or duplicate tags
- if tag.strip() and tag.strip() not in [t['name'] for t in taglist]:
-
- taglist.append({'name': tag.strip(),
- 'slug': url.slugify(tag.strip())})
+ if tag and tag not in [t['name'] for t in taglist]:
+ taglist.append({'name': tag,
+ 'slug': url.slugify(tag)})
return taglist
@@ -85,11 +82,10 @@ def media_tags_as_string(media_entry_tags):
This is the opposite of convert_to_tag_list_of_dicts
"""
- media_tag_string = ''
+ tags_string = ''
if media_entry_tags:
- media_tag_string = (TAGS_DELIMITER+u' ').join(
- [tag['name'] for tag in media_entry_tags])
- return media_tag_string
+ tags_string = u', '.join([tag['name'] for tag in media_entry_tags])
+ return tags_string
TOO_LONG_TAG_WARNING = \
@@ -107,7 +103,7 @@ def tag_length_validator(form, field):
if too_long_tags:
raise wtforms.ValidationError(
- TOO_LONG_TAG_WARNING % (mg_globals.app_config['tags_max_length'], \
+ TOO_LONG_TAG_WARNING % (mg_globals.app_config['tags_max_length'],
', '.join(too_long_tags)))