From efd0a42ca1b81a2dd17aee1626060584a278020c Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 13 Nov 2011 19:51:11 +0100 Subject: Mark two strings for translation --- mediagoblin/templates/mediagoblin/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index b4c4dcf3..925386e5 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -67,7 +67,7 @@ user= request.user['username']) }}"> {{ request.user['username'] }} - (log out) + ({% trans %}log out{% endtrans %}) {% else %} {% trans %}Log in{% endtrans %} -- cgit v1.2.3 From 688f56c2dc579218b35263d0189e5d7c9ba9627f Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 13 Nov 2011 14:34:22 -0600 Subject: Improved title block on media page --- mediagoblin/templates/mediagoblin/user_pages/media.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 17beffb2..2441ec1b 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -20,6 +20,8 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% from "mediagoblin/utils/pagination.html" import render_pagination %} +{% block title %}{{ media.title }} — {{ super() }}{% endblock %} + {% block mediagoblin_content %} {% if media %}
-- cgit v1.2.3 From 017d6ca3501b157277fc01fb37df2dbbd9ed17ef Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 13 Nov 2011 14:38:40 -0600 Subject: Enhanced title for user profile page --- mediagoblin/templates/mediagoblin/user_pages/user.html | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index c5beeaaa..d65da055 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -26,6 +26,17 @@ user=user.username) }}"> {% endblock mediagoblin_head %} +{% block title %} + {%- if user -%} + {%- trans username=user.username -%} + {{ username }}'s profile + {%- endtrans %} — {{ super() }} + {%- else -%} + {{ super() }} + {%- endif -%} +{% endblock %} + + {% block mediagoblin_content -%} {# If no user... #} {% if not user %} -- cgit v1.2.3 From 7fc25d27208ef9926e94eeba953160ffbe676942 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 13 Nov 2011 14:40:11 -0600 Subject: If the gallery view makes sure we have a user anyway, do we need this check? Seems like the classic annoying "SHOULD NEVER HAPPEN" else: statement :) --- .../templates/mediagoblin/user_pages/gallery.html | 39 ++++++++++------------ 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html index df931d9c..86105493 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/gallery.html +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -27,28 +27,23 @@ {% endblock mediagoblin_head %} {% block mediagoblin_content -%} - {% if user %} -

- {%- trans username=user.username, - user_url=request.urlgen( - 'mediagoblin.user_pages.user_home', - user=user.username) -%} - {{ username }}'s media - {%- endtrans %} -

+

+ {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username) -%} + {{ username }}'s media + {%- endtrans %} +

