"""
from mediagoblin.auth import lib as auth_lib
-from mediagoblin.tools import common
+from mediagoblin.tools import common, licenses
class UserMixin(object):
"""
if self['fail_error']:
return common.import_component(self['fail_error'])
+
+ def get_license_data(self):
+ """Return license dict for requested license"""
+ return licenses.SUPPORTED_LICENSES[self.license]
from mediagoblin.db.mongo import migrations
from mediagoblin.db.mongo.util import ASCENDING, DESCENDING, ObjectId
from mediagoblin.tools.pagination import Pagination
-from mediagoblin.tools import url, licenses
+from mediagoblin.tools import url
from mediagoblin.db.mixin import UserMixin, MediaEntryMixin
###################
for media in cursor:
return media.url_for_self(urlgen)
- def get_license_data(self):
- """Return license dict for requested license"""
- return licenses.SUPPORTED_LICENSES[self['license']]
-
@property
def get_uploader(self):
return self.db.User.find_one({'_id': self.uploader})
description_html = Column(UnicodeText) # ??
media_type = Column(Unicode, nullable=False)
state = Column(Unicode, nullable=False) # or use sqlalchemy.types.Enum?
+ license = Column(Unicode, nullable=False)
fail_error = Column(Unicode)
fail_metadata = Column(UnicodeText)
#}
{% block license_content -%}
- License:
- {% if media['license'] %}
- <a href="{{ media['license'] }}">{{ media.get_license_data()['abbreviation'] }}</a>
+ {% trans %}License:{% endtrans %}
+ {% if media.license %}
+ <a href="{{ media.license }}">{{ media.get_license_data().abbreviation }}</a>
{% else %}
- All rights reserved
+ {% trans %}All rights reserved{% endtrans %}
{% endif %}
{% endblock %}