diff options
Diffstat (limited to 'mediagoblin/templates')
60 files changed, 3352 insertions, 0 deletions
diff --git a/mediagoblin/templates/mediagoblin/admin/panel.html b/mediagoblin/templates/mediagoblin/admin/panel.html new file mode 100644 index 00000000..1c3c866e --- /dev/null +++ b/mediagoblin/templates/mediagoblin/admin/panel.html @@ -0,0 +1,114 @@ +{# +# 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/base.html" %} + +{% block title -%} + {% trans %}Media processing panel{% endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + +<h1>{% trans %}Media processing panel{% endtrans %}</h1> + +<p> + {% trans %}Here you can track the state of media being processed on this instance.{% endtrans %} +</p> + +<h2>{% trans %}Media in-processing{% endtrans %}</h2> + +{% if processing_entries.count() %} + <table class="media_panel processing"> + <tr> + <th>ID</th> + <th>User</th> + <th>Title</th> + <th>When submitted</th> + <th>Transcoding progress</th> + </tr> + {% for media_entry in processing_entries %} + <tr> + <td>{{ media_entry.id }}</td> + <td>{{ media_entry.get_uploader.username }}</td> + <td>{{ media_entry.title }}</td> + <td>{{ media_entry.created.strftime("%F %R") }}</td> + {% if media_entry.transcoding_progress %} + <td>{{ media_entry.transcoding_progress }}%</td> + {% else %} + <td>Unknown</td> + {% endif %} + </tr> + {% endfor %} + </table> +{% else %} + <p><em>{% trans %}No media in-processing{% endtrans %}</em></p> +{% endif %} + +<h2>{% trans %}These uploads failed to process:{% endtrans %}</h2> +{% if failed_entries.count() %} + + <table class="media_panel failed"> + <tr> + <th>ID</th> + <th>User</th> + <th>Title</th> + <th>When submitted</th> + <th>Reason for failure</th> + <th>Failure metadata</th> + </tr> + {% for media_entry in failed_entries %} + <tr> + <td>{{ media_entry.id }}</td> + <td>{{ media_entry.get_uploader.username }}</td> + <td>{{ media_entry.title }}</td> + <td>{{ media_entry.created.strftime("%F %R") }}</td> + {% if media_entry.get_fail_exception() %} + <td>{{ media_entry.get_fail_exception().general_message }}</td> + <td>{{ media_entry.fail_metadata }}</td> + {% else %} + <td> </td> + <td> </td> + {% endif %} + </tr> + {% endfor %} + </table> +{% else %} + <p><em>{% trans %}No failed entries!{% endtrans %}</em></p> +{% endif %} +<h2>{% trans %}Last 10 successful uploads{% endtrans %}</h2> +{% if processed_entries.count() %} + + <table class="media_panel processed"> + <tr> + <th>ID</th> + <th>User</th> + <th>Title</th> + <th>Submitted</th> + </tr> + {% for media_entry in processed_entries %} + <tr> + <td>{{ media_entry.id }}</td> + <td>{{ media_entry.get_uploader.username }}</td> + <td><a href="{{ media_entry.url_for_self(request.urlgen) }}">{{ media_entry.title }}</a></td> + <td><span title='{{ media_entry.created.strftime("%F %R") }}'>{{ timesince(media_entry.created) }}</span></td> + </tr> + {% endfor %} + </table> +{% else %} + <p><em>{% trans %}No processed entries, yet!{% endtrans %}</em></p> +{% endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/auth/change_fp.html b/mediagoblin/templates/mediagoblin/auth/change_fp.html new file mode 100644 index 00000000..1f7d9aca --- /dev/null +++ b/mediagoblin/templates/mediagoblin/auth/change_fp.html @@ -0,0 +1,44 @@ +{# +# 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_head %} + <script type="text/javascript" + src="{{ request.staticdirect('/js/show_password.js') }}"></script> +{% endblock mediagoblin_head %} + +{% block title -%} + {% trans %}Set your new password{% endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.auth.verify_forgot_password') }}" + method="POST" enctype="multipart/form-data"> + {{ csrf_token }} + <div class="form_box"> + <h1>{% trans %}Set your new password{% endtrans %}</h1> + {{ wtforms_util.render_divs(cp_form) }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Set password{% endtrans %}" class="button_form"/> + </div> + </div> + </form> +{% endblock %} + diff --git a/mediagoblin/templates/mediagoblin/auth/forgot_password.html b/mediagoblin/templates/mediagoblin/auth/forgot_password.html new file mode 100644 index 00000000..46aeddef --- /dev/null +++ b/mediagoblin/templates/mediagoblin/auth/forgot_password.html @@ -0,0 +1,38 @@ +{# +# 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 title -%} + {% trans %}Recover password{% endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.auth.forgot_password') }}" + method="POST" enctype="multipart/form-data"> + {{ csrf_token }} + <div class="form_box"> + <h1>{% trans %}Recover password{% endtrans %}</h1> + {{ wtforms_util.render_divs(fp_form) }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Send instructions{% endtrans %}" class="button_form"/> + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/auth/fp_verification_email.txt b/mediagoblin/templates/mediagoblin/auth/fp_verification_email.txt new file mode 100644 index 00000000..fb5e1674 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/auth/fp_verification_email.txt @@ -0,0 +1,30 @@ +{# +# 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/>. +#} + +{% trans username=username, verification_url=verification_url|safe -%} +Hi {{ username }}, + +to change your GNU MediaGoblin password, open the following URL in +your web browser: + +{{ verification_url }} + +If you think this is an error, just ignore this email and continue being +a happy goblin! +{%- endtrans %} + diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html new file mode 100644 index 00000000..4a39059d --- /dev/null +++ b/mediagoblin/templates/mediagoblin/auth/login.html @@ -0,0 +1,62 @@ +{# +# 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/base.html" %} + +{% 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 title -%} + {% trans %}Log in{% endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.auth.login') }}" + method="POST" enctype="multipart/form-data"> + {{ csrf_token }} + <div class="form_box"> + <h1>{% trans %}Log in{% endtrans %}</h1> + {% if login_failed %} + <div class="form_field_error"> + {% trans %}Logging in failed!{% endtrans %} + </div> + {% endif %} + {% if allow_registration %} + <p> + {% trans %}Don't have an account yet?{% endtrans %} <a href="{{ request.urlgen('mediagoblin.auth.register') }}"> + {%- trans %}Create one here!{% endtrans %}</a> + </p> + {% endif %} + {{ wtforms_util.render_divs(login_form) }} + <p> + <a href="{{ request.urlgen('mediagoblin.auth.forgot_password') }}" id="forgot_password"> + {% trans %}Forgot your password?{% endtrans %}</a> + </p> + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Log in{% endtrans %}" class="button_form"/> + </div> + {% if next %} + <input type="hidden" name="next" value="{{ next }}" class="button_form" + style="display: none;"/> + {% endif %} + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html new file mode 100644 index 00000000..6dff0207 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/auth/register.html @@ -0,0 +1,47 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_head %} + <script type="text/javascript" + src="{{ request.staticdirect('/js/show_password.js') }}"></script> +{% endblock mediagoblin_head %} + +{% block title -%} + {% trans %}Create an account!{% endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.auth.register') }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box"> + <h1>{% trans %}Create an account!{% endtrans %}</h1> + {{ wtforms_util.render_divs(register_form) }} + {{ csrf_token }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Create{% endtrans %}" + class="button_form" /> + </div> + </div> + </form> +<!-- Focus the username field by default --> +<script>$(document).ready(function(){$("#username").focus();});</script> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/auth/verification_email.txt b/mediagoblin/templates/mediagoblin/auth/verification_email.txt new file mode 100644 index 00000000..969ef96a --- /dev/null +++ b/mediagoblin/templates/mediagoblin/auth/verification_email.txt @@ -0,0 +1,26 @@ +{# +# 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/>. +-#} + +{% trans username=username, verification_url=verification_url|safe -%} +Hi {{ username }}, + +to activate your GNU MediaGoblin account, open the following URL in +your web browser: + +{{ verification_url }} +{%- endtrans %} diff --git a/mediagoblin/templates/mediagoblin/base.html b/mediagoblin/templates/mediagoblin/base.html new file mode 100644 index 00000000..6c7c07d0 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/base.html @@ -0,0 +1,128 @@ +{# +# 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/>. +-#} +<!doctype html> +<html +{% block mediagoblin_html_tag %} +{% endblock mediagoblin_html_tag %} +> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>{% block title %}{{ app_config['html_title'] }}{% endblock %}</title> + <link rel="stylesheet" type="text/css" + href="{{ request.staticdirect('/css/extlib/reset.css') }}"/> + <link rel="stylesheet" type="text/css" + href="{{ request.staticdirect('/css/base.css') }}"/> + <link rel="shortcut icon" + href="{{ request.staticdirect('/images/goblin.ico') }}" /> + <script type="text/javascript" + src="{{ request.staticdirect('/js/extlib/jquery.js') }}"></script> + <script type="text/javascript" + src="{{ request.staticdirect('/js/header_dropdown.js') }}"></script> + + {# For clarification, the difference between the extra_head.html template + # and the head template hook is that the former should be used by + # themes and the latter should be used by plugins. + # The reason is that only one thing can override extra_head.html... + # but multiple plugins can hook into the template hook. + #} + {% include "mediagoblin/extra_head.html" %} + {% template_hook("head") %} + + {% block mediagoblin_head %} + {% endblock mediagoblin_head %} + </head> + <body> + {% include 'mediagoblin/bits/body_start.html' %} + {% block mediagoblin_body %} + {% block mediagoblin_header %} + <header> + {%- include "mediagoblin/bits/logo.html" -%} + {% block mediagoblin_header_title %}{% endblock %} + <div class="header_right"> + {%- if request.user %} + {% if request.user and request.user.status == 'active' %} + <div class="button_action header_dropdown_down">▼</div> + <div class="button_action header_dropdown_up">▲</div> + {% elif request.user and request.user.status == "needs_email_verification" %} + {# the following link should only appear when verification is needed #} + <a href="{{ request.urlgen('mediagoblin.user_pages.user_home', + user=request.user.username) }}" + class="button_action_highlight"> + {% trans %}Verify your email!{% endtrans %}</a> + or <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a> + {% endif %} + {%- else %} + <a href="{{ request.urlgen('mediagoblin.auth.login') }}?next={{ + request.base_url|urlencode }}"> + {%- trans %}Log in{% endtrans -%} + </a> + {%- endif %} + </div> + <div class="clear"></div> + {% if request.user and request.user.status == 'active' %} + <div class="header_dropdown"> + <p> + <span class="dropdown_title"> + {% trans user_url=request.urlgen('mediagoblin.user_pages.user_home', + user=request.user.username), + user_name=request.user.username -%} + <a href="{{ user_url }}">{{ user_name }}</a>'s account + {%- endtrans %} + </span> + · + <a href="{{ request.urlgen('mediagoblin.edit.account') }}">{%- trans %}Change account settings{% endtrans -%}</a> + · + <a href="{{ request.urlgen('mediagoblin.user_pages.processing_panel', + user=request.user.username) }}"> + {%- trans %}Media processing panel{% endtrans -%} + </a> + · + <a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}Log out{% endtrans %}</a> + </p> + <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.start') }}"> + {%- trans %}Add media{% endtrans -%} + </a> + <a class="button_action" href="{{ request.urlgen('mediagoblin.submit.collection') }}"> + {%- trans %}Create new collection{% endtrans -%} + </a> + {% if request.user.is_admin %} + <p> + <span class="dropdown_title">Admin powers:</span> + <a href="{{ request.urlgen('mediagoblin.admin.panel') }}"> + {%- trans %}Media processing panel{% endtrans -%} + </a> + </p> + {% endif %} + </div> + {% endif %} + </header> + {% endblock %} + <div class="container"> + {% include 'mediagoblin/bits/above_content.html' %} + <div class="mediagoblin_content"> + {% include "mediagoblin/utils/messages.html" %} + {% block mediagoblin_content %} + {% endblock mediagoblin_content %} + </div> + {%- include "mediagoblin/bits/base_footer.html" %} + </div> + {%- endblock mediagoblin_body %} + {% include 'mediagoblin/bits/body_end.html' %} + </body> +</html> diff --git a/mediagoblin/templates/mediagoblin/bits/above_content.html b/mediagoblin/templates/mediagoblin/bits/above_content.html new file mode 100644 index 00000000..bb7b9762 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/above_content.html @@ -0,0 +1,17 @@ +{# +# 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/>. +-#} diff --git a/mediagoblin/templates/mediagoblin/bits/base_footer.html b/mediagoblin/templates/mediagoblin/bits/base_footer.html new file mode 100644 index 00000000..80cd41b0 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/base_footer.html @@ -0,0 +1,28 @@ +{# +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011-2013 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/>. +#} + +{%- block mediagoblin_footer %} + <footer> + {% trans -%} + Powered by <a href="http://mediagoblin.org/" title='Version {{ version }}'>MediaGoblin</a>, a <a href="http://gnu.org/">GNU</a> project. + {%- endtrans %} + {% trans source_link=app_config['source_link'] -%} + Released under the <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPL</a>. <a href="{{ source_link }}">Source code</a> available. + {%- endtrans %} + </footer> +{%- endblock mediagoblin_footer -%} diff --git a/mediagoblin/templates/mediagoblin/bits/body_end.html b/mediagoblin/templates/mediagoblin/bits/body_end.html new file mode 100644 index 00000000..bb7b9762 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/body_end.html @@ -0,0 +1,17 @@ +{# +# 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/>. +-#} diff --git a/mediagoblin/templates/mediagoblin/bits/body_start.html b/mediagoblin/templates/mediagoblin/bits/body_start.html new file mode 100644 index 00000000..bb7b9762 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/body_start.html @@ -0,0 +1,17 @@ +{# +# 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/>. +-#} diff --git a/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html b/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html new file mode 100644 index 00000000..544ee146 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/frontpage_welcome.html @@ -0,0 +1,35 @@ +{# +# 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/>. +#} + +{% if request.user %} + <h1>{% trans %}Explore{% endtrans %}</h1> +{% else %} + <h1>{% trans %}Hi there, welcome to this MediaGoblin site!{% endtrans %}</h1> + <img class="right_align" src="{{ request.staticdirect('/images/frontpage_image.png') }}" /> + <p>{% trans %}This site is running <a href="http://mediagoblin.org">MediaGoblin</a>, an extraordinarily great piece of media hosting software.{% endtrans %}</p> + <p>{% trans %}To add your own media, place comments, and more, you can log in with your MediaGoblin account.{% endtrans %}</p> + {% if allow_registration %} + <p>{% trans %}Don't have one yet? It's easy!{% endtrans %}</p> + {% trans register_url=request.urlgen('mediagoblin.auth.register') -%} + <a class="button_action_highlight" href="{{ register_url }}">Create an account at this site</a> + or + <a class="button_action" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a> + {%- endtrans %} + {% endif %} + <div class="clear"></div> +{% endif %} diff --git a/mediagoblin/templates/mediagoblin/bits/logo.html b/mediagoblin/templates/mediagoblin/bits/logo.html new file mode 100644 index 00000000..5bd8edd8 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/bits/logo.html @@ -0,0 +1,25 @@ +{# +# 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/>. +-#} + +{% 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 -%} diff --git a/mediagoblin/templates/mediagoblin/edit/attachments.html b/mediagoblin/templates/mediagoblin/edit/attachments.html new file mode 100644 index 00000000..3fbea3be --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/attachments.html @@ -0,0 +1,69 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block title -%} + {% trans media_title=media.title -%} + Editing attachments for {{ media_title }} + {%- endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.edit.attachments', + user= media.get_uploader.username, + media_id=media.id) }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box"> + <h1> + {%- trans media_title=media.title -%} + Editing attachments for {{ media_title }} + {%- endtrans -%} + </h1> + <div style="text-align: center;" > + <img src="{{ media.thumb_url }}" /> + </div> + + {% if media.attachment_files|count %} + <h2>{% trans %}Attachments{% endtrans %}</h2> + <ul> + {%- for attachment in media.attachment_files %} + <li> + <a target="_blank" href="{{ request.app.public_store.file_url( + attachment['filepath']) }}"> + {{- attachment.name -}} + </a> + </li> + {%- endfor %} + </ul> + {% endif %} + + <h2>{% trans %}Add attachment{% endtrans %}</h2> + {{- wtforms_util.render_divs(form) }} + <div class="form_submit_buttons"> + <a 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> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/edit/change_pass.html b/mediagoblin/templates/mediagoblin/edit/change_pass.html new file mode 100644 index 00000000..ff909b07 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/change_pass.html @@ -0,0 +1,52 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_head %} + <script type="text/javascript" + src="{{ request.staticdirect('/js/show_password.js') }}"></script> +{% endblock mediagoblin_head %} + +{% block title -%} + {% trans username=user.username -%} + Changing {{ username }}'s password + {%- endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.edit.pass') }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box edit_box"> + <h1> + {%- trans username=user.username -%} + Changing {{ username }}'s password + {%- endtrans -%} + </h1> + {{ wtforms_util.render_divs(form) }} + {{ csrf_token }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Save{% endtrans %}" + class="button_form" /> + </div> + </div> + </form> +{% endblock %} + + diff --git a/mediagoblin/templates/mediagoblin/edit/delete_account.html b/mediagoblin/templates/mediagoblin/edit/delete_account.html new file mode 100644 index 00000000..84d0b580 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/delete_account.html @@ -0,0 +1,48 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.edit.delete_account') }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box"> + <h1> + {%- trans user_name=user.username -%} + Really delete user '{{ user_name }}' and all related media/comments? + {%- endtrans -%} + </h1> + <p class="delete_checkbox_box"> + <input type="checkbox" name="confirmed"/> + <label for="confirmed"> + {%- trans %}Yes, really delete my account{% endtrans -%} + </label> + </p> + + <div class="form_submit_buttons"> + <a class="button_action" href="{{ request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username) }}">{% trans %}Cancel{% endtrans %}</a> + {{ csrf_token }} + <input type="submit" value="{% trans %}Delete permanently{% endtrans %}" class="button_form" /> + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/edit/edit.html b/mediagoblin/templates/mediagoblin/edit/edit.html new file mode 100644 index 00000000..9a040095 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/edit.html @@ -0,0 +1,48 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block title -%} + {% trans media_title=media.title -%} + Editing {{ media_title }} + {%- endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.edit.edit_media', + user= media.get_uploader.username, + media_id=media.id) }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box_xl edit_box"> + <h1>{% trans media_title=media.title %}Editing {{ media_title }}{% endtrans %}</h1> + <div style="text-align: center;" > + <img src="{{ media.thumb_url }}" /> + </div> + {{ wtforms_util.render_divs(form) }} + <div class="form_submit_buttons"> + <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> + </div> + </form> + +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/edit/edit_account.html b/mediagoblin/templates/mediagoblin/edit/edit_account.html new file mode 100644 index 00000000..4c4aaf95 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/edit_account.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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_head %} + <script type="text/javascript" + src="{{ request.staticdirect('/js/show_password.js') }}"></script> +{% endblock mediagoblin_head %} + +{% block title -%} + {% trans username=user.username -%} + Changing {{ username }}'s account settings + {%- endtrans %} — {{ super() }} +{%- endblock %} + + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.edit.account') }}?username={{ + user.username }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box edit_box"> + <h1> + {%- trans username=user.username -%} + Changing {{ username }}'s account settings + {%- endtrans -%} + </h1> + <p> + <a href="{{ request.urlgen('mediagoblin.edit.pass') }}"> + {% trans %}Change your password.{% endtrans %} + </a> + </p> + <div class="form_field_input"> + <p>{{ form.wants_comment_notification }} + {{ wtforms_util.render_label(form.wants_comment_notification) }}</p> + </div> + {{- wtforms_util.render_field_div(form.license_preference) }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" /> + {{ csrf_token }} + </div> + </div> + </form> + <div class="delete"> + <a href="{{ request.urlgen('mediagoblin.edit.delete_account') }}"> + {%- trans %}Delete my account{% endtrans -%} + </a> + </div> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/edit/edit_collection.html b/mediagoblin/templates/mediagoblin/edit/edit_collection.html new file mode 100644 index 00000000..5cf5bae8 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/edit_collection.html @@ -0,0 +1,39 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.edit.edit_collection', + user= collection.get_creator.username, + collection= collection.slug) }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box_xl edit_box"> + <h1>{% trans collection_title=collection.title %}Editing {{ collection_title }}{% endtrans %}</h1> + {{ wtforms_util.render_divs(form) }} + <div class="form_submit_buttons"> + <a class="button_action" href="{{ collection.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a> + <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" /> + {{ csrf_token }} + </div> + </div> + </form> + +{% 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..163fe186 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/edit/edit_profile.html @@ -0,0 +1,45 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block title -%} + {% trans username=user.username -%} + Editing {{ username }}'s profile + {%- endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.edit.profile', + user=user.username) }}" method="POST" enctype="multipart/form-data"> + <div class="form_box edit_box"> + <h1> + {%- trans username=user.username -%} + Editing {{ username }}'s profile + {%- endtrans %} + </h1> + {{ wtforms_util.render_divs(form) }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Save changes{% endtrans %}" class="button_form" /> + {{ csrf_token }} + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/error.html b/mediagoblin/templates/mediagoblin/error.html new file mode 100644 index 00000000..c16b650f --- /dev/null +++ b/mediagoblin/templates/mediagoblin/error.html @@ -0,0 +1,28 @@ +{# +# 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/base.html" %} + +{% block title %}{{err_code}} — {{ super() }}{% endblock %} + +{% block mediagoblin_content %} + <img class="right_align" src="{{ request.staticdirect('/images/404.png') }}" + alt="{% trans %}Image of goblin stressing out{% endtrans %}" /> + <h1>{{ title }}</h1> + <p>{{ err_msg|safe }}</p> + <div class="clear"></div> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/extra_head.html b/mediagoblin/templates/mediagoblin/extra_head.html new file mode 100644 index 00000000..973e2b48 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/extra_head.html @@ -0,0 +1,19 @@ +{# +# 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/>. +-#} + +{# Add extra head declarations here for your theme, if appropriate #} diff --git a/mediagoblin/templates/mediagoblin/listings/collection.html b/mediagoblin/templates/mediagoblin/listings/collection.html new file mode 100644 index 00000000..4d502201 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/listings/collection.html @@ -0,0 +1,43 @@ +{# +# 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/base.html" %} + +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + +{% block mediagoblin_head %} + <link rel="alternate" type="application/atom+xml" + href="{{ request.urlgen( + 'mediagoblin.listings.tag_atom_feed', + tag=tag_slug) }}"> +{% endblock mediagoblin_head %} + +{% block title %} + {% trans %}Media tagged with: {{ tag_name }}{% endtrans %} — {{ super() }} +{% endblock %} + +{% block mediagoblin_content -%} + <h1> + {% trans %}Media tagged with: {{ tag_name }}{% endtrans %} + </h1> + + {{ object_gallery(request, media_entries, pagination) }} + + {% set feed_url = request.urlgen('mediagoblin.listings.tag_atom_feed', + tag=tag_slug) %} + {% include "mediagoblin/utils/feed_link.html" %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/listings/tag.html b/mediagoblin/templates/mediagoblin/listings/tag.html new file mode 100644 index 00000000..4d502201 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/listings/tag.html @@ -0,0 +1,43 @@ +{# +# 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/base.html" %} + +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + +{% block mediagoblin_head %} + <link rel="alternate" type="application/atom+xml" + href="{{ request.urlgen( + 'mediagoblin.listings.tag_atom_feed', + tag=tag_slug) }}"> +{% endblock mediagoblin_head %} + +{% block title %} + {% trans %}Media tagged with: {{ tag_name }}{% endtrans %} — {{ super() }} +{% endblock %} + +{% block mediagoblin_content -%} + <h1> + {% trans %}Media tagged with: {{ tag_name }}{% endtrans %} + </h1> + + {{ object_gallery(request, media_entries, pagination) }} + + {% set feed_url = request.urlgen('mediagoblin.listings.tag_atom_feed', + tag=tag_slug) %} + {% include "mediagoblin/utils/feed_link.html" %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/media_displays/ascii.html b/mediagoblin/templates/mediagoblin/media_displays/ascii.html new file mode 100644 index 00000000..3cc5e0ab --- /dev/null +++ b/mediagoblin/templates/mediagoblin/media_displays/ascii.html @@ -0,0 +1,44 @@ +{# +# 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_media %} + <div class="ascii-wrapper"> + <pre> + {%- autoescape False -%} + {{- request.app.public_store.get_file( + media.media_files['unicode']).read()|string -}} + {%- endautoescape -%} + </pre> + </div> +{% endblock %} + +{% block mediagoblin_sidebar %} + {% if 'original' in media.media_files %} + <h3>{% trans %}Download{% endtrans %}</h3> + <p> + <a href="{{ request.app.public_store.file_url( + media.media_files['original']) }}"> + {%- trans -%} + Original + {%- endtrans -%} + </a> + </p> + {% endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/media_displays/audio.html b/mediagoblin/templates/mediagoblin/media_displays/audio.html new file mode 100644 index 00000000..95bc6e88 --- /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/image.html b/mediagoblin/templates/mediagoblin/media_displays/image.html new file mode 100644 index 00000000..d0050f50 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/media_displays/image.html @@ -0,0 +1,46 @@ +{# +# 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() }} + {% template_hook("image_head") %} +{% endblock mediagoblin_head %} + +{% block mediagoblin_sidebar %} + {{ super() }} + {% template_hook("image_sideinfo") %} +{% endblock %} + +{% block mediagoblin_after_added_sidebar %} + {% if app_config['original_date_visible'] %} + {% set original_date = media.media_manager.get_original_date() %} + + {% if original_date %} + <h3>{% trans %}Created{% endtrans %}</h3> + + <p><span title="{{ original_date.strftime("%I:%M%p %Y-%m-%d") }}"> + {%- trans formatted_time=timesince(original_date) -%} + {{ formatted_time }} ago + {%- endtrans -%} + </span></p> + {%- endif %} + {% endif %} +{% endblock %} + diff --git a/mediagoblin/templates/mediagoblin/media_displays/pdf.html b/mediagoblin/templates/mediagoblin/media_displays/pdf.html new file mode 100644 index 00000000..9319e87c --- /dev/null +++ b/mediagoblin/templates/mediagoblin/media_displays/pdf.html @@ -0,0 +1,86 @@ +{# +# 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' %} + +{% set medium_view = request.app.public_store.file_url( + media.media_files['medium']) %} + +{% if 'pdf' in media.media_files %} + {% set pdf_view = request.app.public_store.file_url( + media.media_files['pdf']) %} +{% else %} + {% set pdf_view = request.app.public_store.file_url( + media.media_files['original']) %} +{% endif %} + +{% set pdf_js = global_config.get('media_type:mediagoblin.media_types.pdf', {}).get('pdf_js', False) %} + +{% if pdf_js %} + {% block mediagoblin_html_tag %} + dir="ltr" mozdisallowselectionprint moznomarginboxes + {% endblock mediagoblin_html_tag %} +{% endif %} + +{% block mediagoblin_head -%} + {{ super() }} + + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> + +{%- endblock %} + +{% block mediagoblin_media %} + {% if pdf_js %} + <iframe width="640px" height="480px" + src="{{ request.staticdirect('/extlib/pdf.js/web/viewer.html') }}?file={{ pdf_view }} "> + </iframe> + {% else %} + <a href="{{ pdf_view }}"> + <img id="medium" + class="media_image" + src="{{ medium_view }}" + alt=" + {%- trans media_title=media.title -%} + Image for {{ media_title}} + {%- endtrans %}"/> + </a> + {% endif %} +{% 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> + </li> + {% endif %} + {% if 'pdf' in media.media_files %} + <li> + <a href="{{ request.app.public_store.file_url( + media.media_files.pdf) }}"> + {%- trans %}PDF file{% endtrans -%} + </a> + </li> + {% endif %} + </ul> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/media_displays/stl.html b/mediagoblin/templates/mediagoblin/media_displays/stl.html new file mode 100644 index 00000000..a89e0b4f --- /dev/null +++ b/mediagoblin/templates/mediagoblin/media_displays/stl.html @@ -0,0 +1,150 @@ +{# +# 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_media %} + + +{% set model_download = request.app.public_store.file_url( + media.media_files['original']) %} +{% set perspective_view = request.app.public_store.file_url( + media.media_files['perspective']) %} +{% set top_view = request.app.public_store.file_url( + media.media_files['top']) %} +{% set side_view = request.app.public_store.file_url( + media.media_files['side']) %} +{% set front_view = request.app.public_store.file_url( + media.media_files['front']) %} + +<style type="text/css"> +#top_view, #side_view, #front_view, #thingy_view { + display: none; +} +.media_image { + cursor: inherit!important; +} + +</style> + +{% if media.media_data.file_type == "stl" %} + <script src="{{ request.staticdirect('/js/extlib/thingiview.js/Three.js') }}"></script> + <script src="{{ request.staticdirect('/js/extlib/thingiview.js/plane.js') }}"></script> + <script src="{{ request.staticdirect('/js/extlib/thingiview.js/thingiview.js') }}"></script> +{% endif %} + + +<script type="text/javascript"> +window.show = function (view_id) { + ids = [ + "perspective", + "top_view", + "side_view", + "front_view", + "thingy_view", + ]; + for (var i=0; i<ids.length; i+=1) { + id = ids[i]; + var view = document.getElementById(id); + view.style.display = id===view_id ? "block" : "none"; + } +}; + +window.show_things = function () { + document.getElementById("webgl_button").onclick = function () { + show('thingy_view'); + }; + window.show("thingy_view"); + thingiurlbase = "{{ request.staticdirect('/js/extlib/thingiview.js') }}"; + thingiview = new Thingiview("thingy_view"); + thingiview.setObjectColor('#821543'); + thingiview.initScene(); + thingiview.loadSTL("{{ model_download }}"); + thingiview.setRotation(false); +}; +</script> + +<img + id="perspective" + class="media_image" + src="{{ perspective_view }}" + alt="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> +<img + id="top_view" + class="media_image" + src="{{ top_view }}" + alt="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> +<img + id="side_view" + class="media_image" + src="{{ side_view }}" + alt="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> +<img + id="front_view" + class="media_image" + src="{{ front_view }}" + alt="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> +<div id="thingy_view" style="width:640px;height:640px;"></div> + + +<div style="padding: 4px;"> + <a class="button_action" onclick="show('perspective');" + title="{%- trans %}Toggle Rotate{% endtrans -%}"> + {%- trans %}Perspective{% endtrans -%} + </a> + <a class="button_action" onclick="show('front_view');" + title="{%- trans %}Front{% endtrans -%}"> + {%- trans %}Front{% endtrans -%} + </a> + <a class="button_action" onclick="show('top_view');" + title="{%- trans %}Top{% endtrans -%}"> + {%- trans %}Top{% endtrans -%} + </a> + <a class="button_action" onclick="show('side_view');" + title="{%- trans %}Side{% endtrans -%}"> + {%- trans %}Side{% endtrans -%} + </a> +{% if media.media_data.file_type == "stl" %} + <a id="webgl_button" class="button_action" + onclick="show_things();" + title="{%- trans %}WebGL{% endtrans -%}"> + {%- trans %}WebGL{% endtrans -%} + </a> +{% endif %} + + <a class="button_action" href="{{ model_download }}" + title="{%- trans %}Download{% endtrans -%}" + style="float:right;"> + {%- trans %}Download model{% endtrans -%} + </a> +</div> + + +{% endblock %} + +{% block mediagoblin_sidebar %} +<h3>{% trans %}File Format{% endtrans %}</h3> +<p>{{ media.media_data.file_type }}</p> +<h3>{% trans %}Object Height{% endtrans %}</h3> +<p>~{{ media.media_data.height|int }} mm</p> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html new file mode 100644 index 00000000..b0854c9f --- /dev/null +++ b/mediagoblin/templates/mediagoblin/media_displays/video.html @@ -0,0 +1,74 @@ +{# +# 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() }} + <script type="text/javascript" src="{{ + request.staticdirect('/extlib/video-js/video.min.js') }}"></script> + <link href="{{ request.staticdirect('/css/vjs-mg-skin.css') }}" + rel="stylesheet"> +{%- endblock %} + +{% block mediagoblin_media %} + {% set display_type, display_path = media.get_display_media() %} + + <video controls + {% if global_config['media_type:mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %} + preload="auto" class="video-js vjs-mg-skin" + data-setup='{"height": {{ media.media_data.height }}, + "width": {{ media.media_data.width }} }'> + <source src="{{ request.app.public_store.file_url(display_path) }}" + {% if media.media_data %} + type="{{ media.media_data.source_type() }}" + {% else %} + type="{{ media.media_manager['default_webm_type'] }}" + {% endif %} /> + <div class="no_html5"> + {%- trans -%}Sorry, this video will not work because + your web browser does not support HTML5 + video.{%- endtrans -%}<br/> + {%- trans -%}You can get a modern web browser that + can play this video at <a href="http://getfirefox.com"> + http://getfirefox.com</a>!{%- endtrans -%} + </div> + </video> +{% 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> + </li> + {% endif %} + {% if 'webm_640' in media.media_files %} + <li> + <a href="{{ request.app.public_store.file_url( + media.media_files.webm_640) }}"> + {%- trans %}WebM file (640p; VP8/Vorbis){% endtrans -%} + </a> + </li> + {% endif %} + </ul> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/root.html b/mediagoblin/templates/mediagoblin/root.html new file mode 100644 index 00000000..15d53af1 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/root.html @@ -0,0 +1,38 @@ +{# +# 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/base.html" %} + +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + +{% set feed_url = request.urlgen('mediagoblin.listings.atom_feed') %} + +{% block mediagoblin_head -%} + {% set feed_url = request.urlgen('mediagoblin.listings.atom_feed') -%} + <link rel="alternate" type="application/atom+xml" href="{{ feed_url }}"> +{%- endblock mediagoblin_head %} + +{% block mediagoblin_content %} + {% include "mediagoblin/bits/frontpage_welcome.html" %} + + <h2>{% trans %}Most recent media{% endtrans %}</h2> + {{ object_gallery(request, media_entries, pagination) }} + + {#- Need to set feed_url within this block so template can use it. -#} + {%- set feed_url = feed_url -%} + {%- include "mediagoblin/utils/feed_link.html" -%} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/submit/collection.html b/mediagoblin/templates/mediagoblin/submit/collection.html new file mode 100644 index 00000000..4e2bc17d --- /dev/null +++ b/mediagoblin/templates/mediagoblin/submit/collection.html @@ -0,0 +1,34 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.submit.collection') }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box_xl"> + <h1>{% trans %}Add a collection{% endtrans %}</h1> + {{ wtforms_util.render_divs(submit_form) }} + <div class="form_submit_buttons"> + {{ csrf_token }} + <input type="submit" value="{% trans %}Add{% endtrans %}" class="button_form" /> + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/submit/start.html b/mediagoblin/templates/mediagoblin/submit/start.html new file mode 100644 index 00000000..aa390f56 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/submit/start.html @@ -0,0 +1,38 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block title -%} + {% trans %}Add your media{% endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.submit.start') }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box_xl"> + <h1>{% trans %}Add your media{% endtrans %}</h1> + {{ wtforms_util.render_divs(submit_form) }} + <div class="form_submit_buttons"> + {{ csrf_token }} + <input type="submit" value="{% trans %}Add{% endtrans %}" class="button_form" /> + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/test_submit.html b/mediagoblin/templates/mediagoblin/test_submit.html new file mode 100644 index 00000000..0771a0c7 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/test_submit.html @@ -0,0 +1,34 @@ +{# +# 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/>. +#} +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +<html> + <body> + <form action="{{ request.urlgen('test_submit') }}" method="POST" + enctype="multipart/form-data"> + <table> + {{ wtforms_util.render_table(image_form) }} + <tr> + <td></td> + <td><input type="submit" value="submit" class="button_form" /></td> + {{ csrf_token }} + </tr> + </table> + </form> + </body> +</html> diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection.html b/mediagoblin/templates/mediagoblin/user_pages/collection.html new file mode 100644 index 00000000..5a7baadd --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/collection.html @@ -0,0 +1,72 @@ +{# +# 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/base.html" %} + +{% from "mediagoblin/utils/collection_gallery.html" import collection_gallery %} + +{% block mediagoblin_head %} + <link rel="alternate" type="application/atom+xml" + href="{{ request.urlgen( + 'mediagoblin.user_pages.atom_feed', + user=user.username) }}"> +{% endblock mediagoblin_head %} + +{% block title %} + {%- trans username=user.username, + collection_title=collection.title + -%} + {{ collection_title }} ({{ username }}'s collection) + {%- endtrans %} — {{ super() }} +{% endblock %} + +{% block mediagoblin_content -%} + <h1> + {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username), + collection_title=collection.title -%} + {{ collection_title }} by <a href="{{ user_url }}">{{ username }}</a> + {%- endtrans %} + </h1> + {% if request.user and (collection.creator == request.user.id or + request.user.is_admin) %} + {% set edit_url = request.urlgen('mediagoblin.edit.edit_collection', + user=collection.get_creator.username, + collection=collection.slug) %} + <a class="button_action" href="{{ edit_url }}">{% trans %}Edit{% endtrans %}</a> + {% set delete_url = request.urlgen('mediagoblin.user_pages.collection_confirm_delete', + user=collection.get_creator.username, + collection=collection.slug) %} + <a class="button_action" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a> + {% endif %} + + <p> + {% autoescape False %} + {{ collection.description_html }} + {% endautoescape %} + </p> + + {{ collection_gallery(request, collection_items, pagination) }} + + {% set feed_url = request.urlgen('mediagoblin.user_pages.collection_atom_feed', + user=user.username, + collection=collection.slug ) %} + {% include "mediagoblin/utils/feed_link.html" %} + +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html new file mode 100644 index 00000000..694eb979 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/collection_confirm_delete.html @@ -0,0 +1,53 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.user_pages.collection_confirm_delete', + user=collection.get_creator.username, + collection=collection.slug) }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box"> + <h1> + {%- trans title=collection.title -%} + Really delete {{ title }}? + {%- endtrans %} + </h1> + + <br /> + + <p class="delete_checkbox_box"> + {{ form.confirm }} + {{ wtforms_util.render_label(form.confirm) }} + </p> + + <div class="form_submit_buttons"> + {# TODO: This isn't a button really... might do unexpected things :) #} + <a class="button_action" href=" + {{- collection.url_for_self(request.urlgen) }}"> + {%- trans %}Cancel{% endtrans -%} + </a> + <input type="submit" value="{% trans %}Delete permanently{% endtrans %}" class="button_form" /> + {{ csrf_token }} + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html new file mode 100644 index 00000000..dc31d90f --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/collection_item_confirm_remove.html @@ -0,0 +1,59 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.user_pages.collection_item_confirm_remove', + user=collection_item.in_collection.get_creator.username, + collection=collection_item.in_collection.slug, + collection_item=collection_item.id) }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box"> + <h1> + {%- trans media_title=collection_item.get_media_entry.title, + collection_title=collection_item.in_collection.title -%} + Really remove {{ media_title }} from {{ collection_title }}? + {%- endtrans %} + </h1> + + <div style="text-align: center;" > + <img src="{{ collection_item.get_media_entry.thumb_url }}" /> + </div> + + <br /> + + <p class="delete_checkbox_box"> + {{ form.confirm }} + {{ wtforms_util.render_label(form.confirm) }} + </p> + + <div class="form_submit_buttons"> + {# TODO: This isn't a button really... might do unexpected things :) #} + <a class="button_action" href=" + {{- collection_item.in_collection.url_for_self(request.urlgen) }}"> + {%- trans %}Cancel{% endtrans -%} + </a> + <input type="submit" value="{% trans %}Remove{% endtrans %}" class="button_form" /> + {{ csrf_token }} + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/collection_list.html b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html new file mode 100644 index 00000000..8ac0b988 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/collection_list.html @@ -0,0 +1,56 @@ +{# +# 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/base.html" %} + +{% block title %} + {%- trans username=user.username -%} + {{ username }}'s collections + {%- endtrans %} — {{ super() }} +{% endblock %} + +{% block mediagoblin_content -%} + <h1> + {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username) -%} + <a href="{{ user_url }}">{{ username }}</a>'s collections + {%- endtrans %} + </h1> + + {% if request.user %} + {% if request.user.status == 'active' %} + <p> + <a href="{{ request.urlgen('mediagoblin.submit.collection', + user=user.username) }}"> + {%- trans %}Create new collection{% endtrans -%} + </a> + </p> + {% endif %} + {% endif %} + + <ul> + {% for coll in collections %} + {%- set coll_url = coll.url_for_self(request.urlgen) %} + <li> + <a href="{{ coll_url }}">{{ coll.title }}</a> + </li> + {% endfor %} + </ul> + +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/comment_email.txt b/mediagoblin/templates/mediagoblin/user_pages/comment_email.txt new file mode 100644 index 00000000..1155ac1e --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/comment_email.txt @@ -0,0 +1,26 @@ +{# +# 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/>. +-#} + +{% trans username=username, comment_author=comment_author, instance_name=app_config.html_title -%} + +Hi {{ username }}, +{{ comment_author }} commented on your post ({{ comment_url }}) at {{ instance_name }} +{% endtrans %} +{{ comment_content }} + +{{ app_config.html_title }} diff --git a/mediagoblin/templates/mediagoblin/user_pages/gallery.html b/mediagoblin/templates/mediagoblin/user_pages/gallery.html new file mode 100644 index 00000000..f23bb156 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/gallery.html @@ -0,0 +1,63 @@ +{# +# 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/base.html" %} + +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + +{% block mediagoblin_head %} + <link rel="alternate" type="application/atom+xml" + href="{{ request.urlgen( + 'mediagoblin.user_pages.atom_feed', + user=user.username) }}"> +{% endblock mediagoblin_head %} + +{% block title %} + {%- trans username=user.username -%} + {{ username }}'s media + {%- endtrans %} — {{ super() }} +{% endblock %} + +{% block mediagoblin_content -%} + <h1> + {% if tag %} + {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username), + tag_url=request.urlgen( + 'mediagoblin.listings.tags_listing', + tag=tag) -%} + <a href="{{ user_url }}">{{ username }}</a>'s media with tag <a href="{{ tag_url }}">{{ tag }}</a> + {%- endtrans %} + {% else %} + {%- trans username=user.username, + user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=user.username) -%} + <a href="{{ user_url }}">{{ username }}</a>'s media + {%- endtrans %} + {% endif %} + </h1> + + {{ object_gallery(request, media_entries, pagination) }} + + {% set feed_url = request.urlgen('mediagoblin.user_pages.atom_feed', + user=user.username) %} + {% include "mediagoblin/utils/feed_link.html" %} + +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html new file mode 100644 index 00000000..fb892fd7 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -0,0 +1,205 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} +{% from "mediagoblin/utils/pagination.html" import render_pagination %} + +{% block title %}{{ media.title }} — {{ super() }}{% endblock %} + +{% block mediagoblin_head %} +<!--[if lte IE 8]><link rel="stylesheet" + href="{{ request.staticdirect('/extlib/leaflet/leaflet.ie.css') }}" /><![endif]--> + <script type="text/javascript" + src="{{ request.staticdirect('/js/comment_show.js') }}"></script> + <script type="text/javascript" + src="{{ request.staticdirect('/js/keyboard_navigation.js') }}"></script> + + {% template_hook("media_head") %} +{% endblock mediagoblin_head %} + +{% block mediagoblin_content %} + <p class="context"> + {%- trans user_url=request.urlgen( + 'mediagoblin.user_pages.user_home', + user=media.get_uploader.username), + username=media.get_uploader.username -%} + ❖ Browsing media by <a href="{{user_url}}">{{username}}</a> + {%- endtrans -%} + </p> + {% include "mediagoblin/utils/prev_next.html" %} + <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()[1]) %} + {# 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="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> + </a> + {% else %} + <img class="media_image" + src="{{ display_media }}" + alt="{% trans media_title=media.title -%} + Image for {{ media_title }}{% endtrans %}" /> + {% endif %} + {% endblock %} + </div> + <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_id=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_id=media.id) %} + <a class="button_action" href="{{ delete_url }}">{% trans %}Delete{% endtrans %}</a> + {% endif %} + {% autoescape False %} + <p>{{ media.description_html }}</p> + {% endautoescape %} + {% if comments %} + {% if app_config['allow_comments'] %} + <a + {% if not request.user %} + href="{{ request.urlgen('mediagoblin.auth.login') }}" + {% endif %} + class="button_action" id="button_addcomment" title="Add a comment"> + {% trans %}Add a comment{% endtrans %} + </a> + {% endif %} + {% if request.user %} + <form action="{{ request.urlgen('mediagoblin.user_pages.media_post_comment', + user= media.get_uploader.username, + media_id=media.id) }}" method="POST" id="form_comment"> + {{ wtforms_util.render_divs(comment_form) }} + <div class="form_submit_buttons"> + <input type="submit" value="{% trans %}Add this comment{% endtrans %}" class="button_action" /> + {{ csrf_token }} + </div> + </form> + {% endif %} + <ul style="list-style:none"> + {% for comment in comments %} + {% set comment_author = comment.get_author %} + <li id="comment-{{ comment.id }}" + {%- if pagination.active_id == comment.id %} + class="comment_wrapper comment_active"> + <a name="comment" id="comment"></a> + {%- else %} + class="comment_wrapper"> + {%- endif %} + <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) }}" + class="comment_authorlink"> + {{- comment_author.username -}} + </a> + <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment', + comment=comment.id, + user=media.get_uploader.username, + media=media.slug_or_id) }}#comment" + class="comment_whenlink"> + <span title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'> + {%- trans formatted_time=timesince(comment.created) -%} + {{ formatted_time }} ago + {%- endtrans -%} + </span></a>: + </div> + <div class="comment_content"> + {% autoescape False -%} + {{ comment.content_html }} + {%- endautoescape %} + </div> + </li> + {% endfor %} + </ul> + {{ render_pagination(request, pagination, + media.url_for_self(request.urlgen)) }} + {% endif %} + </div> + <div class="media_sidebar"> + <h3>{% trans %}Added{% endtrans %}</h3> + <p><span title="{{ media.created.strftime("%I:%M%p %Y-%m-%d") }}"> + {%- trans formatted_time=timesince(media.created) -%} + {{ formatted_time }} ago + {%- endtrans -%} + </span></p> + + {% block mediagoblin_after_added_sidebar %} + {% endblock %} + + {% if media.tags %} + {% include "mediagoblin/utils/tags.html" %} + {% endif %} + + {% include "mediagoblin/utils/collections.html" %} + + {% include "mediagoblin/utils/license.html" %} + + {% include "mediagoblin/utils/exif.html" %} + + {%- if media.attachment_files|count %} + <h3>{% trans %}Attachments{% endtrans %}</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) %} + {%- if not media.attachment_files|count %} + <h3>{% trans %}Attachments{% endtrans %}</h3> + {%- endif %} + <p> + <a href="{{ request.urlgen('mediagoblin.edit.attachments', + user=media.get_uploader.username, + media_id=media.id) }}"> + {%- trans %}Add attachment{% endtrans -%} + </a> + </p> + {%- endif %} + + {% template_hook("media_sideinfo") %} + + {% block mediagoblin_sidebar %} + {% endblock %} + + </div> + <div class="clear"></div> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_collect.html b/mediagoblin/templates/mediagoblin/user_pages/media_collect.html new file mode 100644 index 00000000..b4c9671c --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/media_collect.html @@ -0,0 +1,73 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_head %} + <script type="text/javascript" + src="{{ request.staticdirect('/js/collection_form_show.js') }}"></script> +{% endblock %} + +{% block title -%} + {% trans media_title=media.title -%} + Add “{{ media_title }}” to a collection + {%- endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + <form action="{{ request.urlgen('mediagoblin.user_pages.media_collect', + user=media.get_uploader.username, + media_id=media.id) }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box"> + <h1> + {%- trans media_title=media.title -%} + Add “{{ media_title }}” to a collection + {%- endtrans -%} + </h1> + + <div style="text-align: center;" > + <img src="{{ media.thumb_url }}" /> + </div> + + <br /> + + {{- wtforms_util.render_label_p(form.collection) }} + <div class="form_field_input"> + {{ form.collection }} + <a class="button_action" id="button_addcollection">{% trans %}+{% endtrans %}</a> + </div> + + <div id="new_collection" class="subform"> + <h3>{% trans %}Add a new collection{% endtrans %}</h3> + + {{- wtforms_util.render_field_div(form.collection_title) }} + {{- wtforms_util.render_field_div(form.collection_description) }} + </div> + {{- wtforms_util.render_field_div(form.note) }} + + <div class="form_submit_buttons"> + {# TODO: This isn't a button really... might do unexpected things :) #} + <a class="button_action" href="{{ media.url_for_self(request.urlgen) }}">{% trans %}Cancel{% endtrans %}</a> + <input type="submit" value="{% trans %}Add{% endtrans %}" class="button_form" /> + {{ csrf_token }} + </div> + </div> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html new file mode 100644 index 00000000..1d7dcc17 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/media_confirm_delete.html @@ -0,0 +1,54 @@ +{# +# 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/base.html" %} + +{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} + +{% block mediagoblin_content %} + + <form action="{{ request.urlgen('mediagoblin.user_pages.media_confirm_delete', + user=media.get_uploader.username, + media_id=media.id) }}" + method="POST" enctype="multipart/form-data"> + <div class="form_box"> + <h1> + {%- trans title=media.title -%} + Really delete {{ title }}? + {%- endtrans %} + </h1> + + <div style="text-align: center;" > + <img src="{{ media.thumb_url }}" /> + </div> + + <br /> + + <p class="delete_checkbox_box"> + {{ form.confirm }} + {{ wtforms_util.render_label(form.confirm) }} + </p> + + <div class="form_submit_buttons"> + {# TODO: This isn't a button really... might do unexpected things :) #} + <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> + </form> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html new file mode 100644 index 00000000..2a449d45 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/processing_panel.html @@ -0,0 +1,109 @@ +{# +# 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/base.html" %} + +{% block title -%} + {% trans %}Media processing panel{% endtrans %} — {{ super() }} +{%- endblock %} + +{% block mediagoblin_content %} + +<h1>{% trans %}Media processing panel{% endtrans %}</h1> + +<p> + {% trans %}You can track the state of media being processed for your gallery here.{% endtrans %} +</p> + +<h2>{% trans %}Media in-processing{% endtrans %}</h2> + +{% if processing_entries.count() %} + <table class="media_panel processing"> + <tr> + <th>ID</th> + <th>Title</th> + <th>When submitted</th> + <th>Transcoding progress</th> + </tr> + {% for media_entry in processing_entries %} + <tr> + <td>{{ media_entry.id }}</td> + <td>{{ media_entry.title }}</td> + <td>{{ media_entry.created.strftime("%F %R") }}</td> + {% if media_entry.transcoding_progress %} + <td>{{ media_entry.transcoding_progress }}%</td> + {% else %} + <td>Unknown</td> + {% endif %} + </tr> + {% endfor %} + </table> +{% else %} + <p><em>{% trans %}No media in-processing{% endtrans %}</em></p> +{% endif %} + +<h2>{% trans %}These uploads failed to process:{% endtrans %}</h2> +{% if failed_entries.count() %} + + <table class="media_panel failed"> + <tr> + <th>ID</th> + <th>Title</th> + <th>When submitted</th> + <th>Reason for failure</th> + <th>Failure metadata</th> + </tr> + {% for media_entry in failed_entries %} + <tr> + <td>{{ media_entry.id }}</td> + <td>{{ media_entry.title }}</td> + <td>{{ media_entry.created.strftime("%F %R") }}</td> + {% if media_entry.get_fail_exception() %} + <td>{{ media_entry.get_fail_exception().general_message }}</td> + <td>{{ media_entry.fail_metadata }}</td> + {% else %} + <td> </td> + <td> </td> + {% endif %} + </tr> + {% endfor %} + </table> +{% else %} + <p><em>{% trans %}No failed entries!{% endtrans %}</em></p> +{% endif %} + +<h2>{% trans %}Your last 10 successful uploads{% endtrans %}</h2> +{% if processed_entries.count() %} + + <table class="media_panel processed"> + <tr> + <th>ID</th> + <th>Title</th> + <th>Submitted</th> + </tr> + {% for entry in processed_entries %} + <tr> + <td>{{ entry.id }}</td> + <td><a href="{{ entry.url_for_self(request.urlgen) }}">{{ entry.title }}</a></td> + <td>{{ entry.created.strftime("%F %R") }}</td> + </tr> + {% endfor %} + </table> +{% else %} + <p><em>{% trans %}No processed entries, yet!{% endtrans %}</em></p> +{% endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/user.html b/mediagoblin/templates/mediagoblin/user_pages/user.html new file mode 100644 index 00000000..71acd66c --- /dev/null +++ b/mediagoblin/templates/mediagoblin/user_pages/user.html @@ -0,0 +1,171 @@ +{# +# 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/base.html" %} + +{% from "mediagoblin/utils/object_gallery.html" import object_gallery %} + +{% block mediagoblin_head %} + <link rel="alternate" type="application/atom+xml" + href="{{ request.urlgen( + 'mediagoblin.user_pages.atom_feed', + user=user.username) }}"> +{% endblock mediagoblin_head %} + +{% block title %} + {%- if user -%} + {%- trans username=user.username -%} + {{ username }}'s profile + {%- endtrans %} — {{ super() }} + {%- else -%} + {{ super() }} + {%- endif -%} +{% endblock %} + + +{% block mediagoblin_content -%} + {# If no user... #} + {% if not user %} + <p>{% trans %}Sorry, no such user found.{% endtrans %}</p> + + {# User exists, but needs verification #} + {% elif user.status == "needs_email_verification" %} + {% if user == request.user %} + {# this should only be visible when you are this user #} + <div class="form_box"> + <h1>{% trans %}Email verification needed{% endtrans %}</h1> + + <p> + {% trans -%} + Almost done! Your account still needs to be activated. + {%- endtrans %} + </p> + <p> + {% trans -%} + An email should arrive in a few moments with instructions on how to do so. + {%- endtrans %} + </p> + <p>{% trans %}In case it doesn't:{% endtrans %}</p> + + <a href="{{ request.urlgen('mediagoblin.auth.resend_verification') }}" + class="button_action_highlight">{% trans %}Resend verification email{% endtrans %}</a> + </div> + {% else %} + {# if the user is not you, but still needs to verify their email #} + <div class="form_box"> + <h1>{% trans %}Email verification needed{% endtrans %}</h1> + + <p> + {% trans -%} + Someone has registered an account with this username, but it still has to be activated. + {%- endtrans %} + </p> + + <p> + {% trans login_url=request.urlgen('mediagoblin.auth.login') -%} + If you are that person but you've lost your verification email, you can <a href="{{ login_url }}">log in</a> and resend it. + {%- endtrans %} + </p> + </div> + {% endif %} + + {# Active(?) (or at least verified at some point) user, horray! #} + {% else %} + <h1> + {%- trans username=user.username %}{{ username }}'s profile{% endtrans -%} + </h1> + + {% if not user.url and not user.bio %} + {% if request.user and (request.user.id == user.id) %} + <div class="profile_sidebar empty_space"> + <p> + {% trans %}Here's a spot to tell others about yourself.{% endtrans %} + </p> + <a href="{{ request.urlgen('mediagoblin.edit.profile', + user=user.username) }}" class="button_action"> + {%- trans %}Edit profile{% endtrans -%} + </a> + {% else %} + <div class="profile_sidebar empty_space"> + <p> + {% trans -%} + This user hasn't filled in their profile (yet). + {%- endtrans %} + </p> + {% endif %} + {% else %} + <div class="profile_sidebar"> + {% include "mediagoblin/utils/profile.html" %} + {% if request.user and + (request.user.id == user.id or request.user.is_admin) %} + <a href="{{ request.urlgen('mediagoblin.edit.profile', + user=user.username) }}"> + {%- trans %}Edit profile{% endtrans -%} + </a> + {% endif %} + {% endif %} + <p> + <a href="{{ request.urlgen('mediagoblin.user_pages.collection_list', + user=user.username) }}"> + {%- trans %}Browse collections{% endtrans -%} + </a> + </p> + </div> + + {% if media_entries.count() %} + <div class="profile_showcase"> + {{ object_gallery(request, media_entries, pagination, + pagination_base_url=user_gallery_url, col_number=3) }} + {% include "mediagoblin/utils/object_gallery.html" %} + <div class="clear"></div> + <p> + <a href="{{ user_gallery_url }}"> + {% trans username=user.username -%} + View all of {{ username }}'s media{% endtrans -%} + </a> + </p> + {% set feed_url = request.urlgen( + 'mediagoblin.user_pages.atom_feed', + user=user.username) %} + {% include "mediagoblin/utils/feed_link.html" %} + </div> + {% else %} + {% if request.user and (request.user.id == user.id) %} + <div class="profile_showcase empty_space"> + <p> + {% trans -%} + This is where your media will appear, but you don't seem to have added anything yet. + {%- endtrans %} + </p> + <a class="button_action" + href="{{ request.urlgen('mediagoblin.submit.start') }}"> + {%- trans %}Add media{% endtrans -%} + </a> + </div> + {% else %} + <div class="profile_showcase empty_space"> + <p> + {% trans -%} + There doesn't seem to be any media here yet... + {%- endtrans %} + </p> + </div> + {% endif %} + {% endif %} + <div class="clear"></div> + {% endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/collection_gallery.html b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html new file mode 100644 index 00000000..dcc59244 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/collection_gallery.html @@ -0,0 +1,90 @@ +{# +# 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/>. +#} + +{% from "mediagoblin/utils/pagination.html" import render_pagination %} + +{% macro media_grid(request, collection_items, col_number=5) %} + <table class="thumb_gallery"> + {% for row in collection_items|batch(col_number) %} + <tr class="thumb_row + {%- if loop.first %} thumb_row_first + {%- elif loop.last %} thumb_row_last{% endif %}"> + {% for item in row %} + {% set media_entry = item.get_media_entry %} + {% set entry_url = media_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="{{ media_entry.thumb_url }}" /> + </a> + + {% if item.note %} + <a href="{{ entry_url }}">{{ item.note }}</a> + {% endif %} + {% if request.user and + (item.in_collection.creator == request.user.id or + request.user.is_admin) %} + {%- set remove_url=request.urlgen( + 'mediagoblin.user_pages.collection_item_confirm_remove', + user=item.in_collection.get_creator.username, + collection=item.in_collection.slug, + collection_item=item.id) -%} + <a href="{{ remove_url }}" class="remove"> + {%- trans %}(remove){% endtrans -%} + </a> + {% endif %} + </td> + {% endfor %} + </tr> + {% endfor %} + </table> +{%- endmacro %} + +{# + Render a media gallery with pagination. + + Args: + - request: Request + - collection_items: cursor of collection items + - pagination: Paginator object + - pagination_base_url: If you want the pagination to point to a + different URL, point it here + - col_number: How many columns per row (default 5) +#} +{% macro collection_gallery(request, collection_items, pagination, + pagination_base_url=None, col_number=5) %} + {% if collection_items and collection_items.count() %} + {{ media_grid(request, collection_items, col_number=col_number) }} + <div class="clear"></div> + {% 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 %} + {% else %} + <p> + <i> + {%- trans -%} + There doesn't seem to be any media here yet... + {%- endtrans -%} + </i> + </p> + {% endif %} +{% endmacro %} diff --git a/mediagoblin/templates/mediagoblin/utils/collections.html b/mediagoblin/templates/mediagoblin/utils/collections.html new file mode 100644 index 00000000..69738e26 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/collections.html @@ -0,0 +1,44 @@ +{# +# 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/>. +#} + +{% block collections_content -%} + {% if media.collections %} + <h3>{% trans %}Collected in{% endtrans %}</h3> + <p> + {%- for collection in media.collections %} + {%- if not loop.first %} + · + {%- endif %} + <a href="{{ collection.url_for_self(request.urlgen) }}"> + {{- collection.title }} ( + {{- collection.get_creator.username -}} + )</a> + {%- endfor %} + </p> + {%- endif %} + {%- if request.user %} + <p> + <a type="submit" href="{{ request.urlgen('mediagoblin.user_pages.media_collect', + user=media.get_uploader.username, + media_id=media.id) }}" + class="button_action"> + {% trans %}Add to a collection{% endtrans %} + </a> + </p> + {%- endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/exif.html b/mediagoblin/templates/mediagoblin/utils/exif.html new file mode 100644 index 00000000..b62208e1 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/exif.html @@ -0,0 +1,67 @@ +{# +# 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/>. +#} + +{% block exif_content %} +<noscript> + <style type="text/css"> + #exif_additional_info { + display: block; + } + </style> +</noscript> +<div id="exif_content"> + {% if app_config['exif_visible'] + and media.media_data + and media.media_data.exif_all is defined + and media.media_data.exif_all %} + <h3>Camera Information</h3> + <table id="exif_camera_information"> + <tbody> + {% for label, value in media.exif_display_data_short().iteritems() %} + <tr> + <td class="col1">{{ label }}</td> + <td>{{ value }}</td> + </tr> + {% endfor %} + </tbody> + </table> + <h3 id="exif_additional_info_button" class="button_action"> + Additional Information + </h3> + <div id="exif_additional_info"> + <table class="exif_info"> + {% for key, tag in media.exif_display_iter() %} + <tr> + <td class="col1">{{ key }}</td> + <td>{{ tag.printable }}</td> + </tr> + {% endfor %} + </table> + </div> + {% endif %} +<script type="text/javascript"> +$(document).ready(function(){ + +$("#exif_additional_info_button").click(function(){ + $("#exif_additional_info").slideToggle("slow"); +}); + +}); +</script> +</div> <!-- end exif_content div --> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/feed_link.html b/mediagoblin/templates/mediagoblin/utils/feed_link.html new file mode 100644 index 00000000..6a41cef5 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/feed_link.html @@ -0,0 +1,23 @@ +{# +# 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/>. +#} + +<a href="{{ feed_url }}"> + <img src="{{ request.staticdirect('/images/icon_feed.png') }}" + class="media_icon" alt="{% trans %}feed icon{% endtrans %}" /> +</a> +<a href="{{ feed_url }}">{%- trans %}Atom feed{% endtrans -%}</a> diff --git a/mediagoblin/templates/mediagoblin/utils/license.html b/mediagoblin/templates/mediagoblin/utils/license.html new file mode 100644 index 00000000..9dad7419 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/license.html @@ -0,0 +1,28 @@ +{# +# 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/>. +#} + +{% block license_content -%} + <h3>{% trans %}License{% endtrans %}</h3> + <p> + {% if media.license %} + <a href="{{ media.license }}">{{ media.get_license_data().abbreviation }}</a> + {% else %} + {% trans %}All rights reserved{% endtrans %} + {% endif %} + </p> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/messages.html b/mediagoblin/templates/mediagoblin/utils/messages.html new file mode 100644 index 00000000..cb45f59a --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/messages.html @@ -0,0 +1,28 @@ +{# +# 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/>. +#} + +{# Display any queued messages #} +{% set messages = fetch_messages(request) %} +{% if messages %} + <ul class="mediagoblin_messages"> + {% for msg in messages %} + <li class="message_{{ msg.level }}">{{ msg.text }}</li> + {% endfor %} + </ul> +{% endif %} + diff --git a/mediagoblin/templates/mediagoblin/utils/object_gallery.html b/mediagoblin/templates/mediagoblin/utils/object_gallery.html new file mode 100644 index 00000000..d328b552 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/object_gallery.html @@ -0,0 +1,76 @@ +{# +# 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/>. +#} + +{% from "mediagoblin/utils/pagination.html" import render_pagination %} + +{% macro media_grid(request, media_entries, col_number=5) %} + <table class="thumb_gallery"> + {% for row in media_entries|batch(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="{{ entry.thumb_url }}" /> + </a> + {% if entry.title %} + <a class="thumb_entry_title" href="{{ entry_url }}">{{ entry.title }}</a> + {% endif %} + </td> + {% endfor %} + </tr> + {% endfor %} + </table> +{%- endmacro %} + +{# + Render a media gallery with pagination. + + Args: + - request: Request + - media_entries: db cursor of media entries + - pagination: Paginator object + - pagination_base_url: If you want the pagination to point to a + different URL, point it here + - col_number: How many columns per row (default 5) +#} +{% macro object_gallery(request, media_entries, pagination, + pagination_base_url=None, col_number=5) %} + {% if media_entries and media_entries.count() %} + {{ media_grid(request, media_entries, col_number=col_number) }} + <div class="clear"></div> + {% 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 %} + {% else %} + <p> + <i> + {%- trans -%} + There doesn't seem to be any media here yet... + {%- endtrans -%} + </i> + </p> + {% endif %} +{% endmacro %} diff --git a/mediagoblin/templates/mediagoblin/utils/pagination.html b/mediagoblin/templates/mediagoblin/utils/pagination.html new file mode 100644 index 00000000..2ac990ae --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/pagination.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/>. +#} + +{% 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.full_path %} + {% endif %} + + {% if preserve_get_params %} + {% set get_params = request.GET %} + {% else %} + {% set get_params = {} %} + {% endif %} + + <div class="pagination"> + <p> + {% if pagination.has_prev %} + {% set prev_url = pagination.get_page_url_explicit( + base_url, get_params, + pagination.page - 1) %} + <a href="{{ prev_url }}">{% trans %}← Newer{% endtrans %}</a> + {% endif %} + {% if pagination.has_next %} + {% set next_url = pagination.get_page_url_explicit( + base_url, get_params, + pagination.page + 1) %} + <a href="{{ next_url }}">{% trans %}Older →{% endtrans %}</a> + {% endif %} + <br /> + {% trans %}Go to page:{% endtrans %} + {%- 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 %} + <span class="ellipsis">…</span> + {% endif %} + {%- endfor %} + </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..9e262ed9 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/prev_next.html @@ -0,0 +1,48 @@ +{# +# 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/>. +#} + +{# 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) %} + +{% if prev_entry_url or next_entry_url %} + <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 navigation_right" href="{{ next_entry_url }}"> + {% trans %}older{% endtrans %} → + </a> + {% else %} + {# This is the last entry. display greyed-out 'next' image #} + <p class="navigation_button navigation_right"> + {% trans %}older{% endtrans %} → + </p> + {% endif %} + </div> +{% endif %} diff --git a/mediagoblin/templates/mediagoblin/utils/profile.html b/mediagoblin/templates/mediagoblin/utils/profile.html new file mode 100644 index 00000000..7a3af01c --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/profile.html @@ -0,0 +1,30 @@ +{# +# 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/>. +#} + +{% block profile_content -%} + {% if user.bio %} + {% autoescape False %} + {{ user.bio_html }} + {% endautoescape %} + {% endif %} + {% if user.url %} + <p> + <a href="{{ user.url }}">{{ user.url }}</a> + </p> + {% endif %} +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/tags.html b/mediagoblin/templates/mediagoblin/utils/tags.html new file mode 100644 index 00000000..bb4bd1a5 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/tags.html @@ -0,0 +1,46 @@ +{# +# 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/>. +#} + +{% block tags_content -%} + <h3>{% trans %}Tagged with{% endtrans %}</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 %} + · + {% endif %} + <a href="{{ request.urlgen( + 'mediagoblin.user_pages.user_tag_gallery', + tag=tag['slug'], + user=media.get_uploader.username) }}">{{ tag['name'] }}</a> + {% elif loop.revindex == 2 %} + <a href="{{ request.urlgen( + 'mediagoblin.user_pages.user_tag_gallery', + tag=tag['slug'], + user=media.get_uploader.username) }}">{{ tag['name'] }}</a> + {% else %} + <a href="{{ request.urlgen( + 'mediagoblin.user_pages.user_tag_gallery', + tag=tag['slug'], + user=media.get_uploader.username) }}">{{ tag['name'] }}</a> + · + {% endif %} + {% endfor %} + </p> +{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/utils/wtforms.html b/mediagoblin/templates/mediagoblin/utils/wtforms.html new file mode 100644 index 00000000..be6976c2 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/wtforms.html @@ -0,0 +1,76 @@ +{# +# 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/>. +#} + +{# Render the label for a field #} +{% macro render_label(field) %} + {%- if field.label.text -%} + <label for="{{ field.label.field_id }}">{{ field.label.text }}</label> + {%- endif -%} +{%- endmacro %} + +{# Render the label in a <p> for a field #} +{% macro render_label_p(field) %} + {%- if field.label.text %} + <p class="form_field_label"> + {{- render_label(field) -}} + </p> + {%- endif %} +{%- endmacro %} + +{# Generically render a field #} +{% macro render_field_div(field) %} + {{- render_label_p(field) }} + <div class="form_field_input"> + {{ field }} + {%- if field.errors -%} + {% for error in field.errors %} + <p class="form_field_error">{{ error }}</p> + {% endfor %} + {%- endif %} + {%- if field.description %} + <p class="form_field_description">{{ field.description|safe }}</p> + {%- endif %} + </div> +{%- endmacro %} + +{# Auto-render a form as a series of divs #} +{% macro render_divs(form) -%} + {% for field in form %} + {{ render_field_div(field) }} + {% endfor %} +{%- endmacro %} + +{# Auto-render a form as a table #} +{% macro render_table(form) -%} + {% for field in form %} + <tr> + <th>{{ field.label.text }}</th> + <td> + {{field}} + {% if field.errors %} + <br /> + <ul class="errors"> + {% for error in field.errors %} + <li>{{error}}</li> + {% endfor %} + </ul> + {% endif %} + </td> + </tr> + {% endfor %} +{%- endmacro %} diff --git a/mediagoblin/templates/mediagoblin/webfinger/host-meta.xml b/mediagoblin/templates/mediagoblin/webfinger/host-meta.xml new file mode 100644 index 00000000..0f5fa7a3 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/webfinger/host-meta.xml @@ -0,0 +1,27 @@ +{# 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/>. +-#} +<?xml version="1.0" encoding="UTF-8"?> +<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" + xmlns:hm="http://host-meta.net/xrd/1.0"> + + <hm:Host>{{ request.host }}</hm:Host> + + <Link rel="lrdd" + template="{{ lrdd_template|replace(placeholder, '{uri}') }}"> + <Title>{{ lrdd_title }}</Title> + </Link> +</XRD> diff --git a/mediagoblin/templates/mediagoblin/webfinger/xrd.xml b/mediagoblin/templates/mediagoblin/webfinger/xrd.xml new file mode 100644 index 00000000..bb2c5905 --- /dev/null +++ b/mediagoblin/templates/mediagoblin/webfinger/xrd.xml @@ -0,0 +1,27 @@ +{# 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/>. +-#} +<?xml version="1.0" encoding="UTF-8"?> +<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"> + + <Subject>{{ subject }}</Subject> + <Alias>{{ alias }}</Alias> + {% for link in links %} + <Link + {%- for attr, value in link.attrs.items() %} {{ attr }}="{{ value}}" + {%- endfor %} /> + {%- endfor %} +</XRD> |