aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/templates
diff options
context:
space:
mode:
authorJef van Schendel <mail@jefvanschendel.nl>2011-12-13 15:15:57 +0100
committerJef van Schendel <mail@jefvanschendel.nl>2011-12-13 15:15:57 +0100
commitbb3b9e4090706e1e9815c5132c01b9e706e31360 (patch)
treef6a1eb6c0db46bd445bdd67128181206f735b5a8 /mediagoblin/templates
parentd44140a212fddab3301cbf3a97d3197f8879277b (diff)
parentb27067371d6cb99cf21c7c0970b664e970d9a22d (diff)
downloadmediagoblin-bb3b9e4090706e1e9815c5132c01b9e706e31360.tar.lz
mediagoblin-bb3b9e4090706e1e9815c5132c01b9e706e31360.tar.xz
mediagoblin-bb3b9e4090706e1e9815c5132c01b9e706e31360.zip
Merge jQuery branch, resolve conflicts
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r--mediagoblin/templates/mediagoblin/auth/register.html20
-rw-r--r--mediagoblin/templates/mediagoblin/base.html3
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html152
-rw-r--r--mediagoblin/templates/mediagoblin/utils/pagination.html6
-rw-r--r--mediagoblin/templates/mediagoblin/utils/tags.html4
5 files changed, 110 insertions, 75 deletions
diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html
index a0d0a277..bded1d7e 100644
--- a/mediagoblin/templates/mediagoblin/auth/register.html
+++ b/mediagoblin/templates/mediagoblin/auth/register.html
@@ -19,6 +19,26 @@
{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
+{% block mediagoblin_head %}
+ <script>
+ $(document).ready(function(){
+ $("#password").after('<input type="text" value="" name="password_clear" id="password_clear" /><input type="checkbox" id="password_boolean" />Show password');
+ $('#password_clear').hide();
+ $('#password_boolean').click(function(){
+ if($('#password_boolean').prop("checked")) {
+ $('#password_clear').val($('#password').val());
+ $('#password').hide();
+ $('#password_clear').show();
+ } else {
+ $('#password').val($('#password_clear').val());
+ $('#password_clear').hide();
+ $('#password').show();
+ };
+ });
+ });
+ </script>
+{% endblock mediagoblin_head %}
+
{% block mediagoblin_content %}
<form action="{{ request.urlgen('mediagoblin.auth.register') }}"
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html
index 16569f03..b8061f24 100644
--- a/mediagoblin/templates/mediagoblin/base.html
+++ b/mediagoblin/templates/mediagoblin/base.html
@@ -32,10 +32,11 @@
href="{{ request.staticdirect('/css/video-js.css') }}"/>
<link rel="shortcut icon"
href="{{ request.staticdirect('/images/goblin.ico') }}" />
+ <script type="text/javascript"
+ src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script>
{% block mediagoblin_head %}
{% endblock mediagoblin_head %}
</head>
-
<body>
{% block mediagoblin_body %}
<div class="mediagoblin_body">
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index d7d510d4..5760a68c 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -22,13 +22,26 @@
{% block title %}{{ media.title }} &mdash; {{ super() }}{% endblock %}
+{% block mediagoblin_head %}
+ <script>
+ $(document).ready(function(){
+ $('#form_comment').hide();
+ $('#button_addcomment').click(function(){
+ $(this).fadeOut('fast');
+ $('#form_comment').slideDown(function(){
+ $('#comment_content').focus();
+ });
+ });
+ });
+ </script>
+{% endblock mediagoblin_head %}
+
{% block mediagoblin_content %}
<div class="grid_11 alpha">
<div class="media_image_container">
{% block mediagoblin_media %}
{% set display_media = request.app.public_store.file_url(
media.get_display_media(media.media_files)) %}
-
{# if there's a medium file size, that means the medium size
# isn't the original... so link to the original!
#}
@@ -46,91 +59,96 @@
{% endif %}
{% endblock %}
</div>
-
<h2 class="media_title">
{{ media.title }}
</h2>
{% autoescape False %}
<p>{{ media.description_html }}</p>
- {% endautoescape %}
- <p class="media_uploader">
- {% trans date=media.created.strftime("%Y-%m-%d"),
- user_url=request.urlgen(
- 'mediagoblin.user_pages.user_home',
- user=media.get_uploader().username),
- username=media.get_uploader().username -%}
- By <a href="{{ user_url }}">{{ username }}</a> on {{ date }}
+ {% endautoescape %}
+ <p class="media_specs">
+ {% trans date=media.created.strftime("%Y-%m-%d") -%}
+ Added on {{ date }}. Licensed under an <a href="#">X license</a>.
{%- endtrans %}
+ {% if media['uploader'] == request.user._id or
+ request.user['is_admin'] %}
+ {% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
+ user= media.get_uploader().username,
+ media= media._id) %}
+ <a class="button_action" href="{{ edit_url }}">{% trans %}Edit{% endtrans %}</a>
+ {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete',
+ user= media.get_uploader().username,
+ media= media._id) %}
+ <a class="button_action" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a>
+ {% endif %}
</p>
- <h3></h3>
- {% if request.user and comments.count() %}
- <p><a href="#comment_form">{% trans %}Post a comment{% endtrans %}</a></p>
- {% endif %}
- {% if comments %}
- {% for comment in comments %}
- {% set comment_author = comment.author() %}
- {% if pagination.active_id == comment._id %}
- <div class="comment_wrapper comment_active" id="comment-{{ comment._id }}">
- <a name="comment" id="comment"></a>
- {% else %}
- <div class="comment_wrapper" id="comment-{{ comment._id }}">
+ <h3>{% trans %}23 comments{% endtrans %}
+ <div class="right_align">
+ <a
+ {% if not request.user %}
+ href="{{ request.urlgen('mediagoblin.auth.login') }}"
{% endif %}
-
- <div class="comment_content">{% autoescape False %}{{ comment.content_html }}
- {% endautoescape %}
- <img src="{{ request.staticdirect('/images/icon_comment.png') }}" />
- <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
- user = comment_author.username) }}">
- {{ comment_author.username }}</a>
- {% trans %}at{% endtrans %}
- <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
- comment = comment._id,
- user = media.get_uploader().username,
- media = media.slug) }}#comment">
- {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }}
- </a>
- </div>
- </div>
- {% endfor %}
-
+ class="button_action" id="button_addcomment" title="Add a comment">
+ {% trans %}Add one{% endtrans %}
+ </a>
+ </div>
+ </h3>
+ {# 0 comments. Be the first to add one! #}
{% if request.user %}
<form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment',
user= media.get_uploader().username,
- media=media._id) }}" method="POST">
+ media=media._id) }}" method="POST" id="form_comment">
+ <p>
+ {% trans %}Type your comment here. You can use <a href="http://daringfireball.net/projects/markdown/basics" target="_blank">Markdown</a> for formatting.{% endtrans %}
+ </p>
{{ wtforms_util.render_divs(comment_form) }}
<div class="form_submit_buttons">
- <input type="submit" value="{% trans %}Post comment!{% endtrans %}" class="button_form" />
+ <input type="submit" value="{% trans %}Add this comment{% endtrans %}" class="button_action" />
{{ csrf_token }}
</div>
</form>
{% endif %}
-
+ {% if comments %}
+ {% for comment in comments %}
+ {% set comment_author = comment.author() %}
+ {% if pagination.active_id == comment._id %}
+ <div class="comment_wrapper comment_active" id="comment-{{ comment._id }}">
+ <a name="comment" id="comment"></a>
+ {% else %}
+ <div class="comment_wrapper" id="comment-{{ comment._id }}">
+ {% endif %}
+ <div class="comment_content">
+ {% autoescape False %}
+ {{ comment.content_html }}
+ {% endautoescape %}
+ <img src="{{ request.staticdirect('/images/icon_comment.png') }}" />
+ <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
+ user = comment_author.username) }}">
+ {{ comment_author.username }}
+ </a>
+ {% trans %}at{% endtrans %}
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
+ comment = comment._id,
+ user = media.get_uploader().username,
+ media = media.slug) }}#comment">
+ {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }}
+ </a>
+ </div>
+ </div>
+ {% endfor %}
{{ render_pagination(request, pagination,
- request.urlgen('mediagoblin.user_pages.media_home',
- user = media.get_uploader().username,
- media = media._id)) }}
- </div>
- {% endif %}
-
+ request.urlgen('mediagoblin.user_pages.media_home',
+ user = media.get_uploader().username,
+ media = media._id)) }}
+ {% endif %}
+ </div>
<div class="grid_5 omega">
+ {% trans user_url=request.urlgen(
+ 'mediagoblin.user_pages.user_home',
+ user=media.get_uploader().username),
+ username=media.get_uploader().username -%}
+ <p>❖ Browsing media by <a href="{{ user_url }}">{{ username }}</a></p>
+ {%- endtrans %}
{% include "mediagoblin/utils/prev_next.html" %}
-
- {% if media.uploader == request.user._id or
- request.user.is_admin %}
- <p>
- {% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
- user= media.get_uploader().username,
- media= media.slug) %}
- <a href="{{ edit_url }}">{% trans %}Edit{% endtrans %}</a>
- </p>
- <p>
- {% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete',
- user= media.get_uploader().username,
- media= media._id) %}
- <a href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a>
- </p>
- {% endif %}
-
{% if media.attachment_files|count %}
<h3>Attachments</h3>
<ul>
@@ -143,7 +161,6 @@
{% endfor %}
</ul>
{% endif %}
-
{% if app_config['allow_attachments']
and (media.uploader == request.user._id
or request.user.is_admin) %}
@@ -153,7 +170,6 @@
media=media._id) }}">Add attachment</a>
</p>
{% endif %}
-
{% if media.tags %}
{% include "mediagoblin/utils/tags.html" %}
{% endif %}
diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html
index 3c12f93c..caa79fcc 100644
--- a/mediagoblin/templates/mediagoblin/utils/pagination.html
+++ b/mediagoblin/templates/mediagoblin/utils/pagination.html
@@ -36,15 +36,13 @@
{% set prev_url = pagination.get_page_url_explicit(
base_url, get_params,
pagination.page - 1) %}
- <a href="{{ prev_url }}"><img class="pagination_arrow" src="{{ request.staticdirect('/images/pagination_left.png') }}" alt="Previous page" /></a>
- <a href="{{ prev_url }}">{% trans %}Newer{% endtrans %}</a>
+ <a href="{{ prev_url }}">{% trans %}← Newer{% endtrans %}</a>
{% endif %}
{% if pagination.has_next %}
{% set next_url = pagination.get_page_url_explicit(
base_url, get_params,
pagination.page + 1) %}
- <a href="{{ next_url }}">{% trans %}Older{% endtrans %}</a>
- <a href="{{ next_url }}"><img class="pagination_arrow" src="{{ request.staticdirect('/images/pagination_right.png') }}" alt="Next page" /></a>
+ <a href="{{ next_url }}">{% trans %}Older →{% endtrans %}</a>
{% endif %}
<br />
{% trans %}Go to page:{% endtrans %}
diff --git a/mediagoblin/templates/mediagoblin/utils/tags.html b/mediagoblin/templates/mediagoblin/utils/tags.html
index c7dfc8eb..1f587411 100644
--- a/mediagoblin/templates/mediagoblin/utils/tags.html
+++ b/mediagoblin/templates/mediagoblin/utils/tags.html
@@ -17,12 +17,12 @@
#}
{% block tags_content -%}
- <p>{% trans %}Tagged with{% endtrans %}
+ <p>{% trans %}View more media tagged with{% endtrans %}
{% for tag in media.tags %}
{% if loop.last %}
{# the 'and' should only appear if there is more than one tag #}
{% if media.tags|length > 1 %}
- {% trans %}and{% endtrans %}
+ {% trans %}or{% endtrans %}
{% endif %}
<a href="{{ request.urlgen(
'mediagoblin.listings.tags_listing',