Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin
This commit is contained in:
commit
a473deda9a
@ -18,7 +18,7 @@ import pymongo
|
|||||||
import mongokit
|
import mongokit
|
||||||
from paste.deploy.converters import asint
|
from paste.deploy.converters import asint
|
||||||
from mediagoblin.db.mongo import models
|
from mediagoblin.db.mongo import models
|
||||||
from mediagoblin.db.util import MigrationManager
|
from mediagoblin.db.mongo.util import MigrationManager
|
||||||
|
|
||||||
|
|
||||||
def connect_database_from_config(app_config, use_pymongo=False):
|
def connect_database_from_config(app_config, use_pymongo=False):
|
||||||
|
@ -14,5 +14,5 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from mediagoblin.db.mongo.util import (MigrationManager, ObjectId, InvalidId,
|
from mediagoblin.db.mongo.util import (ObjectId, InvalidId,
|
||||||
DESCENDING)
|
DESCENDING)
|
||||||
|
@ -60,8 +60,9 @@
|
|||||||
{% trans date=media.created.strftime("%Y-%m-%d") -%}
|
{% trans date=media.created.strftime("%Y-%m-%d") -%}
|
||||||
Added on {{ date }}.
|
Added on {{ date }}.
|
||||||
{%- endtrans %}
|
{%- endtrans %}
|
||||||
{% if media['uploader'] == request.user._id or
|
{% if request.user and
|
||||||
request.user['is_admin'] %}
|
(media.uploader == request.user._id or
|
||||||
|
request.user.is_admin) %}
|
||||||
{% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
|
{% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
|
||||||
user= media.get_uploader.username,
|
user= media.get_uploader.username,
|
||||||
media= media._id) %}
|
media= media._id) %}
|
||||||
|
@ -113,7 +113,8 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
{% include "mediagoblin/utils/profile.html" %}
|
{% include "mediagoblin/utils/profile.html" %}
|
||||||
{% if request.user._id == user._id or request.user.is_admin %}
|
{% if request.user and
|
||||||
|
(request.user._id == user._id or request.user.is_admin) %}
|
||||||
<a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{
|
<a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{
|
||||||
user.username }}">
|
user.username }}">
|
||||||
{%- trans %}Edit profile{% endtrans -%}
|
{%- trans %}Edit profile{% endtrans -%}
|
||||||
|
@ -41,8 +41,11 @@ def get_jinja_env(template_loader, locale):
|
|||||||
if SETUP_JINJA_ENVS.has_key(locale):
|
if SETUP_JINJA_ENVS.has_key(locale):
|
||||||
return SETUP_JINJA_ENVS[locale]
|
return SETUP_JINJA_ENVS[locale]
|
||||||
|
|
||||||
|
# jinja2.StrictUndefined will give exceptions on references
|
||||||
|
# to undefined/unknown variables in templates.
|
||||||
template_env = jinja2.Environment(
|
template_env = jinja2.Environment(
|
||||||
loader=template_loader, autoescape=True,
|
loader=template_loader, autoescape=True,
|
||||||
|
undefined=jinja2.StrictUndefined,
|
||||||
extensions=['jinja2.ext.i18n', 'jinja2.ext.autoescape'])
|
extensions=['jinja2.ext.i18n', 'jinja2.ext.autoescape'])
|
||||||
|
|
||||||
template_env.install_gettext_callables(
|
template_env.install_gettext_callables(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user