Initial commit

master
Chimo 8 years ago
commit 0b32bbc6e9

@ -0,0 +1,9 @@
{
"preset": "jquery",
"validateLineBreaks": null,
"requireCamelCaseOrUpperCaseIdentifiers": null,
"maximumLineLength": 500,
"requireBlocksOnNewline": true,
"requireSpaceBeforeBlockStatements": true,
"disallowMixedSpacesAndTabs": true
}

@ -0,0 +1,14 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"undef": true,
"unused": true,
"jquery": true,
"browser": true,
"es3": true
}

@ -0,0 +1,75 @@
/**************
* containers *
**************/
.entry-wrapper,
.entry-content {
max-width: none;
width: auto;
}
.mediagoblin_content {
padding-left: 40px;
}
/***********
* gallery *
***********/
ul.thumb_gallery {
display: flex;
flex-flow: row wrap;
justify-content: space-around;
list-style-type: none;
margin: 0;
padding: 0;
}
ul.thumb_gallery li {
background: #eee;
border: 1px solid #ddd;
border-radius: 5px;
flex: 0 1 auto;
padding: 5px;
text-align: center;
}
.thumb_gallery li:hover {
background: #dadada;
border-color: #ccc;
}
/*********
* media *
*********/
figure.media_pane a img {
opacity: 1;
}
figure.media_pane a img:hover {
box-shadow: none;
transform: none;
}
/**************
* pagination *
**************/
.pagination ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.pagination li {
display: inline;
}
/*********
* utils *
*********/
.clear {
clear: both;
}

@ -0,0 +1,9 @@
( function( $ ) {
/* exif dropdown */
$( "#exif_additional_info_button" ).on( "click", function() {
$( "#exif_additional_info" ).slideToggle( "slow" );
} );
/* TODO - maps */
}( jQuery ) );

@ -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 %}Authorization{% endtrans %} &mdash; {{ super() }}
{%- endblock %}
{% block mediagoblin_content %}
<h1>{% trans %}Authorize{% endtrans %}</h1>
<p>
{% trans %}You are logged in as{% endtrans %}
<strong>{{user.username}}</strong>
<br /><br />
{% trans %}Do you want to authorize {% endtrans %}
{% if client.application_name -%}
<em>{{ client.application_name }}</em>
{%- else -%}
<em>{% trans %}an unknown application{% endtrans %}</em>
{%- endif %}
{% trans %} to access your account? {% endtrans %}
<br /><br />
{% trans %}Applications with access to your account can: {% endtrans %}
<ul>
<li>{% trans %}Post new media as you{% endtrans %}</li>
<li>{% trans %}See your information (e.g profile, media, etc...){% endtrans %}</li>
<li>{% trans %}Change your information{% endtrans %}</li>
</ul>
<br />
<form method="POST">
{{ csrf_token }}
{{ authorize_form.oauth_token }}
{{ authorize_form.oauth_verifier }}
<input type="submit" value="{% trans %}Authorize{% endtrans %}">
</form>
</p>
{% endblock %}

@ -0,0 +1,33 @@
{#
# 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 %}Authorization Finished{% endtrans %} &mdash; {{ super() }}
{%- endblock %}
{% block mediagoblin_content %}
<h1>{% trans %}Authorization Complete{% endtrans %}</h1>
<h4>{% trans %}Copy and paste this into your client:{% endtrans %}</h4>
<p class="verifier">
{{ oauth_request.verifier }}
</p>
{% endblock %}

@ -0,0 +1,55 @@
{#
# 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 %}
{{ super() }}
{% template_hook("fp_head") %}
{% endblock %}
{% block title -%}
{% trans %}Log in{% endtrans %} &mdash; {{ super() }}
{%- endblock %}
{% block mediagoblin_content %}
<form action="{{ post_url }}"
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 %}
{% template_hook("create_account") %}
{% template_hook("login_link") %}
{{ wtforms_util.render_divs(login_form, True) }}
{% template_hook("fp_link") %}
<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 %}

@ -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/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 %} &mdash; {{ super() }}
{%- endblock %}
{% block mediagoblin_content %}
<form action="{{ post_url }}"
method="POST" enctype="multipart/form-data">
<div class="form_box">
<h1>{% trans %}Create an account!{% endtrans %}</h1>
{% template_hook("register_link") %}
{{ wtforms_util.render_divs(register_form, True) }}
{{ csrf_token }}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Create{% endtrans %}"
class="button_form" />
</div>
</div>
</form>
{% endblock %}

@ -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 %}

