diff options
Diffstat (limited to 'mediagoblin/templates')
14 files changed, 195 insertions, 73 deletions
diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html index c2e27c15..f6ee7166 100644 --- a/mediagoblin/templates/mediagoblin/auth/login.html +++ b/mediagoblin/templates/mediagoblin/auth/login.html @@ -23,7 +23,7 @@ <form action="{{ request.urlgen('mediagoblin.auth.login') }}" method="POST" enctype="multipart/form-data"> - <div class="login_box form_box"> + <div class="grid_4 prefix_1 suffix_1 form_box"> <h1>Log in</h1> {% if login_failed %} <div class="form_field_error">Login failed!</div> @@ -36,7 +36,7 @@ <input type="hidden" name="next" value="{{ next }}" class="button" style="display: none;"/> {% endif %} - <p>Don't have an account yet? <a href="{{ request.urlgen('mediagoblin.auth.register') }}">Create one here!</a></p> + <p>Don't have an account yet?<br /><a href="{{ request.urlgen('mediagoblin.auth.register') }}">Create one here!</a></p> </div> </form> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html index 730d684d..7e18ca58 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="register_box form_box"> + <div class="grid_4 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 c7313173..63749f68 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -19,6 +19,8 @@ <head> <title>{% block title %}GNU MediaGoblin{% endblock title %}</title> <link rel="stylesheet" type="text/css" + href="{{ request.staticdirect('/css/contrib/960_12_col.css') }}"/> + <link rel="stylesheet" type="text/css" href="{{ request.staticdirect('/css/base.css') }}"/> {% block mediagoblin_head %} {% endblock mediagoblin_head %} @@ -26,30 +28,45 @@ <body> {% block mediagoblin_body %} + <div class="mediagoblin_body"> {% block mediagoblin_header %} <div class="mediagoblin_header"> - <div class="mediagoblin_container"> - {% block mediagoblin_logo %} - <a class="mediagoblin_logo" href="{{ request.urlgen('index') }}"></a> - {% endblock %}{% block mediagoblin_header_title %}{% endblock %} - <div class="mediagoblin_header_right"> - {% if request.user %} - {{ request.user['username'] }}'s account - <a href="{{ request.urlgen('mediagoblin.user_pages.user_gallery', - user= request.user['username']) }}">gallery</a> - (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">logout</a>) - {% else %} - <a href="{{ request.urlgen('mediagoblin.auth.login') }}"> - Login</a> - {% endif %} + <div class="container_12"> + <div class="grid_12"> + {% block mediagoblin_logo %} + <a class="mediagoblin_logo" href="{{ request.urlgen('index') }}"></a> + {% endblock %}{% block mediagoblin_header_title %}{% endblock %} + <div class="mediagoblin_header_right"> + {% if request.user %} + <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', + user= request.user['username']) }}"> + {{ request.user['username'] }}</a>'s account + (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">logout</a>) + {% else %} + <a href="{{ request.urlgen('mediagoblin.auth.login') }}"> + Login</a> + {% endif %} + </div> + </div> </div> </div> - </div> {% endblock %} - <div class="mediagoblin_container"> - {% block mediagoblin_content %} - {% endblock mediagoblin_content %} + <div class="container_12 mediagoblin_content"> + <div class="grid_12"> + {% block mediagoblin_content %} + {% endblock mediagoblin_content %} + </div> </div> + {% block mediagoblin_footer %} + <div class="mediagoblin_footer"> + <div class="container_12"> + <div class="grid_12"> + Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU project</a> + </div> + </div> + </div> + {% endblock %} {% endblock mediagoblin_body %} + </div> </body> </html> diff --git a/mediagoblin/templates/mediagoblin/edit/edit.html b/mediagoblin/templates/mediagoblin/edit/edit.html index 295d57eb..8ee09bd5 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit.html +++ b/mediagoblin/templates/mediagoblin/edit/edit.html @@ -20,19 +20,23 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% block mediagoblin_content %} - <h1>Edit details for {{ media.title }}</h1> <form action="{{ request.urlgen('mediagoblin.edit.edit_media', user= media.uploader().username, media= media._id) }}" method="POST" enctype="multipart/form-data"> - <div class="submit_box form_box"> + <div class="grid_6 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( + media['media_files']['thumb']) }}" /> + </div> {{ wtforms_util.render_divs(form) }} <div class="form_submit_buttons"> - <input type="submit" value="submit" class="button" /> + <a href="{{ media.url_for_self(request.urlgen) }}">Cancel</a> + <input type="submit" value="Save changes" class="button" /> </div> </div> </form> - <img src="{{ request.app.public_store.file_url( - media['media_files']['thumb']) }}" /> + {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/edit/edit_profile.html b/mediagoblin/templates/mediagoblin/edit/edit_profile.html new file mode 100644 index 00000000..7efd0ee3 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/edit_profile.html @@ -0,0 +1,35 @@ +{# +# 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" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.edit.profile', + user=user.username) }}" + method="POST" enctype="multipart/form-data"> + <div class="grid_6 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"> + <input type="submit" value="submit" class="button" /> + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/media_details.html b/mediagoblin/templates/mediagoblin/media_details.html index bd63a289..8cb23e81 100644 --- a/mediagoblin/templates/mediagoblin/media_details.html +++ b/mediagoblin/templates/mediagoblin/media_details.html @@ -17,9 +17,9 @@ #} {% extends "mediagoblin/base.html" %} {% block mediagoblin_content %} - {# temporarily, an "image gallery" that isn't one really ;) #} {% if media %} + <h1>Media details for {{media.title}}</h1> <div> <img src="{{ request.app.public_store.file_url( diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html index e5344e08..e29abd51 100644 --- a/mediagoblin/templates/mediagoblin/root.html +++ b/mediagoblin/templates/mediagoblin/root.html @@ -18,30 +18,25 @@ {% extends "mediagoblin/base.html" %} {% block mediagoblin_content %} - <h1>{% trans %}Welcome to GNU MediaGoblin!{% endtrans %}</h1> {% if request.user %} - <p> - <a href="{{ request.urlgen('mediagoblin.submit.start') }}">Submit an item</a>. - </p> - + <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> - If you have an account, you can - <a href="{{ request.urlgen('mediagoblin.auth.login') }}">Login</a>. - </p> - <p> - If you don't have an account, please - <a href="{{ request.urlgen('mediagoblin.auth.register') }}">Register</a>. - </p> - + <p> + If you have an account, you can + <a href="{{ request.urlgen('mediagoblin.auth.login') }}">Login</a>. + </p> + <p> + If you don't have an account, please + <a href="{{ request.urlgen('mediagoblin.auth.register') }}">Register</a>. + </p> {% endif %} {# temporarily, an "image gallery" that isn't one really ;) #} - <div> {% include "mediagoblin/utils/object_gallery.html" %} - </div> - {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/submit/start.html b/mediagoblin/templates/mediagoblin/submit/start.html index 75c31df4..f34bf2af 100644 --- a/mediagoblin/templates/mediagoblin/submit/start.html +++ b/mediagoblin/templates/mediagoblin/submit/start.html @@ -23,11 +23,13 @@ <form action="{{ request.urlgen('mediagoblin.submit.start') }}" method="POST" enctype="multipart/form-data"> - <div class="submit_box form_box"> + <div class="grid_6 prefix_1 suffix_1 form_box"> <h1>Submit yer media</h1> - {{ wtforms_util.render_divs(submit_form) }} + {{ 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" /> + <input type="submit" value="Submit" class="button" /> </div> </div> </form> diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html index 6f68a41f..28290cfd 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/gallery.html +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -20,16 +20,16 @@ {% 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>gallery for - <a href="{{ request.urlgen( - 'mediagoblin.user_pages.user_home', - user=user.username) }}">{{ user.username }}</a></h1> + <h1> + <a href="{{ request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username) }}">{{ user.username }}</a>'s media</h1> {% include "mediagoblin/utils/object_gallery.html" %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 200f13cd..d221f61e 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -25,17 +25,21 @@ </h1> <img class="media_image" src="{{ request.app.public_store.file_url( media.media_files.main) }}" /> - <p>{{ media.description }}</p> + {% autoescape False %} + <p>{{ media.description_html }}</p> + {% endautoescape %} <p>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><a href="{{ request.urlgen('mediagoblin.edit.edit_media', - user= media.uploader().username, - media= media._id) }}">Edit</a></p> + {{- media.uploader().username }}</a></p> + {% 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 %} {% else %} <p>Sorry, no such media found.<p/> {% endif %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html index b3708c85..99e46a72 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/user.html +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -26,10 +26,16 @@ {% block mediagoblin_content -%} {% if user %} - <h1>User page for '{{ user.username }}'</h1> + <h1>{{ user.username }}'s profile</h1> + + {% include "mediagoblin/utils/profile.html" %} {% 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> + + <a href={{ request.urlgen( 'mediagoblin.user_pages.atom_feed', user=user.username) }}> atom feed</a> diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html index c9c3e0db..8c88c174 100644 --- a/mediagoblin/templates/mediagoblin/utils/object_gallery.html +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -19,7 +19,7 @@ {% block object_gallery_content -%} <div> {% if media_entries %} - <ul> + <ul class="media_thumbnail"> {% for entry in media_entries %} <li class="media_thumbnail"> <a href="{{ entry.url_for_self(request.urlgen) }}"> diff --git a/mediagoblin/templates/mediagoblin/utils/profile.html b/mediagoblin/templates/mediagoblin/utils/profile.html new file mode 100644 index 00000000..b3f5f0f8 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/profile.html @@ -0,0 +1,35 @@ +{# +# 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/>. +#} + +{% block profile_content -%} + <div> + <ul> + {% if user.url %} + <li> + <a href="{{ user.url }}">homepage</a> + </li> + {% endif %} + + {% if user.bio %} + <li> + {{ user.bio }} + </li> + {% endif %} + </ul> + </div> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html index 9adf8e53..1d2f8619 100644 --- a/mediagoblin/templates/mediagoblin/utils/wtforms.html +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -16,23 +16,47 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. #} +{# Generically render a field #} +{% macro render_field_div(field) %} + <div class="form_field_box"> + <div class="form_field_label">{{ field.label }}</div> + {% if field.description -%} + <div class="form_field_description">{{ field.description }}</div> + {%- endif %} + <div class="form_field_input">{{ field }}</div> + {%- if field.errors -%} + {% for error in field.errors %} + <div class="form_field_error"> + {{ error }} + </div> + {% endfor %} + {%- endif %} + </div> +{%- endmacro %} + +{# Generically render a textarea + # ... mostly the same thing except it includes rows and cols #} +{% macro render_textarea_div(field, rows=8, cols=20) %} + <div class="form_field_box"> + <div class="form_field_label">{{ field.label }}</div> + {% if field.description -%} + <div class="form_field_description">{{ field.description }}</div> + {%- endif %} + <div class="form_field_input">{{ field(rows=rows, cols=cols) }}</div> + {%- if field.errors -%} + {% for error in field.errors %} + <div class="form_field_error"> + {{ error }} + </div> + {% endfor %} + {%- endif %} + </div> +{%- endmacro %} + {# Auto-render a form as a series of divs #} {% macro render_divs(form) -%} {% for field in form %} - <div class="form_field_box"> - <div class="form_field_label">{{ field.label }}</div> - {% if field.description -%} - <div class="form_field_description">{{ field.description }}</div> - {%- endif %} - <div class="form_field_input">{{ field }}</div> - {%- if field.errors -%} - {% for error in field.errors %} - <div class="form_field_error"> - {{ error }} - </div> - {% endfor %} - {%- endif %} - </div> + {{ render_field_div(field) }} {% endfor %} {%- endmacro %} |