aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/archivalook/templates
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/plugins/archivalook/templates')
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/bits/feature_dropdown.html24
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature.html115
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_head.html5
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_primary.html54
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_secondary.html40
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_primary.html30
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_secondary.html34
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_tertiary.html40
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_primary.html33
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_secondary.html39
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_head.html23
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html53
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html56
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/feature_media_sidebar.html55
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/recent_media.html36
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/root.html81
-rw-r--r--mediagoblin/plugins/archivalook/templates/archivalook/utils/display_featured.html28
17 files changed, 746 insertions, 0 deletions
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/bits/feature_dropdown.html b/mediagoblin/plugins/archivalook/templates/archivalook/bits/feature_dropdown.html
new file mode 100644
index 00000000..289bbfac
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/bits/feature_dropdown.html
@@ -0,0 +1,24 @@
+{#
+# 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 and
+ request.user.has_privilege('featurer') %}
+ &middot;
+ <a href="{{ request.urlgen('manage-featured-media') }}">
+ {%- trans %}Feature management panel{% endtrans -%}
+ </a>
+ {% endif %}
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature.html
new file mode 100644
index 00000000..ad55f43b
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature.html
@@ -0,0 +1,115 @@
+{#
+# 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 -%}
+ <link rel="stylesheet" type="text/css"
+ href="{{ request.staticdirect('css/featured-media.css','archivalook') }}"/>
+{%- endblock mediagoblin_head %}
+
+{%- block mediagoblin_content %}
+ <form method="POST" action="" id="featured-media-panel">
+ {{ wtforms_util.render_divs(form) }}
+ <input type=submit />
+ {{ csrf_token }}
+ </form>
+
+ <h2>{% trans %}How does this work?{% endtrans %}</h2>
+ <strong><a class="highlight">{% trans %}How to feature media?{% endtrans -%}
+ </a></strong>
+ <p>
+ {% trans %}
+ Go to the page of the media entry you want to feature. Copy it's URL and
+ then paste it into a new line in the text box above. There should be only
+ one url per line. The url that you paste into the text box should be under
+ the header describing how prominent a feature it will be (whether Primary,
+ Secondary, or Tertiary). Once all of the media that you want to feature are
+ inside the text box, click the Submit Query button, and your media should be
+ displayed on the front page.
+ {% endtrans %}</p>
+
+ <strong><a class="highlight">
+ {%- trans %}Is there another way to manage featured media?{% endtrans %}
+ </a></strong>
+ <p>
+ {% trans %}
+ Yes. If you would prefer, you may go to the media homepage of the piece
+ of media you would like to feature or unfeature and look at the bar to
+ the side of the media entry. If the piece of media has not been featured
+ yet you should see a button that says "Feature". Press that button and
+ the media will be featured as a Primary Feature at the top of the page.
+ All other featured media entries will remain as features, but will be
+ pushed further down the page.<br /><br />
+
+ If you go to the media homepage of a piece of media that is currently
+ featured, you will see the options "Unfeature", "Promote" and "Demote"
+ where previously there was the button which said "Feature". Click
+ Unfeature and that media entry will no longer be displayed on the
+ front page, although you can feature it again at any point. Promote
+ moves the featured media higher up on the page and makes it more
+ prominent and Demote moves the featured media lower down and makes it
+ less prominent.
+ {% endtrans %}</p>
+
+ <strong><a class="highlight">{% trans -%}
+ What is a Primary Feature? What is a Secondary Feature?{% endtrans -%}
+ </a></strong>
+ <p>
+ {% trans %}
+ These categories just describe how prominent a feature will be on your
+ front page. Primary Features are placed at the top of the front page and are
+ much larger. Next are Secondary Features, which are slightly smaller.
+ Tertiary Features make up a grid at the bottom of the page.<br /><br />
+
+ Primary Features also can display longer descriptions than Secondary
+ Features, and Secondary Features can display longer descriptions than
+ Tertiary Features.{% endtrans %}</p>
+
+ <strong><a class="highlight">
+ {% trans %}How to decide what information is displayed when a media entry is
+ featured?{% endtrans %}</a></strong>
+ <p>
+ {% trans %}
+ When a media entry is featured, the entry's title, it's thumbnail and a
+ portion of its description will be displayed on your website's front page.
+ The number of characters displayed varies on the prominence of the feature.
+ Primary Features display the first 512 characters of their description,
+ Secondary Features display the first 256 characters of their description,
+ and Tertiary Features display the first 128 characters of their description.
+ {% endtrans %}
+ </p>
+
+ <strong><a class="highlight">{% trans -%}
+ How to unfeature a piece of media?{% endtrans -%}
+ </a></strong>
+ <p>
+ {% trans %}
+ Unfeature a media by removing its line from the above textarea and then
+ pressing the Submit Query button.
+ {% endtrans %}
+ </p>
+
+ <strong><a class="highlight">{% trans %}CAUTION:{% endtrans %}</a></strong>
+ <p>
+ {% trans %}
+ When copying and pasting urls into the above text box, be aware that if
+ you make a typo, once you press Submit Query, your media entry will NOT be
+ featured. Make sure that all your intended Media Entries are featured.
+ {% endtrans %}</p>
+{% endblock %}
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_head.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_head.html
new file mode 100644
index 00000000..a53694b3
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_head.html
@@ -0,0 +1,5 @@
+ <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>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_primary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_primary.html
new file mode 100644
index 00000000..aae3790d
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_primary.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/>.
+#}
+
+{% from "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set media = feature.media_entry %}
+{%- set entry_url = media.url_for_self(request.urlgen) %}
+
+<div class="primary-feature">
+ <a href="{{ entry_url }}">
+ <p class="f-title">{{ media.title }}</p>
+ </a>
+ <p>
+ <div class="audio-media">
+ {%- if 'spectrogram' in media.media_files %}
+ <div class="audio-spectrogram f-display">
+ <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>
+ </p>
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_secondary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_secondary.html
new file mode 100644
index 00000000..b863f5b0
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/audio_secondary.html
@@ -0,0 +1,40 @@
+{#
+# 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 "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set media = feature.media_entry %}
+{%- set entry_url = media.url_for_self(request.urlgen) %}
+{%- if feature_loop.index % 2 == 1 -%}
+<div class="secondary-feature aligned-right">
+{%- else -%}
+<div class="secondary-feature aligned-left">
+{%- endif %}
+ <p class="f-display">
+ <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" />
+ </audio>
+ </p>
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+ <a href="{{ entry_url }}">
+ <p class="f-title">{{ media.title }}</p>
+ </a>
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_primary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_primary.html
new file mode 100644
index 00000000..57986622
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_primary.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/>.
+#}
+
+{% from "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set featured_media_entry = feature.media_entry %}
+{%- set entry_url = featured_media_entry.url_for_self(request.urlgen) %}
+
+<div class="primary-feature">
+ <a href="{{ entry_url }}">
+ <p class="f-title">{{ featured_media_entry.title }}<p>
+ </a>
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_secondary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_secondary.html
new file mode 100644
index 00000000..4d2bdab9
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_secondary.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/>.
+#}
+
+
+{% from "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set featured_media_entry = feature.media_entry %}
+{%- set entry_url = featured_media_entry.url_for_self(request.urlgen) %}
+{%- if feature_loop.index % 2 == 1 -%}
+<div class="secondary-feature aligned-right">
+{%- else -%}
+<div class="secondary-feature aligned-left">
+{%- endif -%}
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+ <a href="{{ entry_url }}">
+ <p class="f-title">{{ featured_media_entry.title }}</p>
+ </a>
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_tertiary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_tertiary.html
new file mode 100644
index 00000000..90083a91
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/default_tertiary.html
@@ -0,0 +1,40 @@
+{#
+# 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 "archivalook/utils/display_featured.html" import
+ possibly_shortened_description -%}
+
+{%- set entry = feature.media_entry -%}
+{%- set entry_url = entry.url_for_self(request.urlgen) -%}
+
+{%- if feature_loop.first %}
+ {%- set row_position = "row_first" %}
+{%- elif feature_loop.last %}
+ {%- set row_position = "row_last" %}
+{%- else -%}
+ {%- set row_position = "row_center" %}
+{%- endif -%}
+
+<td class="{{ row_position }}">
+ <a href="{{ entry_url }}">
+ <img src="{{ entry.thumb_url }}" />
+ </a><span class="clear"></span>
+ <a class="f-title" href="{{ entry_url }}">{{ entry.title }}
+ </a><span class="clear"></span>
+ {{ possibly_shortened_description(request, feature.media_entry, 128) }}
+</td>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_primary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_primary.html
new file mode 100644
index 00000000..66687be9
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_primary.html
@@ -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/>.
+#}
+
+{% from "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set featured_media_entry = feature.media_entry %}
+{%- set display_media = request.app.public_store.file_url(
+ featured_media_entry.get_display_media()[1]) %}
+{%- set entry_url = featured_media_entry.url_for_self(request.urlgen) %}
+
+<div class="primary-feature">
+ <a href="{{ entry_url }}">
+ <p class="f-title">{{ featured_media_entry.title }}<p>
+ <p class="f-display"><img src="{{ display_media }}"/></p>
+ </a>
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_secondary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_secondary.html
new file mode 100644
index 00000000..0f64448a
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/image_secondary.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/>.
+#}
+
+
+{% from "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set featured_media_entry = feature.media_entry %}
+{%- set display_media = request.app.public_store.file_url(
+ featured_media_entry.get_display_media()[1]) %}
+{%- set entry_url = featured_media_entry.url_for_self(request.urlgen) %}
+{%- if feature_loop.index % 2 == 1 -%}
+<div class="secondary-feature aligned-right">
+{%- else -%}
+<div class="secondary-feature aligned-left">
+{%- endif -%}
+ <a href="{{ entry_url }}">
+ <p class="f-display"><img src="{{ display_media }}"/></p>
+ </a>
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+ <a href="{{ featured_media_entry.url_for_self(request.urlgen) }}">
+ <p class="f-title">{{ featured_media_entry.title }}</p>
+ </a>
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_head.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_head.html
new file mode 100644
index 00000000..495382f5
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_head.html
@@ -0,0 +1,23 @@
+<script type="text/javascript" src="{{
+ request.staticdirect('/extlib/video-js/video.js') }}"></script>
+{# Sadly commented out till we can get the mediagoblin skin ported over
+ # to the newest video.js release ;\ #}
+{#
+ <link href="{{ request.staticdirect('/css/vjs-mg-skin.css') }}"
+ rel="stylesheet">
+#}
+<link href="{{
+ request.staticdirect('/extlib/video-js/video-js.css') }}"
+ rel="stylesheet">
+
+<style type="text/css">
+ .vjs-default-skin .vjs-big-play-button
+ {
+ top: 50%;
+ left: 50%;
+ margin: -1.5em auto auto -2em;
+ }
+ .vjs-play-progress, .vjs-volume-level {
+ background-color: #86D4B1 !important;
+ }
+</style>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.html
new file mode 100644
index 00000000..64976257
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_primary.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/>.
+#}
+
+{% from "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set media = feature.media_entry %}
+{%- set display_media = request.app.public_store.file_url(
+ media.get_display_media()[1]) %}
+{%- set entry_url = media.url_for_self(request.urlgen) %}
+
+<div class="primary-feature">
+ <a href="{{ entry_url }}">
+ <p class="f-title">{{ media.title }}</p>
+ </a>
+ <div class="f-display">
+ {%- set display_type, display_path = media.get_display_media() %}
+ <video controls
+ {% if global_config['plugins']['mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
+ preload="auto" class="video-js vjs-default-skin">
+ <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>
+ </div>
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.html
new file mode 100644
index 00000000..92a44d49
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_displays/video_secondary.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/>.
+#}
+
+{% from "archivalook/utils/display_featured.html" import
+ possibly_shortened_description %}
+
+{%- set media = feature.media_entry %}
+{%- set display_media = request.app.public_store.file_url(
+ media.get_display_media()[1]) %}
+{%- set entry_url = media.url_for_self(request.urlgen) %}
+{%- if feature_loop.index % 2 == 1 -%}
+<div class="secondary-feature aligned-right">
+{%- else -%}
+<div class="secondary-feature aligned-left">
+{%- endif %}
+ <div class="f-display">
+ {%- set display_type, display_path = media.get_display_media() %}
+ <video controls
+ {% if global_config['plugins']['mediagoblin.media_types.video']['auto_play'] %}autoplay{% endif %}
+ preload="auto" class="video-js vjs-default-skin">
+ <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>
+ </div>
+ {{ possibly_shortened_description(request, feature.media_entry) }}
+ <a href="{{ entry_url }}">
+ <p class="f-title">{{ media.title }}</p>
+ </a>
+</div>
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/feature_media_sidebar.html b/mediagoblin/plugins/archivalook/templates/archivalook/feature_media_sidebar.html
new file mode 100644
index 00000000..c5b8a7d6
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/feature_media_sidebar.html
@@ -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/>.
+#}
+ {% if request.user and request.user.has_privilege('featurer') %}
+ {% set media_feature=featured_media.filter_by(
+ media_entry_id = media.id).first() %}
+ {% if not media_feature %}
+ <a href="{{ request.urlgen(
+ 'mediagoblin.user_pages.media_feature',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}"
+ class="button_action" id="button_featuremedia" title="{% trans %}
+Feature Media {% endtrans %}">
+ {% trans %}Feature{% endtrans %}</a>
+ {% else %}
+ <a href="{{ request.urlgen(
+ 'mediagoblin.user_pages.media_unfeature',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}"
+ class="button_action" id="button_unfeaturemedia" title="{% trans %}
+Unfeature Media {% endtrans %}">
+ {% trans %}Unfeature{% endtrans %}</a>
+ {% if not media_feature.display_type == 'primary' %}
+ <a href="{{ request.urlgen(
+ 'mediagoblin.user_pages.feature_promote',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}"
+ class="button_action" id="button_promotefeature" title="{% trans %}
+Promote Feature {% endtrans %}">
+ {% trans %}Promote{% endtrans %}</a>
+ {% endif %}{% if not media_feature.display_type == 'tertiary' %}
+ <a href="{{ request.urlgen(
+ 'mediagoblin.user_pages.feature_demote',
+ user=media.get_uploader.username,
+ media=media.slug_or_id) }}"
+ class="button_action" id="button_demotefeature" title="{% trans %}
+Demote Feature {% endtrans %}">
+ {% trans %}Demote{% endtrans %}</a>
+ {% endif %}
+ {% endif %}
+ {% endif %}
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/recent_media.html b/mediagoblin/plugins/archivalook/templates/archivalook/recent_media.html
new file mode 100644
index 00000000..09690c8f
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/recent_media.html
@@ -0,0 +1,36 @@
+{#
+# 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 %}
+ <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/plugins/archivalook/templates/archivalook/root.html b/mediagoblin/plugins/archivalook/templates/archivalook/root.html
new file mode 100644
index 00000000..4dbd0f9e
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/root.html
@@ -0,0 +1,81 @@
+{#
+# 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" %}
+
+{% 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 }}" />
+ <link rel="stylesheet" type="text/css"
+ href="{{ request.staticdirect('css/featured-media.css','archivalook') }}"/>
+
+ {% template_hook("archivalook_feature_head") %}
+{%- endblock mediagoblin_head %}
+
+{%- block mediagoblin_content %}
+ <div class="frontpage-container" >
+ {%- if featured_media.primary|length > 0 or
+ featured_media.secondary|length > 0 or
+ featured_media.tertiary|length > 0 -%}
+ {%- for feature in featured_media.primary %}
+ {% set feature_loop = loop %}
+ {% include feature_template(feature.media_entry, "primary") %}
+ {%- endfor %}
+
+ {%- for feature in featured_media.secondary %}
+ {% set feature_loop = loop %}
+ {% include feature_template(feature.media_entry, "secondary") %}
+ {%- endfor %}
+
+ <table class="tertiary-features">
+ {% set col_number = 3 %}
+ {%- for row in featured_media.tertiary|batch(col_number) %}
+ {% set row_loop = loop %}
+ <tr>
+ {%- for feature in row %}
+ {% set feature_loop = loop %}
+ {% include feature_template(feature.media_entry, "tertiary") %}
+ {%- endfor %}
+ </tr>
+ {%- endfor %}
+ </table>
+ </div>
+ {%- elif request.user and request.user.has_privilege('featurer') %}
+ <div>
+ <h2>{% trans %}Nothing is currently featured.{% endtrans %}</h2>
+ {% trans -%}
+ If you would like to feature a
+ piece of media, go to that media entry's homepage and click the button
+ that says <a class="button_action">Feature</a>.
+ {%- endtrans %}
+ {% trans featured_media_url=request.urlgen('manage-featured-media') -%}
+ You're seeing this page because you are a user capable of
+ featuring media, a regular user would see a blank page, so be sure to
+ have media featured as long as your instance has the 'archivalook'
+ plugin enabled. A more advanced tool to manage features can be found
+ in the <a href="{{ featured_media_url }}">feature management panel.</a>
+ {%- endtrans %}
+ </a>
+ </div>
+ </div>
+ {%- endif %}
+ <a href="{{ request.urlgen('gallery-recent-media') }}">
+ {% trans %}View most recent media{% endtrans %}
+ </a>
+{% endblock %}
diff --git a/mediagoblin/plugins/archivalook/templates/archivalook/utils/display_featured.html b/mediagoblin/plugins/archivalook/templates/archivalook/utils/display_featured.html
new file mode 100644
index 00000000..b3c23c0c
--- /dev/null
+++ b/mediagoblin/plugins/archivalook/templates/archivalook/utils/display_featured.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/>.
+#}
+
+{% macro possibly_shortened_description(request, entry, max_length=512) -%}
+ <p class="f-description">
+ {%- if entry.description|length < max_length %}
+ {{- entry.description -}}
+ {%- else -%}
+ {{- entry.description[:max_length] }}...
+ <a href="{{ entry.url_for_self(request.urlgen) }}">[More]</a>
+ {%- endif -%}
+ </p>
+{%- endmacro %}