aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/admin/panel.html2
-rw-r--r--mediagoblin/templates/mediagoblin/auth/change_fp.html3
-rw-r--r--mediagoblin/templates/mediagoblin/auth/forgot_password.html2
-rw-r--r--mediagoblin/templates/mediagoblin/auth/login.html18
-rw-r--r--mediagoblin/templates/mediagoblin/auth/register.html7
-rw-r--r--mediagoblin/templates/mediagoblin/base.html33
-rw-r--r--mediagoblin/templates/mediagoblin/bits/above_content.html (renamed from mediagoblin/templates/mediagoblin/bits/above-content.html)0
-rw-r--r--mediagoblin/templates/mediagoblin/bits/base_footer.html28
-rw-r--r--mediagoblin/templates/mediagoblin/bits/body_end.html (renamed from mediagoblin/templates/mediagoblin/bits/body-end.html)0
-rw-r--r--mediagoblin/templates/mediagoblin/bits/body_start.html (renamed from mediagoblin/templates/mediagoblin/bits/body-start.html)0
-rw-r--r--mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html41
-rw-r--r--mediagoblin/templates/mediagoblin/edit/change_pass.html52
-rw-r--r--mediagoblin/templates/mediagoblin/edit/edit_account.html20
-rw-r--r--mediagoblin/templates/mediagoblin/edit/verification.txt29
-rw-r--r--mediagoblin/templates/mediagoblin/fragments/header_notifications.html40
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/image.html17
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/pdf.html86
-rw-r--r--mediagoblin/templates/mediagoblin/media_displays/stl.html16
-rw-r--r--mediagoblin/templates/mediagoblin/root.html19
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html7
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html7
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/collection_list.html12
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html55
-rw-r--r--mediagoblin/templates/mediagoblin/utils/comment-subscription.html34
-rw-r--r--mediagoblin/templates/mediagoblin/utils/exif.html39
-rw-r--r--mediagoblin/templates/mediagoblin/utils/wtforms.html62
26 files changed, 510 insertions, 119 deletions
diff --git a/mediagoblin/templates/mediagoblin/admin/panel.html b/mediagoblin/templates/mediagoblin/admin/panel.html
index 6bcb5c24..1c3c866e 100644
--- a/mediagoblin/templates/mediagoblin/admin/panel.html
+++ b/mediagoblin/templates/mediagoblin/admin/panel.html
@@ -104,7 +104,7 @@
<td>{{ media_entry.id }}</td>
<td>{{ media_entry.get_uploader.username }}</td>
<td><a href="{{ media_entry.url_for_self(request.urlgen) }}">{{ media_entry.title }}</a></td>
- <td>{{ media_entry.created.strftime("%F %R") }}</td>
+ <td><span title='{{ media_entry.created.strftime("%F %R") }}'>{{ timesince(media_entry.created) }}</span></td>
</tr>
{% endfor %}
</table>
diff --git a/mediagoblin/templates/mediagoblin/auth/change_fp.html b/mediagoblin/templates/mediagoblin/auth/change_fp.html
index 1f7d9aca..a3cf9cb9 100644
--- a/mediagoblin/templates/mediagoblin/auth/change_fp.html
+++ b/mediagoblin/templates/mediagoblin/auth/change_fp.html
@@ -34,11 +34,10 @@
{{ csrf_token }}
<div class="form_box">
<h1>{% trans %}Set your new password{% endtrans %}</h1>
- {{ wtforms_util.render_divs(cp_form) }}
+ {{ wtforms_util.render_divs(cp_form, True) }}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Set password{% endtrans %}" class="button_form"/>
</div>
</div>
- </form>
{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/auth/forgot_password.html b/mediagoblin/templates/mediagoblin/auth/forgot_password.html
index 46aeddef..6cfd2c85 100644
--- a/mediagoblin/templates/mediagoblin/auth/forgot_password.html
+++ b/mediagoblin/templates/mediagoblin/auth/forgot_password.html
@@ -29,7 +29,7 @@
{{ csrf_token }}
<div class="form_box">
<h1>{% trans %}Recover password{% endtrans %}</h1>
- {{ wtforms_util.render_divs(fp_form) }}
+ {{ wtforms_util.render_divs(fp_form, True) }}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Send instructions{% endtrans %}" class="button_form"/>
</div>
diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html
index 4a39059d..3329b5d0 100644
--- a/mediagoblin/templates/mediagoblin/auth/login.html
+++ b/mediagoblin/templates/mediagoblin/auth/login.html
@@ -29,7 +29,7 @@
{%- endblock %}
{% block mediagoblin_content %}
- <form action="{{ request.urlgen('mediagoblin.auth.login') }}"
+ <form action="{{ post_url }}"
method="POST" enctype="multipart/form-data">
{{ csrf_token }}
<div class="form_box">
@@ -41,15 +41,19 @@
{% endif %}
{% if allow_registration %}
<p>
- {% trans %}Don't have an account yet?{% endtrans %} <a href="{{ request.urlgen('mediagoblin.auth.register') }}">
+ {% trans %}Don't have an account yet?{% endtrans %}
+ <a href="{{ request.urlgen('mediagoblin.auth.register') }}">
{%- trans %}Create one here!{% endtrans %}</a>
</p>
{% endif %}
- {{ wtforms_util.render_divs(login_form) }}
- <p>
- <a href="{{ request.urlgen('mediagoblin.auth.forgot_password') }}" id="forgot_password">
- {% trans %}Forgot your password?{% endtrans %}</a>
- </p>
+ {% template_hook("login_link") %}
+ {{ wtforms_util.render_divs(login_form, True) }}
+ {% if pass_auth %}
+ <p>
+ <a href="{{ request.urlgen('mediagoblin.auth.forgot_password') }}" id="forgot_password">
+ {% trans %}Forgot your password?{% endtrans %}</a>
+ </p>
+ {% endif %}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Log in{% endtrans %}" class="button_form"/>
</div>
diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html
index 6dff0207..a7b8033f 100644
--- a/mediagoblin/templates/mediagoblin/auth/register.html
+++ b/mediagoblin/templates/mediagoblin/auth/register.html
@@ -30,11 +30,12 @@
{% block mediagoblin_content %}
- <form action="{{ request.urlgen('mediagoblin.auth.register') }}"
+ <form action="{{ post_url }}"
method="POST" enctype="multipart/form-data">
<div class="form_box">
<h1>{% trans %}Create an account!{% endtrans %}</h1>
- {{ wtforms_util.render_divs(register_form) }}
+ {% template_hook("register_link") %}
+ {{ wtforms_util.render_divs(register_form, True) }}
{{ csrf_token }}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Create{% endtrans %}"
@@ -42,6 +43,4 @@
</div>
</div>
</form>
-<!-- Focus the username field by default -->
-<script>$(document).ready(function(){$("#username").focus();});</script>
{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html
index 66b95661..1fc4467c 100644
--- a/mediagoblin/templates/mediagoblin/base.html
+++ b/mediagoblin/templates/mediagoblin/base.html
@@ -16,7 +16,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#}
<!doctype html>
-<html>
+<html
+{% block mediagoblin_html_tag %}
+{% endblock mediagoblin_html_tag %}
+>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -31,6 +34,8 @@
src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script>
<script type="text/javascript"
src="{{ request.staticdirect('/js/header_dropdown.js') }}"></script>
+ <script type="text/javascript"
+ src="{{ request.staticdirect('/js/notifications.js') }}"></script>
{# For clarification, the difference between the extra_head.html template
# and the head template hook is that the former should be used by
@@ -45,7 +50,7 @@
{% endblock mediagoblin_head %}
</head>
<body>
- {% include 'mediagoblin/bits/body-start.html' %}
+ {% include 'mediagoblin/bits/body_start.html' %}
{% block mediagoblin_body %}
{% block mediagoblin_header %}
<header>
@@ -54,6 +59,12 @@
<div class="header_right">
{%- if request.user %}
{% if request.user and request.user.status == 'active' %}
+
+ {% set notification_count = request.notifications.get_notification_count(request.user.id) %}
+ {% if notification_count %}
+ <a href="#notifications" class="notification-gem button_action" title="Notifications">
+ {{ notification_count }}</a>
+ {% endif %}
<div class="button_action header_dropdown_down">&#9660;</div>
<div class="button_action header_dropdown_up">&#9650;</div>
{% elif request.user and request.user.status == "needs_email_verification" %}
@@ -64,7 +75,7 @@
{% trans %}Verify your email!{% endtrans %}</a>
or <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>
{% endif %}
- {%- else %}
+ {%- elif auth %}
<a href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{
request.base_url|urlencode }}">
{%- trans %}Log in{% endtrans -%}
@@ -106,29 +117,21 @@
</a>
</p>
{% endif %}
+ {% include 'mediagoblin/fragments/header_notifications.html' %}
</div>
{% endif %}
</header>
{% endblock %}
<div class="container">
- {% include 'mediagoblin/bits/above-content.html' %}
+ {% include 'mediagoblin/bits/above_content.html' %}
<div class="mediagoblin_content">
{% include "mediagoblin/utils/messages.html" %}
{% block mediagoblin_content %}
{% endblock mediagoblin_content %}
</div>
- {%- block mediagoblin_footer %}
- <footer>
- {% trans -%}
- Powered by <a href="http://mediagoblin.org/" title='Version {{ version }}'>MediaGoblin</a>, a <a href="http://gnu.org/">GNU</a> project.
- {%- endtrans %}
- {% trans source_link=app_config['source_link'] -%}
- Released under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPL</a>. <a href="{{ source_link }}">Source code</a> available.
- {%- endtrans %}
- </footer>
- {%- endblock mediagoblin_footer %}
+ {%- include "mediagoblin/bits/base_footer.html" %}
</div>
{%- endblock mediagoblin_body %}
- {% include 'mediagoblin/bits/body-end.html' %}
+ {% include 'mediagoblin/bits/body_end.html' %}
</body>
</html>
diff --git a/mediagoblin/templates/mediagoblin/bits/above-content.html b/mediagoblin/templates/mediagoblin/bits/above_content.html
index bb7b9762..bb7b9762 100644
--- a/mediagoblin/templates/mediagoblin/bits/above-content.html
+++ b/mediagoblin/templates/mediagoblin/bits/above_content.html
diff --git a/mediagoblin/templates/mediagoblin/bits/base_footer.html b/mediagoblin/templates/mediagoblin/bits/base_footer.html
new file mode 100644
index 00000000..80cd41b0
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/bits/base_footer.html
@@ -0,0 +1,28 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011-2013 MediaGoblin contributors. See AUTHORS.
+#
+# 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/>.
+#}
+
+{%- block mediagoblin_footer %}
+ <footer>
+ {% trans -%}
+ Powered by <a href="http://mediagoblin.org/" title='Version {{ version }}'>MediaGoblin</a>, a <a href="http://gnu.org/">GNU</a> project.
+ {%- endtrans %}
+ {% trans source_link=app_config['source_link'] -%}
+ Released under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPL</a>. <a href="{{ source_link }}">Source code</a> available.
+ {%- endtrans %}
+ </footer>
+{%- endblock mediagoblin_footer -%}
diff --git a/mediagoblin/templates/mediagoblin/bits/body-end.html b/mediagoblin/templates/mediagoblin/bits/body_end.html
index bb7b9762..bb7b9762 100644
--- a/mediagoblin/templates/mediagoblin/bits/body-end.html
+++ b/mediagoblin/templates/mediagoblin/bits/body_end.html
diff --git a/mediagoblin/templates/mediagoblin/bits/body-start.html b/mediagoblin/templates/mediagoblin/bits/body_start.html
index bb7b9762..bb7b9762 100644
--- a/mediagoblin/templates/mediagoblin/bits/body-start.html
+++ b/mediagoblin/templates/mediagoblin/bits/body_start.html
diff --git a/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html b/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html
new file mode 100644
index 00000000..9ef28a4d
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html
@@ -0,0 +1,41 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# 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/>.
+#}
+
+{% if request.user %}
+ <h1>{% trans %}Explore{% endtrans %}</h1>
+ {% else %}
+ <h1>{% trans %}Hi there, welcome to this MediaGoblin site!{% endtrans %}</h1>
+ <img class="right_align" src="{{ request.staticdirect('/images/frontpage_image.png') }}" />
+ <p>{% trans %}This site is running <a href="http://mediagoblin.org">MediaGoblin</a>, an extraordinarily great piece of media hosting software.{% endtrans %}</p>
+ {% if auth %}
+ <p>{% trans %}To add your own media, place comments, 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>
+ {% trans register_url=request.urlgen('mediagoblin.auth.register') -%}
+ <a class="button_action_highlight" href="{{ register_url }}">Create an account at this site</a>
+ or
+ {%- endtrans %}
+ {% endif %}
+ {% endif %}
+ {% trans %}
+ <a class="button_action" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a>
+ {%- endtrans %}
+
+ <div class="clear"></div>
+ {% endif %}
+
diff --git a/mediagoblin/templates/mediagoblin/edit/change_pass.html b/mediagoblin/templates/mediagoblin/edit/change_pass.html
new file mode 100644
index 00000000..2a1ffee0
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/edit/change_pass.html
@@ -0,0 +1,52 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# 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" %}
+
+{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
+
+{% block mediagoblin_head %}
+ <script type="text/javascript"
+ src="{{ request.staticdirect('/js/show_password.js') }}"></script>
+{% endblock mediagoblin_head %}
+
+{% block title -%}
+ {% trans username=user.username -%}
+ Changing {{ username }}'s password
+ {%- endtrans %} &mdash; {{ super() }}
+{%- endblock %}
+
+{% block mediagoblin_content %}
+ <form action="{{ request.urlgen('mediagoblin.edit.pass') }}"
+ method="POST" enctype="multipart/form-data">
+ <div class="form_box edit_box">
+ <h1>
+ {%- trans username=user.username -%}
+ Changing {{ username }}'s password
+ {%- endtrans -%}
+ </h1>
+ {{ wtforms_util.render_divs(form, True) }}
+ {{ csrf_token }}
+ <div class="form_submit_buttons">
+ <input type="submit" value="{% trans %}Save{% endtrans %}"
+ class="button_form" />
+ </div>
+ </div>
+ </form>
+{% endblock %}
+
+
diff --git a/mediagoblin/templates/mediagoblin/edit/edit_account.html b/mediagoblin/templates/mediagoblin/edit/edit_account.html
index 7fe2c031..51293acb 100644
--- a/mediagoblin/templates/mediagoblin/edit/edit_account.html
+++ b/mediagoblin/templates/mediagoblin/edit/edit_account.html
@@ -41,16 +41,18 @@
Changing {{ username }}'s account settings
{%- endtrans -%}
</h1>
- {{ wtforms_util.render_field_div(form.old_password) }}
- {{ wtforms_util.render_field_div(form.new_password) }}
- <div class="form_field_input">
- <p>{{ form.wants_comment_notification }}
- {{ wtforms_util.render_label(form.wants_comment_notification) }}</p>
- </div>
- {{- wtforms_util.render_field_div(form.license_preference) }}
- <div class="form_submit_buttons">
+ {% if pass_auth is defined %}
+ <p>
+ <a href="{{ request.urlgen('mediagoblin.edit.pass') }}">
+ {% trans %}Change your password.{% endtrans %}
+ </a>
+ </p>
+ {% endif %}
+ {% template_hook("edit_link") %}
+ {{ wtforms_util.render_divs(form, True) }}
+ <div class="form_submit_buttons">
<input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" />
- {{ csrf_token }}
+ {{ csrf_token }}
</div>
</div>
</form>
diff --git a/mediagoblin/templates/mediagoblin/edit/verification.txt b/mediagoblin/templates/mediagoblin/edit/verification.txt
new file mode 100644
index 00000000..d53cd5e8
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/edit/verification.txt
@@ -0,0 +1,29 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# 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/>.
+-#}
+
+{% trans username=username, verification_url=verification_url|safe -%}
+Hi,
+
+We wanted to verify that you are {{ username }}. If this is the case, then
+please follow the link below to verify your new email address.
+
+{{ verification_url }}
+
+If you are not {{ username }} or didn't request an email change, you can ignore
+this email.
+{%- endtrans %}
diff --git a/mediagoblin/templates/mediagoblin/fragments/header_notifications.html b/mediagoblin/templates/mediagoblin/fragments/header_notifications.html
new file mode 100644
index 00000000..613100aa
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/fragments/header_notifications.html
@@ -0,0 +1,40 @@
+{% set notifications = request.notifications.get_notifications(request.user.id) %}
+{% if notifications %}
+ <div class="header_notifications">
+ <h3>{% trans %}New comments{% endtrans %}</h3>
+ <ul>
+ {% for notification in notifications %}
+ {% set comment = notification.subject %}
+ {% set comment_author = comment.get_author %}
+ {% set media = comment.get_entry %}
+ <li class="comment_wrapper">
+ <div class="comment_author">
+ <img src="{{ request.staticdirect('/images/icon_comment.png') }}" />
+ <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
+ user=comment_author.username) }}"
+ class="comment_authorlink">
+ {{- comment_author.username -}}
+ </a>
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
+ comment=comment.id,
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}#comment"
+ class="comment_whenlink">
+ <span title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
+ {%- trans formatted_time=timesince(comment.created) -%}
+ {{ formatted_time }} ago
+ {%- endtrans -%}
+ </span>
+ </a>:
+ </div>
+ <div class="comment_content">
+ {% autoescape False -%}
+ {{ comment.content_html }}
+ {%- endautoescape %}
+ </div>
+
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+{% endif %}
diff --git a/mediagoblin/templates/mediagoblin/media_displays/image.html b/mediagoblin/templates/mediagoblin/media_displays/image.html
index 158dd67f..d0050f50 100644
--- a/mediagoblin/templates/mediagoblin/media_displays/image.html
+++ b/mediagoblin/templates/mediagoblin/media_displays/image.html
@@ -27,3 +27,20 @@
{{ super() }}
{% template_hook("image_sideinfo") %}
{% endblock %}
+
+{% block mediagoblin_after_added_sidebar %}
+ {% if app_config['original_date_visible'] %}
+ {% set original_date = media.media_manager.get_original_date() %}
+
+ {% if original_date %}
+ <h3>{% trans %}Created{% endtrans %}</h3>
+
+ <p><span title="{{ original_date.strftime("%I:%M%p %Y-%m-%d") }}">
+ {%- trans formatted_time=timesince(original_date) -%}
+ {{ formatted_time }} ago
+ {%- endtrans -%}
+ </span></p>
+ {%- endif %}
+ {% endif %}
+{% endblock %}
+
diff --git a/mediagoblin/templates/mediagoblin/media_displays/pdf.html b/mediagoblin/templates/mediagoblin/media_displays/pdf.html
new file mode 100644
index 00000000..9319e87c
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/media_displays/pdf.html
@@ -0,0 +1,86 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# 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/user_pages/media.html' %}
+
+{% set medium_view = request.app.public_store.file_url(
+ media.media_files['medium']) %}
+
+{% if 'pdf' in media.media_files %}
+ {% set pdf_view = request.app.public_store.file_url(
+ media.media_files['pdf']) %}
+{% else %}
+ {% set pdf_view = request.app.public_store.file_url(
+ media.media_files['original']) %}
+{% endif %}
+
+{% set pdf_js = global_config.get('media_type:mediagoblin.media_types.pdf', {}).get('pdf_js', False) %}
+
+{% if pdf_js %}
+ {% block mediagoblin_html_tag %}
+ dir="ltr" mozdisallowselectionprint moznomarginboxes
+ {% endblock mediagoblin_html_tag %}
+{% endif %}
+
+{% block mediagoblin_head -%}
+ {{ super() }}
+
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+
+{%- endblock %}
+
+{% block mediagoblin_media %}
+ {% if pdf_js %}
+ <iframe width="640px" height="480px"
+ src="{{ request.staticdirect('/extlib/pdf.js/web/viewer.html') }}?file={{ pdf_view }} ">
+ </iframe>
+ {% else %}
+ <a href="{{ pdf_view }}">
+ <img id="medium"
+ class="media_image"
+ src="{{ medium_view }}"
+ alt="
+ {%- trans media_title=media.title -%}
+ Image for {{ media_title}}
+ {%- endtrans %}"/>
+ </a>
+ {% endif %}
+{% endblock %}
+
+{% block mediagoblin_sidebar %}
+ <h3>{% trans %}Download{% endtrans %}</h3>
+ <ul>
+ {% if 'original' in media.media_files %}
+ <li>
+ <a href="{{ request.app.public_store.file_url(
+ media.media_files.original) }}">
+ {%- trans %}Original file{% endtrans -%}
+ </a>
+ </li>
+ {% endif %}
+ {% if 'pdf' in media.media_files %}
+ <li>
+ <a href="{{ request.app.public_store.file_url(
+ media.media_files.pdf) }}">
+ {%- trans %}PDF file{% endtrans -%}
+ </a>
+ </li>
+ {% endif %}
+ </ul>
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/media_displays/stl.html b/mediagoblin/templates/mediagoblin/media_displays/stl.html
index a89e0b4f..bc12ce4e 100644
--- a/mediagoblin/templates/mediagoblin/media_displays/stl.html
+++ b/mediagoblin/templates/mediagoblin/media_displays/stl.html
@@ -108,32 +108,26 @@ window.show_things = function () {
<div style="padding: 4px;">
- <a class="button_action" onclick="show('perspective');"
- title="{%- trans %}Toggle Rotate{% endtrans -%}">
+ <a class="button_action" onclick="show('perspective');">
{%- trans %}Perspective{% endtrans -%}
</a>
- <a class="button_action" onclick="show('front_view');"
- title="{%- trans %}Front{% endtrans -%}">
+ <a class="button_action" onclick="show('front_view');">
{%- trans %}Front{% endtrans -%}
</a>
- <a class="button_action" onclick="show('top_view');"
- title="{%- trans %}Top{% endtrans -%}">
+ <a class="button_action" onclick="show('top_view');">
{%- trans %}Top{% endtrans -%}
</a>
- <a class="button_action" onclick="show('side_view');"
- title="{%- trans %}Side{% endtrans -%}">
+ <a class="button_action" onclick="show('side_view');">
{%- trans %}Side{% endtrans -%}
</a>
{% if media.media_data.file_type == "stl" %}
<a id="webgl_button" class="button_action"
- onclick="show_things();"
- title="{%- trans %}WebGL{% endtrans -%}">
+ onclick="show_things();">
{%- trans %}WebGL{% endtrans -%}
</a>
{% endif %}
<a class="button_action" href="{{ model_download }}"
- title="{%- trans %}Download{% endtrans -%}"
style="float:right;">
{%- trans %}Download model{% endtrans -%}
</a>
diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html
index 529d89ef..15d53af1 100644
--- a/mediagoblin/templates/mediagoblin/root.html
+++ b/mediagoblin/templates/mediagoblin/root.html
@@ -27,23 +27,8 @@
{%- endblock mediagoblin_head %}
{% block mediagoblin_content %}
- {% if request.user %}
- <h1>{% trans %}Explore{% endtrans %}</h1>
- {% else %}
- <h1>{% trans %}Hi there, welcome to this MediaGoblin site!{% endtrans %}</h1>
- <img class="right_align" src="{{ request.staticdirect('/images/frontpage_image.png') }}" />
- <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, 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>
- {% trans register_url=request.urlgen('mediagoblin.auth.register') -%}
- <a class="button_action_highlight" href="{{ register_url }}">Create an account at this site</a>
- or
- <a class="button_action" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a>
- {%- endtrans %}
- {% endif %}
- <div class="clear"></div>
- {% endif %}
+ {% include "mediagoblin/bits/frontpage_welcome.html" %}
+
<h2>{% trans %}Most recent media{% endtrans %}</h2>
{{ object_gallery(request, media_entries, pagination) }}
diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html
index 2b790584..694eb979 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html
@@ -41,9 +41,10 @@
<div class="form_submit_buttons">
{# TODO: This isn't a button really... might do unexpected things :) #}
- <a class="button_action" href="{{ request.urlgen('mediagoblin.user_pages.user_collection',
- collection=collection.slug,
- user=request.user.username) }}">{% trans %}Cancel{% endtrans %}</a>
+ <a class="button_action" href="
+ {{- collection.url_for_self(request.urlgen) }}">
+ {%- trans %}Cancel{% endtrans -%}
+ </a>
<input type="submit" value="{% trans %}Delete permanently{% endtrans %}" class="button_form" />
{{ csrf_token }}
</div>
diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html
index 449cc3ce..dc31d90f 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html
@@ -47,9 +47,10 @@
<div class="form_submit_buttons">
{# TODO: This isn't a button really... might do unexpected things :) #}
- <a class="button_action" href="{{ request.urlgen('mediagoblin.user_pages.user_collection',
- collection=collection_item.in_collection.slug,
- user=request.user.username) }}">{% trans %}Cancel{% endtrans %}</a>
+ <a class="button_action" href="
+ {{- collection_item.in_collection.url_for_self(request.urlgen) }}">
+ {%- trans %}Cancel{% endtrans -%}
+ </a>
<input type="submit" value="{% trans %}Remove{% endtrans %}" class="button_form" />
{{ csrf_token }}
</div>
diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_list.html b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
index abf22623..8ac0b988 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html
@@ -15,7 +15,7 @@
# 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" %}
+{%- extends "mediagoblin/base.html" %}
{% block title %}
{%- trans username=user.username -%}
@@ -39,17 +39,17 @@
<a href="{{ request.urlgen('mediagoblin.submit.collection',
user=user.username) }}">
{%- trans %}Create new collection{% endtrans -%}
+ </a>
</p>
{% endif %}
{% endif %}
<ul>
{% for coll in collections %}
- {% set coll_url = request.urlgen(
- 'mediagoblin.user_pages.user_collection',
- user=user.username,
- collection=coll.slug) %}
- <li><a href="{{ coll_url }}">{{ coll.title }}</li>
+ {%- set coll_url = coll.url_for_self(request.urlgen) %}
+ <li>
+ <a href="{{ coll_url }}">{{ coll.title }}</a>
+ </li>
{% endfor %}
</ul>
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index b77c12b9..c16e4c78 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -43,7 +43,7 @@
{%- endtrans -%}
</p>
{% include "mediagoblin/utils/prev_next.html" %}
- <div class="media_pane">
+ <div class="media_pane">
<div class="media_image_container">
{% block mediagoblin_media %}
{% set display_media = request.app.public_store.file_url(
@@ -71,7 +71,7 @@
{{ media.title }}
</h2>
{% if request.user and
- (media.uploader == request.user.id or
+ (media.uploader == request.user.id or
request.user.is_admin) %}
{% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
user= media.get_uploader.username,
@@ -81,20 +81,25 @@
user= media.get_uploader.username,
media_id=media.id) %}
<a class="button_action" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a>
+
{% endif %}
{% autoescape False %}
<p>{{ media.description_html }}</p>
{% endautoescape %}
{% if comments %}
- <a
- {% if not request.user %}
- href="{{ request.urlgen('mediagoblin.auth.login') }}"
- {% endif %}
- class="button_action" id="button_addcomment" title="Add a comment">
- {% trans %}Add a comment{% endtrans %}
- </a>
+ {% if app_config['allow_comments'] %}
+ <a
+ {% if not request.user %}
+ href="{{ request.urlgen('mediagoblin.auth.login') }}"
+ {% endif %}
+ class="button_action" id="button_addcomment" title="Add a comment">
+ {% trans %}Add a comment{% endtrans %}
+ </a>
+ {% include "mediagoblin/utils/comment-subscription.html" %}
+
+ {% endif %}
{% if request.user %}
- <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment',
+ <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment',
user= media.get_uploader.username,
media_id=media.id) }}" method="POST" id="form_comment">
{{ wtforms_util.render_divs(comment_form) }}
@@ -117,16 +122,20 @@
<div class="comment_author">
<img src="{{ request.staticdirect('/images/icon_comment.png') }}" />
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
- user=comment_author.username) }}">
+ user=comment_author.username) }}"
+ class="comment_authorlink">
{{- 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_or_id) }}#comment">
- {{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}
- </a>:
+ media=media.slug_or_id) }}#comment"
+ class="comment_whenlink">
+ <span title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
+ {%- trans formatted_time=timesince(comment.created) -%}
+ {{ formatted_time }} ago
+ {%- endtrans -%}
+ </span></a>:
</div>
<div class="comment_content">
{% autoescape False -%}
@@ -141,10 +150,16 @@
{% endif %}
</div>
<div class="media_sidebar">
- {% trans date=media.created.strftime("%Y-%m-%d") -%}
- <h3>Added on</h3>
- <p>{{ date }}</p>
- {%- endtrans %}
+ <h3>{% trans %}Added{% endtrans %}</h3>
+ <p><span title="{{ media.created.strftime("%I:%M%p %Y-%m-%d") }}">
+ {%- trans formatted_time=timesince(media.created) -%}
+ {{ formatted_time }} ago
+ {%- endtrans -%}
+ </span></p>
+
+ {% block mediagoblin_after_added_sidebar %}
+ {% endblock %}
+
{% if media.tags %}
{% include "mediagoblin/utils/tags.html" %}
{% endif %}
@@ -154,7 +169,7 @@
{% include "mediagoblin/utils/license.html" %}
{% include "mediagoblin/utils/exif.html" %}
-
+
{%- if media.attachment_files|count %}
<h3>{% trans %}Attachments{% endtrans %}</h3>
<ul>
diff --git a/mediagoblin/templates/mediagoblin/utils/comment-subscription.html b/mediagoblin/templates/mediagoblin/utils/comment-subscription.html
new file mode 100644
index 00000000..bd367e80
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/utils/comment-subscription.html
@@ -0,0 +1,34 @@
+{#
+# GNU MediaGoblin -- federated, autonomous media hosting
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
+#
+# 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/>.
+#}
+{%- if request.user %}
+ {% set subscription = request.notifications.get_comment_subscription(
+ request.user.id, media.id) %}
+ {% if not subscription or not subscription.notify %}
+ <a type="submit" href="{{ request.urlgen('mediagoblin.notifications.subscribe_comments',
+ user=media.get_uploader.username,
+ media=media.slug_or_id)}}"
+ class="button_action">Subscribe to comments
+ </a>
+ {% else %}
+ <a type="submit" href="{{ request.urlgen('mediagoblin.notifications.silence_comments',
+ user=media.get_uploader.username,
+ media=media.slug_or_id)}}"
+ class="button_action">Silence comments
+ </a>
+ {% endif %}
+{%- endif %}
diff --git a/mediagoblin/templates/mediagoblin/utils/exif.html b/mediagoblin/templates/mediagoblin/utils/exif.html
index a89e69c8..b62208e1 100644
--- a/mediagoblin/templates/mediagoblin/utils/exif.html
+++ b/mediagoblin/templates/mediagoblin/utils/exif.html
@@ -17,18 +17,51 @@
#}
{% block exif_content %}
+<noscript>
+ <style type="text/css">
+ #exif_additional_info {
+ display: block;
+ }
+ </style>
+</noscript>
+<div id="exif_content">
{% if app_config['exif_visible']
and media.media_data
and media.media_data.exif_all is defined
and media.media_data.exif_all %}
- <h3>EXIF</h3>
- <table>
+ <h3>Camera Information</h3>
+ <table id="exif_camera_information">
+ <tbody>
+ {% for label, value in media.exif_display_data_short().iteritems() %}
+ <tr>
+ <td class="col1">{{ label }}</td>
+ <td>{{ value }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <h3 id="exif_additional_info_button" class="button_action">
+ Additional Information
+ </h3>
+ <div id="exif_additional_info">
+ <table class="exif_info">
{% for key, tag in media.exif_display_iter() %}
<tr>
- <td>{{ key }}</td>
+ <td class="col1">{{ key }}</td>
<td>{{ tag.printable }}</td>
</tr>
{% endfor %}
</table>
+ </div>
{% endif %}
+<script type="text/javascript">
+$(document).ready(function(){
+
+$("#exif_additional_info_button").click(function(){
+ $("#exif_additional_info").slideToggle("slow");
+});
+
+});
+</script>
+</div> <!-- end exif_content div -->
{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html
index 35b4aa04..e079274e 100644
--- a/mediagoblin/templates/mediagoblin/utils/wtforms.html
+++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html
@@ -19,7 +19,7 @@
{# Render the label for a field #}
{% macro render_label(field) %}
{%- if field.label.text -%}
- <label for="{{ field.label.field_id }}">{{ _(field.label.text) }}</label>
+ <label for="{{ field.label.field_id }}">{{ field.label.text }}</label>
{%- endif -%}
{%- endmacro %}
@@ -33,25 +33,37 @@
{%- endmacro %}
{# Generically render a field #}
-{% macro render_field_div(field) %}
- {{- render_label_p(field) }}
- <div class="form_field_input">
- {{ field }}
- {%- if field.errors -%}
- {% for error in field.errors %}
- <p class="form_field_error">{{ _(error) }}</p>
- {% endfor %}
- {%- endif %}
- {%- if field.description %}
- <p class="form_field_description">{{ _(field.description)|safe }}</p>
- {%- endif %}
- </div>
+{% macro render_field_div(field, autofocus_first=False) %}
+ {% if field.type == 'BooleanField' %}
+ {{ render_bool(field) }}
+ {% else %}
+ {{- render_label_p(field) }}
+ <div class="form_field_input">
+ {% if autofocus_first %}
+ {{ field(autofocus=True) }}
+ {% else %}
+ {{ field }}
+ {% endif %}
+ {%- if field.errors -%}
+ {% for error in field.errors %}
+ <p class="form_field_error">{{ error }}</p>
+ {% endfor %}
+ {%- endif %}
+ {%- if field.description %}
+ <p class="form_field_description">{{ field.description|safe }}</p>
+ {%- endif %}
+ </div>
+ {% endif %}
{%- endmacro %}
{# Auto-render a form as a series of divs #}
-{% macro render_divs(form) -%}
+{% macro render_divs(form, autofocus_first=False) -%}
{% for field in form %}
- {{ render_field_div(field) }}
+ {% if autofocus_first and loop.first %}
+ {{ render_field_div(field, True) }}
+ {% else %}
+ {{ render_field_div(field) }}
+ {% endif %}
{% endfor %}
{%- endmacro %}
@@ -59,7 +71,7 @@
{% macro render_table(form) -%}
{% for field in form %}
<tr>
- <th>{{ _(field.label.text) }}</th>
+ <th>{{ field.label.text }}</th>
<td>
{{field}}
{% if field.errors %}
@@ -74,3 +86,19 @@
</tr>
{% endfor %}
{%- endmacro %}
+
+{# Render a boolean field #}
+{% macro render_bool(field) %}
+ <div class="boolean">
+ <label for="{{ field.label.field_id }}">
+ {{ field }}</input>
+ {{ field.description|safe }}
+ </label>
+ {%- if field.errors -%}
+ {% for error in field.errors %}
+ <p class="form_field_error">{{ error }}</p>
+ {% endfor %}
+ {% endif %}
+ </div>
+{% endmacro %}
+