aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
authortilly-Q <nattilypigeonfowl@gmail.com>2013-08-20 12:21:13 -0400
committertilly-Q <nattilypigeonfowl@gmail.com>2013-08-20 12:21:13 -0400
commit9e204e49c9670b0e004dc9b62bf3b698b7534325 (patch)
tree452eab56add0e1b009b665f5b32d7b59b7545e82 /mediagoblin/templates
parente1561d048815e29b3b7c7e1c860d9cf0c4326f0a (diff)
parentc62d174437445565b55b220396e7571a323a159c (diff)
downloadmediagoblin-9e204e49c9670b0e004dc9b62bf3b698b7534325.tar.lz
mediagoblin-9e204e49c9670b0e004dc9b62bf3b698b7534325.tar.xz
mediagoblin-9e204e49c9670b0e004dc9b62bf3b698b7534325.zip
Merge branch 'master' into OPW-Moderation-Update
Conflicts: mediagoblin/db/models.py mediagoblin/decorators.py mediagoblin/routing.py mediagoblin/user_pages/views.py
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/api/authorize.html56
-rw-r--r--mediagoblin/templates/mediagoblin/api/oob.html33
-rw-r--r--mediagoblin/templates/mediagoblin/base.html39
-rw-r--r--mediagoblin/templates/mediagoblin/bits/body_end.html2
-rw-r--r--mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html14
-rw-r--r--mediagoblin/templates/mediagoblin/fragments/header_notifications.html2
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html6
-rw-r--r--mediagoblin/templates/mediagoblin/utils/comment-subscription.html3
8 files changed, 138 insertions, 17 deletions
diff --git a/mediagoblin/templates/mediagoblin/api/authorize.html b/mediagoblin/templates/mediagoblin/api/authorize.html
new file mode 100644
index 00000000..d0ec2616
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/api/authorize.html
@@ -0,0 +1,56 @@
+{#
+# 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" %}
+
+{% block title -%}
+ {% trans %}Authorization{% endtrans %} &mdash; {{ super() }}
+{%- endblock %}
+
+{% block mediagoblin_content %}
+
+<h1>{% trans %}Authorize{% endtrans %}</h1>
+
+<p>
+ {% trans %}You are logged in as{% endtrans %}
+ <strong>{{user.username}}</strong>
+ <br /><br />
+
+ {% trans %}Do you want to authorize {% endtrans %}
+ {% if client.application_name -%}
+ <em>{{ client.application_name }}</em>
+ {%- else -%}
+ <em>{% trans %}an unknown application{% endtrans %}</em>
+ {%- endif %}
+ {% trans %} to access your account? {% endtrans %}
+ <br /><br />
+ {% trans %}Applications with access to your account can: {% endtrans %}
+ <ul>
+ <li>{% trans %}Post new media as you{% endtrans %}</li>
+ <li>{% trans %}See your information (e.g profile, meida, etc...){% endtrans %}</li>
+ <li>{% trans %}Change your information{% endtrans %}</li>
+ </ul>
+ <br />
+
+ <form method="POST">
+ {{ csrf_token }}
+ {{ authorize_form.oauth_token }}
+ {{ authorize_form.oauth_verifier }}
+ <input type="submit" value="{% trans %}Authorize{% endtrans %}">
+ </form>
+</p>
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/api/oob.html b/mediagoblin/templates/mediagoblin/api/oob.html
new file mode 100644
index 00000000..d290472a
--- /dev/null
+++ b/mediagoblin/templates/mediagoblin/api/oob.html
@@ -0,0 +1,33 @@
+{#
+# 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" %}
+
+{% block title -%}
+ {% trans %}Authorization Finished{% endtrans %} &mdash; {{ super() }}
+{%- endblock %}
+
+{% block mediagoblin_content %}
+
+<h1>{% trans %}Authorization Complete{% endtrans %}</h1>
+
+<h4>{% trans %}Copy and paste this into your client:{% endtrans %}</h4>
+
+<p class="verifier">
+ {{ oauth_request.verifier }}
+</p>
+{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html
index 6eaad70b..7d53585b 100644
--- a/mediagoblin/templates/mediagoblin/base.html
+++ b/mediagoblin/templates/mediagoblin/base.html
@@ -23,6 +23,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>{% block title %}{{ app_config['html_title'] }}{% endblock %}</title>
<link rel="stylesheet" type="text/css"
href="{{ request.staticdirect('/css/extlib/reset.css') }}"/>
@@ -60,24 +61,35 @@
{%- if request.user %}
{% if request.user and request.user.status == 'active' %}
- {% set notification_count = request.notifications.get_notification_count(request.user.id) %}
+ {% set notification_count = get_notification_count(request.user.id) %}
{% if notification_count %}
- <a href="#notifications" class="notification-gem button_action" title="Notifications">
- {{ notification_count }}</a>
+ <a href="javascript:;" 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>
+ <a href="javascript:;" class="button_action header_dropdown_down">&#9660;</a>
+ <a href="javascript:;" class="button_action header_dropdown_up">&#9650;</a>
{% elif request.user and request.user.status == "needs_email_verification" %}
{# the following link should only appear when verification is needed #}
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
user=request.user.username) }}"
class="button_action_highlight">
{% trans %}Verify your email!{% endtrans %}</a>
- or <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>
+ or <a id="logout" href=
+ {% if persona is not defined %}
+ "{{ request.urlgen('mediagoblin.auth.logout') }}"
+ {% else %}
+ "javascript:;"
+ {% endif %}
+ >{% trans %}log out{% endtrans %}</a>
{% endif %}
{%- elif auth %}
- <a href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{
- request.base_url|urlencode }}">
+ <a href=
+ {% if persona_auth is defined %}
+ "javascript:;" id="persona_login"
+ {% else %}
+ "{{ request.urlgen('mediagoblin.auth.login') }}"
+ {% endif %}
+ >
{%- trans %}Log in{% endtrans -%}
</a>
{%- endif %}
@@ -101,7 +113,13 @@
{%- trans %}Media processing panel{% endtrans -%}
</a>
&middot;
- <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}Log out{% endtrans %}</a>
+ <a id="logout" href=
+ {% if persona is not defined %}
+ "{{ request.urlgen('mediagoblin.auth.logout') }}"
+ {% else %}
+ "javascript:;"
+ {% endif %}
+ >{% trans %}Log out{% endtrans %}</a>
</p>
<a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}">
{%- trans %}Add media{% endtrans -%}
@@ -134,6 +152,9 @@
{% include "mediagoblin/utils/messages.html" %}
{% block mediagoblin_content %}
{% endblock mediagoblin_content %}
+ {% if csrf_token is defined %}
+ {% template_hook("persona_form") %}
+ {% endif %}
</div>
{%- include "mediagoblin/bits/base_footer.html" %}
</div>
diff --git a/mediagoblin/templates/mediagoblin/bits/body_end.html b/mediagoblin/templates/mediagoblin/bits/body_end.html
index bb7b9762..c8f5e2d6 100644
--- a/mediagoblin/templates/mediagoblin/bits/body_end.html
+++ b/mediagoblin/templates/mediagoblin/bits/body_end.html
@@ -15,3 +15,5 @@
# 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/>.
-#}
+
+{% template_hook("persona_end") %}
diff --git a/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html b/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html
index 9ef28a4d..4e55e618 100644
--- a/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html
+++ b/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html
@@ -19,21 +19,27 @@
{% if request.user %}
<h1>{% trans %}Explore{% endtrans %}</h1>
{% else %}
+ <img class="right_align" src="{{ request.staticdirect('/images/home_goblin.png') }}" />
<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>
+ <a class="button_action_highlight" href=
+ {% if persona_auth is defined %}
+ "javascript:;" id="persona_login1"
+ {% else %}
+ "{{ request.urlgen('mediagoblin.auth.register') }}"
+ {% endif %}
+ {% trans %}
+ >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>
+ <a class="button_action" href="http://mediagoblin.readthedocs.org/">Set up MediaGoblin on your own server</a>
{%- endtrans %}
<div class="clear"></div>
diff --git a/mediagoblin/templates/mediagoblin/fragments/header_notifications.html b/mediagoblin/templates/mediagoblin/fragments/header_notifications.html
index 613100aa..70d7935a 100644
--- a/mediagoblin/templates/mediagoblin/fragments/header_notifications.html
+++ b/mediagoblin/templates/mediagoblin/fragments/header_notifications.html
@@ -1,4 +1,4 @@
-{% set notifications = request.notifications.get_notifications(request.user.id) %}
+{% set notifications = get_notifications(request.user.id) %}
{% if notifications %}
<div class="header_notifications">
<h3>{% trans %}New comments{% endtrans %}</h3>
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index 441452f2..e161afc9 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -90,7 +90,8 @@
{% if app_config['allow_comments'] %}
<a
{% if not request.user %}
- href="{{ request.urlgen('mediagoblin.auth.login') }}"
+ href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{
+ request.base_url|urlencode }}"
{% endif %}
class="button_action" id="button_addcomment" title="Add a comment">
{% trans %}Add a comment{% endtrans %}
@@ -107,7 +108,10 @@
<input type="submit" value="{% trans %}Add this comment{% endtrans %}" class="button_action" />
{{ csrf_token }}
</div>
+ <input type="hidden" value="{{ request.urlgen('mediagoblin.user_pages.media_preview_comment') }}" id="previewURL" />
+ <input type="hidden" value="{% trans %}Comment Preview{% endtrans %}" id="previewText"/>
</form>
+ <div id="comment_preview"></div>
{% endif %}
<ul style="list-style:none">
{% for comment in comments %}
diff --git a/mediagoblin/templates/mediagoblin/utils/comment-subscription.html b/mediagoblin/templates/mediagoblin/utils/comment-subscription.html
index bd367e80..75da5e89 100644
--- a/mediagoblin/templates/mediagoblin/utils/comment-subscription.html
+++ b/mediagoblin/templates/mediagoblin/utils/comment-subscription.html
@@ -16,8 +16,7 @@
# 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) %}
+ {% set subscription = 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,