@ -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/>.
#}
{% extends "mediagoblin/base.html" %}
{% block title %}{% trans %}You are Banned.{% endtrans %}{% endblock %}
{% block mediagoblin_content %}
<img class="right_align" src="{{ request.staticdirect('/images/404.png') }}"
alt="{% trans %}Image of goblin stressing out{% endtrans %}" style="max-width:100%;"/>
<h1>{% trans %}You have been banned{% endtrans %}
{% if expiration_date %}
{% trans until_when=expiration_date %}until {{ until_when }}{% endtrans %}
{% else %}
{% trans %}indefinitely{% endtrans %}
{% endif %}
</h2>
<p>{{ reason|safe }}</p>
<div class="clear"></div>
{% endblock %}

@ -0,0 +1,111 @@
{#
# 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>
<head>
<meta charset="utf-8" />
<title>{% block title %}{{ app_config['html_title'] }}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<!-- TODO?: Twitter Cards, Open Graph -->
<!-- TODO: favicon -->
<link rel="stylesheet" href="//chromic.org/assets/css/main.css" />
<link rel="stylesheet" href="{{ request.staticdirect('/css/styles.css', 'theme') }}" />
{% template_hook("head") %}
<!-- {% block mediagoblin_head %}
{% endblock mediagoblin_head %} -->
</head>
<body>
{% block mediagoblin_body %}
{% block mediagoblin_header %}
<!-- navigation -->
<div class="navigation-wrapper">
<nav role="navigation" id="site-nav" class="animated drop" itemscope itemtype="http://schema.org/SiteNavigationElement">
<ul>
<li>
<a href="http://chromic.org/about">About</a>
</li>
<li>
<a href="http://chromic.org/blog/">Blog</a>
</li>
<li>
<a href="http://sn.chromic.org">micro-blog</a>
</li>
<li>
<a href="http://media.chromic.org">Media</a>
</li>
<li>
<a href="http://code.chromic.org">Code</a>
</li>
<li>
<a href="http://fm.chromic.org">fm</a>
</li>
<!-- <li>
<a href="/atom/" title="Atom/RSS feed">
<i class="icon-rss"></i> Feed
</a>
</li> -->
<!-- <li class="dosearch">
<i class="icon-search"></i> Search
</li> -->
</ul>
</nav>
</div>
{% endblock %}
{% block simple_header %}
{% endblock %}
<!-- main -->
<div id="main" role="main" itemprop="mainContentOfPage">
<div class="entry-wrapper">
<div class="entry-content" itemprop="description">
<div class="container">
{% include 'mediagoblin/bits/above_content.html' %}
<div class="mediagoblin_content">
{% include "mediagoblin/utils/messages.html" %}
{% block mediagoblin_content %}
{% endblock mediagoblin_content %}
{% if csrf_token is defined %}
{% template_hook("persona_form") %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
<!-- footer -->
<div class="footer-wrapper">
<footer role="contentinfo">
{%- include "mediagoblin/bits/base_footer.html" %}
</footer>
</div>
{%- endblock mediagoblin_body %}
{% include 'mediagoblin/bits/body_end.html' %}
<!-- js -->
<script src="//chromic.org/assets/js/vendor/jquery-1.9.1.min.js"></script>
<script src="//chromic.org/assets/js/scripts.min.js"></script>
<script src="{{ request.staticdirect('/js/simple.js', 'theme') }}"></script>
</body>
</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/>.
-#}

@ -0,0 +1,35 @@
{#
# 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 %}
{% if app_config['show_tos'] %}
<p class="fine_print">
<a href="{{ request.urlgen('terms_of_service') }}">
{%- trans %}Terms of Service{%- endtrans %}
</a>
</p>
{% endif %}
</footer>
{%- endblock mediagoblin_footer -%}

@ -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/>.
-#}
{% template_hook("persona_end") %}

@ -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/>.
-#}

@ -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/>.
#}
<!-- header -->
<header class="masthead" itemscope itemtype="http://schema.org/Organization">
<div class="wrap">
<a href="http://media.chromic.org" class="site-logo" rel="home" title="Chromic" itemprop="url"><img src="http://chromic.org/images/site-logo.png" width="200" height="200" alt="Chromic logo" class="animated fadeInUp" itemprop="logo"></a>
<h1 class="site-title animated fadeIn"><a href="http://media.chromic.org">media.chromic</a></h1>
<h2 class="site-description animated fadeIn" itemprop="description">Pictures and Stuff.</h2>
</div>
</header>
<div class="clear"></div>
<!-- <img itemprop="image" alt="The Web and I" class="entry-feature-image" src="http://media.chromic.org/mgoblin_media/media_entries/350/IMG_0820.jpg"> -->

@ -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 -%}

@ -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 %} &mdash; {{ 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 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 %}

@ -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 -%}
Changing {{ username }}'s email
{%- endtrans %} &mdash; {{ super() }}
{%- endblock %}
{% block mediagoblin_content %}
<form action="{{ request.urlgen('mediagoblin.edit.email') }}"
method="POST" enctype="multipart/form-data">
<div class="form_box edit_box">
<h1>
{%- trans username=user.username -%}
Changing {{ username }}'s email
{%- endtrans -%}
</h1>
{{ wtforms_util.render_divs(form, True) }}
{{ csrf_token }}
<div class="form_submit_buttons">
<input type="submit" value="{% trans %}Save{% endtrans %}"
class="button_form" />
</div>
</div>
</form>
{% endblock %}

@ -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 button_warning" />
</div>
</div>
</form>
{% endblock %}

@ -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 %} &mdash; {{ 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 %}

@ -0,0 +1,68 @@
{#
# 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 %} &mdash; {{ 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>
{% template_hook("edit_link") %}
{{ wtforms_util.render_divs(form, True) }}
<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>
&middot;
{% template_hook("edit_link") %}
<a href="{{ request.urlgen('mediagoblin.edit.email') }}">
{% trans %}Email{% endtrans %}
</a>
{% if pass_auth is defined %}
&middot;
<a href="{{ request.urlgen('mediagoblin.plugins.basic_auth.edit.pass') }}">
{% trans %}Password{% endtrans %}
</a>
{% endif %}
</div>
{% endblock %}

@ -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 %}

@ -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 %} &mdash; {{ 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 %}

@ -0,0 +1,29 @@
{#
# 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,
We wanted to verify that you are {{ username }}. If this is the case, then
please follow the link below to verify your new email address.
{{ verification_url }}
If you are not {{ username }} or didn't request an email change, you can ignore
this email.
{%- endtrans %}

@ -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}} &mdash; {{ super() }}{% endblock %}
{% block mediagoblin_content %}
<img class="right_align" src="{{ request.staticdirect('/images/404.png') }}"
alt="{% trans %}Image of goblin stressing out{% endtrans %}" style="max-width:100%;"/>
<h1>{{ title }}</h1>
<p>{{ err_msg|safe }}</p>
<div class="clear"></div>
{% endblock %}

