diff options
Diffstat (limited to 'mediagoblin/templates/mediagoblin/user_pages/media.html')
-rw-r--r-- | mediagoblin/templates/mediagoblin/user_pages/media.html | 63 |
1 files changed, 57 insertions, 6 deletions
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 90c5a231..3cebe2f9 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -16,15 +16,18 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. #} {% extends "mediagoblin/base.html" %} + +{% 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"> - <img src="{{ request.app.public_store.file_url( - media.media_files.main) }}" /> - <h2> + <h1> {{media.title}} - </h2> + </h1> + <img class="media_image" src="{{ request.app.public_store.file_url( + media.media_files.main) }}" /> <p> Uploaded on {{ "%4d-%02d-%02d"|format(media.created.year, @@ -33,16 +36,64 @@ <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user= media.uploader().username) }}"> {{- media.uploader().username }}</a> - </p> + </p> + {% autoescape False %} <p>{{ media.description_html }}</p> {% endautoescape %} + {% 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 %} - </div> + {% 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" /> + </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 %} + <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> + {% endfor %} + {% include "mediagoblin/utils/pagination.html" %} + </div> + {% endif %} + <div class="grid_4 omega media_sidebar"> <p>This is a sidebar! Yay!</p> </div> |