diff options
Diffstat (limited to 'mediagoblin/templates')
15 files changed, 218 insertions, 161 deletions
diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html index f6ee7166..2303ce5c 100644 --- a/mediagoblin/templates/mediagoblin/auth/login.html +++ b/mediagoblin/templates/mediagoblin/auth/login.html @@ -20,10 +20,9 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %} - <form action="{{ request.urlgen('mediagoblin.auth.login') }}" method="POST" enctype="multipart/form-data"> - <div class="grid_4 prefix_1 suffix_1 form_box"> + <div class="grid_6 prefix_1 suffix_1 form_box"> <h1>Log in</h1> {% if login_failed %} <div class="form_field_error">Login failed!</div> diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html index 7e18ca58..f77b3782 100644 --- a/mediagoblin/templates/mediagoblin/auth/register.html +++ b/mediagoblin/templates/mediagoblin/auth/register.html @@ -23,7 +23,7 @@ <form action="{{ request.urlgen('mediagoblin.auth.register') }}" method="POST" enctype="multipart/form-data"> - <div class="grid_4 prefix_1 suffix_1 form_box"> + <div class="grid_6 prefix_1 suffix_1 form_box"> <h1>Create an account!</h1> {{ wtforms_util.render_divs(register_form) }} <div class="form_submit_buttons"> diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index fbb52803..b71fca24 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -19,7 +19,11 @@ <head> <title>{% block title %}GNU MediaGoblin{% endblock title %}</title> <link rel="stylesheet" type="text/css" - href="{{ request.staticdirect('/css/contrib/960_12_col.css') }}"/> + href="{{ request.staticdirect('/css/contrib/reset.css') }}"/> + <link rel="stylesheet" type="text/css" + href="{{ request.staticdirect('/css/contrib/text.css') }}"/> + <link rel="stylesheet" type="text/css" + href="{{ request.staticdirect('/css/contrib/960_16_col.css') }}"/> <link rel="stylesheet" type="text/css" href="{{ request.staticdirect('/css/base.css') }}"/> {% block mediagoblin_head %} @@ -31,8 +35,8 @@ <div class="mediagoblin_body"> {% block mediagoblin_header %} <div class="mediagoblin_header"> - <div class="container_12"> - <div class="grid_12"> + <div class="container_16"> + <div class="grid_16"> {% block mediagoblin_logo %} <a class="mediagoblin_logo" href="{{ request.urlgen('index') }}"></a> {% endblock %}{% block mediagoblin_header_title %}{% endblock %} @@ -51,8 +55,8 @@ </div> </div> {% endblock %} - <div class="container_12 mediagoblin_content"> - <div class="grid_12"> + <div class="container_16 mediagoblin_content"> + <div class="grid_16"> {% include "mediagoblin/utils/messages.html" %} {% block mediagoblin_content %} {% endblock mediagoblin_content %} @@ -60,8 +64,8 @@ </div> {% block mediagoblin_footer %} <div class="mediagoblin_footer"> - <div class="container_12"> - <div class="grid_12"> + <div class="container_16"> + <div class="grid_16"> Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU project</a> </div> </div> diff --git a/mediagoblin/templates/mediagoblin/edit/edit.html b/mediagoblin/templates/mediagoblin/edit/edit.html index 8ee09bd5..d19034cb 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit.html +++ b/mediagoblin/templates/mediagoblin/edit/edit.html @@ -25,7 +25,7 @@ user= media.uploader().username, media= media._id) }}" method="POST" enctype="multipart/form-data"> - <div class="grid_6 prefix_1 suffix_1 edit_box form_box"> + <div class="grid_8 prefix_1 suffix_1 edit_box form_box"> <h1>Editing {{ media.title }}</h1> <div style="text-align: center;" > <img src="{{ request.app.public_store.file_url( diff --git a/mediagoblin/templates/mediagoblin/edit/edit_profile.html b/mediagoblin/templates/mediagoblin/edit/edit_profile.html index 7efd0ee3..a11b86d7 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit_profile.html +++ b/mediagoblin/templates/mediagoblin/edit/edit_profile.html @@ -21,10 +21,10 @@ {% block mediagoblin_content %} - <form action="{{ request.urlgen('mediagoblin.edit.profile', - user=user.username) }}" + <form action="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{ + user['username'] }}" method="POST" enctype="multipart/form-data"> - <div class="grid_6 prefix_1 suffix_1 edit_box form_box"> + <div class="grid_8 prefix_1 suffix_1 edit_box form_box"> <h1>Editing {{ user['username'] }}'s profile</h1> {{ wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> diff --git a/mediagoblin/templates/mediagoblin/media_details.html b/mediagoblin/templates/mediagoblin/media_details.html deleted file mode 100644 index 0e907616..00000000 --- a/mediagoblin/templates/mediagoblin/media_details.html +++ /dev/null @@ -1,37 +0,0 @@ -{# -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011 Free Software Foundation, Inc -# -# 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 mediagoblin_content %} - {# temporarily, an "image gallery" that isn't one really ;) #} - {% if media %} - <div class="grid_8 alpha media_image"> - <img src="{{ request.app.public_store.file_url( - media.media_files.main) }}" /> - <h1>Media details for {{media.title}}</h1> - <p> - <br/>Uploaded: {{ media.created}} - <br/>Description: {{media.description}} - </p> - </div> - <div class="grid_4 omega sidebar"> - <p>Uploaded: {{ media.created}}</p> - </div> - {% else %} - <p>Sorry, no such media found.<p/> - {% endif %} -{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index e29abd51..5b744999 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -23,7 +23,6 @@ {% if request.user %} <p> <a href="{{ request.urlgen('mediagoblin.submit.start') }}">Submit an item</a> - <a href="{{ request.urlgen('mediagoblin.edit.profile') }}">Edit profile</a> </p> {% else %} <p> diff --git a/mediagoblin/templates/mediagoblin/submit/start.html b/mediagoblin/templates/mediagoblin/submit/start.html index f34bf2af..50c86afe 100644 --- a/mediagoblin/templates/mediagoblin/submit/start.html +++ b/mediagoblin/templates/mediagoblin/submit/start.html @@ -20,17 +20,16 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %} - <form action="{{ request.urlgen('mediagoblin.submit.start') }}" method="POST" enctype="multipart/form-data"> - <div class="grid_6 prefix_1 suffix_1 form_box"> + <div class="grid_8 prefix_1 suffix_1 form_box"> <h1>Submit yer media</h1> + {{ wtforms_util.render_field_div(submit_form.file) }} {{ wtforms_util.render_field_div(submit_form.title) }} {{ wtforms_util.render_textarea_div(submit_form.description) }} - {{ wtforms_util.render_field_div(submit_form.file) }} <div class="form_submit_buttons"> <input type="submit" value="Submit" class="button" /> </div> </div> </form> -{% endblock %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html index 28290cfd..a434ff15 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/gallery.html +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -31,7 +31,11 @@ 'mediagoblin.user_pages.user_home', user=user.username) }}">{{ user.username }}</a>'s media</h1> - {% include "mediagoblin/utils/object_gallery.html" %} + </div> + <div class="container_16 media_gallery"> + {% include "mediagoblin/utils/object_gallery.html" %} + </div> + <div class="grid_16"> <a href={{ request.urlgen( 'mediagoblin.user_pages.atom_feed', diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 3cebe2f9..1484cc73 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -18,86 +18,100 @@ {% extends "mediagoblin/base.html" %} {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} +{% from "mediagoblin/utils/pagination.html" import render_pagination %} {% block mediagoblin_content %} - {# temporarily, an "image gallery" that isn't one really ;) #} {% if media %} - <div class="grid_8 alpha media_image"> - <h1> + <div class="grid_11 alpha"> + {% if media.media_files.medium %} + <img src="{{ request.app.public_store.file_url( + media.media_files.medium) }}" /> + {% else %} + <img src="{{ request.app.public_store.file_url( + media.media_files.main) }}" /> + {% endif %} + + <h2> {{media.title}} - </h1> - <img class="media_image" src="{{ request.app.public_store.file_url( - media.media_files.main) }}" /> + </h2> + + {% autoescape False %} + <p>{{ media.description_html }}</p> + {% endautoescape %} + <p> - Uploaded on + — uploaded on {{ "%4d-%02d-%02d"|format(media.created.year, media.created.month, media.created.day) }} by <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', user= media.uploader().username) }}"> {{- media.uploader().username }}</a> - </p> + </p> + <br /> - {% autoescape False %} - <p>{{ media.description_html }}</p> - {% endautoescape %} - - {% if media['uploader'] == request.user['_id'] %} - <p><a href="{{ request.urlgen('mediagoblin.edit.edit_media', - user= media.uploader().username, - media= media._id) }}">Edit</a></p> - {% endif %} + <h3>Comments</h3> {% if request.user %} <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', user= media.uploader().username, media=media._id) }}" method="POST"> - <h3>Post a comment!</h3> {{ wtforms_util.render_field_div(comment_form.comment) }} <div class="form_submit_buttons"> - <input type="submit" value="Submit" class="button" /> + <input type="submit" value="Post comment!" class="button" /> </div> </form> {% endif %} - {# - {{ wtforms_util.render_textarea_div(submit_form.description) }} - {{ wtforms_util.render_field_div(submit_form.file) }} - #} - {% if comments %} - <h3>Comments</h3> {% for comment in comments %} + {% set comment_author = comment.author() %} <div class="comment_wrapper" id="comment-{{ comment['_id'] }}"> - <div class="comment_author">By: - <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', - user = comment['author']['username']) }}"> - {{ comment['author']['username'] }} - </a> - </div> - <div class="comment_datetime"> - <a href="#comment-{{ comment['_id'] }}"> - {{ "%4d-%02d-%02d %02d:%02d"|format(comment.created.year, - comment.created.month, - comment.created.day, - comment.created.hour, - comment.created.minute) }} - </a> - </div> <div class="comment_content"> {% autoescape False %} {{ comment.content_html }} {% endautoescape %} - </div> - </div> + </div> + <div class="comment_author">— + <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', + user = comment_author['username']) }}"> + {{ comment_author['username'] }}</a> at + <!--</div> + <div class="comment_datetime">--> + <a href="#comment-{{ comment['_id'] }}"> + {{ "%4d-%02d-%02d %02d:%02d"|format(comment.created.year, + comment.created.month, + comment.created.day, + comment.created.hour, + comment.created.minute) }} + </a> + </div> + </div> {% endfor %} - {% include "mediagoblin/utils/pagination.html" %} + + {{ render_pagination(request, pagination) }} </div> {% endif %} - - <div class="grid_4 omega media_sidebar"> - <p>This is a sidebar! Yay!</p> + <div class="grid_5 omega"> + {% include "mediagoblin/utils/prev_next.html" %} + <h3>Sidebar content here!</h3> + <p> + {% if media['uploader'] == request.user['_id'] or + request.user['is_admin'] %} + <p> + <a href="{{ request.urlgen('mediagoblin.edit.edit_media', + user= media.uploader().username, + media= media._id) }}" + ><img src="{{ request.staticdirect('/images/icon_edit.png') }}" + class="media_icon" />edit</a> + </p> + <p> + <img src="{{ request.staticdirect('/images/icon_delete.png') }}" + class="media_icon" />delete + </p> + {% endif %} + </p> </div> {% else %} - <p>Sorry, no such media found.<p/> + <p>Sorry, no such media found.<p/> {% endif %} {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index 99e46a72..aed330c8 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -20,27 +20,39 @@ {% block mediagoblin_head %} <link rel="alternate" type="application/atom+xml" href="{{ request.urlgen( - 'mediagoblin.user_pages.atom_feed', + 'mediagoblin.user_pages.atom_feed', user=user.username) }}"> {% endblock mediagoblin_head %} {% block mediagoblin_content -%} {% if user %} <h1>{{ user.username }}'s profile</h1> - + {% include "mediagoblin/utils/profile.html" %} + {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %} + <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{ + user.username }}">Edit profile</a> + {% endif %} + + {% if request.user['_id'] == user['_id'] %} + <p> + <a href="{{ request.urlgen('mediagoblin.submit.start') }}">Submit an item</a> + </p> + {% endif %} + + {% set pagination_base_url = user_gallery_url %} {% include "mediagoblin/utils/object_gallery.html" %} - <p><a href="{{ request.urlgen('mediagoblin.user_pages.user_gallery', - user= request.user['username']) }}">View all of {{ user.username }}'s media</a></p> + <div class="clear"></div> + <p><a href="{{ user_gallery_url }}">View all of {{ user.username }}'s media</a></p> <a href={{ request.urlgen( 'mediagoblin.user_pages.atom_feed', - user=user.username) }}> atom feed</a> + user=user.username) }}>atom feed</a> {% else %} {# This *should* not occur as the view makes sure we pass in a user. #} <p>Sorry, no such user found.<p/> {% endif %} -{% endblock %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index 8c88c174..2c7a7129 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -16,20 +16,22 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. #} -{% block object_gallery_content -%} - <div> - {% if media_entries %} - <ul class="media_thumbnail"> - {% for entry in media_entries %} - <li class="media_thumbnail"> - <a href="{{ entry.url_for_self(request.urlgen) }}"> - <img src="{{ request.app.public_store.file_url( - entry['media_files']['thumb']) }}" /></a> - </li> - {% endfor %} - </ul> - {% include "mediagoblin/utils/pagination.html" %} - {% endif %} +{% from "mediagoblin/utils/pagination.html" import render_pagination %} - </div> -{% endblock %} +{% block object_gallery_content -%} + {% if media_entries %} + {% for entry in media_entries %} + <div class="media_thumbnail"> + <a href="{{ entry.url_for_self(request.urlgen) }}"> + <img src="{{ request.app.public_store.file_url( + entry['media_files']['thumb']) }}" /></a> + </div> + {% endfor %} + {% if pagination_base_url %} + {# different url, so set that and don't keep the get params #} + {{ render_pagination(request, pagination, pagination_base_url, False) }} + {% else %} + {{ render_pagination(request, pagination) }} + {% endif %} + {% endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html index 2be0b92e..aae50d22 100644 --- a/mediagoblin/templates/mediagoblin/utils/pagination.html +++ b/mediagoblin/templates/mediagoblin/utils/pagination.html @@ -15,30 +15,48 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. #} -{# only display if {{pagination}} is defined #} +{% macro render_pagination(request, pagination, + base_url=None, preserve_get_params=True) %} + {# only display if {{pagination}} is defined #} + {% if pagination and pagination.pages > 1 %} + {% if not base_url %} + {% set base_url = request.path_info %} + {% endif %} -{% if pagination %} - <div class="pagination"> + {% if preserve_get_params %} + {% set get_params = request.GET %} + {% else %} + {% set get_params = {} %} + {% endif %} - {% if pagination.has_prev %} - <a href="{{ pagination.get_page_url(request, pagination.page-1) }}">« Prev</> - {% endif %} - - {%- for page in pagination.iter_pages() %} - {% if page %} - {% if page != pagination.page %} - <a href="{{ pagination.get_page_url(request, page) }}">{{ page }}</a> + <div class="pagination"> + <p> + {% if pagination.has_prev %} + <a href="{{ pagination.get_page_url_explicit( + base_url, get_params, + pagination.page - 1) }}">« Prev</a> + {% endif %} + + {%- for page in pagination.iter_pages() %} + {% if page %} + {% if page != pagination.page %} + <a href="{{ pagination.get_page_url_explicit( + base_url, get_params, + page) }}">{{ page }}</a> + {% else %} + {{ page }} + {% endif %} {% else %} - <strong>{{ page }}</strong> + <span class="ellipsis">…</span> {% endif %} - {% else %} - <span class="ellipsis">…</span> + {%- endfor %} + + {% if pagination.has_next %} + <a href="{{ pagination.get_page_url_explicit( + base_url, get_params, + pagination.page + 1) }}">Next »</a> {% endif %} - {%- endfor %} - - {% if pagination.has_next %} - <a href="{{ pagination.get_page_url(request, pagination.page + 1) }}">Next »</a> - {% endif %} - </div> -{% endif %} - + </p> + </div> + {% endif %} +{% endmacro %} diff --git a/mediagoblin/templates/mediagoblin/utils/prev_next.html b/mediagoblin/templates/mediagoblin/utils/prev_next.html new file mode 100644 index 00000000..8908c298 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/prev_next.html @@ -0,0 +1,43 @@ +{# +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 Free Software Foundation, Inc +# +# 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/>. +#} + +{# Provide navigation links to neighboring media entries, if possible #} +{% set prev_entry_url = media.url_to_prev(request.urlgen) %} +{% set next_entry_url = media.url_to_next(request.urlgen) %} + +<div> + {# 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 }}"> + < + </a> + {% else %} + {# This is the first entry. display greyed-out 'previous' image #} + <p class="navigation_button">X</p> + {% endif %} + + {# Likewise, this could be the very last media entry #} + {% if next_entry_url %} + <a class="navigation_button" href="{{ next_entry_url }}"> + > + </a> + {% else %} + {# This is the last entry. display greyed-out 'next' image #} + <p class="navigation_button">X</p> + {% endif %} +</div> diff --git a/mediagoblin/templates/mediagoblin/utils/profile.html b/mediagoblin/templates/mediagoblin/utils/profile.html index b3f5f0f8..cd60bbfc 100644 --- a/mediagoblin/templates/mediagoblin/utils/profile.html +++ b/mediagoblin/templates/mediagoblin/utils/profile.html @@ -17,19 +17,19 @@ #} {% block profile_content -%} - <div> - <ul> + {% if user.url or user.bio %} + <div class="profile_content"> {% if user.url %} - <li> - <a href="{{ user.url }}">homepage</a> - </li> - {% endif %} - + <div class="profile_homepage"> + <a href="{{ user.url }}">{{ user.url }}</a> + </div> + {% endif %} + {% if user.bio %} - <li> - {{ user.bio }} - </li> - {% endif %} - </ul> - </div> + <div class="profile_bio"> + {{ user.bio }} + </div> + {% endif %} + </div> + {% endif %} {% endblock %} |