diff options
Diffstat (limited to 'mediagoblin/templates/mediagoblin/user_pages/media.html')
-rw-r--r-- | mediagoblin/templates/mediagoblin/user_pages/media.html | 75 |
1 files changed, 32 insertions, 43 deletions
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 433f74dc..7ef64c76 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 %} <div class="grid_11 alpha"> @@ -47,67 +49,61 @@ <h2 class="media_title"> {{ media.title }} </h2> - + {% autoescape False %} + <p>{{ media.description_html }}</p> + {% endautoescape %} <p class="media_uploader"> {% trans date=media.created.strftime("%Y-%m-%d"), user_url=request.urlgen( 'mediagoblin.user_pages.user_home', user=media.uploader().username), username=media.uploader().username -%} - Uploaded on {{ date }} by <a href="{{ user_url }}">{{ username }}</a> + By <a href="{{ user_url }}">{{ username }}</a> on {{ date }} {%- endtrans %} </p> - - {% autoescape False %} - <p>{{ media.description_html }}</p> - {% endautoescape %} - - <br /> - <h3>{% trans %}Comments{% endtrans %}</h3> - - {% if request.user %} - <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', - user= media.uploader().username, - media=media._id) }}" method="POST"> - {{ wtforms_util.render_divs(comment_form) }} - <div class="form_submit_buttons"> - <input type="submit" value="{% trans %}Post comment!{% endtrans %}" class="button" /> - {{ csrf_token }} - </div> - </form> + <h3></h3> + {% if request.user and comments.count() %} + <p><a href="#comment_form">{% trans %}Post a comment{% endtrans %}</a></p> {% endif %} - {% if comments %} {% 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 }} + <div class="comment_content">{% autoescape False %}{{ comment.content_html }} {% endautoescape %} - </div> - - <div class="comment_author">— - <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', + <img src="{{ request.staticdirect('/images/icon_comment.png') }}" /> + <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user = comment_author['username']) }}"> {{ 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("%Y-%m-%d %I:%M%p") }} + {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }} </a> </div> </div> {% endfor %} + {% if request.user %} + <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', + user= media.uploader().username, + media=media._id) }}" method="POST"> + {{ wtforms_util.render_divs(comment_form) }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Post comment!{% endtrans %}" class="button_form" /> + {{ csrf_token }} + </div> + </form> + {% endif %} + {{ render_pagination(request, pagination, request.urlgen('mediagoblin.user_pages.media_home', user = media.uploader().username, @@ -118,26 +114,19 @@ <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>Temporary button holder</h3> <p> {% set edit_url = request.urlgen('mediagoblin.edit.edit_media', user= media.uploader().username, media= media._id) %} - <a href="{{ edit_url }}" - ><img src="{{ request.staticdirect('/images/icon_edit.png') }}" - class="media_icon" /></a> - <a href="{{ edit_url }}">{% trans %}edit{% endtrans %}</a> + <a href="{{ edit_url }}">{% trans %}Edit{% endtrans %}</a> </p> <p> {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete', user= media.uploader().username, media= media._id) %} - <a href="{{ delete_url }}" - ><img src="{{ request.staticdirect('/images/icon_delete.png') }}" - class="media_icon" /></a> - <a href="{{ delete_url }}">{% trans %}delete{% endtrans %}</a> + <a href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a> </p> {% endif %} @@ -155,7 +144,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', |