diff options
Diffstat (limited to 'mediagoblin/templates')
7 files changed, 125 insertions, 47 deletions
diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html index 6250bf3c..58de7325 100644 --- a/mediagoblin/templates/mediagoblin/base.html +++ b/mediagoblin/templates/mediagoblin/base.html @@ -28,34 +28,49 @@ <body> {% block mediagoblin_body %} + <div class="mediagoblin_body"> {% block mediagoblin_header %} - <div class="mediagoblin_header"> - <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 class="mediagoblin_header"> + <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="container_12"> + + {% include "mediagoblin/utils/messages.html" %} + + <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 12ddd535..8ee09bd5 100644 --- a/mediagoblin/templates/mediagoblin/edit/edit.html +++ b/mediagoblin/templates/mediagoblin/edit/edit.html @@ -27,13 +27,15 @@ method="POST" enctype="multipart/form-data"> <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"> <a href="{{ media.url_for_self(request.urlgen) }}">Cancel</a> <input type="submit" value="Save changes" class="button" /> </div> - <img src="{{ request.app.public_store.file_url( - media['media_files']['thumb']) }}" /> </div> </form> diff --git a/mediagoblin/templates/mediagoblin/submit/start.html b/mediagoblin/templates/mediagoblin/submit/start.html index 00577fa1..f34bf2af 100644 --- a/mediagoblin/templates/mediagoblin/submit/start.html +++ b/mediagoblin/templates/mediagoblin/submit/start.html @@ -25,7 +25,9 @@ method="POST" enctype="multipart/form-data"> <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" /> </div> diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html index 33732d0d..28290cfd 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/gallery.html +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -20,15 +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><a href="{{ request.urlgen( - 'mediagoblin.user_pages.user_home', - user=user.username) }}">{{ user.username }}</a>'s media</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 d221f61e..97ff8e51 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -25,16 +25,18 @@ </h1> <img class="media_image" src="{{ request.app.public_store.file_url( media.media_files.main) }}" /> + <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> {% autoescape False %} - <p>{{ media.description_html }}</p> + <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> {% if media['uploader'] == request.user['_id'] %} <p><a href="{{ request.urlgen('mediagoblin.edit.edit_media', user= media.uploader().username, diff --git a/mediagoblin/templates/mediagoblin/utils/messages.html b/mediagoblin/templates/mediagoblin/utils/messages.html new file mode 100644 index 00000000..52d03daa --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/messages.html @@ -0,0 +1,32 @@ +{# +# 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/>. +#} + +{# Display any queued messages #} +{% set messages = fetch_messages(request) %} +{% if messages %} +<div class="container_12 mediagoblin_messages"> + <div class="grid_12"> + <ul class="mediagoblin_messages"> + {% for msg in messages %} + <li class="message_{{ msg.level }}">{{ msg.text }}</li> + {% endfor %} + </ul> + </div> +</div> +{% endif %} + 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 %} |