diff options
Diffstat (limited to 'mediagoblin/templates')
7 files changed, 127 insertions, 52 deletions
diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html index 39f07d33..8161ea9d 100644 --- a/mediagoblin/templates/mediagoblin/auth/login.html +++ b/mediagoblin/templates/mediagoblin/auth/login.html @@ -19,6 +19,11 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} +{% block mediagoblin_head %} + <script type="text/javascript" + src="{{ request.staticdirect('/js/autofilledin_password.js') }}"></script> +{% endblock %} + {% block mediagoblin_content %} <form action="{{ request.urlgen('mediagoblin.auth.login') }}" method="POST" enctype="multipart/form-data"> @@ -38,7 +43,7 @@ {% endif %} {{ wtforms_util.render_divs(login_form) }} <p> - <a href="{{ request.urlgen('mediagoblin.auth.forgot_password') }}"> + <a href="{{ request.urlgen('mediagoblin.auth.forgot_password') }}" id="forgot_password"> {% trans %}Forgot your password?{% endtrans %}</a> </p> <div class="form_submit_buttons"> diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index be81c27b..1a3408cd 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -28,6 +28,8 @@ <link rel="shortcut icon" href="{{ request.staticdirect('/images/goblin.ico') }}" /> <script src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script> + <script type="text/javascript" + src="{{ request.staticdirect('/js/header_dropdown.js') }}"></script> <!--[if lt IE 9]> <script src="{{ request.staticdirect('/js/extlib/html5shiv.js') }}"></script> <![endif]--> @@ -36,44 +38,43 @@ </head> <body> {% block mediagoblin_body %} - <div class="container"> {% block mediagoblin_header %} - <header> - {% block mediagoblin_logo %} - <a class="logo" - href="{{ request.urlgen('index') }}" - ><img src="{{ request.staticdirect('/images/logo.png') }}" - alt="{% trans %}MediaGoblin logo{% endtrans %}" /></a> - {% endblock mediagoblin_logo %} - {% if request.user and request.user.status == 'active' %} - <a class="button_action" - href="{{ request.urlgen('mediagoblin.submit.start') }}"> - {% trans %}Add media{% endtrans %} - </a> - {% endif %} - {% block mediagoblin_header_title %}{% endblock %} - <div class="header_right"> - {% if request.user %} - {# the following link should only appear when verification is needed #} - {% if request.user.status == "needs_email_verification" %} - <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', - user=request.user.username) }}" - class="button_action_highlight"> - {% trans %}Verify your email!{% endtrans %}</a> - {% endif %} - + <header> + {% block mediagoblin_logo %} + <a class="logo" + href="{{ request.urlgen('index') }}" + ><img src="{{ request.staticdirect('/images/logo.png') }}" + alt="{% trans %}MediaGoblin logo{% endtrans %}" /></a> + {% endblock mediagoblin_logo %} + {% block mediagoblin_header_title %}{% endblock %} + <div class="header_right"> + {% if request.user %} + {# the following link should only appear when verification is needed #} + {% if request.user.status == "needs_email_verification" %} <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', - user= request.user.username) }}"> - {{ request.user.username }}</a> - - (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>) - {% else %} - <a href="{{ request.urlgen('mediagoblin.auth.login') }}"> - {% trans %}Log in{% endtrans %}</a> + user=request.user.username) }}" + class="button_action_highlight"> + {% trans %}Verify your email!{% endtrans %}</a> {% endif %} - </div> - </header> + <div class="dropdown"> + {{ request.user.username }} ▾ + <div class="dropdown_items"> + {% if request.user and request.user.status == 'active' %} + <a href="{{ request.urlgen('mediagoblin.submit.start') }}">{% trans %}+ Add media{% endtrans %}</a> + {% endif %} + <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user= request.user.username) }}">{% trans %}View your profile{% endtrans %}</a> + <a class="button_action" href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}Log out{% endtrans %}</a> + </div> + </div> + {% else %} + <a href="{{ request.urlgen('mediagoblin.auth.login') }}"> + {% trans %}Log in{% endtrans %}</a> + {% endif %} + </div> + <div class="clear"></div> + </header> {% endblock %} + <div class="container"> <div class="mediagoblin_content"> {% include "mediagoblin/utils/messages.html" %} {% block mediagoblin_content %} diff --git a/mediagoblin/templates/mediagoblin/media_displays/audio.html b/mediagoblin/templates/mediagoblin/media_displays/audio.html new file mode 100644 index 00000000..9713aa49 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/media_displays/audio.html @@ -0,0 +1,65 @@ +{# +# 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' %} + +{% block mediagoblin_head %} + {{ super() }} + <link rel="stylesheet" type="text/css" href="{{ request.staticdirect('/css/audio.css') }}" /> + <script type="text/javascript" src="{{ request.staticdirect( + '/js/extlib/html5slider.js') }}"></script> + <script type="text/javascript" src="{{ request.staticdirect( + '/js/audio.js') }}"></script> +{% endblock %} + +{% block mediagoblin_media %} + <div class="audio-media"> + {% if 'spectrogram' in media.media_files %} + <div class="audio-spectrogram"> + <img src="{{ request.app.public_store.file_url( + media.media_files.spectrogram) }}" + alt="Spectrogram" /> + </div> + {% endif %} + <audio class="audio-player" controls="controls" + preload="metadata"> + <source src="{{ request.app.public_store.file_url( + media.media_files.webm_audio) }}" type="audio/webm; codecs=vorbis" /> + <div class="no_html5"> + {%- trans -%}Sorry, this audio will not work because + your web browser does not support HTML5 + audio.{%- endtrans -%}<br/> + {%- trans -%}You can get a modern web browser that + can play the audio at <a href="http://getfirefox.com"> + http://getfirefox.com</a>!{%- endtrans -%} + </div> + </audio> + </div> +{% 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> + {% endif %} + <li><a href="{{ request.app.public_store.file_url( + media.media_files.webm_audio) }}">{% trans %}WebM file (Vorbis codec){% endtrans %}</a> + </ul> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html index cf68b61b..86c277aa 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/video.html +++ b/mediagoblin/templates/mediagoblin/media_displays/video.html @@ -22,12 +22,12 @@ {{ super() }} <script type="text/javascript" src="{{ request.staticdirect('/js/extlib/video-js/video.js') }}"></script> - <link href="{{ request.staticdirect('/js/extlib/video-js/video-js.css') }}" rel="stylesheet"> + <link href="{{ request.staticdirect('/css/vjs-mg-skin.css') }}" rel="stylesheet"> {% endblock %} {% block mediagoblin_media %} <div class="video-player" style="position: relative;"> - <video class="video-js vjs-default-skin" + <video class="video-js vjs-mg-skin" width="{{ media.media_data.width }}" height="{{ media.media_data.height }}" controls="controls" diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 70a367f9..21990442 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -64,12 +64,14 @@ media.media_files['original']) }}"> <img class="media_image" src="{{ display_media }}" - alt="Image for {{ media.title }}" /> + alt="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> </a> {% else %} <img class="media_image" src="{{ display_media }}" - alt="Image for {{ media.title }}" /> + alt="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> {% endif %} {% endblock %} </div> @@ -114,8 +116,6 @@ </p> {% endif %} {% if comments %} - <h3> - <div class="right_align"> <a {% if not request.user %} href="{{ request.urlgen('mediagoblin.auth.login') }}" @@ -123,8 +123,6 @@ class="button_action" id="button_addcomment" title="Add a comment"> {% trans %}Add a comment{% endtrans %} </a> - </div> - </h3> {% if request.user %} <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', user= media.get_uploader.username, @@ -147,10 +145,7 @@ {% else %} <div class="comment_wrapper" id="comment-{{ comment._id }}"> {% endif %} - <div class="comment_content"> - {% autoescape False %} - {{ comment.content_html }} - {% endautoescape %} + <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) }}"> @@ -162,7 +157,12 @@ user = media.get_uploader.username, media = media.slug_or_id) }}#comment"> {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }} - </a> + </a>: + </div> + <div class="comment_content"> + {% autoescape False %} + {{ comment.content_html }} + {% endautoescape %} </div> </div> {% endfor %} @@ -184,6 +184,9 @@ {% include "mediagoblin/utils/geolocation_map.html" %} {% include "mediagoblin/utils/exif.html" %} + + {% block mediagoblin_sidebar %} + {% endblock %} </div> <div class="clear"></div> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/exif.html b/mediagoblin/templates/mediagoblin/utils/exif.html index 37f274fe..a89e69c8 100644 --- a/mediagoblin/templates/mediagoblin/utils/exif.html +++ b/mediagoblin/templates/mediagoblin/utils/exif.html @@ -18,11 +18,12 @@ {% block exif_content %} {% if app_config['exif_visible'] - and media.media_data.exif is defined - and media.media_data.exif.has_key('useful') %} + and media.media_data + and media.media_data.exif_all is defined + and media.media_data.exif_all %} <h3>EXIF</h3> <table> - {% for key, tag in media.media_data.exif.useful.items() %} + {% for key, tag in media.exif_display_iter() %} <tr> <td>{{ key }}</td> <td>{{ tag.printable }}</td> diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index a85a3d96..58ecb8e0 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -25,7 +25,7 @@ {{ field }} {%- if field.errors -%} {% for error in field.errors %} - <p class="form_field_error">{{ error }}</p> + <p class="form_field_error">{{ _(error) }}</p> {% endfor %} {%- endif %} {% if field.description -%} |