diff options
Diffstat (limited to 'mediagoblin/templates')
10 files changed, 132 insertions, 130 deletions
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index 3441365f..b8061f24 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -49,7 +49,7 @@ ><img src="{{ request.staticdirect('/images/logo.png') }}" alt="{% trans %}MediaGoblin logo{% endtrans %}" /></a> {% endblock %} - {% if request.user and request.user['status'] == 'active' %} + {% if request.user and request.user.status == 'active' %} <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}"> {% trans %}Submit media{% endtrans %} @@ -61,14 +61,14 @@ {# the following link should only appear when verification is needed #} {% if request.user.status == "needs_email_verification" %} <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', - user=request.user['username']) }}" + user=request.user.username) }}" class="button_action_highlight"> {% trans %}Verify your email!{% endtrans %}</a> {% endif %} <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', - user= request.user['username']) }}"> - {{ request.user['username'] }}</a> + user= request.user.username) }}"> + {{ request.user.username }}</a> (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>) {% else %} diff --git a/mediagoblin/templates/mediagoblin/edit/edit_profile.html b/mediagoblin/templates/mediagoblin/edit/edit_profile.html index bf8fe5c1..2d5daa95 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit_profile.html +++ b/mediagoblin/templates/mediagoblin/edit/edit_profile.html @@ -22,11 +22,11 @@ {% block mediagoblin_content %} <form action="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{ - user['username'] }}" + user.username }}" method="POST" enctype="multipart/form-data"> <div class="grid_8 prefix_1 suffix_1 edit_box form_box"> <h1> - {%- trans username=user['username'] -%} + {%- trans username=user.username -%} Editing {{ username }}'s profile {%- endtrans %} </h1> diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html index 5b8ec789..5ef1a782 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/video.html +++ b/mediagoblin/templates/mediagoblin/media_displays/video.html @@ -21,5 +21,5 @@ {%- endtrans -%} </a> </p> - {% endif %} + {% endif %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index 25ce9e96..0f769f2f 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -25,7 +25,7 @@ {% else %} <div class="grid_11 alpha"> <h1>{% trans %}Hi there, welcome to this MediaGoblin site!{% endtrans %}</h1> - <p>{% trans %}Your finest source for all goblin-related media.{% endtrans %}</p> + <p>{% trans %}This site is running <a href="http://mediagoblin.org">MediaGoblin</a>, an extraordinarily great piece of media hosting software.{% endtrans %}</p> <p>{% trans %}To add your own media, place comments, save your favourites and more, you can log in with your MediaGoblin account.{% endtrans %}</p> {% if allow_registration %} <p>{% trans %}Don't have one yet? It's easy!{% endtrans %}</p> diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 1a19443c..5760a68c 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -37,60 +37,69 @@ {% endblock mediagoblin_head %} {% block mediagoblin_content %} - {% if media %} - <div class="grid_11 alpha"> - <div class="media_image_container"> - {% block mediagoblin_media %} - {% set display_media = request.app.public_store.file_url( - media.get_display_media(media.media_files)) %} - - {# if there's a medium file size, that means the medium size - # isn't the original... so link to the original! - #} - {% if media['media_files'].has_key('medium') %} - <a href="{{ request.app.public_store.file_url( - media['media_files']['original']) }}"> - <img class="media_image" - src="{{ display_media }}" - alt="Image for {{ media.title }}" /> - </a> - {% else %} + <div class="grid_11 alpha"> + <div class="media_image_container"> + {% block mediagoblin_media %} + {% set display_media = request.app.public_store.file_url( + media.get_display_media(media.media_files)) %} + {# if there's a medium file size, that means the medium size + # isn't the original... so link to the original! + #} + {% if media['media_files'].has_key('medium') %} + <a href="{{ request.app.public_store.file_url( + media['media_files']['original']) }}"> <img class="media_image" src="{{ display_media }}" alt="Image for {{ media.title }}" /> + </a> + {% else %} + <img class="media_image" + src="{{ display_media }}" + alt="Image for {{ media.title }}" /> + {% endif %} + {% endblock %} + </div> + <h2 class="media_title"> + {{ media.title }} + </h2> + {% autoescape False %} + <p>{{ media.description_html }}</p> + {% endautoescape %} + <p class="media_specs"> + {% trans date=media.created.strftime("%Y-%m-%d") -%} + Added on {{ date }}. Licensed under an <a href="#">X license</a>. + {%- endtrans %} + {% if media['uploader'] == request.user._id or + request.user['is_admin'] %} + {% set edit_url = request.urlgen('mediagoblin.edit.edit_media', + user= media.get_uploader().username, + media= media._id) %} + <a class="button_action" href="{{ edit_url }}">{% trans %}Edit{% endtrans %}</a> + {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete', + user= media.get_uploader().username, + media= media._id) %} + <a class="button_action" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a> + {% endif %} + </p> + <h3>{% trans %}23 comments{% endtrans %} + <div class="right_align"> + <a + {% if not request.user %} + href="{{ request.urlgen('mediagoblin.auth.login') }}" {% endif %} - {% endblock %} + class="button_action" id="button_addcomment" title="Add a comment"> + {% trans %}Add one{% endtrans %} + </a> </div> - - <h2 class="media_title"> - {{ media.title }} - </h2> - {% autoescape False %} - <p>{{ media.description_html }}</p> - {% endautoescape %} - <p class="media_specs"> - {% trans date=media.created.strftime("%Y-%m-%d") -%} - Added on {{ date }}. Licensed under an <a href="#">X license</a>. - {%- endtrans %} - {% if media['uploader'] == request.user._id or - request.user['is_admin'] %} - {% set edit_url = request.urlgen('mediagoblin.edit.edit_media', - user= media.get_uploader().username, - media= media._id) %} - <a class="button_action" href="{{ edit_url }}">{% trans %}Edit{% endtrans %}</a> - {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete', - user= media.get_uploader().username, - media= media._id) %} - <a class="button_action" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a> - {% endif %} - </p> - <h3>{% trans %}23 comments{% endtrans %} <div class="right_align"><a {% if not request.user %}href="{{ request.urlgen('mediagoblin.auth.login') }}"{% endif %}class="button_action" id="button_addcomment" title="Add a comment">{% trans %}Add one{% endtrans %}</a></div></h3> - {# 0 comments. Be the first to add one! #} + </h3> + {# 0 comments. Be the first to add one! #} {% if request.user %} <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', user= media.get_uploader().username, media=media._id) }}" method="POST" id="form_comment"> - <p>{% trans %}Type your comment here. You can use <a href="http://daringfireball.net/projects/markdown/basics" target="_blank">Markdown</a> for formatting.{% endtrans %}</p> + <p> + {% trans %}Type your comment here. You can use <a href="http://daringfireball.net/projects/markdown/basics" target="_blank">Markdown</a> for formatting.{% endtrans %} + </p> {{ wtforms_util.render_divs(comment_form) }} <div class="form_submit_buttons"> <input type="submit" value="{% trans %}Add this comment{% endtrans %}" class="button_action" /> @@ -101,75 +110,68 @@ {% if comments %} {% for comment in comments %} {% set comment_author = comment.author() %} - {% if pagination.active_id == comment._id %} + {% if pagination.active_id == comment._id %} <div class="comment_wrapper comment_active" id="comment-{{ comment._id }}"> - <a name="comment" id="comment"></a> + <a name="comment" id="comment"></a> {% else %} <div class="comment_wrapper" id="comment-{{ comment._id }}"> - {% endif %} - - <div class="comment_content">{% autoescape False %}{{ comment.content_html }} - {% endautoescape %} - <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, - user = media.get_uploader().username, - media = media._id) }}#comment"> - {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }} - </a> - </div> - </div> + {% endif %} + <div class="comment_content"> + {% autoescape False %} + {{ comment.content_html }} + {% endautoescape %} + <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, + user = media.get_uploader().username, + media = media.slug) }}#comment"> + {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }} + </a> + </div> + </div> {% endfor %} - - {{ render_pagination(request, pagination, - request.urlgen('mediagoblin.user_pages.media_home', - user = media.get_uploader().username, - media = media._id)) }} - </div> + {{ render_pagination(request, pagination, + request.urlgen('mediagoblin.user_pages.media_home', + user = media.get_uploader().username, + media = media._id)) }} {% endif %} - - <div class="grid_5 omega"> - {% trans user_url=request.urlgen( - 'mediagoblin.user_pages.user_home', - user=media.get_uploader().username), - username=media.get_uploader().username -%} + </div> + <div class="grid_5 omega"> + {% trans user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=media.get_uploader().username), + username=media.get_uploader().username -%} <p>❖ Browsing media by <a href="{{ user_url }}">{{ username }}</a></p> - {%- endtrans %} - - {% include "mediagoblin/utils/prev_next.html" %} - - {% if media.attachment_files|count %} - <h3>Attachments</h3> - <ul> - {% for attachment in media.attachment_files %} - <li> - <a href="{{ request.app.public_store.file_url(attachment.filepath) }}"> - {{ attachment.name }} - </a> - </li> - {% endfor %} - </ul> - {% endif %} - - {% if app_config['allow_attachments'] - and (media['uploader'] == request.user._id - or request.user['is_admin']) %} - <p> - <a href="{{ request.urlgen('mediagoblin.edit.attachments', - user=media.get_uploader().username, - media=media._id) }}">Add attachment</a> - </p> - {% endif %} - - {% if media.tags %} - {% include "mediagoblin/utils/tags.html" %} - {% endif %} - </div> - {% else %} - <p>{% trans %}Sorry, no such media found.{% endtrans %}<p/> - {% endif %} + {%- endtrans %} + {% include "mediagoblin/utils/prev_next.html" %} + {% if media.attachment_files|count %} + <h3>Attachments</h3> + <ul> + {% for attachment in media.attachment_files %} + <li> + <a href="{{ request.app.public_store.file_url(attachment.filepath) }}"> + {{ attachment.name }} + </a> + </li> + {% endfor %} + </ul> + {% endif %} + {% if app_config['allow_attachments'] + and (media.uploader == request.user._id + or request.user.is_admin) %} + <p> + <a href="{{ request.urlgen('mediagoblin.edit.attachments', + user=media.get_uploader().username, + media=media._id) }}">Add attachment</a> + </p> + {% endif %} + {% if media.tags %} + {% include "mediagoblin/utils/tags.html" %} + {% endif %} + </div> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html index 058351a5..7c7218ae 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html @@ -27,7 +27,7 @@ method="POST" enctype="multipart/form-data"> <div class="grid_8 prefix_1 suffix_1 edit_box form_box"> <h1> - {%- trans title=media['title'] -%} + {%- trans title=media.title -%} Really delete {{ title }}? {%- endtrans %} </h1> diff --git a/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html index 9b4adeb5..a14b0123 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html +++ b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html @@ -36,8 +36,8 @@ </tr> {% for media_entry in processing_entries %} <tr> - <td>{{ media_entry['title'] }}</td> - <td>{{ media_entry['created'].strftime("%m-%d-%Y %I:%M %p") }}</td> + <td>{{ media_entry.title }}</td> + <td>{{ media_entry.created.strftime("%m-%d-%Y %I:%M %p") }}</td> <td></td> </tr> {% endfor %} @@ -57,7 +57,7 @@ </tr> {% for media_entry in failed_entries %} <tr> - <td>{{ media_entry['title'] }}</td> + <td>{{ media_entry.title }}</td> <td>{{ media_entry['created'].strftime("%m-%d-%Y %I:%M %p") }}</td> <td>{{ media_entry.get_fail_exception().general_message }}</td> </tr> diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 5a39aaa5..b952e88c 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -89,7 +89,7 @@ {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%} </h1> - {% if not user['url'] and not user['bio'] %} + {% if not user.url and not user.bio %} {% if request.user._id == user._id %} <div class="grid_6 alpha empty_space"> <p> @@ -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 -%} diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index e1b8cc9b..65ff09a4 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -33,9 +33,9 @@ <img src="{{ request.app.public_store.file_url( entry['media_files']['thumb']) }}" /> </a> - {% if entry['title'] %} + {% if entry.title %} <br /> - <a href="{{ entry_url }}">{{ entry['title'] }}</a> + <a href="{{ entry_url }}">{{ entry.title }}</a> {% endif %} </td> {% endfor %} diff --git a/mediagoblin/templates/mediagoblin/utils/prev_next.html b/mediagoblin/templates/mediagoblin/utils/prev_next.html index 3363891b..b0c01963 100644 --- a/mediagoblin/templates/mediagoblin/utils/prev_next.html +++ b/mediagoblin/templates/mediagoblin/utils/prev_next.html @@ -25,23 +25,23 @@ {# There are no previous entries for the very first media entry #} {% if prev_entry_url %} <a class="navigation_button navigation_left" href="{{ prev_entry_url }}"> - ← newer + ← {% trans %}newer{% endtrans %} </a> {% else %} {# This is the first entry. display greyed-out 'previous' image #} <p class="navigation_button navigation_left"> - ← newer + ← {% trans %}newer{% endtrans %} </p> {% endif %} {# Likewise, this could be the very last media entry #} {% if next_entry_url %} <a class="navigation_button" href="{{ next_entry_url }}"> - older → + {% trans %}older{% endtrans %} → </a> {% else %} {# This is the last entry. display greyed-out 'next' image #} <p class="navigation_button"> - older → + {% trans %}older{% endtrans %} → </p> {% endif %} </div> |