- + -
- {% set feed_url = request.urlgen( - 'mediagoblin.user_pages.atom_feed', - user=user.username) %} - {% include "mediagoblin/utils/feed_link.html" %} -
- {% else %} - {# This *should* not occur as the view makes sure we pass in a user. #} -

{% trans %}Sorry, no such user found.{% endtrans %}

- {% endif %} +

+ {% set feed_url = request.urlgen( + 'mediagoblin.user_pages.atom_feed', + user=user.username) %} + {% include "mediagoblin/utils/feed_link.html" %} +
{% endblock %} -- cgit v1.2.3 From ab56689017daa985f3938af4710f3c76ad415bda Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 13 Nov 2011 14:42:03 -0600 Subject: Enhanced title on the user's main media gallery --- mediagoblin/templates/mediagoblin/user_pages/gallery.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html index 86105493..b066dd71 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/gallery.html +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -26,6 +26,12 @@ user=user.username) }}"> {% endblock mediagoblin_head %} +{% block title %} + {%- trans username=user.username -%} + {{ username }}'s media + {%- endtrans %} — {{ super() }} +{% endblock %} + {% block mediagoblin_content -%}

{%- trans username=user.username, -- cgit v1.2.3 From 4671fda345394dad9ca4278b1cf7b2cdf7d2b4ee Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 13 Nov 2011 14:48:51 -0600 Subject: Improving on tag page *and* adjusting translation for RTL reasons Basically moving the variable inside the translation to give translators more flexibility --- mediagoblin/templates/mediagoblin/listings/tag.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/listings/tag.html b/mediagoblin/templates/mediagoblin/listings/tag.html index 58863015..f797f72f 100644 --- a/mediagoblin/templates/mediagoblin/listings/tag.html +++ b/mediagoblin/templates/mediagoblin/listings/tag.html @@ -26,9 +26,13 @@ tag=tag_slug) }}"> {% endblock mediagoblin_head %} +{% block title %} + {% trans %}Media tagged with: {{ tag_name }}{% endtrans %} — {{ super() }} +{% endblock %} + {% block mediagoblin_content -%} <h1> - {% trans %}Media tagged with:{% endtrans %} {{ tag_name }} + {% trans %}Media tagged with: {{ tag_name }}{% endtrans %} </h1> <div class="container_16 media_gallery"> -- cgit v1.2.3 From 2b7aa99d3c221e713a95b664491f35612f9023cc Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber <cwebber@dustycloud.org> Date: Sun, 13 Nov 2011 20:39:42 -0600 Subject: Only show "post a comment" link if comments already exist The purpose of the link is to help you jump past comments to the comment box, and so... Even with this new conditional, I'm not entirely sure I like that link ;) --- mediagoblin/templates/mediagoblin/user_pages/media.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 2441ec1b..1e495b98 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -62,7 +62,7 @@ {%- endtrans %} </p> <h3></h3> - {% if request.user %} + {% if request.user and comments.count() %} <p><a href="#comment_form">{% trans %}Post a comment{% endtrans %}</a></p> {% endif %} {% if comments %} -- cgit v1.2.3 From eabe6b678a98fd06d9cd8463935a3b842f41485c Mon Sep 17 00:00:00 2001 From: Elrond <elrond+mediagoblin.org@samba-tng.org> Date: Sun, 13 Nov 2011 19:25:06 +0100 Subject: Dot-Notation for "_id" Note: Migrations can't use "Dot Notation"! Migrations run on pymongo, not mongokit. So they can't use the "Dot Notation". This isn't really a big issue, as migrations are anyway quite mongo specific. --- mediagoblin/templates/mediagoblin/user_pages/media.html | 10 +++++----- mediagoblin/templates/mediagoblin/user_pages/user.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 1e495b98..4b02b684 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -69,10 +69,10 @@ {% for comment in comments %} {% set comment_author = comment.author() %} {% if pagination.active_id == comment._id %} - <div class="comment_wrapper comment_active" id="comment-{{ comment['_id'] }}"> + <div class="comment_wrapper comment_active" id="comment-{{ comment._id }}"> <a name="comment" id="comment"></a> {% else %} - <div class="comment_wrapper" id="comment-{{ comment['_id'] }}"> + <div class="comment_wrapper" id="comment-{{ comment._id }}"> {% endif %} <div class="comment_content">{% autoescape False %}{{ comment.content_html }} @@ -83,7 +83,7 @@ {{ comment_author['username'] }}</a> {% trans %}at{% endtrans %} <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment', - comment = comment['_id'], + comment = comment._id, user = media.uploader().username, media = media._id) }}#comment"> {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }} @@ -114,7 +114,7 @@ <div class="grid_5 omega"> {% include "mediagoblin/utils/prev_next.html" %} - {% if media['uploader'] == request.user['_id'] or + {% if media['uploader'] == request.user._id or request.user['is_admin'] %} <h3>{% trans %}Actions{% endtrans %}</h3> <p> @@ -151,7 +151,7 @@ {% endif %} {% if app_config['allow_attachments'] - and (media['uploader'] == request.user['_id'] + and (media['uploader'] == request.user._id or request.user['is_admin']) %} <p> <a href="{{ request.urlgen('mediagoblin.edit.attachments', diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index d65da055..1de7f611 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -90,7 +90,7 @@ </h1> {% if not user['url'] and not user['profile'] %} - {% if request.user['_id'] == user['_id'] %} + {% if request.user._id == user._id %} <div class="grid_6 alpha empty_space"> <p> {% trans %}Here's a spot to tell others about yourself.{% endtrans %} @@ -113,7 +113,7 @@ {% else %} <div class="grid_6 alpha"> {% include "mediagoblin/utils/profile.html" %} - {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %} + {% if request.user._id == user._id or request.user['is_admin'] %} <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{ user.username }}"> {%- trans %}Edit profile{% endtrans -%} @@ -140,7 +140,7 @@ {% include "mediagoblin/utils/feed_link.html" %} </div> {% else %} - {% if request.user['_id'] == user['_id'] %} + {% if request.user._id == user._id %} <div class="grid_10 omega empty_space"> <p> {% trans -%} -- cgit v1.2.3