aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/404.html34
-rw-r--r--mediagoblin/templates/mediagoblin/auth/login.html4
-rw-r--r--mediagoblin/templates/mediagoblin/auth/register.html2
-rw-r--r--mediagoblin/templates/mediagoblin/base.html12
-rw-r--r--mediagoblin/templates/mediagoblin/edit/edit_profile.html2
-rw-r--r--mediagoblin/templates/mediagoblin/listings/tag.html13
-rw-r--r--mediagoblin/templates/mediagoblin/root.html49
-rw-r--r--mediagoblin/templates/mediagoblin/submit/start.html5
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/gallery.html15
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html40
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/processing_panel.html67
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/user.html97
-rw-r--r--mediagoblin/templates/mediagoblin/utils/feed_link.html23
-rw-r--r--mediagoblin/templates/mediagoblin/utils/object_gallery.html45
-rw-r--r--mediagoblin/templates/mediagoblin/utils/wtforms.html25
15 files changed, 306 insertions, 127 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 5750feb0..afbecf20 100644
--- a/mediagoblin/templates/mediagoblin/auth/login.html
+++ b/mediagoblin/templates/mediagoblin/auth/login.html
@@ -26,12 +26,12 @@
<h1>{% trans %}Log in{% endtrans %}</h1>
{% if login_failed %}
<div class="form_field_error">
- {% trans %}Login failed!{% endtrans %}
+ {% trans %}Logging in failed!{% endtrans %}
</div>
{% endif %}
{{ wtforms_util.render_divs(login_form) }}
<div class="form_submit_buttons">
- <input type="submit" value="{% trans %}Submit{% endtrans %}" class="button"/>
+ <input type="submit" value="{% trans %}Log in{% endtrans %}" class="button"/>
</div>
{% if next %}
<input type="hidden" name="next" value="{{ next }}" class="button"
diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html
index 623cbdfd..d9eedc4a 100644
--- a/mediagoblin/templates/mediagoblin/auth/register.html
+++ b/mediagoblin/templates/mediagoblin/auth/register.html
@@ -27,7 +27,7 @@
<h1>{% trans %}Create an account!{% endtrans %}</h1>
{{ wtforms_util.render_divs(register_form) }}
<div class="form_submit_buttons">
- <input type="submit" value="{% trans %}Submit{% endtrans %}"
+ <input type="submit" value="{% trans %}Create{% endtrans %}"
class="button" />
</div>
</div>
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html
index 986e0995..6e54c31d 100644
--- a/mediagoblin/templates/mediagoblin/base.html
+++ b/mediagoblin/templates/mediagoblin/base.html
@@ -39,11 +39,9 @@
<div class="container_16">
<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="{% trans %}Mediagoblin logo{% endtrans %}" />
- </a>
+ <a class="mediagoblin_logo" href="{{ request.urlgen('index') }}">
+ MediaGoblin<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"
@@ -66,10 +64,10 @@
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') }}">
- {% trans %}Login{% endtrans %}</a>
+ {% trans %}Log in{% endtrans %}</a>
{% endif %}
</div>
</div>
diff --git a/mediagoblin/templates/mediagoblin/edit/edit_profile.html b/mediagoblin/templates/mediagoblin/edit/edit_profile.html
index 534e5f20..bed5e0ca 100644
--- a/mediagoblin/templates/mediagoblin/edit/edit_profile.html
+++ b/mediagoblin/templates/mediagoblin/edit/edit_profile.html
@@ -32,7 +32,7 @@
</h1>
{{ wtforms_util.render_divs(form) }}
<div class="form_submit_buttons">
- <input type="submit" value="{% trans %}Submit{% endtrans %}" 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 a013797f..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(
@@ -30,14 +32,13 @@
</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) }}">
- {%- trans %}atom feed{% endtrans -%}
- </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 a4e19984..08155c17 100644
--- a/mediagoblin/templates/mediagoblin/root.html
+++ b/mediagoblin/templates/mediagoblin/root.html
@@ -17,31 +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') }}">
- {%- trans %}Submit an item{% endtrans -%}
- </a>
- </p>
+ <h1>Explore</h1>
{% else %}
- <p>
- {% trans login_url=request.urlgen('mediagoblin.auth.login') -%}
- If you have an account, you can <a href="{{ login_url }}">Login</a>.
- {%- endtrans %}
- </p>
- {% if allow_registration %}
- <p>
- {% trans register_url=request.urlgen('mediagoblin.auth.register') -%}
- If you don't have an account, please <a href="{{ register_url }}">Register</a>.
- {%- endtrans %}
- </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 eb34c2e2..3a40850d 100644
--- a/mediagoblin/templates/mediagoblin/submit/start.html
+++ b/mediagoblin/templates/mediagoblin/submit/start.html
@@ -24,10 +24,7 @@
method="POST" enctype="multipart/form-data">
<div class="grid_8 prefix_1 suffix_1 form_box">
<h1>{% trans %}Submit yer media{% endtrans %}</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) }}
+ {{ wtforms_util.render_divs(submit_form) }}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Submit{% endtrans %}" class="button" />
</div>
diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html
index a66a547e..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(
@@ -35,16 +37,15 @@
{%- 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) }}">
- {%- trans %}atom feed{% endtrans -%}
- </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. #}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index afc0d903..2086d3d6 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -29,33 +29,32 @@
media.get_display_media(media.media_files)) }}" />
</div>
- <h2>
- {{media.title}}
+ <h2 class="media_title">
+ {{ media.title }}
</h2>
- {% autoescape False %}
- <p>{{ media.description_html }}</p>
- {% endautoescape %}
-
- <p>
- {% trans date="%4d-%02d-%02d"|format(
- media.created.year,
- media.created.month, media.created.day),
+ <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 -%}
- &mdash;&nbsp;uploaded on {{ date }} by <a href="{{ user_url }}">{{ username }}</a>
+ Uploaded on {{ date }} by <a href="{{ user_url }}">{{ username }}</a>
{%- endtrans %}
</p>
- <br />
+ {% 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_field_div(comment_form.comment_content) }}
+ {{ wtforms_util.render_divs(comment_form) }}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Post comment!{% endtrans %}" class="button" />
</div>
@@ -71,26 +70,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">&mdash;
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
- user = comment_author['username']) }}">
- {{ comment_author['username'] }}</a> {% trans %}at{% endtrans %}
- <!--</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>
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 1115fc56..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(
@@ -76,32 +78,79 @@
{%- 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 }}">
- {%- trans %}Edit profile{% endtrans -%}
- </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 }}">
- {% trans username=user.username -%}
- View all of {{ username }}'s media{% endtrans -%}
- </a>
- </p>
- <a href="{{ request.urlgen( 'mediagoblin.user_pages.atom_feed',
- user=user.username) }}">
- {%- trans %}atom feed{% endtrans -%}
- </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..b451946d 100644
--- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html
+++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html
@@ -18,15 +18,42 @@
{% 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 %}
+ <td class="media_thumbnail thumb_entry
+ {%- if loop.first %} thumb_entry_first
+ {%- elif loop.last %} thumb_entry_last{% endif %}">
+ <a href="{{ entry.url_for_self(request.urlgen) }}">
+ <img src="{{ request.app.public_store.file_url(
+ entry['media_files']['thumb']) }}" />
+ </a>
+ </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 +66,4 @@
<i>There doesn't seem to be any media here yet...</i>
</p>
{% endif %}
-{% endblock %}
+{% endmacro %}
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 %}