@ -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/>.
-#}
{# Add extra head declarations here for your theme, if appropriate #}
<script type="text/javascript"
src="{{request.staticdirect('extlib/tinymce/js/tinymce/tinymce.min.js')}}"></script>
<script type="text/javascript">
tinyMCE.init({
selector: "div.blog_form_field_input textarea",
height: 300,
width: 800,
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor"
]
})
</script>

@ -0,0 +1,44 @@
{% set notifications = get_notifications(request.user.id) %}
{% if notifications %}
<div class="header_notifications">
<h3>{% trans %}New comments{% endtrans %}</h3>
<ul>
{% for notification in notifications %}
{% set comment = notification.subject %}
{% set comment_author = comment.get_author %}
{% set media = comment.get_entry %}
<li class="comment_wrapper">
<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>
<a href="{{ request.urlgen('mediagoblin.notifications.mark_all_comment_notifications_seen') }}?next={{
request.base_url|urlencode }}" id="mark_all_comments_seen">
{% trans %}Mark all read{% endtrans %}
</a>
</div>
{% endif %}

@ -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 %} &mdash; {{ super() }}
{% endblock %}
{% block mediagoblin_content -%}
{% set feed_url = request.urlgen('mediagoblin.listings.tag_atom_feed',
tag=tag_slug) %}
<h1>
{% trans %}Media tagged with: {{ tag_name }}{% endtrans %}
<a class="fa fa-rss" href="{{ feed_url }}" title="atom feed"></a>
</h1>
{{ object_gallery(request, media_entries, pagination) }}
{% endblock %}

@ -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 %} &mdash; {{ super() }}
{% endblock %}
{% block mediagoblin_content -%}
{% set feed_url = request.urlgen('mediagoblin.listings.tag_atom_feed',
tag=tag_slug) %}
<h1>
{% trans %}Media tagged with: {{ tag_name }}{% endtrans %}
<a class="fa fa-rss" href="{{ feed_url }}" title="atom feed"></a>
</h1>
{{ object_gallery(request, media_entries, pagination) }}
{% endblock %}

@ -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 %}

@ -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 %}

@ -0,0 +1,33 @@
{#
# 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/blog_media.html' %}
{% block mediagoblin_head %}
{{ super() }}
{% endblock %}
{% block mediagoblin_media %}
<h1> {{media.title}}</h1>
<p>{{media.description|safe}}</p>
{% endblock %}

@ -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 %}

@ -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['plugins'].get('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 %}

@ -0,0 +1,149 @@
{#
# 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>