diff options
author | Jef van Schendel <mail@jefvanschendel.nl> | 2012-03-04 19:05:41 +0100 |
---|---|---|
committer | Jef van Schendel <mail@jefvanschendel.nl> | 2012-03-04 19:05:41 +0100 |
commit | 822d37176e51ce1d56c4ce8eed6948118ef8281a (patch) | |
tree | fc1f34e04634715ce9adaeb4f770e4ef70ab8044 /mediagoblin/templates | |
parent | b8e635b22f9647b173b9320ebb6539bdefe851d8 (diff) | |
parent | ee9a0e3c78a621b09a04914e53906d36a635899f (diff) | |
download | mediagoblin-822d37176e51ce1d56c4ce8eed6948118ef8281a.tar.lz mediagoblin-822d37176e51ce1d56c4ce8eed6948118ef8281a.tar.xz mediagoblin-822d37176e51ce1d56c4ce8eed6948118ef8281a.zip |
Merge branch 'newlayout' into newlayout-stage
Diffstat (limited to 'mediagoblin/templates')
9 files changed, 117 insertions, 127 deletions
diff --git a/mediagoblin/templates/mediagoblin/edit/edit.html b/mediagoblin/templates/mediagoblin/edit/edit.html index 0c4d5bb1..3f7cbe0e 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit.html +++ b/mediagoblin/templates/mediagoblin/edit/edit.html @@ -33,7 +33,7 @@ </div> {{ wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> - <a href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a> + <a class="button_action" href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a> <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" /> {{ csrf_token }} </div> diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index d2503a4e..0100ad9e 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -40,67 +40,84 @@ {% endblock mediagoblin_head %} {% block mediagoblin_content %} - <div class="media_pane"> - <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! - #} - {% if media.media_files.has_key('medium') %} - <a href="{{ request.app.public_store.file_url( - media.media_files['original']) }}"> - <img class="media_image" - src="{{ display_media }}" - alt="Image for {{ media.title }}" /> - </a> - {% else %} + {% trans user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=media.get_uploader.username), + username=media.get_uploader.username -%} + <p class="context">❖ Browsing media by <a href="{{ user_url }}">{{ username }}</a></p> + {%- endtrans %} + {% include "mediagoblin/utils/prev_next.html" %} + <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! + #} + {% if media.media_files.has_key('medium') %} + <a href="{{ request.app.public_store.file_url( + media.media_files['original']) }}"> <img class="media_image" src="{{ display_media }}" alt="Image for {{ media.title }}" /> - {% endif %} - {% endblock %} - </div> + </a> + {% else %} + <img class="media_image" + src="{{ display_media }}" + alt="Image for {{ media.title }}" /> + {% endif %} + {% endblock %} + </div> + <div class="media_pane"> <h2 class="media_title"> {{ media.title }} </h2> + {% if request.user and + (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 %} {% autoescape False %} <p>{{ media.description_html }}</p> - {% endautoescape %} - <p class="media_specs"> - {% trans date=media.created.strftime("%Y-%m-%d") -%} - Added on {{ date }}. - {%- endtrans %} - {% if request.user and - (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> + {% endautoescape %} + {% if media.attachment_files|count %} + <h3>Attachments</h3> + <ul> + {% for attachment in media.attachment_files %} + <li> + <a href="{{ request.app.public_store.file_url(attachment.filepath) }}"> + {{ attachment.name }} + </a> + </li> + {% endfor %} + </ul> + {% endif %} + {% if app_config['allow_attachments'] + and request.user + and (media.uploader == request.user._id + or request.user.is_admin) %} + <p> + <a href="{{ request.urlgen('mediagoblin.edit.attachments', + user=media.get_uploader.username, + media=media._id) }}">Add attachment</a> + </p> + {% endif %} {% if comments %} <h3> - {% if comments.count()==1 %} - {% trans comment_count=comments.count() -%}{{ comment_count }} comment{%- endtrans %} - {% elif comments.count()>1 %} - {% trans comment_count=comments.count() -%}{{ comment_count }} comments{%- endtrans %} - {% else %} - {% trans %}No comments yet.{% endtrans %} - {% endif %} <div class="right_align"> <a {% if not request.user %} href="{{ request.urlgen('mediagoblin.auth.login') }}" {% endif %} class="button_action" id="button_addcomment" title="Add a comment"> - {% trans %}Add one{% endtrans %} + {% trans %}Add a comment{% endtrans %} </a> </div> </h3> @@ -150,35 +167,10 @@ {% endif %} </div> <div class="media_sidebar"> - {% 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.attachment_files|count %} - <h3>Attachments</h3> - <ul> - {% for attachment in media.attachment_files %} - <li> - <a href="{{ request.app.public_store.file_url(attachment.filepath) }}"> - {{ attachment.name }} - </a> - </li> - {% endfor %} - </ul> - {% endif %} - {% if app_config['allow_attachments'] - and request.user - and (media.uploader == request.user._id - or request.user.is_admin) %} - <p> - <a href="{{ request.urlgen('mediagoblin.edit.attachments', - user=media.get_uploader.username, - media=media._id) }}">Add attachment</a> - </p> - {% endif %} + {% trans date=media.created.strftime("%Y-%m-%d") -%} + <h3 class="sidedata">Added on</h3> + <p>{{ date }}</p> + {%- endtrans %} {% if media.tags %} {% include "mediagoblin/utils/tags.html" %} {% endif %} @@ -189,4 +181,5 @@ {% include "mediagoblin/utils/exif.html" %} </div> + <div class="clear"></div> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html index e64845e7..a3459206 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html @@ -46,8 +46,8 @@ <div class="form_submit_buttons"> {# TODO: This isn't a button really... might do unexpected things :) #} - <a class="cancel_link" href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a> - <input type="submit" value="{% trans %}Delete Permanently{% endtrans %}" class="button_form" /> + <a class="button_action" href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a> + <input type="submit" value="{% trans %}Delete permanently{% endtrans %}" class="button_form" /> {{ csrf_token }} </div> </div> diff --git a/mediagoblin/templates/mediagoblin/utils/exif.html b/mediagoblin/templates/mediagoblin/utils/exif.html index 0dd187f2..bd2e3307 100644 --- a/mediagoblin/templates/mediagoblin/utils/exif.html +++ b/mediagoblin/templates/mediagoblin/utils/exif.html @@ -20,7 +20,7 @@ {% if media.media_data.has_key('exif') and app_config['exif_visible'] and media.media_data.exif.has_key('useful') %} - <h4>EXIF</h4> + <h3 class="sidedata">EXIF</h3> <table> {% for key, tag in media.media_data.exif.useful.items() %} <tr> diff --git a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html index c1909ae5..118d0e62 100644 --- a/mediagoblin/templates/mediagoblin/utils/geolocation_map.html +++ b/mediagoblin/templates/mediagoblin/utils/geolocation_map.html @@ -20,7 +20,7 @@ {% if media.media_data.has_key('gps') and app_config['geolocation_map_visible'] and media.media_data.gps %} - <h4>Map</h4> + <h3 class="sidedata">Location</h3> <div> {% set gps = media.media_data.gps %} <div id="tile-map" style="width: 100%; height: 196px;"> diff --git a/mediagoblin/templates/mediagoblin/utils/license.html b/mediagoblin/templates/mediagoblin/utils/license.html index 2438ed4e..ab157508 100644 --- a/mediagoblin/templates/mediagoblin/utils/license.html +++ b/mediagoblin/templates/mediagoblin/utils/license.html @@ -17,8 +17,8 @@ #} {% block license_content -%} + <h3 class="sidedata">{% trans %}License{% endtrans %}</h3> <p> - {% trans %}License:{% endtrans %} {% if media.license %} <a href="{{ media.license }}">{{ media.get_license_data().abbreviation }}</a> {% else %} diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index 81506a84..6b5988fb 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -19,29 +19,23 @@ {% from "mediagoblin/utils/pagination.html" import render_pagination %} {% macro media_grid(request, media_entries, col_number=5) %} - <table class="thumb_gallery"> + <ul 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 %} - {% set entry_url = entry.url_for_self(request.urlgen) %} - <td class="media_thumbnail thumb_entry - {%- if loop.first %} thumb_entry_first - {%- elif loop.last %} thumb_entry_last{% endif %}"> - <a href="{{ entry_url }}"> - <img src="{{ request.app.public_store.file_url( - entry.media_files['thumb']) }}" /> - </a> - {% if entry.title %} - <br /> - <a href="{{ entry_url }}">{{ entry.title }}</a> - {% endif %} - </td> - {% endfor %} - </tr> + {% for entry in row %} + {% set entry_url = entry.url_for_self(request.urlgen) %} + <li class="media_thumbnail"> + <a href="{{ entry_url }}"> + <img src="{{ request.app.public_store.file_url( + entry.media_files['thumb']) }}" /> + </a> + {% if entry.title %} + <br /> + <a href="{{ entry_url }}">{{ entry.title }}</a> + {% endif %} + </li> + {% endfor %} {% endfor %} - </table> + </ul> {%- endmacro %} {# diff --git a/mediagoblin/templates/mediagoblin/utils/prev_next.html b/mediagoblin/templates/mediagoblin/utils/prev_next.html index d0cf3f8c..f1175ce4 100644 --- a/mediagoblin/templates/mediagoblin/utils/prev_next.html +++ b/mediagoblin/templates/mediagoblin/utils/prev_next.html @@ -21,26 +21,28 @@ {% set next_entry_url = media.url_to_next(request.urlgen) %} {% if prev_entry_url or next_entry_url %} - {# There are no previous entries for the very first media entry #} - {% if prev_entry_url %} - <a class="navigation_button navigation_left" href="{{ prev_entry_url }}"> - ← {% trans %}newer{% endtrans %} - </a> - {% else %} - {# This is the first entry. display greyed-out 'previous' image #} - <p class="navigation_button navigation_left"> - ← {% trans %}newer{% endtrans %} - </p> - {% endif %} - {# Likewise, this could be the very last media entry #} - {% if next_entry_url %} - <a class="navigation_button" href="{{ next_entry_url }}"> - {% trans %}older{% endtrans %} → - </a> - {% else %} - {# This is the last entry. display greyed-out 'next' image #} - <p class="navigation_button"> - {% trans %}older{% endtrans %} → - </p> - {% endif %} + <div class="navigation"> + {# There are no previous entries for the very first media entry #} + {% if prev_entry_url %} + <a class="navigation_button navigation_left" href="{{ prev_entry_url }}"> + ← {% trans %}newer{% endtrans %} + </a> + {% else %} + {# This is the first entry. display greyed-out 'previous' image #} + <p class="navigation_button navigation_left"> + ← {% trans %}newer{% endtrans %} + </p> + {% endif %} + {# Likewise, this could be the very last media entry #} + {% if next_entry_url %} + <a class="navigation_button" href="{{ next_entry_url }}"> + {% trans %}older{% endtrans %} → + </a> + {% else %} + {# This is the last entry. display greyed-out 'next' image #} + <p class="navigation_button"> + {% trans %}older{% endtrans %} → + </p> + {% endif %} + </div> {% endif %} diff --git a/mediagoblin/templates/mediagoblin/utils/tags.html b/mediagoblin/templates/mediagoblin/utils/tags.html index 6408102d..bcf3b5fd 100644 --- a/mediagoblin/templates/mediagoblin/utils/tags.html +++ b/mediagoblin/templates/mediagoblin/utils/tags.html @@ -17,16 +17,17 @@ #} {% block tags_content -%} - <p>{% trans %}View more media tagged with{% endtrans %} + <h3 class="sidedata">Tagged with</h3> + <p> {% 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 %}or{% endtrans %} + · {% endif %} <a href="{{ request.urlgen( 'mediagoblin.listings.tags_listing', - tag=tag['slug']) }}">{{ tag['name'] }}</a>. + tag=tag['slug']) }}">{{ tag['name'] }}</a> {% elif loop.revindex == 2 %} <a href="{{ request.urlgen( 'mediagoblin.listings.tags_listing', @@ -34,7 +35,7 @@ {% else %} <a href="{{ request.urlgen( 'mediagoblin.listings.tags_listing', - tag=tag['slug']) }}">{{ tag['name'] }}</a>, + tag=tag['slug']) }}">{{ tag['name'] }}</a> · {% endif %} {% endfor %} </p> |