diff options
Diffstat (limited to 'mediagoblin/templates')
3 files changed, 55 insertions, 85 deletions
diff --git a/mediagoblin/templates/mediagoblin/media_details.html b/mediagoblin/templates/mediagoblin/media_details.html deleted file mode 100644 index 0e907616..00000000 --- a/mediagoblin/templates/mediagoblin/media_details.html +++ /dev/null @@ -1,37 +0,0 @@ -{# -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 Free Software Foundation, Inc -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# 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/>. -#} -{% extends "mediagoblin/base.html" %} -{% block mediagoblin_content %} - {# temporarily, an "image gallery" that isn't one really ;) #} - {% if media %} - <div class="grid_8 alpha media_image"> - <img src="{{ request.app.public_store.file_url( - media.media_files.main) }}" /> - <h1>Media details for {{media.title}}</h1> - <p> - <br/>Uploaded: {{ media.created}} - <br/>Description: {{media.description}} - </p> - </div> - <div class="grid_4 omega sidebar"> - <p>Uploaded: {{ media.created}}</p> - </div> - {% else %} - <p>Sorry, no such media found.<p/> - {% endif %} -{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index e16f1e00..0c13f5c4 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -20,12 +20,8 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %} - {# temporarily, an "image gallery" that isn't one really ;) #} {% if media %} <div class="grid_8 alpha media_image"> - <h1> - {{media.title}} - </h1> {% if media.media_files.medium %} <img class="media_image" src="{{ request.app.public_store.file_url( media.media_files.medium) }}" /> @@ -33,76 +29,86 @@ <img class="media_image" src="{{ request.app.public_store.file_url( media.media_files.main) }}" /> {% endif %} + + <h2> + {{media.title}} + </h2> + + {% autoescape False %} + <p>{{ media.description_html }}</p> + {% endautoescape %} + <p> - Uploaded on + — uploaded on {{ "%4d-%02d-%02d"|format(media.created.year, media.created.month, media.created.day) }} by <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user= media.uploader().username) }}"> {{- media.uploader().username }}</a> - </p> - - {% autoescape False %} - <p>{{ media.description_html }}</p> - {% endautoescape %} + </p> + <br /><br /> - {% if media['uploader'] == request.user['_id'] %} - <p><a href="{{ request.urlgen('mediagoblin.edit.edit_media', - user= media.uploader().username, - media= media._id) }}">Edit</a></p> - {% endif %} + <h3>Comments</h3> {% if request.user %} <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', user= media.uploader().username, media=media._id) }}" method="POST"> - <h3>Post a comment!</h3> {{ wtforms_util.render_field_div(comment_form.comment) }} <div class="form_submit_buttons"> - <input type="submit" value="Submit" class="button" /> + <input type="submit" value="Post comment!" class="button" /> </div> </form> {% endif %} - {# - {{ wtforms_util.render_textarea_div(submit_form.description) }} - {{ wtforms_util.render_field_div(submit_form.file) }} - #} - {% if comments %} - <h3>Comments</h3> {% for comment in comments %} + {% set comment_author = comment.author() %} <div class="comment_wrapper" id="comment-{{ comment['_id'] }}"> - <div class="comment_author">By: - <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', - user = comment['author']['username']) }}"> - {{ comment['author']['username'] }} - </a> - </div> - <div class="comment_datetime"> - <a href="#comment-{{ comment['_id'] }}"> - {{ "%4d-%02d-%02d %02d:%02d"|format(comment.created.year, - comment.created.month, - comment.created.day, - comment.created.hour, - comment.created.minute) }} - </a> - </div> <div class="comment_content"> {% autoescape False %} {{ comment.content_html }} {% endautoescape %} - </div> - </div> + </div> + <div class="comment_author">— + <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', + user = comment_author['username']) }}"> + {{ comment_author['username'] }}</a> at + <!--</div> + <div class="comment_datetime">--> + <a href="#comment-{{ comment['_id'] }}"> + {{ "%4d-%02d-%02d %02d:%02d"|format(comment.created.year, + comment.created.month, + comment.created.day, + comment.created.hour, + comment.created.minute) }} + </a> + </div> + </div> {% endfor %} + {% include "mediagoblin/utils/pagination.html" %} </div> {% endif %} - <div class="grid_4 omega media_sidebar"> - <p>This is a sidebar! Yay!</p> + <h3>Sidebar content here!</h3> + <p> + {% if media['uploader'] == request.user['_id'] %} + <p> + <a href="{{ request.urlgen('mediagoblin.edit.edit_media', + user= media.uploader().username, + media= media._id) }}" + ><img src="{{ request.staticdirect('/images/icon_edit.png') }}" + class="media_icon" />edit</a> + </p> + <p> + <img src="{{ request.staticdirect('/images/icon_delete.png') }}" + class="media_icon" />delete + </p> + {% endif %} + </p> </div> {% else %} - <p>Sorry, no such media found.<p/> + <p>Sorry, no such media found.<p/> {% endif %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html index 2be0b92e..7b55b81d 100644 --- a/mediagoblin/templates/mediagoblin/utils/pagination.html +++ b/mediagoblin/templates/mediagoblin/utils/pagination.html @@ -17,19 +17,19 @@ {# only display if {{pagination}} is defined #} -{% if pagination %} +{% if pagination and pagination.pages > 1 %} <div class="pagination"> - + <p> {% if pagination.has_prev %} - <a href="{{ pagination.get_page_url(request, pagination.page-1) }}">« Prev</> + <a href="{{ pagination.get_page_url(request, pagination.page-1) }}">« Prev</a> {% endif %} {%- for page in pagination.iter_pages() %} {% if page %} {% if page != pagination.page %} - <a href="{{ pagination.get_page_url(request, page) }}">{{ page }}</a> + <a href="{{ pagination.get_page_url(request, page) }}">{{ page }}</a> {% else %} - <strong>{{ page }}</strong> + {{ page }} {% endif %} {% else %} <span class="ellipsis">…</span> @@ -39,6 +39,7 @@ {% if pagination.has_next %} <a href="{{ pagination.get_page_url(request, pagination.page + 1) }}">Next »</a> {% endif %} + </p> </div> {% endif %} |