diff options
Diffstat (limited to 'mediagoblin/templates')
19 files changed, 434 insertions, 188 deletions
diff --git a/mediagoblin/templates/mediagoblin/404.html b/mediagoblin/templates/mediagoblin/404.html new file mode 100644 index 00000000..5af46a87 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/404.html @@ -0,0 +1,34 @@ +{# +# 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 %} + <h1>{% trans %}Oops!{% endtrans %}</h1> + + <div class="grid_8 alpha"> + <p>{% trans %}There doesn't seem to be a page at this address. Sorry!{% endtrans %}</p> + <p> + {%- trans %}If you're sure the address is correct, maybe the page you're looking for has been moved or deleted.{% endtrans -%} + </p> + </div> + + <div class="grid_8 omega"> + <img src="{{ request.staticdirect('/images/404.png') }}" + alt="{% trans %}Image of 404 goblin stressing out{% endtrans %}" /> + </div> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html index e25783ea..afbecf20 100644 --- a/mediagoblin/templates/mediagoblin/auth/login.html +++ b/mediagoblin/templates/mediagoblin/auth/login.html @@ -23,20 +23,27 @@ <form action="{{ request.urlgen('mediagoblin.auth.login') }}" method="POST" enctype="multipart/form-data"> <div class="grid_6 prefix_1 suffix_1 form_box"> - <h1>Log in</h1> + <h1>{% trans %}Log in{% endtrans %}</h1> {% if login_failed %} - <div class="form_field_error">Login failed!</div> + <div class="form_field_error"> + {% trans %}Logging in failed!{% endtrans %} + </div> {% endif %} {{ wtforms_util.render_divs(login_form) }} <div class="form_submit_buttons"> - <input type="submit" value="submit" class="button"/> + <input type="submit" value="{% trans %}Log in{% endtrans %}" class="button"/> </div> {% if next %} <input type="hidden" name="next" value="{{ next }}" class="button" style="display: none;"/> {% endif %} {% if allow_registration %} - <p>Don't have an account yet?<br /><a href="{{ request.urlgen('mediagoblin.auth.register') }}">Create one here!</a></p> + <p> + {% trans %}Don't have an account yet?{% endtrans %} + <br /> + <a href="{{ request.urlgen('mediagoblin.auth.register') }}"> + {%- trans %}Create one here!{% endtrans %}</a> + </p> {% endif %} </div> </form> diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html index f77b3782..d9eedc4a 100644 --- a/mediagoblin/templates/mediagoblin/auth/register.html +++ b/mediagoblin/templates/mediagoblin/auth/register.html @@ -24,10 +24,11 @@ <form action="{{ request.urlgen('mediagoblin.auth.register') }}" method="POST" enctype="multipart/form-data"> <div class="grid_6 prefix_1 suffix_1 form_box"> - <h1>Create an account!</h1> + <h1>{% trans %}Create an account!{% endtrans %}</h1> {{ wtforms_util.render_divs(register_form) }} <div class="form_submit_buttons"> - <input type="submit" value="submit" class="button" /> + <input type="submit" value="{% trans %}Create{% endtrans %}" + class="button" /> </div> </div> </form> diff --git a/mediagoblin/templates/mediagoblin/auth/resent_verification_email.html b/mediagoblin/templates/mediagoblin/auth/resent_verification_email.html index da3a9e99..8fd80ee9 100644 --- a/mediagoblin/templates/mediagoblin/auth/resent_verification_email.html +++ b/mediagoblin/templates/mediagoblin/auth/resent_verification_email.html @@ -19,6 +19,6 @@ {% block mediagoblin_content %} <p> - Resent your verification email. + {% trans %}Resent your verification email.{% endtrans %} </p> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/auth/verification_email.txt b/mediagoblin/templates/mediagoblin/auth/verification_email.txt index 7863374d..32053101 100644 --- a/mediagoblin/templates/mediagoblin/auth/verification_email.txt +++ b/mediagoblin/templates/mediagoblin/auth/verification_email.txt @@ -14,9 +14,13 @@ # # 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/>. -#} +-#} + +{% trans username=username, verification_url=verification_url|safe -%} Hi {{ username }}, -to activate your GNU MediaGoblin account, open the following URL in your web browser +to activate your GNU MediaGoblin account, open the following URL in +your web browser: -{{ verification_url|safe }} +{{ verification_url }} +{%- endtrans %} diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index 4da685f9..32d5a5d2 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -19,7 +19,7 @@ <html> <head> <meta charset="utf-8"> - <title>{% block title %}GNU MediaGoblin{% endblock title %}</title> + <title>{% block title %}{% trans %}GNU MediaGoblin{% endtrans %}{% endblock title %}</title> <link rel="stylesheet" type="text/css" href="{{ request.staticdirect('/css/extlib/reset.css') }}"/> <link rel="stylesheet" type="text/css" @@ -28,6 +28,8 @@ href="{{ request.staticdirect('/css/extlib/960_16_col.css') }}"/> <link rel="stylesheet" type="text/css" href="{{ request.staticdirect('/css/base.css') }}"/> + <link rel="shortcut icon" + href="{{ request.staticdirect('/images/goblin.ico') }}" /> {% block mediagoblin_head %} {% endblock mediagoblin_head %} </head> @@ -40,15 +42,14 @@ <div class="grid_16 mediagoblin_header"> {% block mediagoblin_logo %} <a class="mediagoblin_logo" - href="{{ request.urlgen('index') }}"> - <img src="{{ request.staticdirect('/images/logo.png') }}" - alt="Mediagoblin logo" /> - </a> + href="{{ request.urlgen('index') }}" + ><img src="{{ request.staticdirect('/images/logo.png') }}" + alt="{% trans %}MediaGoblin logo{% endtrans %}" /></a> {% endblock %} {% if request.user and request.user['status'] == 'active' %} <a class="header_submit" href="{{ request.urlgen('mediagoblin.submit.start') }}"> - Submit media + {% trans %}Submit media{% endtrans %} </a> {% endif %} {% block mediagoblin_header_title %}{% endblock %} @@ -59,17 +60,17 @@ <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user=request.user['username']) }}" class="header_submit"> - verify your email!</a> + {% trans %}verify your email!{% endtrans %}</a> {% endif %} <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user= request.user['username']) }}"> {{ request.user['username'] }}</a> - (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">logout</a>) + (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">log out</a>) {% else %} <a href="{{ request.urlgen('mediagoblin.auth.login') }}"> - Login</a> + {% trans %}Log in{% endtrans %}</a> {% endif %} </div> </div> @@ -85,7 +86,9 @@ {% block mediagoblin_footer %} <div class="container_16"> <div class="grid_16 mediagoblin_footer"> - Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU project</a> + {% trans -%} + Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU project</a> + {%- endtrans %} </div> </div> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/edit/edit.html b/mediagoblin/templates/mediagoblin/edit/edit.html index d19034cb..3dc170c8 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit.html +++ b/mediagoblin/templates/mediagoblin/edit/edit.html @@ -26,15 +26,15 @@ media= media._id) }}" method="POST" enctype="multipart/form-data"> <div class="grid_8 prefix_1 suffix_1 edit_box form_box"> - <h1>Editing {{ media.title }}</h1> + <h1>{% trans media_title=media.title %}Editing {{ media_title }}{% endtrans %}</h1> <div style="text-align: center;" > <img src="{{ request.app.public_store.file_url( media['media_files']['thumb']) }}" /> </div> {{ wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> - <a href="{{ media.url_for_self(request.urlgen) }}">Cancel</a> - <input type="submit" value="Save changes" class="button" /> + <a href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a> + <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button" /> </div> </div> </form> diff --git a/mediagoblin/templates/mediagoblin/edit/edit_profile.html b/mediagoblin/templates/mediagoblin/edit/edit_profile.html index a11b86d7..bed5e0ca 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit_profile.html +++ b/mediagoblin/templates/mediagoblin/edit/edit_profile.html @@ -25,10 +25,14 @@ user['username'] }}" method="POST" enctype="multipart/form-data"> <div class="grid_8 prefix_1 suffix_1 edit_box form_box"> - <h1>Editing {{ user['username'] }}'s profile</h1> + <h1> + {%- trans username=user['username'] -%} + Editing {{ username }}'s profile + {%- endtrans %} + </h1> {{ wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> - <input type="submit" value="submit" class="button" /> + <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button" /> </div> </div> </form> diff --git a/mediagoblin/templates/mediagoblin/listings/tag.html b/mediagoblin/templates/mediagoblin/listings/tag.html index 6f10ec8d..289f44b8 100644 --- a/mediagoblin/templates/mediagoblin/listings/tag.html +++ b/mediagoblin/templates/mediagoblin/listings/tag.html @@ -17,6 +17,8 @@ #} {% extends "mediagoblin/base.html" %} +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + {% block mediagoblin_head %} <link rel="alternate" type="application/atom+xml" href="{{ request.urlgen( @@ -26,16 +28,17 @@ {% block mediagoblin_content -%} <h1> - Media tagged with: {{ tag_name }} + {% trans %}Media tagged with:{% endtrans %} {{ tag_name }} </h1> <div class="container_16 media_gallery"> - {% include "mediagoblin/utils/object_gallery.html" %} + {{ object_gallery(request, media_entries, pagination) }} </div> <div class="grid_16"> - <a href="{{ request.urlgen( - 'mediagoblin.listings.tag_atom_feed', - tag=tag_slug) }}">atom feed</a> + {% set feed_url = request.urlgen( + 'mediagoblin.listings.tag_atom_feed', + tag=tag_slug) %} + {% include "mediagoblin/utils/feed_link.html" %} </div> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index ed7b931f..08155c17 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -17,27 +17,36 @@ #} {% extends "mediagoblin/base.html" %} -{% block mediagoblin_content %} - <h1>{% trans %}Welcome to GNU MediaGoblin!{% endtrans %}</h1> +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} +{% block mediagoblin_content %} {% if request.user %} - <p> - <a href="{{ request.urlgen('mediagoblin.submit.start') }}">Submit an item</a> - </p> + <h1>Explore</h1> {% else %} - <p> - If you have an account, you can - <a href="{{ request.urlgen('mediagoblin.auth.login') }}">Login</a>. - </p> - {% if allow_registration %} - <p> - If you don't have an account, please - <a href="{{ request.urlgen('mediagoblin.auth.register') }}">Register</a>. - </p> - {% endif %} - {% endif %} + <div class="grid_11 alpha"> + <h1>{% trans %}Hi there, media lover! MediaGoblin is...{% endtrans %}</h1> + <ul> + <li>{% trans %}The perfect place for your media!{% endtrans %}</li> + <li>{% trans %}A place for people to collaborate and show off original and derived creations!{% endtrans %}</li> + <li>{% trans %}Free, as in freedom. (We’re a <a href="http://gnu.org">GNU project</a> in the making, after all.){% endtrans %}</li> + <li>{% trans %}Aiming to make the world a better place through decentralization and (eventually, coming soon!) federation!{% endtrans %}</li> + <li>{% trans %}Built for extensibility. (Multiple media types coming soon to the software, including video support!){% endtrans %}</li> + <li>{% trans %}Powered by people like you. (<a href="http://mediagoblin.org/pages/join.html">You can help us improve this software!</a>){% endtrans %}</li> + </ul> - {# temporarily, an "image gallery" that isn't one really ;) #} + {% if allow_registration %} + <p>Excited to join us? To add your own media, make collections and save favorites...<p> + <a class="header_submit_highlight" href="{{ request.urlgen('mediagoblin.auth.register') }}">Create a free account</a> or + <a class="header_submit" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a> + {% endif %} + </div> - {% include "mediagoblin/utils/object_gallery.html" %} + <div class="grid_5 omega"> + <img src="{{ request.staticdirect('/images/frontpage_image.png') }}" /> + </div> + + <div class="clear"></div> + {% endif %} + <h2>Most recent media</h2> + {{ object_gallery(request, media_entries, pagination) }} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/submit/start.html b/mediagoblin/templates/mediagoblin/submit/start.html index 6d00510c..3a40850d 100644 --- a/mediagoblin/templates/mediagoblin/submit/start.html +++ b/mediagoblin/templates/mediagoblin/submit/start.html @@ -23,13 +23,10 @@ <form action="{{ request.urlgen('mediagoblin.submit.start') }}" method="POST" enctype="multipart/form-data"> <div class="grid_8 prefix_1 suffix_1 form_box"> - <h1>Submit yer media</h1> - {{ wtforms_util.render_field_div(submit_form.file) }} - {{ wtforms_util.render_field_div(submit_form.title) }} - {{ wtforms_util.render_textarea_div(submit_form.description) }} - {{ wtforms_util.render_field_div(submit_form.tags) }} + <h1>{% trans %}Submit yer media{% endtrans %}</h1> + {{ wtforms_util.render_divs(submit_form) }} <div class="form_submit_buttons"> - <input type="submit" value="Submit" class="button" /> + <input type="submit" value="{% trans %}Submit{% endtrans %}" class="button" /> </div> </div> </form> diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html index 637c892d..3a3d2373 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/gallery.html +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -17,6 +17,8 @@ #} {% extends "mediagoblin/base.html" %} +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + {% block mediagoblin_head %} <link rel="alternate" type="application/atom+xml" href="{{ request.urlgen( @@ -27,21 +29,26 @@ {% block mediagoblin_content -%} {% if user %} <h1> - <a href="{{ request.urlgen( - 'mediagoblin.user_pages.user_home', - user=user.username) }}">{{ user.username }}</a>'s media</h1> + {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username) -%} + <a href="{{ user_url }}">{{ username }}</a>'s media + {%- endtrans %} + </h1> - </div> <div class="container_16 media_gallery"> - {% include "mediagoblin/utils/object_gallery.html" %} + {{ object_gallery(request, media_entries, pagination) }} </div> + <div class="grid_16"> - <a href={{ request.urlgen( - 'mediagoblin.user_pages.atom_feed', - user=user.username) }}>atom feed</a> + {% set feed_url = request.urlgen( + 'mediagoblin.user_pages.atom_feed', + user=user.username) %} + {% include "mediagoblin/utils/feed_link.html" %} </div> {% else %} {# This *should* not occur as the view makes sure we pass in a user. #} - <p>Sorry, no such user found.<p/> + <p>{% trans %}Sorry, no such user found.{% endtrans %}<p/> {% endif %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 1a5eed1f..08d5dbe9 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -24,38 +24,54 @@ {% if media %} <div class="grid_11 alpha"> <div class="media_image_container"> - <img class="media_image" - src="{{ request.app.public_store.file_url( - media.get_display_media(media.media_files)) }}" /> + {% 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 %} </div> - <h2> - {{media.title}} + <h2 class="media_title"> + {{ media.title }} </h2> + <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> + {%- endtrans %} + </p> + {% autoescape False %} <p>{{ media.description_html }}</p> {% endautoescape %} - <p> - — 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> <br /> + <h3>{% trans %}Comments{% endtrans %}</h3> - <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"> - {{ wtforms_util.render_field_div(comment_form.comment_content) }} + {{ wtforms_util.render_divs(comment_form) }} <div class="form_submit_buttons"> - <input type="submit" value="Post comment!" class="button" /> + <input type="submit" value="{% trans %}Post comment!{% endtrans %}" class="button" /> </div> </form> {% endif %} @@ -69,26 +85,23 @@ {% else %} <div class="comment_wrapper" id="comment-{{ comment['_id'] }}"> {% endif %} + <div class="comment_content"> {% autoescape False %} {{ comment.content_html }} {% endautoescape %} </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">--> + 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.uploader().username, media = media._id) }}#comment"> - {{ "%4d-%02d-%02d %02d:%02d"|format(comment.created.year, - comment.created.month, - comment.created.day, - comment.created.hour, - comment.created.minute) }} + {{ comment.created.strftime("%Y-%m-%d %I:%M%p") }} </a> </div> </div> @@ -103,45 +116,42 @@ <div class="grid_5 omega"> {% include "mediagoblin/utils/prev_next.html" %} - <h3>Sidebar content here!</h3> - {% if media.attachment_files or media['uploader'] == request.user['_id'] or - request.user['is_admin'] %} - - <p> - {% if media['uploader'] == request.user['_id'] or - request.user['is_admin'] %} - <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> + + {% if media['uploader'] == request.user['_id'] or + request.user['is_admin'] %} + <h3>Temporary button holder</h3> + <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" />{% trans %}delete{% endtrans %} + </p> + {% endif %} {% 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 %} - {% endif %} - </ul> + <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'] %} + + {% if app_config['allow_attachments'] + and (media['uploader'] == request.user['_id'] + or request.user['is_admin']) %} <a href="{{ request.urlgen('mediagoblin.edit.attachments', - user= media.uploader().username, - media= media._id) }}">Add attachment</a> + user=media.uploader().username, + media=media._id) }}">Add attachment</a> {% endif %} {% if media.tags %} @@ -149,6 +159,6 @@ {% endif %} </div> {% else %} - <p>Sorry, no such media found.<p/> + <p>{% trans %}Sorry, no such media found.{% endtrans %}<p/> {% endif %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html new file mode 100644 index 00000000..abc7efd3 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html @@ -0,0 +1,67 @@ +{# +# 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 %} + +<h1>{% trans %}Media processing panel{% endtrans %}</h1> + +<p> + {% trans %}You can track the state of media being processed for your gallery here.{% endtrans %} +</p> + +<h2>{% trans %}Media in-processing{% endtrans %}</h2> + +{% if processing_entries.count() %} + <table class="media_panel processing"> + <tr> + <th>Title</th> + <th>When submitted</th> + <th>Status</th> + </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></td> + </tr> + {% endfor %} + </table> +{% else %} + <p><i>{% trans %}No media in-processing{% endtrans %}</i></p> +{% endif %} + +{% if failed_entries.count() %} + <h2>{% trans %}These uploads failed to process:{% endtrans %}</h2> + + <table class="media_panel failed"> + <tr> + <th>Title</th> + <th>When submitted</th> + <th>Reason for failure</th> + </tr> + {% for media_entry in failed_entries %} + <tr> + <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> + {% endfor %} + </table> +{% endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 76cf36be..0214082c 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -17,6 +17,8 @@ #} {% extends "mediagoblin/base.html" %} +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + {% block mediagoblin_head %} <link rel="alternate" type="application/atom+xml" href="{{ request.urlgen( @@ -27,66 +29,128 @@ {% block mediagoblin_content -%} {# If no user... #} {% if not user %} - <p>Sorry, no such user found.<p/> + <p>{% trans %}Sorry, no such user found.{% endtrans %}<p/> {# User exists, but needs verification #} {% elif user.status == "needs_email_verification" %} {% if user == request.user %} {# this should only be visible when you are this user #} <div class="grid_6 prefix_1 suffix_1 form_box"> - <h1>Verification needed</h1> + <h1>{% trans %}Verification needed{% endtrans %}</h1> - <p>Almost done! Your account still needs to be verified.</p> <p> - An email should arrive in a few moments with instructions - on how to do so. + {% trans -%} + Almost done! Your account still needs to be verified. + {%- endtrans %} + </p> + <p> + {% trans -%} + An email should arrive in a few moments with instructions on how to do so. + {%- endtrans %} </p> - <p>In case it doesn't:</p> + <p>{% trans %}In case it doesn't:{% endtrans %}</p> <a href="{{ request.urlgen('mediagoblin.auth.resend_verification') }}" - class="button">Resend verification email</a> + class="button">{% trans %}Resend verification email{% endtrans %}</a> </div> {% else %} {# if the user is not you, but still needs to verify their email #} <div class="grid_6 prefix_1 suffix_1 form_box"> - <h1>Verification needed</h1> + <h1>{% trans %}Verification needed{% endtrans %}</h1> <p> - Someone has registered an account with this username, but it - still has to be verified. + {% trans -%} + Someone has registered an account with this username, but it still has to be verified. + {%- endtrans %} </p> <p> - If you are that person but you've lost your verification - email, you can - <a href="{{ request.urlgen('mediagoblin.auth.login') }}">log in</a> - and resend it. + {% trans login_url=request.urlgen('mediagoblin.auth.login') -%} + If you are that person but you've lost your verification email, you can <a href="{{ login_url }}">log in</a> and resend it. + {%- endtrans %} </p> </div> {% endif %} {# Active(?) (or at least verified at some point) user, horray! #} {% else %} - <h1>{{ user.username }}'s profile</h1> + <h1> + {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%} + </h1> - <div class="grid_6 alpha"> - {% include "mediagoblin/utils/profile.html" %} - {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %} - <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{ - user.username }}">Edit profile</a> + {% if not user['url'] and not user['profile'] %} + {% 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 %} + </p> + <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{ + user.username }}" + class="header_submit"> + {%- trans %}Edit profile{% endtrans -%} + </a> + </div> + {% else %} + <div class="grid_6 alpha empty_space"> + <p> + {% trans -%} + This user hasn't filled in their profile (yet). + {%- endtrans %} + </p> + </div> {% endif %} - </div> - - <div class="grid_10 omega"> - {% set pagination_base_url = user_gallery_url %} - {% include "mediagoblin/utils/object_gallery.html" %} - <div class="clear"></div> - <p><a href="{{ user_gallery_url }}">View all of {{ user.username }}'s media</a></p> - <a href={{ request.urlgen( - 'mediagoblin.user_pages.atom_feed', - user=user.username) }}>atom feed</a> - </div> + {% else %} + <div class="grid_6 alpha"> + {% include "mediagoblin/utils/profile.html" %} + {% 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 -%} + </a> + {% endif %} + </div> + {% endif %} + {% if media_entries.count() %} + <div class="grid_10 omega"> + {{ object_gallery(request, media_entries, pagination, + pagination_base_url=user_gallery_url, col_number=3) }} + {% include "mediagoblin/utils/object_gallery.html" %} + <div class="clear"></div> + <p> + <a href="{{ user_gallery_url }}"> + {% trans username=user.username -%} + View all of {{ username }}'s media{% endtrans -%} + </a> + </p> + {% set feed_url = request.urlgen( + 'mediagoblin.user_pages.atom_feed', + user=user.username) %} + {% include "mediagoblin/utils/feed_link.html" %} + </div> + {% else %} + {% if request.user['_id'] == user['_id'] %} + <div class="grid_10 omega empty_space"> + <p> + {% trans -%} + This is where your media will appear, but you don't seem to have added anything yet. + {%- endtrans %} + </p> + <a class="header_submit" + href="{{ request.urlgen('mediagoblin.submit.start') }}"> + {%- trans %}Add media{% endtrans -%} + </a> + </div> + {% else %} + <div class="grid_10 omega empty_space"> + <p> + {% trans -%} + There doesn't seem to be any media here yet... + {%- endtrans %} + </p> + </div> + {% endif %} + {% endif %} <div class="clear"></div> {% endif %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/feed_link.html b/mediagoblin/templates/mediagoblin/utils/feed_link.html new file mode 100644 index 00000000..c4036bf3 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/feed_link.html @@ -0,0 +1,23 @@ +{# +# 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/>. +#} + +<a href="{{ feed_url }}"> + <img src="{{ request.staticdirect('/images/icon_feed.png') }}" + class="media_icon" alt="{% trans %}feed icon{% endtrans %}" /> +</a> +<a href="{{ feed_url }}">{%- trans %}Atom feed{% endtrans -%}</a> diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index 03b85b17..34eb7dbc 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -18,15 +18,47 @@ {% from "mediagoblin/utils/pagination.html" import render_pagination %} -{% block object_gallery_content -%} - {% if media_entries and media_entries.count() %} - {% for entry in media_entries %} - <div class="media_thumbnail"> - <a href="{{ entry.url_for_self(request.urlgen) }}"> - <img src="{{ request.app.public_store.file_url( - entry['media_files']['thumb']) }}" /></a> - </div> +{% macro media_grid(request, media_entries, col_number=5) %} + <table class="thumb_gallery"> + {% for row in gridify_cursor(media_entries, col_number) %} + <tr class="thumb_row + {%- if loop.first %} thumb_row_first + {%- elif loop.last %} thumb_row_last{% endif %}"> + {% for entry in row %} + {% set entry_url = entry.url_for_self(request.urlgen) %} + <td class="media_thumbnail thumb_entry + {%- if loop.first %} thumb_entry_first + {%- elif loop.last %} thumb_entry_last{% endif %}"> + <a href="{{ entry_url }}"> + <img src="{{ request.app.public_store.file_url( + entry['media_files']['thumb']) }}" /> + </a> + {% if entry['title'] %} + <br /> + <a href="{{ entry_url }}">{{ entry['title'] }}</a> + {% endif %} + </td> + {% endfor %} + </tr> {% endfor %} + </table> +{%- endmacro %} + +{# + Render a media gallery with pagination. + + Args: + - request: Request + - media_entries: pymongo cursor of media entries + - pagination: Paginator object + - pagination_base_url: If you want the pagination to point to a + different URL, point it here + - col_number: How many columns per row (default 5) +#} +{% macro object_gallery(request, media_entries, pagination, + pagination_base_url=None, col_number=5) %} + {% if media_entries and media_entries.count() %} + {{ media_grid(request, media_entries, col_number=col_number) }} <div class="clear"></div> {% if pagination_base_url %} {# different url, so set that and don't keep the get params #} @@ -39,4 +71,4 @@ <i>There doesn't seem to be any media here yet...</i> </p> {% endif %} -{% endblock %} +{% endmacro %} diff --git a/mediagoblin/templates/mediagoblin/utils/tags.html b/mediagoblin/templates/mediagoblin/utils/tags.html index ade41944..32db6e31 100644 --- a/mediagoblin/templates/mediagoblin/utils/tags.html +++ b/mediagoblin/templates/mediagoblin/utils/tags.html @@ -17,7 +17,7 @@ #} {% block tags_content -%} - <h4>Tags</h4> + <h3>Tags</h3> <ul class="mediaentry_tags"> {% for tag in media.tags %} <li class="tag"> diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index 1d2f8619..2639522a 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -19,9 +19,9 @@ {# Generically render a field #} {% macro render_field_div(field) %} <div class="form_field_box"> - <div class="form_field_label">{{ field.label }}</div> + <div class="form_field_label">{{ _(field.label.text) }}</div> {% if field.description -%} - <div class="form_field_description">{{ field.description }}</div> + <div class="form_field_description">{{ _(field.description) }}</div> {%- endif %} <div class="form_field_input">{{ field }}</div> {%- if field.errors -%} @@ -34,25 +34,6 @@ </div> {%- endmacro %} -{# Generically render a textarea - # ... mostly the same thing except it includes rows and cols #} -{% macro render_textarea_div(field, rows=8, cols=20) %} - <div class="form_field_box"> - <div class="form_field_label">{{ field.label }}</div> - {% if field.description -%} - <div class="form_field_description">{{ field.description }}</div> - {%- endif %} - <div class="form_field_input">{{ field(rows=rows, cols=cols) }}</div> - {%- if field.errors -%} - {% for error in field.errors %} - <div class="form_field_error"> - {{ error }} - </div> - {% endfor %} - {%- endif %} - </div> -{%- endmacro %} - {# Auto-render a form as a series of divs #} {% macro render_divs(form) -%} {% for field in form %} @@ -64,7 +45,7 @@ {% macro render_table(form) -%} {% for field in form %} <tr> - <th>{{field.label}}</th> + <th>{{ _(field.label.text) }}</th> <td> {{field}} {% if field.errors %} |