from django.contrib import admin
-class MediaFundAdmin(admin.ModelAdmin):
+class MediaFondsAdmin(admin.ModelAdmin):
search_fields = ['title', 'code']
ordering = ['code']
ordering = ['-time']
-admin.site.register(MediaFund, MediaFundAdmin)
+admin.site.register(MediaFonds, MediaFondsAdmin)
admin.site.register(MediaCorpus, MediaCorpusAdmin)
admin.site.register(MediaCollection, MediaCollectionAdmin)
admin.site.register(MediaItem, MediaItemAdmin)
from django.forms import ModelForm
from telemeta.models import *
-class MediaFundForm(ModelForm):
+class MediaFondsForm(ModelForm):
class Meta:
- model = MediaFund
+ model = MediaFonds
+
+class MediaFondsRelatedForm(ModelForm):
+ class Meta:
+ model = MediaFondsRelated
class MediaCorpusForm(ModelForm):
class Meta:
model = MediaCorpus
-
+
+class MediaCorpusRelatedForm(ModelForm):
+ class Meta:
+ model = MediaCorpusRelated
+
class MediaCollectionForm(ModelForm):
class Meta:
model = MediaCollection
def clean_doctype_code(self):
return self.cleaned_data['doctype_code'] or 0
-
+
class MediaCollectionRelatedForm(ModelForm):
class Meta:
model = MediaCollectionRelated
class MediaItemRelatedForm(ModelForm):
class Meta:
model = MediaItemRelated
-
+
class MediaItemKeywordForm(ModelForm):
class Meta:
model = MediaItemKeyword
class MediaItemPerformanceForm(ModelForm):
class Meta:
model = MediaItemPerformance
-
+
def __init__(self, *args, **kwds):
super(MediaItemPerformanceForm, self).__init__(*args, **kwds)
self.fields['instrument'].queryset = Instrument.objects.order_by('name')
/* you can make a different style for default selected value */
#nav a.selected {
-color:#f00;
+color:#FFF;
}
/* submenu, it's hidden by default */
ordering = ['code']
+class MediaRelated(MediaResource):
+ "Related media"
+
+ element_type = 'media'
+
+ title = CharField(_('title'))
+ date = DateTimeField(_('date'), auto_now=True)
+ description = TextField(_('description'))
+ mime_type = CharField(_('mime_type'), null=True)
+ url = CharField(_('url'), max_length=500)
+ credits = CharField(_('credits'))
+ file = FileField(_('file'), upload_to='items/%Y/%m/%d', db_column="filename")
+
+ def is_image(self):
+ is_url_image = False
+ if self.url:
+ url_types = ['.png', '.jpg', '.gif', '.jpeg']
+ for type in url_types:
+ if type in self.url:
+ is_url_image = True
+ return 'image' in self.mime_type or is_url_image
+
+ def save(self, force_insert=False, force_update=False):
+ super(MediaRelated, self).save(force_insert, force_update)
+
+ def set_mime_type(self):
+ if self.file:
+ self.mime_type = mimetypes.guess_type(self.file.path)[0]
+
+ def __unicode__(self):
+ if self.title and not re.match('^ *N *$', self.title):
+ title = self.title
+ else:
+ title = unicode(self.item)
+ return title
+
+ class Meta:
+ abstract = True
+
+
class MediaCollection(MediaResource):
"Describe a collection of items"
ordering = ['code']
verbose_name = _('collection')
-class MediaRelated(MediaResource):
- "Related media"
-
- element_type = 'media'
-
- title = CharField(_('title'))
- date = DateTimeField(_('date'), auto_now=True)
- description = TextField(_('description'))
- mime_type = CharField(_('mime_type'), null=True)
- url = CharField(_('url'), max_length=500)
- credits = CharField(_('credits'))
- file = FileField(_('file'), upload_to='items/%Y/%m/%d', db_column="filename")
-
- def is_image(self):
- is_url_image = False
- if self.url:
- url_types = ['.png', '.jpg', '.gif', '.jpeg']
- for type in url_types:
- if type in self.url:
- is_url_image = True
- return 'image' in self.mime_type or is_url_image
-
- def save(self, force_insert=False, force_update=False):
- super(MediaRelated, self).save(force_insert, force_update)
-
- def set_mime_type(self):
- if self.file:
- self.mime_type = mimetypes.guess_type(self.file.path)[0]
-
- def __unicode__(self):
- if self.title and not re.match('^ *N *$', self.title):
- title = self.title
- else:
- title = unicode(self.item)
- return title
-
- class Meta:
- abstract = True
class MediaCollectionRelated(MediaRelated):
"Collection related media"
"Describe a corpus"
element_type = 'corpus'
-
- collections = models.ManyToManyField(MediaCollection)
-
+ children_type = 'collections'
+
+ children = models.ManyToManyField(MediaCollection, related_name="corpus", verbose_name=_('collections'))
+
+ @property
+ def public_id(self):
+ return self.code
+
class Meta(MetaCore):
db_table = 'media_corpus'
verbose_name = _('corpus')
verbose_name_plural = _('corpus')
+class MediaFonds(MediaBaseResource):
+ "Describe fonds"
+
+ element_type = 'fonds'
+ children_type = 'corpus'
+
+ children = models.ManyToManyField(MediaCorpus, related_name="fonds", verbose_name=_('corpus'))
+
+ @property
+ def public_id(self):
+ return self.code
+
+ class Meta(MetaCore):
+ db_table = 'media_fonds'
+ verbose_name = _('fonds')
+ verbose_name_plural = _('fonds')
+
+
class MediaCorpusRelated(MediaRelated):
"Corpus related media"
- corpus = ForeignKey(MediaCorpus, related_name="related", verbose_name=_('corpus'))
+ resource = ForeignKey(MediaCorpus, related_name="related", verbose_name=_('corpus'))
class Meta(MetaCore):
db_table = 'media_corpus_related'
verbose_name = _('corpus related media')
verbose_name_plural = _('corpus related media')
-
-
-class MediaFund(MediaBaseResource):
- "Describe a fund"
-
- element_type = 'fund'
-
- corpus = models.ManyToManyField(MediaCorpus)
-
- class Meta(MetaCore):
- db_table = 'media_funds'
- verbose_name = _('fund')
-class MediaFundRelated(MediaRelated):
- "Fund related media"
+class MediaFondsRelated(MediaRelated):
+ "Fonds related media"
- fund = ForeignKey(MediaFund, related_name="related", verbose_name=_('fund'))
+ resource = ForeignKey(MediaFonds, related_name="related", verbose_name=_('fonds'))
class Meta(MetaCore):
- db_table = 'media_fund_related'
- verbose_name = _('fund related media')
- verbose_name_plural = _('fund related media')
-
-
\ No newline at end of file
+ db_table = 'media_fonds_related'
+ verbose_name = _('fonds related media')
+ verbose_name_plural = _('fonds related media')
+
class Revision(ModelCore):
"Revision made by user"
- ELEMENT_TYPE_CHOICES = (('collection', 'collection'), ('item', 'item'), ('part', 'part'), ('marker', 'marker'), ('media', 'media'))
+ ELEMENT_TYPE_CHOICES = (('collection', 'collection'), ('item', 'item'), ('part', 'part'), ('marker', 'marker'), ('media', 'media'), ('fonds', 'fonds'), ('corpus', 'corpus'))
CHANGE_TYPE_CHOICES = (('import', 'import'), ('create', 'create'), ('update', 'update'), ('delete','delete'))
element_type = CharField(_('element type'), choices=ELEMENT_TYPE_CHOICES, max_length=16, required=True)
-{% extends "telemeta_default/admin.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block stylesheets %}
+{{ block.super }}
+<link rel="stylesheet" type="text/css" href="{% url telemeta-css "admin.css" %}" />
+{% endblock %}
+
+{% block title %}
+<h1><img src="{% url telemeta-images "admin_red.png" %}" style="vertical-align:middle" /> {% trans "Administration" %}</h1>
+{% endblock %}
+
+{% block content %}
+
+{% block tab %}
+<div class="tabs">
+<ul>
+<li><a href="{% url telemeta-admin-general %}">{% trans "General administration" %}</a></li>
+<li><a href="{% url telemeta-admin-users %}">{% trans "Users" %}</a></li>
+<li><a href="{% url telemeta-admin-enumerations %}">{% trans "Enumerations" %}</a></li>
+<li><a href="{% url telemeta-instrument-edit %}">{% trans "Instruments" %}</a></li>
+</ul>
+</div>
+{% endblock tab %}
+
+<div class="tabcontents">
+ {% block tabcontents %}
+ {% endblock %}
+</div>
+
+{% endblock %}
-{% extends "telemeta_default/admin_enumerations.html" %}
+{% extends "telemeta/admin.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block tabcontents %}
+ <h4>{% trans "Enumerations" %}</h4>
+
+{% if enumerations %}
+
+ <table class="listing">
+ <thead>
+ <tr><th>{% trans "Title"%}</th></tr>
+ </thead><tbody>
+ {% for enum in enumerations %}
+ <tr><td><a href="{% url telemeta-enumeration-edit enum.id %}">
+ {{ enum.name|capfirst }}</a></td></tr>
+ {% endfor %}
+ </tbody>
+ </table>
+
+ {% else %}
+ <p class="help">{% trans "No enumerations" %}</p>
+ {% endif %}
+
+{% endblock %}
+
+
-{% extends "telemeta_default/admin_general.html" %}
+{% extends "telemeta/admin.html" %}
+{% load i18n %}
+
+{% block tabcontents %}
+ <iframe align="middle" frameborder="0" width="100%" height="600px" src="{% url telemeta-home %}admin/django/" />
+{% endblock %}
-{% extends "telemeta_default/admin_instruments.html" %}
+{% extends "telemeta/admin.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block tabcontents %}
+ <h4>{% trans "Users" %}</h4>
+
+ {% if users %}
+ <ul>
+ {% for user in users %}
+ <li>{{user.username}}</li>
+ {% endfor %}
+ </ul>
+ {% else %}
+ <p class="help">{% trans "No users" %}</p>
+ {% endif %}
+
+{% endblock %}
+
+
+
-{% extends "telemeta_default/admin_users.html" %}
+{% extends "telemeta/admin.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block tabcontents %}
+ <h4>{% trans "Users" %}</h4>
+
+ {% if users %}
+ {% include "telemeta/inc/user_list.html" %}
+ {% else %}
+ <p class="help">{% trans "No users" %}</p>
+ {% endif %}
+
+{% endblock %}
-{% extends "telemeta_default/base.html" %}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+{% load i18n %}
+{% load telemeta_utils %}
+{% get_current_language as LANGUAGE_CODE %}
+{% get_available_languages as LANGUAGES %}
+<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
+
+<head>
+<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
+<title>{%block head_title %}{% description %} - Telemeta{% endblock %}</title>
+
+{% block stylesheets %}
+<link rel="stylesheet" type="text/css" href="{% url telemeta-css "telemeta.css" %}" />
+<link rel="alternate" href="/rss" title="RSS 2.0" type="application/rss+xml" />
+<!--[if IE]>
+<link rel="stylesheet" type="text/css" href="{% url telemeta-css "telemeta_ie.css" %}" />
+<![endif]-->
+<!--[if lte IE 6]>
+<link rel="stylesheet"type="text/css" href="{% url telemeta-css "telemeta_ie6.css" %}" />
+<![endif]-->
+{% endblock %}
+
+{% block javascript %}
+<script src="{% url django.views.i18n.javascript_catalog %}" type="text/javascript"></script>
+<!--<script src="{% url telemeta-js "jquery-1.6.min.js" %}" type="text/javascript"></script>-->
+<script src="{% url telemeta-timeside "js/libs/jquery-1.6.min.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "locale.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "application.js" %}" type="text/javascript"></script>
+{% if user.is_authenticated %}
+<script type='text/javascript'>var CURRENT_USER_NAME="{{ user.username }}";</script>
+{% else %}
+<script type='text/javascript'>var CURRENT_USER_NAME=undefined;</script>
+{% endif %}
+{% endblock %}
+
+{% block extra_javascript %}{% endblock %}
+</head>
+
+<body>
+{% block layout %}
+<div id="layout">
+{% block header %}
+<div id="header">
+<div id="logo">
+{% block logo %}
+<a href="{% url telemeta-home %}"><img src="{% url telemeta-images "logo_telemeta_2.png" %}" alt="Telemeta" /></a>
+{% endblock %}
+</div>
+
+<div id="auth_info">
+{% if user.is_authenticated %}
+<img src="{% url telemeta-images "user.png" %}" alt="user" style="vertical-align:middle" />
+{% trans "Welcome" %},
+{% if user.first_name and user.last_name %}
+{{ user.first_name }} {{ user.last_name }} |
+{% else %}
+{{ user.username }} |
+{% endif %}
+<a href="{% url telemeta-profile-detail user.username %}">{% trans "Profile" %}</a> |
+<a href="{% url telemeta-flatpage "help" %}">{% trans "Help" %}</a> |
+<a href="{% url telemeta-logout %}">{% trans "Sign out" %}
+<img src="{% url telemeta-images "logout.png" %}" alt="logout" style="vertical-align:middle" /></a>
+{% else %}
+<a href="{% url telemeta-flatpage "help" %}">{% trans "Help" %}</a> |
+<a href="{% url telemeta-login %}?next={{ request.path|urlencode }}">{% trans "Sign in" %}</a>
+{% endif %}
+</div>
+
+<div id="quick_search">
+<form action="{% url telemeta-search %}" id="_quickSearchForm" method="get">
+<input type="text" id="quick_search_pattern" name="pattern" />
+<a href="#" class="component button"
+ onclick="document.getElementById('_quickSearchForm').submit(); return false;">{% trans "Search" %}</a>
+</form>
+</div>
+
+<div id="menu" class="nav">
+{% block menu %}
+
+{# spaces between li and a elements breaks layout #}
+
+<!--<ul id="nav">
+ <a href="{% url telemeta-home %}" class="darkblue">{% trans "Home" %}</a>
+ <a href="{% url telemeta-collections %}" class="blue">{% trans "Collections" %}</a>
+ <a href="{% url telemeta-items %}" class="green">{% trans "Items" %}</a></li>
+ <a href="{% url telemeta-geo-continents %}" class="yellow">{% trans "Geo Navigator" %}</a>
+ <a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Advanced search" %}</a>
+ {% if user.is_authenticated %}
+ <a href="{% url telemeta-users %}" class="red">{% trans "Users" %}</a>
+ {% endif %}
+ {% if user.is_staff %}
+ <a href="{% url telemeta-admin %}" class="violet">{% trans "Admin" %}</a>
+{% endif %}
+</ul>-->
+
+<ul id="nav">
+ <li><a href="{% url telemeta-home %}" class="blue">{% trans "Home" %}</a></li>
+
+ <li><a href="{% url telemeta-archives %}" class="green">{% trans "Archives" %}</a>
+ <ul>
+ <li><a href="{% url telemeta-fonds %}">{% trans "Fonds" %}</a></li>
+ <li><a href="{% url telemeta-corpus %}">{% trans "Corpus" %}</a></li>
+ <li><a href="{% url telemeta-collections %}">{% trans "Collections" %}</a></li>
+ <li><a href="{% url telemeta-items %}">{% trans "Items" %}</a></li>
+ </ul>
+ <div class="clear"></div>
+ </li>
+ <li><a href="{% url telemeta-geo-continents %}" class="yellow">{% trans "Geo Navigator" %}</a></li>
+ <li><a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Advanced search" %}</a></li>
+ {% if user.is_authenticated %}
+ <li><a href="{% url telemeta-users %}" class="red">{% trans "Users" %}</a></li>
+ {% endif %}
+ {% if user.is_staff %}
+ <li><a href="{% url telemeta-admin %}" class="violet">{% trans "Admin" %}</a></li>
+{% endif %}
+</ul>
+<div class="clear"></div>
+
+{% endblock %}
+</div>
+</div>
+{% endblock header %}
+
+<div id="content">
+ <table id="content_header"><tr>
+ <td class="leftcol"><h1>{% block title %}{% endblock %}</h1></td>
+ <td class="rightcol">{% block title_buttons %}{% endblock %}</td>
+ </tr></table>
+{% block content %}{% endblock %}
+<div class="nett"></div>
+{% block delete %}{% endblock %}
+</div>
+
+{% block footer %}
+<div id="footer">
+ <hr />
+ <table width="100%">
+ <tr>
+ <td>
+ <a id="telemeta_powered" href="{% telemeta_url %}" target="_blank"><img src="{% url telemeta-images "logo_mini_2.png" %}" height="30" width="93"
+ alt="Telemeta Powered"/></a>
+ <p class="left">
+ {% trans "Powered by" %} <a href="{% telemeta_url %}" target="_blank"><strong>Telemeta {% telemeta_version %}</strong></a><br />
+ {% trans "By" %} <a href="http://www.parisson.com/">Parisson SARL</a>
+ </p>
+ </td>
+ <td>
+ <p class="center">
+ {% trans "Usage of the archives in the respect of cultural heritage of the original communities." %}
+ </p>
+ </td>
+ <td>
+ <p class="right">
+ Copyright © {% current_year %} {% organization %}<br />
+ <a href="{% url telemeta-flatpage "legal_notices" %}">{% trans "Legal notices" %}</a>
+ </p>
+ </td>
+ </tr>
+ </table>
+</div>
+{% endblock %}
+</div>
+{% endblock layout %}
+
+{% block analytics %}
+{% endblock analytics %}
+
+</body>
+</html>
+++ /dev/null
-{% extends "telemeta_default/base_site.html" %}
-{% extends "telemeta_default/base_xspf.xml" %}
+<?xml version="1.0" encoding="UTF-8"?>
+<playlist version="1" xmlns="http://xspf.org/ns/0/">
+{% block listinfo %}{% endblock %}
+ <trackList>
+ {% block tracklist %}{% endblock %}
+ </trackList>
+</playlist>
+
+
-{% extends "telemeta_default/collection.m3u" %}
+#EXTM3U{% load telemeta_utils %}{% for item in collection.items.all %}
+#EXTINF:{{ item.get_duration }},{{ item }}
+http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}{% endfor %}
-{% extends "telemeta_default/collection_add.html" %}
+{% extends "telemeta/collection_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block title %}
+ <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> Collection : NEW
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-collections %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block infos %}
+ <div class="infos">
+ <form method="post" id ="_addCollectionForm" action="">{% csrf_token %}
+ <table>
+ <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
+ {% for field in form %}
+ <tr>
+ {% if field.html_name == "copied_from_item" or field.html_name == "doctype_code" %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <div align="center" style="margin-top:3ex;">
+ <a href="{% url telemeta-collections %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_addCollectionForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+{% endblock infos%}
+
+{% block delete %}
+{% endblock %}
-{% extends "telemeta_default/collection_detail.html" %}
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block head_title %}{% trans "Collection" %}{{collection|prepend:' : '}} - {{ block.super }}{% endblock %}
+
+{% block extra_javascript %}
+<script src="{% url telemeta-js "swfobject.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "popupdiv.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script>
+<script>
+ {% if user.is_authenticated %}
+ jQuery(document).ready(function(){
+ var p = playlistUtils;
+
+ {% for playlist in playlists %}
+ p.addPlaylist('{{ playlist.playlist.title }}','{{playlist.playlist.public_id}}');
+ {% endfor %}
+
+ {% if collection %}
+ var anchor = jQuery('#_add_to_playlist');
+ if(anchor.length){
+ anchor.click(function(){
+ p.showAddResourceToPlaylist(anchor,'collection','{{collection.id}}',gettrans('collection added to the selected playlist'));return false;
+ });
+ }
+ {% endif %}
+ });
+ {% endif %}
+</script>
+{% endblock %}
+
+{% if collection %}
+
+{% block title %}
+ <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" />
+ Collection :
+ <a href="{% url telemeta-collection-detail collection.public_id %}">{{ collection.title }}</a>
+{% endblock %}
+
+{% block title_buttons %}
+ <div class="fixedWidthAsPlayer">
+ {% if user.is_authenticated and perms.telemeta.change_mediacollection %}
+ <a href="{% url telemeta-collection-edit collection.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
+ <a href="{% url telemeta-collection-copy collection.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
+ <a href="{% url telemeta-collection-additem collection.public_id %}" class="component_icon button icon_add">{% trans "Add item" %}</a>
+ {% endif %}
+ {% if user.is_authenticated %}
+ <a href=# id ="_add_to_playlist" class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
+ {% endif %}
+ <a href="{% url telemeta-collection-dublincore collection.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
+ </div>
+{% endblock %}
+
+{% block content %}
+ <div class="{% if collection.has_mediafile %}{% if public_access or perms.telemeta.can_play_all_items %}with-rightcol{% endif %}{% endif %}">
+ {% if collection.has_mediafile %}
+ {% if public_access or perms.telemeta.can_play_all_items %}
+ <div id="rightcol">
+ <div id="collection_player">
+ <div class="title">
+ <h3><b>{% trans "Listen to this collection" %}</b>
+ (<a href="{% url telemeta-collection-m3u collection.public_id %}">M3U</a>,
+ <a href="{% url telemeta-collection-xspf collection.public_id %}">XSPF</a>)</h3>
+ </div>
+ <!-- This is Jeroen Wijering's Flash MP3 Player,
+ under CC Attribution-NonCommercial-ShareAlike 2.0 license
+ from: http://www.jeroenwijering.com/?item=Flash_MP3_Player-->
+ <p id="collection_player_c">
+ <a href="http://www.macromedia.com/go/getflashplayer">Get Flash</a> to see this player.
+ </p>
+ <script type="text/javascript">
+ var so = new SWFObject('{% url telemeta-swf "mp3player.swf" %}','playlist','362','200','7');
+ so.addVariable("file","{% url telemeta-collection-xspf collection.public_id %}");
+ so.addVariable("displayheight","0");
+ so.addParam("wmode", "opaque");
+ so.write('collection_player_c');
+ </script>
+ </div>
+ </div>
+ {% endif %}
+ {% endif %}
+ {% block infos %}
+ <div class="intro">
+ <span><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% if collection.items.count %}{{ collection.items.count }} {% ifequal collection.items.count 1 %}item{% else %}items{% endifequal %}{% else %}No item{% endif %}</span>
+ </div>
+ <div class="infos">
+ {% block general_info %}
+ <dl class="listing">
+ {% dl_field collection "reference" %}
+ {% dl_field collection "title" %}
+ {% dl_field collection "alt_title" %}
+ {% dl_field collection "creator" placeholder %}
+ {% dl_field collection "recording_context" %}
+ <dt>{% trans "Recording period" %}</dt>
+ <dd>{% if collection.recorded_from_year %}{{ collection.recorded_from_year }}{% endif %}{% if collection.recorded_from_year and collection.recorded_to_year %} - {% endif %}{% if collection.recorded_to_year %}{{ collection.recorded_to_year}}{% endif %}</dd>
+ {% dl_field collection "year_published" placeholder %}
+ </dl>
+ {% endblock general_info %}
+ </div>
+ <div class="extraInfos">
+ {% block geoethnic_data %}
+ <div>
+ <h4><a href="#">{% trans "Geographic and cultural informations" %}</a></h4>
+ <div>
+ <dl class="listing">
+ {% dl_field collection "countries" join with ", " %}
+ {% dl_field collection "ethnic_groups" join with ", " placeholder %}
+ </dl>
+ </div>
+ </div>
+ {% endblock geoethnic_data %}
+ </div>
+ <div class="extraInfos">
+ {% block legal_data %}
+ <div>
+ <h4><a href="#">{% trans "Legal notices" %}</a></h4>
+ <div>
+ <dl class="listing">
+ {% if collection.collector_is_creator %}
+ {% if collection.creator %}
+ <dt>{% trans "Recordist" %}</dt><dd>{{ collection.creator }}</dd>
+ {% endif%}
+ {% else %}
+ {% dl_field collection "collector" %}
+ {% endif %}
+ {% dl_field collection "publisher" %}
+ {% dl_field collection "publisher_collection" %}
+ {% dl_field collection "publisher_serial" %}
+ {% dl_field collection "booklet_author" %}
+ <dt>{% trans "Bibliographic references" %}</dt>
+ <dd>{{ collection.external_references|html_line_break|safe }}</dd>
+ {% dl_field collection "doctype_code" %}
+ {% dl_field collection "public_access_label" %}
+ {% dl_field collection "legal_rights" %}
+ </dl>
+ </div>
+ </div>
+ {% endblock legal_data %}
+ </div>
+ <div class="extraInfos">
+ {% block archive_data %}
+ <div>
+ <h4><a href="#">{% trans "Archiving data" %}</a></h4>
+ <div>
+ <dl class="listing">
+ {% dl_field collection "acquisition_mode" %}
+ {% dl_field collection "cnrs_contributor" %}
+ {% dl_field collection "metadata_author" %}
+ <dt>{% trans "Related documentation" %}</dt>
+ <dd>{{ collection.booklet_description|html_line_break|safe }}</dd>
+ {% dl_field collection "publishing_status" %}
+ {% dl_field collection "alt_ids" %}
+ <dt>{% trans "Comments" %}</dt>
+ <dd>{{ collection.comment|html_line_break|safe }}</dd>
+ {% dl_field collection "metadata_writer" %}
+ {% dl_field collection "travail" %}
+ {% dl_field collection "items_done" %}
+ {% dl_field collection "conservation_site" %}
+ </dl>
+ </div>
+ </div>
+ {% endblock archive_data %}
+ </div>
+ <div class="extraInfos">
+ {% block technical_data %}
+ <div>
+ <h4><a href="#">{% trans "Technical data" %}</a></h4>
+ <div>
+ <dl class="listing">
+ {% dl_field collection "code" %}
+ {% dl_field collection "old_code" %}
+ <dt>{% trans "Media type" %}</dt><dd>{% trans "Audio" %}</dd>
+ {% dl_field collection "approx_duration" %}
+ {% dl_field collection "computed_duration" %}
+ {% dl_field collection "physical_items_num" %}
+ <div class="wazing"></div>
+ <dt>{% trans "Number of items" %}</dt><dd>{{ collection.items.count }}</dd>
+ {% dl_field collection "physical_format" %}
+ {% dl_field collection "ad_conversion" %}
+ </dl>
+ </div>
+ </div>
+ {% endblock technical_data %}
+ </div>
+
+ <div class="extraInfos">
+ {% block related %}
+ {% include "telemeta/inc/collection_related.html" %}
+ {% endblock related %}
+ </div>
+
+ <div class="extraInfos">
+ <h4><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> Items</h4>
+ {% with "1" as location_name %}
+ {% include "telemeta/inc/mediaitem_list.html" %}
+ {% endwith %}
+ </div>
+
+ {% endblock infos %}
+ </div>
+{% endblock %}
+
+{% block delete %}
+{% if user.is_authenticated and perms.telemeta.delete_mediacollection %}
+ <a href="#" onclick="if(confirm(gettrans('delete the collection permanently?'))){window.location.href='{% url telemeta-collection-delete collection.public_id %}';};return false;"
+ class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
+{% endif %}
+
+{% endblock %}
+
+{% else %}
+ <p>No such collection</p>
+{% endif %}
+
-{% extends "telemeta_default/collection_detail_dc.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Collection" %}{{collection|prepend:': '}} - {{ block.super }}{% endblock %}
+
+{% if collection %}
+{% block title %}
+<h1>Collection: {{ collection }}</h1>
+{% endblock %}
+{% block title_buttons %}
+ <a class="component_icon button icon_previous" href="{% url telemeta-collection-detail collection.public_id %}">{% trans "Normal View" %}</a>
+{% endblock %}
+
+{% block content %}
+{% with collection|to_dublincore as resource %}
+{% include "telemeta/inc/dublincore.html" %}
+{% endwith %}
+
+{% endblock %}
+{% else %}
+ <p>{% trans "No such collection" %}</p>
+{% endif %}
-{% extends "telemeta_default/collection_edit.html" %}
+{% extends "telemeta/collection_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block title %}
+ <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> Collection : {{ collection }}
+{% endblock %}
+{% block title_buttons %}
+ <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block infos %}
+ <div class="infos">
+ <form method="post" id="_editCollectionForm" action="">{% csrf_token %}
+ <table>
+ <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
+ {% for field in form %}
+ <tr>
+ {% if field.html_name == "copied_from_item" or field.html_name == "doctype_code" %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <div align="center" style="margin-top:3ex;">
+ <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+{% endblock infos%}
+
+{% block delete %}
+{% endblock %}
-{% extends "telemeta_default/collection_list.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Media Collections" %} - {{ block.super }}{% endblock %}
+
+{% block title%}
+ <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> {% trans "Media Collections" %}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-collections %}" class="component_icon button icon_filter">{% trans "All" %}</a>
+ <a href="{% url telemeta-collections-unpublished %}" class="component_icon button icon_filter">{% trans "Unpublished" %}</a>
+ <a href="{% url telemeta-collections-published %}" class="component_icon button icon_filter">{% trans "Published" %}</a>
+ <a href="{% url telemeta-collections-sound %}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
+ {% if user.is_authenticated and perms.telemeta.add_mediacollection %}
+ <a href="{% url telemeta-collection-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+{% with object_list as collections %}
+<div class="fullpage">
+{% include "telemeta/inc/collection_list.html" %}
+</div>
+{% endwith %}
+{% endblock %}
-{% extends "telemeta_default/collection_related_edit.html" %}
+{% extends "telemeta/collection_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> Collection : {{ collection }}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form enctype="multipart/form-data" method="post" id="_editMediaCollectionRelatedFileForm" action="">{% csrf_token %}
+
+ {{ formset.management_form }}
+ {% for form in formset.forms %}
+ <hr>
+ <table>
+ <tr><td><b>{% trans "Media" %} :</b><td></td></tr>
+ {% for field in form %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <tr>
+ {% if "media_collection" in field.html_name or "id" in field.html_name or "collection" in field.html_name or "mime_type" in field.html_name %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <br />
+ {% endfor %}
+ <div align="center">
+ <a href="{% url telemeta-collection-detail collection.public_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editMediaCollectionRelatedFileForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+ {% endblock infos %}
+{% endblock content %}
-{% extends "telemeta_default/collection_xspf.xml" %}
+{% extends "telemeta/base_xspf.xml" %}
+{% load telemeta_utils %}
+
+{% block listinfo %}
+{% with collection.to_dublincore.flatten as dc %}
+ <creator>{{ dc.creator }}</creator>
+ <title>{{ dc.title }}</title>
+ <info>http://{{ host }}{% url telemeta-collection-detail collection.public_id %}</info>
+{% endwith %}
+{% endblock %}
+
+{% block tracklist %}
+{% for item in collection.items.all %}
+ <track>
+ <title>{{ item }}</title>
+ <meta rel="type">mp3</meta>
+ <location>http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}</location>
+ <duration>{{ item.computed_duration.as_seconds|mul:1000 }}</duration>
+ <info>http://{{ host }}{% url telemeta-item-detail item.public_id %}</info>
+ </track>
+{% endfor %}
+{% endblock %}
+
-{% extends "telemeta_default/country_info.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+<h2>{{ country }}</h2>
+<p>
+<a href="{% url telemeta-geo-country-items continent.flatname,country.flatname %}">
+{{ country.items|resources_num }}
+</a>
+{% trans "in" %}
+<a href="{% url telemeta-geo-country-collections continent.flatname,country.flatname %}">
+{{ country.collections|resources_num }}
+</a>
+</p>
+<!--
+{% with country.items.all.ethnic_groups as ethnic_groups %}
+{% if ethnic_groups %}
+<p>
+<b>{% trans "Populations / Social groups" %}:</b>
+{{ ethnic_groups|join:', ' }}
+</p>
+{% endif %}
+{% endwith %}
+-->
-{% extends "telemeta_default/enumeration_edit.html" %}
+{% extends "telemeta/admin.html" %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Enumeration" %}: {{ enumeration_name|capfirst }} - {{ block.super }}{% endblock %}
+
+{% block tabcontents %}
+ <h4>{% trans "Enumeration" %}: {{ enumeration_name|capfirst }}</h4>
+
+ <form class="addnew" id="_addenum" method="POST"
+ action="{% url telemeta-enumeration-add enumeration_id %}">{% csrf_token %}
+ <fieldset>
+ <legend>{% trans "Add entry" %}</legend>
+ <div class="field">
+ <label>{% trans "Value" %}: <input id="id_value_add" type="text" name="value"></label>
+
+ </div>
+ <div class="buttons">
+ <br />
+ <a href="#" class="component_icon button icon_add"
+ onclick="document.getElementById('_addenum').submit(); return false;">{% trans "Add" %}</a>
+ </div>
+ </fieldset>
+ </form>
+ {% if enumeration_values %}
+ <form id="_updateenum" method="POST" action="{% url telemeta-enumeration-update enumeration_id %}">{% csrf_token %}
+ <table class="listing">
+ <thead>
+ <tr><th class="sel"> </th><th>{% trans "Value"%}</th>
+
+ </tr>
+ </thead><tbody>
+ {% for record in enumeration_values %}
+ <tr>
+ <td><input type="checkbox" name="sel" value="{{record.id}}" /></td>
+ <td><a href="{% url telemeta-enumeration-record-edit enumeration_id,record.id %}">
+ {{record.value}}</a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <div class="buttons">
+ <br />
+ <a href="#" class="component_icon button icon_cancel"
+ onclick="document.getElementById('_updateenum').submit(); return false;">{% trans "Remove selected items" %}</a>
+ </div>
+ </form>
+ {% else %}
+ <p class="help">{% trans "This enumeration is empty" %}</p>
+ {% endif %}
+
+ <br style="clear: right"/>
+{% endblock %}
-{% extends "telemeta_default/enumeration_edit_value.html" %}
+{% extends "telemeta/admin.html" %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Enumeration" %}: {{ enumeration_name|capfirst }} - {{ block.super }}{% endblock %}
+
+{% block tabcontents %}
+ <h4>{% trans "Enumeration" %}: {{ enumeration_name|capfirst }}</h4>
+
+ <form class="mod" id="addenum" method="post"
+ action="{% url telemeta-enumeration-record-update enumeration_id,enumeration_record.id %}">{% csrf_token %}
+ <fieldset>
+ <legend>{% trans "Modify an entry" %}</legend>
+ <div class="field">
+ <label>{% trans "Value" %}: <input id="id_value_edit" type="text" name="value" value="{{enumeration_record.value}}" /></label>
+
+ </div>
+ <br />
+ <div class="buttons">
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('addenum').submit(); return false;">{% trans "Save" %}</a>
+ <a href="{% url telemeta-enumeration-edit enumeration_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ </div>
+ </fieldset>
+ </form>
+ <br style="clear: right"/>
+
+{% endblock %}
-{% extends "telemeta_default/flatpage.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% block content %}
+{{ page_content|render_flatpage }}
+{% endblock %}
-{% extends "telemeta_default/geo_continents.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
+
+{% block extra_javascript %}
+{% if gmap_key %}
+<script src="http://www.google.com/jsapi?key={{ gmap_key }}" type="text/javascript"></script>
+<script src="{% url telemeta-js "resourcemap.js" %}" type="text/javascript"></script>
+<script type="text/javascript">
+var resourceMap = new ResourceMap('.continents', {
+ 'countryInfoUri': '/geo/country_info/RESOURCEID/'
+});
+</script>
+{% endif %}
+{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "world_red.png" %}" alt="geo-navigator" style="vertical-align:middle" /> {% trans "Geographic Navigator" %}
+{% endblock %}
+
+{% block title_buttons %}
+ {% if continents %}
+ <a href="#" onclick="resourceMap.toggle('map'); return false;" class="component button">{% trans "Map" %}</a> |
+ <a href="#" onclick="resourceMap.toggle('list'); return false;" class="component button">{% trans "List" %}</a>
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+{% if continents %}
+<ul class="continents">
+{% for group in continents %}
+ <li class="name {% if not forloop.counter0|divisibleby:"2" %}odd{% endif %}"><b><a href="{% url telemeta-geo-countries group.continent.flatname %}">{{ group.continent }}</a></b>
+ <ul>
+ {% for country in group.countries %}
+ <li id="resource-{{country.id}}" class="country_name resourcemap-element">
+ <a href="{% url telemeta-geo-country-collections group.continent.flatname,country.flatname %}">
+ <span class="resourcemap-name">{{ country }}</span></a>
+ {% if not country.latitude|is_none and not country.longitude|is_none %}
+ <input type="hidden" class="resourcemap-lat" value="{{country.latitude}}" />
+ <input type="hidden" class="resourcemap-lng" value="{{country.longitude}}" />
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+ </li>
+{% endfor %}
+</ul>
+{% else %}
+<p>No data</p>
+{% endif %}
+{% endblock %}
-{% extends "telemeta_default/geo_countries.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{{ continent }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "world_red.png" %}" alt="geo-countries" style="vertical-align:middle" /> <a href="{% url telemeta-geo-continents %}">{% trans "World" %}</a> / {{ continent }}
+{% endblock title %}
+
+{% block content %}
+<table class="listing">
+ <tr>
+ <th>{% trans "Country" %}</th>
+ <th>{% trans "Number of collections" %}</th>
+ <th>{% trans "Number of items" %}</th>
+ </tr>
+ {% for country in countries %}
+ <tr>
+ <td>{{ country }}</td>
+ <td>
+ {% with country.collections.count as num %}
+ <a href="{% url telemeta-geo-country-collections continent.flatname,country.flatname %}">
+ {% blocktrans count num as counter %}1 collection{% plural %}{{ counter }} collections{% endblocktrans %}
+ </a>
+ {% endwith %}
+ </td>
+ <td>
+ {% with country.items.count as num %}
+ <a href="{% url telemeta-geo-country-items continent.flatname,country.flatname %}">
+ {% blocktrans count num as counter %}1 item{% plural %}{{ counter }} items {% endblocktrans %}
+ </a>
+ {% endwith %}
+ </td>
+ </tr>
+{% endfor %}
+</table>
+{% endblock %}
-{% extends "telemeta_default/geo_country_collections.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{{ country }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
+
+{% block title %}
+<img src="{% url telemeta-images "world_red.png" %}" alt="geo-country" style="vertical-align:middle" /> <a href="{% url telemeta-geo-continents %}">{% trans "World" %}</a> /
+ <a href="{% url telemeta-geo-countries continent.flatname %}">{{ continent }}</a> / {{ country }}
+{% endblock title %}
+
+{% block content %}
+{% with object_list as collections %}
+<div class="fullpage">
+{% include "telemeta/inc/collection_list.html" %}
+</div>
+{% endwith %}
+{% endblock %}
-{% extends "telemeta_default/geo_country_items.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{{ country }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
+
+{% block title %}
+<a href="{% url telemeta-geo-continents %}">{% trans "World" %}</a> /
+ <a href="{% url telemeta-geo-countries continent.flatname %}">{{ continent }}</a>
+ / {{ country }}
+{% endblock title %}
+
+{% block content %}
+{% with object_list as items %}
+<div class="fullpage">
+{% include "telemeta/inc/mediaitem_list.html" %}
+</div>
+{% endwith %}
+{% endblock %}
-{% extends "telemeta_default/home.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block extra_javascript %}
+<script src="{% url telemeta-js "popupdiv-min.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script>
+<script>
+ jQuery(window).ready(function(){
+ var p = playlistUtils;
+ var a = jQuery('#_new_playlist');
+ a.unbind('click').click(function(){p.showAdd(a);return false;});
+ });
+
+</script>
+{% endblock %}
+
+{% block content %}
+<div id="module-set" style="width: 33%">
+ {% block modules %}
+ {% include "telemeta/inc/module_revisions.html" %}
+ {% endblock %}
+</div>
+<div class="home-description">
+ <h1><img src="{% url telemeta-images "playlist_title.png" %}" alt="playlists" style="vertical-align:middle" /> {% trans "Playlists" %}</h1>
+ <a href=# id="_new_playlist" style="float:right" class="component_icon button icon_add">
+ {% trans "Add" %}</a>
+ {% for playlist in playlists %}
+ <table class="listing" style="width:100%;margin-top: 3em">
+ <tr>
+ <td style="border-bottom:1px solid #6A0307;color:#6A0307;font-size: 100%">{{ playlist.playlist.title }}</td>
+ <td style="width:66ex; padding-right: 0; border-bottom:1px solid #6A0307; text-align:right">
+ <a href="{% url telemeta-playlist-csv-export playlist.playlist.public_id 'collections' %}" class="component_icon button icon_csv">CSV Collections</a>
+ <a href="{% url telemeta-playlist-csv-export playlist.playlist.public_id 'items' %}" class="component_icon button icon_csv">CSV Items</a>
+ <a href="#" id="{{playlist.playlist.public_id}}" onclick="playlistUtils.remove(this.id);return false;" class="component_icon button icon_cancel">{% trans "Delete" %}</a>
+ </td>
+ </tr>
+ {% if playlist.playlist.description %}
+ <tr>
+ <td colspan="2" style="border-bottom:1px solid #6A0307;color:#6A0307;font-size: 80%">{{ playlist.playlist.description }}</td>
+ </tr>
+ {% endif %}
+ </table>
+ <table class="listing" width="100%">
+ <tr>
+ <th class="highlight">{% trans "Title" %}</th>
+ <th>{% trans "Type" %}</th>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Recordist" %}</th>
+ <th>{% trans "Recording period" %}</th>
+ <th>{% trans "Sound" %}</th>
+ <th>{% trans "Action" %}</th>
+ </tr>
+ {% for resource in playlist.resources %}
+ <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+ <td>
+ {% if resource.type == "item" and not resource.element == None %}
+ <a href="{% url telemeta-item-detail resource.element.public_id %}">{{ resource.element }}</a>
+ {% endif %}
+ {% if resource.type == "collection" and not resource.element == None %}
+ <a href="{% url telemeta-collection-detail resource.element.public_id %}">{% if resource.element.title %}{{ resource.element.title }}{% else %}{{ resource.element }}{% endif %}</a>
+ {% endif %}
+ {% if resource.type == "marker" and not resource.element == None %}
+ <a href="{% url telemeta-item-detail-marker resource.element.public_id %}">{{ resource.element }}</a>
+ {% endif %}
+ {% if resource.element == None %}{% trans "deleted" %}{% endif %}
+ </td>
+ <td>{{ resource.type }}</td>
+ <td>
+ {{ resource.element.public_id }}
+ </td>
+ <td>{{ resource.element.apparent_collector }}</td>
+
+ <td>
+ {% if resource.element.recorded_from_date %}
+ {{ resource.element.recorded_from_date.year }}
+ {% if resource.element.recorded_to_date and not resource.element.recorded_to_date.year|equals:resource.element.recorded_from_date.year %}
+ - {{ resource.element.recorded_to_date.year }}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td align="center" style="vertical-align:middle">
+ {% if resource.element.file or resource.element.has_mediafile %}
+ <img src="{% url telemeta-images "ok.png" %}" alt="yes" style="vertical-align:middle" /></a>
+ {% endif %}
+ </td>
+ <td style="vertical-align:middle">
+ <a href="#" onclick="playlistUtils.removeResource('{{resource.public_id}}');return false;" class="component_icon button icon_cancel" style="padding: 4px 12px;"></a>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% endfor %}
+</div>
+{% endblock %}
+
--- /dev/null
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% if children %}
+
+{% if hits %}
+<p class="pagination">
+{% blocktrans %}{{ resource.children_type|capitalize }} {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
+| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
+</p>
+{% endif %}
+
+<table class="listing">
+<tr>
+ <th class="highlight">{% trans "Title" %}</th>
+ <th>{% trans "Description" %}</th>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Reference" %}</th>
+</tr>
+{% for child in children %}
+{% if child.code %}
+<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+ <td class="highlight">
+ <a href="{% url telemeta-resource-detail resource.children_type child.public_id %}">{{ child.title }}</a>
+ </td>
+ <td>{{ children.code }}</td>
+ <td>{{ children.reference }}</td>
+</tr>
+{% endif %}
+{% endfor %}
+</table>
+
+{% else %}
+ <p>{% trans "No resources" %}</p>
+
+{% endif %}
+
-{% extends "telemeta_default/inc/collection_list.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+{% if collections %}
+{% if hits %}
+
+<p class="pagination">
+{% blocktrans %}Collections {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
+| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
+</p>
+{% endif %}
+<table class="listing">
+<tr>
+ <th class="highlight">{% trans "Title" %}</th>
+ <th>{% trans "Code" %}</th>
+ <th>{% field_label "MediaCollection" "creator" %}</th>
+ <th>{% trans "Recordist" %}</th>
+ <th>{% trans "Recording period" %}</th>
+ <th>{% trans "Sound" %}</th>
+</tr>
+{% for collection in collections %}
+<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+ <td class="highlight">
+ <a href="{% url telemeta-collection-detail collection.public_id %}">{{ collection.title }}</a>
+ </td>
+ <td>
+ {{ collection.code|default:collection.old_code }}
+ </td>
+ <td>{{ collection.creator }}</td>
+ <td>{{ collection.apparent_collector }}</td>
+ <td>
+ {% if collection.recorded_from_year %}
+ {{ collection.recorded_from_year }}
+ {% if collection.recorded_to_year and not collection.recorded_to_year|equals:collection.recorded_from_year %}
+ - {{ collection.recorded_to_year }}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td>
+ {% if collection.has_mediafile %}
+ <img src="images/ok.png" alt="yes" style="vertical-align:middle" />
+ {% endif %}
+ </td>
+</tr>
+{% endfor %}
+</table>
+{% else %}
+ <p>{% trans "No collection" %}</p>
+{% endif %}
+
-{% extends "telemeta_default/inc/collection_related.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+ <div>
+ <h4><a href="#">{% trans "Related media" %}</a></h4>
+ {% if related_media %}
+ <div>
+ <table class="instruments" width="100%">
+ <thead>
+ <tr>
+ <td>{% trans "Media" %}</td>
+ <td>{% trans "Preview" %}</td>
+ </tr>
+ </thead>
+ <tbody>
+ {% for media in related_media %}
+ <tr>
+ <td style="font-size: 1em;">
+ <dl class="listing">
+ <dt>{% trans "Title" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.url|get_filename }}</a>
+ {% endif %}
+ {% else %}
+ <a href="{% url telemeta-collection-related collection.public_id media.id %}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.file|get_filename }}</a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ <dt>{% trans "Description" %}</dt>
+ <dd>{{ media.description|html_line_break|safe }}</dd>
+ <dt>{% trans "Credits" %}</dt>
+ <dd>{{ media.credits }}</dd>
+ {% dl_field media "mime_type" %}
+ <dt>{% trans "URL" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
+ {% else %}
+ {% if media.file %}
+ <a href="{% url telemeta-collection-related collection.public_id media.id %}" target="_blank">
+ {% url telemeta-collection-related collection.public_id media.id %}
+ </a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ </dl>
+ </td>
+
+ <td style="padding-bottom: 1em;">{% if media.is_image %}
+ {% if media.url %}
+ <a href="{{ media.url }}">
+ <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% else %}
+ <a href="{% url telemeta-collection-related collection.public_id media.id %}">
+ <img src="{% url telemeta-collection-related collection.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% endif %}
+ {% else %}
+ {% if media.url %}
+ {% if "youtu" in media.url %}
+ <iframe width="251" height="200" src="{{ media.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+ {% if user.is_authenticated and perms.telemeta.change_mediacollection %}
+ <br /><a href="{% url telemeta-collection-related_edit collection.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+ {% endif %}
+ </div>
-{% extends "telemeta_default/inc/dublincore.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+ <h4 class="dublincore">{% trans "Dublin Core Metadata" %}</h4>
+ <dl class="dublincore">
+ <dt class="caption"><span>Element</span>Refinement</dt><dd class="caption">Value</dd>
+ {% for element in resource.elements %}
+ <dt><span>{{ element.name }}</span>{{ element.refinement|default:" " }}</dt>
+ <dd>
+ {% if element.related|is_item or element.related|is_collection %}
+ {% if element.related|is_item %}
+ <a href="{% url telemeta-item-dublincore element.related.public_id %}">{{ element.value }}</a>
+ {% else %}
+ <a href="{% url telemeta-collection-dublincore element.related.public_id %}">{{ element.value }}</a>
+ {% endif %}
+ {% else %}
+ {{ element.value }}
+ {% endif %}
+ </dd>
+ {% endfor %}
+ </dl>
-{% extends "telemeta_default/inc/mediaitem_list.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+{% if items %}
+
+{% if hits %}
+<p class="pagination">
+{% blocktrans %}Items {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
+| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
+</p>
+{% endif %}
+
+<table class="listing">
+<tr>
+ <th class="highlight">{% trans "Title" %}</th>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Recordist" %}</th>
+ {% if location_name %}
+ <th>{% trans "Location" %}</th>
+ {% else %}
+ <th>{% trans "Country/Continent" %}</th>
+ {% endif %}
+ <th>{% trans "Year of recording" %}</th>
+ <th>{% trans "Sound" %}</th>
+</tr>
+{% for item in items %}
+<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+ <td class="highlight">
+ <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
+ </td>
+ <td>
+ {{ item.code|default:item.old_code }}
+ </td>
+ <td>{{ item.apparent_collector }}</td>
+ {% if location_name %}
+ <td>{{ item.location.name }}</td>
+ {% else %}
+ <td>{{ item.country_or_continent|default:' ' }}</td>
+ {% endif %}
+ <td>
+ {% if item.recorded_from_date %}
+ {{ item.recorded_from_date.year }}
+ {% if item.recorded_to_date and not item.recorded_to_date.year|equals:item.recorded_from_date.year %}
+ - {{ item.recorded_to_date.year }}
+ {% endif %}
+ {% endif %}
+ </td>
+ <td align="center">
+ {% if item.file %}
+ <a href="{% url telemeta-item-detail item.public_id %}">
+ <img src="images/ok.png" alt="yes" style="vertical-align:middle" /></a>
+ {% endif %}
+ </td>
+</tr>
+{% endfor %}
+</table>
+
+{% else %}
+ <p>{% trans "No item" %}</p>
+{% endif %}
+
-{% extends "telemeta_default/inc/mediaitem_related.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+ <div>
+ <h4><a href="#">{% trans "Related media" %}</a></h4>
+ {% if related_media %}
+ <div>
+ <table class="instruments" width="100%">
+ <thead>
+ <tr>
+ <td>{% trans "Media" %}</td>
+ <td>{% trans "Preview" %}</td>
+ </tr>
+ </thead>
+ <tbody>
+ {% for media in related_media %}
+ <tr>
+ <td style="font-size: 1em;">
+ <dl class="listing">
+ <dt>{% trans "Title" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.url|get_filename }}</a>
+ {% endif %}
+ {% else %}
+ <a href="{% url telemeta-item-related item.public_id media.id %}" target="_blank">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.file|get_filename }}</a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ <dt>{% trans "Description" %}</dt>
+ <dd>{{ media.description|html_line_break|safe }}</dd>
+ <dt>{% trans "Credits" %}</dt>
+ <dd>{{ media.credits }}</dd>
+ {% dl_field media "mime_type" %}
+ <dt>{% trans "URL" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
+ {% else %}
+ {% if media.file %}
+ <a href="{% url telemeta-item-related item.public_id media.id %}" target="_blank">
+ {% url telemeta-item-related item.public_id media.id %}
+ </a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ </dl>
+ </td>
+
+ <td style="padding-bottom: 1em;">{% if media.is_image %}
+ {% if media.url %}
+ <a href="{{ media.url }}">
+ <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% else %}
+ <a href="{% url telemeta-item-related item.public_id media.id %}">
+ <img src="{% url telemeta-item-related item.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% endif %}
+ {% else %}
+ {% if media.url %}
+ {% if "youtu" in media.url %}
+ <iframe width="251" height="200" src="{{ media.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+ {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
+ <br /><a href="{% url telemeta-item-related_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+ {% endif %}
+ </div>
-{% extends "telemeta_default/inc/module_revisions.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+ <div class="module">
+ <h3><a href="{% url telemeta-rss %}">
+ <img src="{% url telemeta-images "rss.png" %}" alt="rss" style="vertical-align:middle" /></a>
+ {% trans "Last changes" %}</h3>
+ <a href="/rss" style="float:right" class="icon_rss"> </a>
+ <div class="vscroll">
+ <table class="listing" bgcolor="#FFFFFF" style="width: 100%">
+ <tr>
+ <th class="highlight">{% trans "Date" %}</th>
+ <th>{% trans "Title" %}</th>
+ <th>{% trans "Type" %}</th>
+ <th>{% trans "User" %}</th>
+ </tr>
+ {% for r in revisions %}
+ <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+ <td>{{ r.revision.time }}</td>
+ <td>
+ {% if r.element %}
+ {% if r.revision.element_type == "collection" %}
+ <a href="{% url telemeta-collection-detail r.element.public_id %}">{{ r.element.title }}</a>
+ {% endif %}
+ {% if r.revision.element_type == "item" %}
+ <a href="{% url telemeta-item-detail r.element.public_id %}">
+ {% if r.element.title != '' %}{{ r.element.title }}{% else %}{{ r.element.collection.title }} - {{ r.element.track }}{% endif %}</a>
+ {% endif %}
+ {% if r.revision.element_type == "marker" %}
+ <a href="{% url telemeta-item-detail-marker r.element.public_id %}">{{ r.element.title }}</a>
+ {% endif %}
+ {% else %}
+ {% trans "deleted" %}
+ {% endif %}
+ </td>
+ <td>{{ r.revision.element_type }}</td>
+ <td>{% if r.revision.user %}<a href="{% url telemeta-profile-detail r.revision.user.username %}">{{ r.revision.user.username }}</a>{% endif %}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ </div>
\ No newline at end of file
--- /dev/null
+{% load telemeta_utils %}
+{% load i18n %}
+{% if resources %}
+{% if hits %}
+
+<p class="pagination">
+{{ type|capitalize }}{% blocktrans %} from {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
+| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
+</p>
+{% endif %}
+<table class="listing">
+<tr>
+ <th class="highlight">{% trans "Title" %}</th>
+ <th>{% trans "Description" %}</th>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Reference" %}</th>
+</tr>
+{% for resource in resources %}
+<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+ <td class="highlight">
+ <a href="{% url telemeta-resource-detail type resource.public_id %}">{{ resource.title }}</a>
+ </td>
+ <td>{{ resource.description }}</td>
+ <td>{{ resource.code }}</td>
+ <td>{{ resource.reference }}</td>
+</tr>
+{% endfor %}
+</table>
+{% else %}
+ <p>{% trans "No resource" %}</p>
+{% endif %}
+
--- /dev/null
+{% load i18n %}
+{% load telemeta_utils %}
+
+ <div>
+ <h4><a href="#">{% trans "Related media" %}</a></h4>
+ {% if related_media %}
+ <div>
+ <table class="instruments" width="100%">
+ <thead>
+ <tr>
+ <td>{% trans "Media" %}</td>
+ <td>{% trans "Preview" %}</td>
+ </tr>
+ </thead>
+ <tbody>
+ {% for media in related_media %}
+ <tr>
+ <td style="font-size: 1em;">
+ <dl class="listing">
+ <dt>{% trans "Title" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.url|get_filename }}</a>
+ {% endif %}
+ {% else %}
+ <a href="{% url telemeta-resource-related type resource.public_id media.id %}">
+ {% if media.title %}
+ {{ media.title }}</a>
+ {% else %}
+ {{ media.file|get_filename }}</a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ <dt>{% trans "Description" %}</dt>
+ <dd>{{ media.description|html_line_break|safe }}</dd>
+ <dt>{% trans "Credits" %}</dt>
+ <dd>{{ media.credits }}</dd>
+ {% dl_field media "mime_type" %}
+ <dt>{% trans "URL" %}</dt>
+ <dd>
+ {% if media.url %}
+ <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
+ {% else %}
+ {% if media.file %}
+ <a href="{% url telemeta-resource-related type resource.public_id media.id %}" target="_blank">
+ {% url telemeta-resource-related type resource.public_id media.id %}
+ </a>
+ {% endif %}
+ {% endif %}
+ </dd>
+ </dl>
+ </td>
+
+ <td style="padding-bottom: 1em;">{% if media.is_image %}
+ {% if media.url %}
+ <a href="{{ media.url }}">
+ <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% else %}
+ <a href="{% url telemeta-resource-related type resource.public_id media.id %}">
+ <img src="{% url telemeta-resource-related type resource.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
+ {% endif %}
+ {% else %}
+ {% if media.url %}
+ {% if "youtu" in media.url %}
+ <iframe width="251" height="200" src="{{ media.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+ {% if user.is_authenticated and perms.telemeta.change_mediaresource %}
+ <br /><a href="{% url telemeta-resource-related_edit type resource.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+ {% endif %}
+ </div>
-{% extends "telemeta_default/inc/user_list.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+ <table class="listing" width="100%">
+ <thead>
+ <tr><th>{% trans "User"%}</th>
+ <th>{% trans "First Name"%}</th>
+ <th>{% trans "Last Name"%}</th>
+ <th>{% trans "E-mail"%}</th>
+ <th>{% trans "Groups"%}</th>
+ </tr>
+ </thead><tbody>
+ {% for user in users %}
+ <tr>
+ <td><a href="{% url telemeta-profile-detail user.username %}">{{user.username}}</a></td>
+ <td>{{ user.first_name }}</td>
+ <td>{{ user.last_name }}</td>
+ <td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>
+ <td>{% for group in user.groups.all %}{{ group }} {% endfor %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
\ No newline at end of file
-{% extends "telemeta_default/index.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block content %}
+<div class="home-content">
+<div id="module-set">
+
+{% block modules %}
+
+{% if sound_pub_item %}
+<div id="module" class="module">
+ <h3><img src="{% url telemeta-images "module_playlist.png" %}" alt="playlist" style="vertical-align:middle" />
+ {% trans "Musical selection" %}</h3>
+ <ul class="playlist">
+ <li><a href="{% url telemeta-item-detail sound_pub_item.public_id %}"><b>{{ sound_pub_item }}</b></a>{% if sound_pub_item.alt_title %} ({{ sound_pub_item.alt_title }}){% endif %}<br /><span style="font-size: 90%">{{ sound_pub_item.location.fullnames|to_string }}</span><br />
+<iframe width='376' height='215' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/items/{{ sound_pub_item.public_id }}/player/362x130/'></iframe>
+ </li>
+ </ul>
+</div>
+{% endif %}
+
+<div class="module">
+ <h3><img src="{% url telemeta-images "module_world.png" %}" alt="world" style="vertical-align:middle" />
+ {% trans "Geo Navigator" %}</h3>
+ <a class="image-link" href="{% url telemeta-geo-continents %}">
+ <img class="map-thumbnail" src="{% url telemeta-images "world2.png" %}" alt="{% trans "Open the geographic navigator" %}" style="width:398px" /></a>
+</div>
+
+{% include "telemeta/inc/module_revisions.html" %}
+
+{{ block.super }}
+<div id="module" class="module">
+ <h3><img src="/images/module_playlist.png" style="vertical-align:middle" />
+ Partenaires</h3><br />
+ <div style="background-color: white; padding: 1ex;" align="center">
+ <a href="http://www.cnrs.fr"><img class="image-link" src="{% url telemeta-images "logo-CNRS.png" %}" alt="CNRS"></a>
+ <a href="http://www.culture.gouv.fr"><img class="image-link" src="{% url telemeta-images "logo_mcc_2.png" %}" alt="MCC"></a>
+ <a href="http://www.mnhn.fr"><img class="image-link" src="{% url telemeta-images "logo-mnhn.gif" %}" alt="MNHN"></a>
+ <br /><br />
+ <a href="http://www.tge-adonis.fr"><img class="image-link" src="{% url telemeta-images "logo-adonis.jpg" %}" alt="TGE Adonis"></a>
+ </div>
+</div>
+
+{% endblock %}
+
+</div>
+
+<div class="home-description">
+<img class="align-left" src="{% url telemeta-images "vox.png" %}" alt="vox" style="vertical-align:middle;" />
+{{ page_content|render_flatpage }}
+</div>
+
+{% if sound_pub_items %}
+<div style="margin-top: 1ex;">
+<h1><img src="{% url telemeta-images "playlist_title.png" %}" alt="playlists" style="vertical-align:middle" />
+ {% trans "Musical selection" %}</h1>
+<table style="font-size: 90%"><tr>
+{% for item in sound_pub_items %}
+<td width="390"><a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>{% if item.alt_title %} ({{ item.alt_title }}){% endif %}<br /><span style="font-size: 80%">{{ item.location.fullnames|to_string }}</span><br />
+<iframe width='376' height='220' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/items/{{ item.public_id }}/player/362x130/'></iframe></td>
+{% endfor %}
+</tr>
+</table>
+</div>
+{% endif %}
+
+</div>
+{% endblock %}
-{% extends "telemeta_default/instrument_edit.html" %}
+{% extends "telemeta/admin.html" %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Instruments" %} - {{ block.super }}{% endblock %}
+
+{% block tabcontents %}
+ <h4>{% trans "Instruments" %}</h4>
+ <form class="addnew" id="_addinstru" method="POST"
+ action="{% url telemeta-instrument-add %}">{% csrf_token %}
+ <fieldset>
+ <legend>{% trans "Add entry" %}</legend>
+ <div class="field">
+ <label>{% trans "Name" %}: <input type="text" name="value"></label>
+
+ </div>
+ <div class="buttons">
+ <br />
+ <a href="#" class="component_icon button icon_add"
+ onclick="document.getElementById('_addinstru').submit(); return false;">{% trans "Add" %}</a>
+ </div>
+ </fieldset>
+ </form>
+ {% if instruments %}
+ <form id="_updateinstru" method="POST" action="{% url telemeta-instrument-update %}">{% csrf_token %}
+ <table class="listing">
+ <thead>
+ <tr><th class="sel"> </th><th>{% trans "Name"%}</th></tr>
+ </thead><tbody>
+ {% for record in instruments %}
+ <tr>
+ <td><input type="checkbox" name="sel" value="{{record.id}}" /></td>
+ <td><a href="{% url telemeta-instrument-record-edit record.id %}">
+ {{record.name}}</a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <div class="buttons">
+ <br />
+ <a href="#" class="component_icon button icon_cancel"
+ onclick="document.getElementById('_updateinstru').submit(); return false;">{% trans "Remove selected items" %}</a>
+ </div>
+ </form>
+ {% else %}
+ <p class="help">{% trans "This instrument list is empty" %}</p>
+ {% endif %}
+
+ <br style="clear: right"/>
+{% endblock %}
-{% extends "telemeta_default/instrument_edit_value.html" %}
+{% extends "telemeta/admin.html" %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Instruments" %} - {{ block.super }}{% endblock %}
+
+{% block tabcontents %}
+ <h4>{% trans "Instruments" %}</h4>
+ <form class="mod" id="addinstru" method="post"
+ action="{% url telemeta-instrument-record-update instrument.id %}">{% csrf_token %}
+ <fieldset>
+ <legend>{% trans "Modify an entry" %}</legend>
+ <div class="field">
+ <label>{% trans "Name" %}: <input type="text" name="value" value="{{instrument.name}}" /></label>
+
+ </div>
+ <br />
+ <div class="buttons">
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('addinstru').submit(); return false;">{% trans "Save" %}</a>
+ <a href="{% url telemeta-instrument-edit %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ </div>
+ </fieldset>
+ </form>
+ <br style="clear: right"/>
+{% endblock %}
-{% extends "telemeta_default/login.html" %}
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+
+{% block title %}
+ <img src="{% url telemeta-images "user_red.png" %}" style="vertical-align:middle" /> {% trans "User authentication" %}
+{% endblock %}
+
+{% block content %}
+{% if form.errors %}
+<p class="login-error">{% trans "Your username and password didn't match. Please try again." %}</p>
+{% endif %}
+<form class="login" id="_loginForm" method="post" action="{% url telemeta-login %}">{% csrf_token %}
+<p>
+{{ form.username.label_tag }}
+{{ form.username }}<br />
+{{ form.password.label_tag }}
+{{ form.password }}
+</p>
+<a href="#" class="component_icon button icon_login" style="float: right;"
+ onclick="document.getElementById('_loginForm').submit(); return false;">{% trans "Sign in" %}</a>
+<input type="hidden" name="next" value="{{ next }}" />
+<span style="align: right;"><a href="{% url telemeta-password-reset %}">{% trans "Password forgotten" %} ?</a></span>
+</form>
+{% endblock %}
-{% extends "telemeta_default/mediaitem_add.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Item" %}- {{ block.super }}{% endblock %}
+
+{% if item %}
+{% block title %}
+ <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> Item : NEW
+{% endblock %}
+
+{% block title_buttons %}
+ {% if perms.telemeta.add_mediaitem %}
+ <a href="{% url telemeta-items %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form method="post" id="_addItemForm" action="" enctype="multipart/form-data">{% csrf_token %}
+ <ul>{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</ul>
+ <table>
+ {% for field in form %}
+ <tr>
+ {% if field.html_name == "copied_from_item" %}
+ <td>{{ field.label_tag.as_hidden }}{{ field.as_hidden }}</td>
+ {% else %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{{ field.label_tag }}:</td>
+ {% if field.html_name == "collection" %}
+ <td> {% trans "Title"Â %} : {{ item.collection.title }}<br />
+ {% trans "Code"Â %} : {{ item.collection.code }}<br />
+ {{ field }}</td>
+ {% else %}
+ <td>{{ field }}</td>
+ {% endif %}
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <div align="center" style="margin-top:3ex;">
+ <a href="{% url telemeta-items %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="var d=document; d.getElementById('wait-img').style.display='inline'; setTimeout(function(){d.getElementById('_addItemForm').submit();},300); return false;">{% trans "Save" %}</a>
+ <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{% url telemeta-images "wait.gif" %}" />
+ </div>
+ </form>
+ </div>
+ {% endblock infos %}
+</div> <!-- with-rightcol -->
+{% endblock %}
+
+{% block delete %}
+{% endblock %}
+
+{% else %}
+<p>No such item</p>
+{% endif %}
-{% extends "telemeta_default/mediaitem_copy.html" %}
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Item" %}- {{ block.super }}{% endblock %}
+
+{% block extra_javascript %}
+{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> Item : NEW
+{% endblock %}
+
+{% block title_buttons %}
+ {% if user.is_authenticated and perms.telemeta.add_mediaitem %}
+ <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form enctype="multipart/form-data" id="_mediaItemCopyForm" method="post" action="">{% csrf_token %}
+ <ul>{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</ul>
+ <table>
+ {% for field in form %}
+ <tr>
+ {% if field.html_name == "copied_from_item" %}
+ <td>{{ field.label_tag.as_hidden }}{{ field.as_hidden }}</td>
+ {% else %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{{ field.label_tag }}:</td>
+ {% if field.html_name == "collection" %}
+ <td> {% trans "Title"Â %} : {{ item.collection.title }}<br />
+ {% trans "Code"Â %} : {{ item.collection.code }}<br />
+ {{ field }}</td>
+ {% else %}
+ <td>{{ field }}</td>
+ {% endif %}
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <div align="center" style="margin-top:3ex;">
+ <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_mediaItemCopyForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+ {% endblock infos %}
+{% endblock %}
+
+{% block delete %}
+{% endblock %}
+
-{% extends "telemeta_default/mediaitem_detail.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Item" %} : {% if item.title %}{{ item.title }}{% else %}{{ item.public_id}}{% endif %} - {{ block.super }}{% endblock %}
+
+{% block stylesheets %}
+{{ block.super }}
+ <link rel="stylesheet" type="text/css" href="{% url telemeta-timeside "skins/lab/style.css" %}" />
+ <link rel="stylesheet" type="text/css" href="{% url telemeta-css "player.css" %}" />
+{% endblock %}
+
+{% block extra_javascript %}
+{% if item %}
+
+{% if item.file %}
+{% if public_access or perms.telemeta.can_play_all_items %}
+<script src="{% url telemeta-timeside "js/libs/soundmanager2-nodebug-jsmin.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-timeside "js/timeside.js" %}" type="text/javascript"></script>
+{% endif %}
+{% endif %}
+
+<script src="{% url telemeta-js "popupdiv-min.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script>
+
+{% if item.file %}
+{% if public_access or perms.telemeta.can_play_all_items %}
+<script src="{% url telemeta-js "playerLoader.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "divmarker.js" %}" type="text/javascript"></script>
+{% endif %}
+{% endif %}
+
+<script type="text/javascript">
+ {% if item.file %}
+ {% if public_access or perms.telemeta.can_play_all_items %}
+ //initializing soundManager default properties
+ soundManager.flashVersion = 9;
+ soundManager.url = "{% url telemeta-timeside "swf/" %}";
+ soundManager.debugMode = false;
+ soundManager.allowPolling = true;
+ soundManager.useHTML5Audio = true;
+ soundManager.preferFlash = true;
+
+ //initializing the visualizers to be passed to the player
+ var visualizers = {};
+ {% for v in visualizers %}
+ visualizers["{{v.name}}"] = "{% url telemeta-item-visualize item.public_id,v.id,"WIDTH","HEIGHT" %}";
+ {% endfor %}
+ {% if user.is_superuser %}
+ loadPlayer('{% url telemeta-item-analyze-xml item.public_id %}',
+ "{% url telemeta-item-export item.public_id,"mp3" %}", undefined, '{{item.id}}', visualizers,
+ CURRENT_USER_NAME, //undefined if !user.is_authenticated
+ true); //true because superuser
+ {% else %}
+ loadPlayer('{% url telemeta-item-analyze-xml item.public_id %}',
+ "{% url telemeta-item-export item.public_id,"mp3" %}", undefined, '{{item.id}}', visualizers,
+ CURRENT_USER_NAME, //undefined if !user.is_authenticated
+ false); //false because not superuser
+ {% endif %}
+ {% endif %}
+ {% endif %}
+ //playlists:
+ {% if user.is_authenticated %}
+ {% for playlist in playlists %}
+ playlistUtils.addPlaylist('{{ playlist.playlist.title }}','{{playlist.playlist.public_id}}');
+ {% endfor %}
+ jQuery(window).ready(function(){
+ var anchor = jQuery('#_add_to_playlist');
+ if(anchor.length){
+ anchor.unbind('click').click(function(){
+ playlistUtils.showAddResourceToPlaylist(anchor,'item','{{item.id}}',gettrans('item added to the selected playlist'));
+ return false;
+ });
+ }
+ });
+ {% endif %}
+</script>
+{% endif %}
+{% endblock %}
+
+{% if item %}
+
+{% block title %}
+<img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" />
+Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
+{% endblock %}
+
+{% block title_buttons %}
+<div class="fixedWidthAsPlayer">
+ {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
+ <a href="{% url telemeta-item-edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
+ <a href="{% url telemeta-item-copy item.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
+ {% endif %}
+ {% if user.is_authenticated %}
+ <a id="_add_to_playlist" href='#' class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
+ {% endif %}
+ <a href="{% url telemeta-item-detail previous %}" class="component_icon button icon_previous">{% trans "Previous" %}</a>
+ <a href="{% url telemeta-item-detail next %}" class="component_icon button icon_next">{% trans "Next" %}</a>
+ <a href="{% url telemeta-item-dublincore item.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
+</div>
+{% endblock %}
+
+{% block content %}
+<div class="{% if item.file %}{% if public_access or perms.telemeta.can_play_all_items %}with-rightcol{% endif %}{% endif %}">
+ {% if item.file %}
+ {% if public_access or perms.telemeta.can_play_all_items %}
+ <div id="player_maximized" class="ts-skin-lab">
+ <a href="#" class="toggle">Minimize</a>
+ <a href="#" class="embed_player_frame"></></a>
+ <div class="wazing"></div>
+ </div>
+ <div id="rightcol">
+ <div id="player_minimized" class="ts-skin-lab">
+ <a href="#" class="toggle">Maximize</a>
+ <a href="#" class="embed_player_frame"></></a>
+ <div class="wazing"></div>
+ <div id="player" class="ts-player">
+ </div>
+ </div>
+
+ <!-- </div> -->
+ <div id="tabs_container">
+ <!-- this div will be hidden when everything is fully loaded-->
+ <span id="loading_span" href="#"><img style="vertical-align:middle" alt="wait" src="{% url telemeta-images "wait.gif" %}" />
+ <span id="loading_span_text">Loading...</span></span>
+ <a id="tab_analysis" style="display:none" class ="tab" href="#">{% trans "Analysis" %}</a><!--
+ do not let space here as it appears in the document!!!!!
+ --><a id="tab_markers" style="display:none" class="tab" href="#">{% trans "Markers" %}</a>
+ </div>
+
+ <div class="markers" id="markers_div_id"></div>
+
+ <div class="analyzer" id="analyzer_div_id">
+ <table width="100%">
+ <tr class="analyzer-title">
+ <td>{% trans "Property" %}</td>
+ <td>{% trans "Value" %}</td>
+ <td>{% trans "Unit" %}</td>
+ </tr>
+ </table>
+ </div>
+ <!--</div>-->
+
+ {% if audio_export_enabled or perms.telemeta.can_download_all_items or user.is_superuser %}
+ <div class="exporter">
+ <p><img src="{% url telemeta-images "download.png" %}" alt="download" style="vertical-align:middle" /> {% trans "Download:" %}
+ {% for format in export_formats %}
+ <a href="{% url telemeta-item-export item.public_id,format.extension %}">
+ <img src="images/{{ format.extension }}.png" style="vertical-align:middle" alt="{{ format.extension }}" /></a>
+ {% endfor %}</p>
+ </div>
+ {% endif %}
+
+ </div>
+ {% endif %}
+ {% endif %}
+
+ {% block infos %}
+ <div class="infos">
+ {% block general_info %}
+ <dl class="listing">
+ {% dl_field item "title" placeholder %}
+ {% dl_field item "alt_title" %}
+ {% dl_field item "collector" placeholder %}
+ <dt>{% field_label item "collection" %}</dt>
+ <dd><a href="{% url telemeta-collection-detail item.collection.public_id %}">{{ item.collection }}</a></dd>
+ <dt>{% trans "Recording date" %}</dt>
+
+ <dd>{% if item.recorded_from_date %}{{ item.recorded_from_date }}{% endif %}{% if item.recorded_from_date and item.recorded_to_date%} - {% endif %}{% if item.recorded_to_date %}{{ item.recorded_to_date}}{% endif %}</dd>
+
+ </dl>
+ {% endblock general_info %}
+ </div>
+ <div class="extraInfos">
+ {% block geoethnic_data %}
+ <div>
+ <h4><a href="#">{% trans "Geographic and cultural informations" %}</a></h4>
+ <dl class="listing">
+ <dt>{% trans "Location" %}</dt>
+ <dd>{% if item.location %}{{ item.location.fullnames|join:"<br/>" }}{% endif %}</dd>
+ {% dl_field item "location_comment" %}
+ {% dl_field item "cultural_area" %}
+ {% dl_field item "language" %}
+ {% if item.language_iso %}
+ <dt>{% trans "Language ISO" %}</dt>
+ <dd>{{ item.language_iso.name|to_utf8 }}</dd>
+ {% endif %}
+ {% dl_field item "ethnic_group" placeholder %}
+ <dt>{% trans "Ethnographic context" %}</dt>
+ <dd>{{ item.context_comment|html_line_break|safe }}</dd>
+ {% dl_field item "keywords" join with ", " %}
+ </dl>
+ </div>
+ {% endblock geoethnic_data %}
+ </div>
+ {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
+ <a href="{% url telemeta-item-keywords_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %} {% trans "keywords" %}</a>
+ {% endif %}
+ <div class="extraInfos">
+ {% block musical_data %}
+ <div>
+ <h4><a href="#">{% trans "Musical informations" %}</a></h4>
+ <dl class="listing">
+ {% dl_field item "vernacular_style" %}
+ {% dl_field item "generic_style" %}
+ {% dl_field item "author" %}
+ </dl>
+ {% if item.performances %}
+ <div class="instruments">
+ <table class="instruments">
+ <thead>
+ <tr>
+ <td>{% field_label "MediaItemPerformance" "instruments_num" %}</td>
+ <td>{% field_label "MediaItemPerformance" "instrument" %}</td>
+ <td>{% field_label "MediaItemPerformance" "alias" %}</td>
+ <td>{% field_label "MediaItemPerformance" "musicians" %}</td>
+ </tr>
+ </thead>
+ <tbody>
+ {% for performance in item.performances.all %}
+ <tr>
+ <td>{{ performance.instruments_num }}</td>
+ <td>{{ performance.instrument|default:"" }}</td>
+ <td>{{ performance.alias|default:"" }}</td>
+ <td>{{ performance.musicians }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+ </div>
+ {% endblock musical_data %}
+ </div>
+ {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
+ <a href="{% url telemeta-item-performances_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "performance"%}</a>
+ {% endif %}
+ <div class="extraInfos">
+ {% block general_data %}
+ <div>
+ <h4><a href="#">{% trans "General informations" %}</a></h4>
+ <dl class="listing">
+ <dt>{% trans "Remarks" %}</dt>
+ <dd>{{ item.comment|html_line_break|safe }}</dd>
+ {% dl_field item "collector_selection" %}
+ </dl>
+ </div>
+ {% endblock general_data %}
+ </div>
+ <div class="extraInfos">
+ {% block archive_data %}
+ <div>
+ <h4><a href="#">{% trans "Archiving data" %}</a></h4>
+ <dl class="listing">
+ {% dl_field item "code" %}
+ {% dl_field item "old_code" %}
+ {% dl_field item "track" %}
+ {% dl_field item "creator_reference" %}
+ <dt>{% trans "Published references" %}</dt>
+ <dd>{{ item.external_references|html_line_break|safe }}</dd>
+ {% dl_field item "public_access_label" %}
+ </dl>
+ </div>
+ {% endblock archive_data %}
+ </div>
+ <div class="extraInfos">
+ {% block technical_data %}
+ <div>
+ <h4><a href="#">{% trans "Technical data" %}</a></h4>
+ <div>
+ <dl class="listing">
+ <dt>{% trans "Media type" %}</dt><dd>{% trans "Audio" %}</dd>
+ {% dl_field item "approx_duration" %}
+ </dl>
+ </div>
+ </div>
+ {% endblock technical_data %}
+ </div>
+ {% endblock infos %}
+</div> <!-- with-rightcol -->
+
+<div class="extraInfos">
+ {% block related %}
+ {% include "telemeta/inc/mediaitem_related.html" %}
+ {% endblock related %}
+</div>
+
+{% endblock %}
+
+{% block delete %}
+{% if user.is_authenticated and perms.telemeta.delete_mediaitem %}
+ <a href="#" onclick="if(confirm(gettrans('delete the item permanently?'))){window.location.href='{% url telemeta-item-delete item.public_id %}';};return false;"
+ class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
+{% endif %}
+{% endblock %}
+
+{% else %}
+<p>No such item</p>
+{% endif %}
-{% extends "telemeta_default/mediaitem_detail_dc.html" %}
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% if item %}
+{% block title_buttons %}
+ <a class="component_icon button icon_previous" href="{% url telemeta-item-detail item.public_id %}">{% trans "Normal View" %}</a>
+{% endblock %}
+
+{% block infos %}
+{% with item|to_dublincore as resource %}
+{% include "telemeta/inc/dublincore.html" %}
+{% endwith %}
+{% endblock %}
+{% else %}
+ <p>{% trans "No such item" %}</p>
+{% endif %}
+
+{% block related %}
+{% endblock related %}
-{% extends "telemeta_default/mediaitem_edit.html" %}
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block title %}
+<img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> Item : {{ item }}
+{% endblock %}
+
+{% block title_buttons %}
+<a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block infos %}
+<div class="infos">
+ <form enctype="multipart/form-data" id="_editItemForm" method="post" action="">{% csrf_token %}
+ <table>
+ <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
+ {% for field in form %}
+ <tr>
+ {% if field.html_name == "copied_from_item" %}
+ <td>{{ field.label_tag.as_hidden }}{{ field.as_hidden }}</td>
+ {% else %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{{ field.label_tag }}:</td>
+ {% if field.html_name == "collection" %}
+ <td> {% trans "Title"Â %} : {{ item.collection.title }}<br />
+ {% trans "Code"Â %} : {{ item.collection.code }}<br />
+ {{ field }}</td>
+ {% else %}
+ <td>{{ field }}</td>
+ {% endif %}
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <div align="center" style="margin-top:3ex;">
+ <a href="{% url telemeta-item-detail item.public_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+onclick="var d=document; d.getElementById('wait-img').style.display='inline'; setTimeout(function(){d.getElementById('_editItemForm').submit();},300); return false;">{% trans "Save" %}</a>
+ <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{% url telemeta-images "wait.gif" %}" />
+ </div>
+ </form>
+</div>
+{% endblock infos %}
+
+{% block related %}
+{% endblock %}
+
+{% block delete %}
+{% endblock %}
-{% extends "telemeta_default/mediaitem_keywords_edit.html" %}
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}
+{% endblock %}
+
+ {% block title %}
+ <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> <h1>Item : {{ item }}</h1>
+ {% endblock %}
+ {% block title_buttons %}
+ <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ {% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form method="post" id="_editForm" action="">{% csrf_token %}
+
+ {{ formset.management_form }}
+ {% for form in formset.forms %}
+ <table>
+ <tr><td><b>{% trans "Keyword" %} :</b><td></td></tr>
+ {% for field in form %}
+ <tr>
+ {% if "item" in field.html_name or "id" in field.html_name %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <br />
+ {% endfor %}
+
+ <div align="center">
+ <a href="{% url telemeta-item-detail item.public_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+
+ </form>
+ </div>
+
+ {% endblock infos %}
+{% endblock content %}
-{% extends "telemeta_default/mediaitem_list.html" %}
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block head_title %}{% trans "Media Items" %} - {{ block.super }}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> {% trans "Media Items" %}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-items %}" class="component_icon button icon_filter">{% trans "All" %}</a>
+ <a href="{% url telemeta-items-sound %}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
+ {% if user.is_authenticated and perms.telemeta.add_mediaitem %}
+ <a href="{% url telemeta-item-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+{% with object_list as items %}
+<div class="fullpage">
+{% include "telemeta/inc/mediaitem_list.html" %}
+</div>
+{% endwith %}
+{% endblock %}
-{% extends "telemeta_default/mediaitem_performances_edit.html" %}
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> Item : {{ item }}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form method="post" id="_editPerformanceForm" action="">{% csrf_token %}
+
+ {{ formset.management_form }}
+ {% for form in formset.forms %}
+ <hr>
+ <table>
+ <tr><td><b>{% trans "Performance" %} :</b><td></td></tr>
+ {% for field in form %}
+ <tr>
+ {% if not "media_item" in field.html_name %}
+ {% if "id" in field.html_name %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
+ {% endif %}
+ {% else %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <br />
+ {% endfor %}
+ <div align="center">
+ <a href="{% url telemeta-item-detail item.public_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editPerformanceForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+ {% endblock infos %}
+{% endblock content %}
-{% extends "telemeta_default/mediaitem_player.html" %}
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+
+{% block stylesheets %}
+{{ block.super }}
+ <style type="text/css">
+ #rightcol {
+ width: {{width}}px;
+ }
+ .ts-skin-lab .ts-player .ts-wave {
+ height: {{height}}px;
+ }
+ </style>
+{% endblock %}
+
+{% block title %}{% endblock %}
+{% block title_buttons %}{% endblock %}
+
+{% block layout %}
+{% block content %}
+<div>
+{% if item.file %}
+ {% if public_access or user.is_staff %}
+ <div id="rightcol" style="float: left; padding-bottom:0;">
+ <div id="player_minimized" class="ts-skin-lab">
+ <div class="wazing"></div>
+ <div id="player" class="ts-player">
+ </div>
+ </div>
+ <div>
+ <span style="font-size:65%; float:left">{% organization %} - Item : <a href="{% url telemeta-item-detail item.public_id %}" target="_blank">{% if item.code %}{{ item.code }}{% else %}{{ item.old_code }}{% endif %}</a></span>
+ <span style="font-size:65%; float:right"><a href="http://telemeta.org" target="_blank">Telemeta</a> powered</span>
+ </div>
+ </div>
+ {% endif %}
+{% endif %}
+</div>
+
+{% endblock content%}
+{% endblock layout %}
+
+{% block footer %}{% endblock %}
-{% extends "telemeta_default/mediaitem_related_edit.html" %}
+{% extends "telemeta/mediaitem_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> Item : {{ item }}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form enctype="multipart/form-data" method="post" id="_editMediaItemRelatedFileForm" action="">{% csrf_token %}
+
+ {{ formset.management_form }}
+ {% for form in formset.forms %}
+ <hr>
+ <table>
+ <tr><td><b>{% trans "Media" %} :</b><td></td></tr>
+ {% for field in form %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <tr>
+ {% if "media_item" in field.html_name or "id" in field.html_name or "item" in field.html_name or "mime_type" in field.html_name %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <br />
+ {% endfor %}
+ <div align="center">
+ <a href="{% url telemeta-item-detail item.public_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editMediaItemRelatedFileForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+ {% endblock infos %}
+{% endblock content %}
-{% extends "telemeta_default/mediaitem_xspf.xml" %}
+{% extends "telemeta/base_xspf.xml" %}
+{% load telemeta_utils %}
+
+{% block tracklist %}
+ <track>
+ <title>{{ item }}</title>
+ <meta rel="type">mp3</meta>
+ <location>http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}</location>
+ <duration>{{ item.get_duration|mul:1000 }}</duration>
+ <info>http://{{ host }}{% url telemeta-item-detail item.public_id %}</info>
+ </track>
+{% endblock %}
+
-{% extends "telemeta_default/messages.html" %}
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+
+{% block content %}
+{% if messages %}
+ {% for message in messages %}
+ <h1>{{ message }}</h1>
+ <p>{{ description }}
+ {% endfor %}
+{% endif %}
+{% endblock %}
+
-{% extends "telemeta_default/paginator.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% if has_previous %}
+ <a href="?page={{ previous }}&{{ criteria|build_query_string }}">< {% trans "Previous" %}</a>
+{% endif %}
+
+{% if show_first %}
+<a href="?page=1">1</a> ...
+{% endif %}
+{% for linkpage in page_numbers %}
+ {% ifequal linkpage page %}
+ {{ page }}
+ {% else %}
+ <a href="?page={{ linkpage }}&{{ criteria|build_query_string }}">{{ linkpage }}</a>
+ {% endifequal %}
+{% endfor %}
+{% if show_last %}
+ ...
+ <a href="?page=last">{{ pages }}</a>
+{% endif %}
+{% if has_next %}
+ <a href="?page={{ next }}&{{ criteria|build_query_string }}">{% trans "Next" %} ></a>
+{% endif %}
-{% extends "telemeta_default/profile_detail.html" %}
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block head_title %}{% trans "User Profile" %} : {{ usr.username }}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "user_red.png" %}" alt="user" style="vertical-align:middle" /> {% trans "User profile" %} : {{ usr.username }}
+{% endblock %}
+
+{% block content %}
+ <div id="module-set" style="width: 33%">
+ {% block modules %}
+ <div class="module">
+ <h3><img src="{% url telemeta-images "module_playlist.png" %}" alt="playlists" style="vertical-align:middle" />
+ {% trans "Playlists" %}</h3>
+ <ul class="playlist">
+ {% for p in playlists %}
+ <li>
+ <b>{{ p.playlist.title }}</b>
+ <br />
+ <span class="info">{{ p.playlist.description }}</span>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ {% endblock %}
+ </div>
+
+ <div class="infos" style="padding-top: 1em;">
+ <dl class="listing">
+ <dt>{% trans "First Name" %}</dt><dd>{{ usr.first_name }}</dd>
+ <dt>{% trans "Last Name" %}</dt><dd>{{ usr.last_name }}</dd>
+ <dt>{% trans "Email" %}</dt><dd>{{ usr.email }}</dd>
+
+ <dt>{% trans "Institution" %}</dt><dd>{% if profile %}{{ profile.institution }}{% endif %}</dd>
+ <dt>{% trans "Function" %}</dt><dd>{% if profile %}{{ profile.function }}{% endif %}</dd>
+ <dt>{% trans "Address" %}</dt><dd>{% if profile %}{{ profile.address }}{% endif %}</dd>
+ <dt>{% trans "Telephone" %}</dt><dd>{% if profile %}{{ profile.telephone }}{% endif %}</dd>
+ <dt>{% trans "Expiration date" %}</dt><dd>{% if profile %}{{ profile.expiration_date }}{% endif %}</dd>
+
+ <dt>{% trans "Is staff" %}</dt><dd>{{ usr.is_staff }}</dd>
+ <dt>{% trans "Is superuser" %}</dt><dd>{{ usr.is_superuser }}</dd>
+ <dt>{% blocktrans count user.groups.all.count as counter %}Group{% plural %}Groups{% endblocktrans %}</dt><dd>{% for group in usr.groups.all %}{{ group }} {% endfor %}</dd>
+ <dt>{% trans "Last login" %}</dt><dd>{{ usr.last_login }}</dd>
+ {% if user.is_authenticated and user.username == usr.username %}
+ <dt>{% trans "Language" %}</dt><dd><form id="setlang" action="/i18n/setlang/" method="post">{% csrf_token %}
+ <input name="next" type="hidden" value="" />
+ <select name="language">
+ {% for lang in LANGUAGES %}
+ <option {% if lang.0 == LANGUAGE_CODE %}selected{% endif %} value="{{ lang.0 }}">{{ lang.1 }}</option>
+ {% endfor %}
+ </select>
+ <a href="#" class="component_icon button icon_ok"
+ onclick="document.getElementById('setlang').submit(); return false;">{% trans "Apply" %}</a>
+ </form>
+ </dd>
+ {% endif %}
+ </dl>
+ </div>
+
+ {% if user.is_authenticated and user.username == usr.username or user.is_staff %}
+ <a href="{% url telemeta-profile-edit usr.username %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
+ {% endif %}
+ {% if user.is_authenticated and user.username == usr.username %}
+ <a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Change password" %}</a>
+ {% endif %}
+
+ </div>
+{% endblock %}
+
-{% extends "telemeta_default/profile_edit.html" %}
+{% extends "telemeta/profile_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-profile-detail usr.username %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block content %}
+ <div class="infos" style="padding-top: 1em;">
+ <form method="POST" id="_editUserProfileForm" action="">{% csrf_token %}
+ <table>
+ {% for form in forms %}
+ {% for field in form %}
+ {% if not field.html_name in user_hidden_fields %}
+ <tr>
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{% trans field.label_tag %} : </td><td>{{ field }}</td>
+ </tr>
+ {% else %}
+ <tr>
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ {% endfor %}
+ </table>
+ <div align="center">
+ <a href="{% url telemeta-profile-detail usr.username %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editUserProfileForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+{% endblock %}
{% extends "telemeta/base.html" %}
{% load i18n %}
-{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a></div>{% endblock %}
-
{% block content %}
<p>{% trans "Thanks for spending some quality time with the Web site today." %}</p>
-{% extends "telemeta_default/registration/password_change_done.html" %}
\ No newline at end of file
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+{% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}{% trans 'Change password' %} / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %}
+
+{% block title %}<br />{% trans 'Password change successful' %}{% endblock %}
+
+{% block content %}
+
+<p>{% trans 'Your password was changed.' %}</p>
+
+{% endblock %}
-{% extends "telemeta_default/registration/password_change_form.html" %}
\ No newline at end of file
+{% extends "telemeta/base.html" %}
+{% load i18n adminmedia %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
+{% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} / <a href="../logout/">{% trans 'Log out' %}</a>{% endblock %}
+
+{% block title %}<br />{% trans 'Password change' %}{% endblock %}
+
+{% block content %}<div id="content-main">
+
+<form id="password_change" action="" method="post">{% csrf_token %}
+<div>
+{% if form.errors %}
+ <p class="errornote">
+ {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
+ </p>
+{% endif %}
+
+<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
+
+<fieldset class="aligned wide">
+
+<div class="form-row">
+ {{ form.old_password.errors }}
+ <label for="id_old_password" class="required">{% trans 'Old password' %}:</label>{{ form.old_password }}
+</div>
+
+<div class="form-row">
+ {{ form.new_password1.errors }}
+ <label for="id_new_password1" class="required">{% trans 'New password' %}:</label>{{ form.new_password1 }}
+</div>
+
+<div class="form-row">
+{{ form.new_password2.errors }}
+ <label for="id_new_password2" class="required">{% trans 'Password (again)' %}:</label>{{ form.new_password2 }}
+</div>
+
+</fieldset>
+
+<br />
+<div class="submit-row">
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('password_change').submit(); return false;">{% trans 'Change my password' %}</a>
+</div>
+
+<script type="text/javascript">document.getElementById("id_old_password").focus();</script>
+</div>
+</form></div>
+
+{% endblock %}
-{% extends "telemeta_default/registration/password_reset_complete.html" %}
\ No newline at end of file
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+
+{% block title %}<br />{% trans 'Password reset complete' %}{% endblock %}
+
+{% block content %}
+<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
+<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
+{% endblock %}
-{% extends "telemeta_default/registration/password_reset_confirm.html" %}
\ No newline at end of file
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+
+{% block title %}<br />{% trans 'Password reset' %}{% endblock %}
+
+{% block content %}
+{% if validlink %}
+<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
+
+<form id="password_confirm" action="" method="post">{% csrf_token %}
+{{ form.new_password1.errors }}
+<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
+{{ form.new_password2.errors }}
+<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
+<p><a href="#" class="component_icon button icon_save" onclick="document.getElementById('password_confirm').submit(); return false;">{% trans 'Change my password' %}</a></p>
+</form>
+
+{% else %}
+<h1>{% trans 'Password reset unsuccessful' %}</h1>
+<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
+
+{% endif %}
+{% endblock %}
-{% extends "telemeta_default/registration/password_reset_done.html" %}
\ No newline at end of file
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+
+{% block title %}<br />{% trans 'Password reset successful' %}{% endblock %}
+
+{% block content %}
+<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
+{% endblock %}
-{% extends "telemeta_default/registration/password_reset_email.html" %}
\ No newline at end of file
+{% load i18n %}{% autoescape off %}
+{% trans "You're receiving this e-mail because you requested a password reset" %}
+{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}.
+
+{% trans "Please go to the following page and choose a new password:" %}
+{% block reset_link %}
+{{ protocol }}://{{ domain }}{% url telemeta-password-reset-confirm uidb36=uid token=token %}
+{% endblock %}
+{% trans "Your username, in case you've forgotten:" %} {{ user.username }}
+
+{% trans "Thanks for using our site!" %}
+
+{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
+
+{% endautoescape %}
-{% extends "telemeta_default/registration/password_reset_form.html" %}
\ No newline at end of file
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+
+{% block title %}<br />{% trans "Password reset" %}{% endblock %}
+
+{% block content %}
+<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p>
+
+<form id="password_reset" action="" method="post">{% csrf_token %}
+{{ form.email.errors }}
+<p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <a href="#" class="component_icon button icon_ok" onclick="document.getElementById('password_reset').submit(); return false;">{% trans 'Reset my password' %}</a></p>
+</form>
+{% endblock %}
--- /dev/null
+{% extends "telemeta/resource_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block title %}
+ <img src="{% url telemeta-images "corpus_red.png" %}" style="vertical-align:middle" /> {{ type }} : {% trans "New" %}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="/archives/{{type}}/" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+
+{% block infos %}
+ <div class="infos">
+ <form method="post" id ="_addResourceForm" action="">{% csrf_token %}
+ <table>
+ <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
+ {% for field in form %}
+ <tr>
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ <div align="center" style="margin-top:3ex;">
+ <a href="/archives/{{type}}/" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_addResourceForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+{% endblock infos%}
+
+{% block delete %}
+{% endblock %}
--- /dev/null
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block head_title %}{% trans type %}{{resource|prepend:' : '}} - {{ block.super }}{% endblock %}
+
+{% block extra_javascript %}
+{% endblock %}
+
+{% if resource %}
+
+{% block title %}
+ <img src="{% url telemeta-images resource.icon %}" style="vertical-align:middle" />
+ {{ type|capitalize }} :
+ <a href="{% url telemeta-resource-detail type resource.public_id %}">{{ resource.title }}</a>
+{% endblock %}
+
+{% block title_buttons %}
+ <div class="fixedWidthAsPlayer">
+ {% if user.is_authenticated and perms.telemeta.change_mediaresource %}
+ <a href="{% url telemeta-resource-edit type resource.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
+ <a href="{% url telemeta-resource-copy type resource.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
+ {% endif %}
+ {% if user.is_authenticated %}
+ <a href=# id ="_add_to_playlist" class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
+ {% endif %}
+ <a href="{% url telemeta-resource-dublincore type resource.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
+ </div>
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="intro">
+
+ </div>
+ <div class="infos">
+ {% block general_info %}
+ <dl class="listing">
+ {% dl_field resource "reference" %}
+ {% dl_field resource "title" %}
+ {% dl_field resource "description" %}
+ {% dl_field resource "code" %}
+ </dl>
+ {% endblock general_info %}
+
+ <div class="extraInfos">
+ {% block related %}
+ {% include "telemeta/inc/resource_related.html" %}
+ {% endblock related %}
+ </div>
+
+ <div class="extraInfos">
+ <h4><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" />{{resource.children_type|capitalize }} </h4>
+ {% with resource.children.all as children %}
+ {% include "telemeta/inc/children_list.html" %}
+ {% endwith %}
+ </div>
+
+ {% endblock infos %}
+ </div>
+{% endblock %}
+
+{% block delete %}
+{% if user.is_authenticated and perms.telemeta.delete_mediaresource %}
+ <a href="#" onclick="if(confirm(gettrans('delete the resource permanently?'))){window.location.href='{% url telemeta-resource-delete type resource.public_id %}';};return false;"
+ class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
+{% endif %}
+
+{% endblock %}
+
+{% else %}
+ <p>No such resource</p>
+{% endif %}
+
--- /dev/null
+{% extends "telemeta/resource_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block title %}
+ <img src="{% url telemeta-images "corpus_red.png" %}" style="vertical-align:middle" /> {{ type }} : {{ resource }}
+{% endblock %}
+{% block title_buttons %}
+ <a href="{% url telemeta-resource-detail type resource.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block infos %}
+ <div class="infos">
+ <form method="post" id="_editCollectionForm" action="">{% csrf_token %}
+ <table>
+ <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
+ {% for field in form %}
+ <tr>
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ <div align="center" style="margin-top:3ex;">
+ <a href="{% url telemeta-resource-detail type resource.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+{% endblock infos%}
+
+{% block delete %}
+{% endblock %}
--- /dev/null
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans type %} - {{ block.super }}{% endblock %}
+
+{% block title%}
+ <img src="{% url telemeta-images "corpus_red.png" %}" style="vertical-align:middle" /> {{ type|capitalize }}
+{% endblock %}
+
+{% block title_buttons %}
+ {% if user.is_authenticated and perms.telemeta.add_mediacollection %}
+ <a href="{% url telemeta-resource-add type %}" class="component_icon button icon_add">{% trans "Add" %}</a>
+ {% endif %}
+{% endblock %}
+
+{% block content %}
+{% with object_list as resources and type as type %}
+<div class="fullpage">
+{% include "telemeta/inc/resource_list.html" %}
+</div>
+{% endwith %}
+{% endblock %}
--- /dev/null
+{% extends "telemeta/resource_detail.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block extra_javascript %}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> {{ type|capitalize }} : {{ resource }}
+{% endblock %}
+
+{% block title_buttons %}
+ <a href="{% url telemeta-resource-detail type resource.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+{% endblock %}
+
+{% block content %}
+ {% block infos %}
+ <div class="infos">
+ <form enctype="multipart/form-data" method="post" id="_editMediaRelatedFileForm" action="">{% csrf_token %}
+
+ {{ formset.management_form }}
+ {% for form in formset.forms %}
+ <hr>
+ <table>
+ <tr><td><b>{% trans "Media" %} :</b><td></td></tr>
+ {% for field in form %}
+ <tr><td class="error">{{ field.errors }}</td></tr>
+ <tr>
+ {% if "resource" in field.html_name or "id" in field.html_name or "mime_type" in field.html_name %}
+ <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
+ {% else %}
+ <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <br />
+ {% endfor %}
+ <div align="center">
+ <a href="{% url telemeta-resource-detail type resource.public_id %}"
+ class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+ <a href="#" class="component_icon button icon_save"
+ onclick="document.getElementById('_editMediaRelatedFileForm').submit(); return false;">{% trans "Save" %}</a>
+ </div>
+ </form>
+ </div>
+ {% endblock infos %}
+{% endblock content %}
-{% extends "telemeta_default/search_criteria.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Advanced Search" %} - {{ block.super }}{% endblock %}
+
+{% block stylesheets %}
+{{ block.super }}
+<link rel="stylesheet" type="text/css" href="{% url telemeta-css "jquery.autocomplete.css" %}" />
+{% endblock %}
+
+{% block extra_javascript %}
+<script src="{% url telemeta-js "jquery.bgiframe.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "jquery.autocomplete.js" %}" type="text/javascript"></script>
+<script type="text/javascript">
+function update_period(source, from_field, to_field) {
+ var from_year = $(from_field);
+ var to_year = $(to_field);
+
+ if (from_year.val() == "0") {
+ to_year.attr('disabled', '1');
+ to_year.val('0');
+ } else {
+ to_year.removeAttr('disabled');
+ if ($(source).is(to_field)) {
+ if (parseInt(from_year.val()) > parseInt(to_year.val()))
+ from_year.val(to_year.val());
+ } else if (parseInt(from_year.val()) > parseInt(to_year.val())) {
+ to_year.val(from_year.val());
+ }
+ }
+}
+
+$(document).ready(function () {
+ $('#location').autocomplete('{% url telemeta-complete-location %}', {
+ max: 20,
+ formatResult: function(data) {
+ return data[0].replace(/ *\([0-9]+.*\) *$/, '');
+ }
+ });
+ update_period('#rec_year_from', '#rec_year_to');
+ $('#rec_year_from, #rec_year_to').change(function () {
+ update_period(this, '#rec_year_from', '#rec_year_to');
+ });
+ update_period('#pub_year_from', '#pub_year_to');
+ $('#pub_year_from, #pub_year_to').change(function () {
+ update_period(this, '#pub_year_from', '#pub_year_to');
+ });
+});
+
+</script>
+{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "adv_search_red.png" %}" alt="advanced-search" style="vertical-align:middle" /> {% trans "Advanced Search" %}
+{% endblock %}
+
+{% block content %}
+<form action="{% url telemeta-search %}" id="searchform">{% csrf_token %}
+<fieldset>
+
+ <p>
+ <label for="location">{% field_label "Location" %}</label>
+ <input type="text" name="location" id="location" value="{{ criteria.location }}" />
+ </p>
+
+ <p>
+ <label for="ethnic_group">{% field_label "EthnicGroup" %}</label>
+ <select id="ethnic_group" name="ethnic_group">
+ <option value="">All ethnic groups</option>
+ {% for group in ethnic_groups %}
+ <option value="{{group.id}}" {% ifequal criteria.ethnic_group.id group.id %}selected {% endifequal %}>{{group|escape}}</option>
+ {% endfor %}
+ </select>
+ </p>
+
+ <p>
+ <label for="title">{% trans "Title" %}</label>
+ <input type="text" id="title" name="title" />
+ </p>
+
+ <p>
+ <label for="creator">{% field_label "MediaCollection" "creator" %}</label>
+ <input type="text" id="creator" name="creator" />
+ </p>
+
+ <p>
+ <label for="collector">{% field_label "MediaCollection" "collector" %}</label>
+ <input type="text" id="collector" name="collector" />
+ </p>
+
+ {% if rec_years %}
+ <p>
+ <label for="rec_date_from">{% trans "Year of recording" %}</label>
+ <select id="rec_year_from" name="rec_year_from" class="tiny">
+ <option value="0"></option>
+ {% for year in rec_years %}
+ <option value="{{ year }}" {% ifequal criteria.rec_year_from year %}selected {% endifequal %}>{{year}}</option>
+ {% endfor %}
+ </select>
+ {% trans "to" %}
+ <select id="rec_year_to" name="rec_year_to" class="tiny">
+ <option value="0"></option>
+ {% for year in rec_years %}
+ <option value="{{ year }}" {% ifequal criteria.rec_year_to year %}selected {% endifequal %}>{{year}}</option>
+ {% endfor %}
+ </select>
+ </p>
+ {% endif %}
+
+ {% if pub_years %}
+ <p>
+ <label for="pub_date_from">{% trans "Year of publication" %}</label>
+ <select id="pub_year_from" name="pub_year_from" class="tiny">
+ <option value="0"></option>
+ {% for year in pub_years %}
+ <option value="{{ year }}" {% ifequal criteria.pub_year_from year %}selected {% endifequal %}>{{year}}</option>
+ {% endfor %}
+ </select>
+ {% trans "to" %}
+ <select id="pub_year_to" name="pub_year_to" class="tiny">
+ <option value="0"></option>
+ {% for year in pub_years %}
+ <option value="{{ year }}" {% ifequal criteria.pub_year_to year %}selected {% endifequal %}>{{year}}</option>
+ {% endfor %}
+ </select>
+ </p>
+ {% endif %}
+
+ <p><label for="sound">{% trans "Sound" %}</label>
+ <input type="checkbox" name="sound" value="True" align="left" />
+ </p>
+
+</fieldset>
+
+<p class="input">
+<a href="#" class="component_icon button icon_search"
+ onclick="document.getElementById('searchform').submit(); return false;">{% trans 'Search' %}</a>
+</p>
+
+</form>
+{% endblock %}
-{% extends "telemeta_default/search_results.html" %}
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Search Results" %} - {{ block.super }}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "search_red.png" %}" alt="search-results" style="vertical-align:middle" /> {% trans "Search Results" %}
+{% endblock %}
+
+{% block title_buttons %}
+ {% ifequal type 'items' %}
+ <a href="{% url telemeta-search-items %}?{{criteria|with_no_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "All" %}</a>
+ <a href="{% url telemeta-search-items %}?{{criteria|with_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
+ {% else %}
+ <a href="{% url telemeta-search-collections %}?{{criteria|with_no_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "All" %}</a>
+ <a href="{% url telemeta-search-collections %}?{{criteria|with_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
+ {% endifequal %}
+{% endblock %}
+
+{% block content %}
+{% if criteria %}
+<ul>
+ {% if criteria.pattern %}
+ <li><b>{% trans "Search pattern" %}:</b> {{criteria.pattern}}</li>
+ {% endif %}
+ {% if criteria.location %}
+ <li><b>{% field_label "Location" %}:</b> {{criteria.location}}</li>
+ {% endif %}
+ {% if criteria.ethnic_group %}
+ <li><b>{% field_label "EthnicGroup" %}:</b> {{criteria.ethnic_group}}</li>
+ {% endif %}
+ {% if criteria.creator %}
+ <li><b>{% field_label "MediaCollection" "creator" %}:</b> {{criteria.creator}}</li>
+ {% endif %}
+ {% if criteria.collector %}
+ <li><b>{% field_label "MediaCollection" "collector" %}:</b> {{criteria.collector}}</li>
+ {% endif %}
+ {% if criteria.title %}
+ <li><b>{% trans "Title" %}:</b> {{criteria.title}}</li>
+ {% endif %}
+ {% if criteria.rec_year_from %}
+ <li><b>{% trans "Year of recording" %}:</b> {{criteria.rec_year_from}}
+ {% ifnotequal criteria.rec_year_to criteria.rec_year_from %}
+ {% trans "to" %} {{criteria.rec_year_to}}
+ {% endifnotequal %}
+ </li>
+ {% endif %}
+ {% if criteria.pub_year_from %}
+ <li><b>{% trans "Year of publication" %}:</b> {{criteria.pub_year_from}}
+ {% ifnotequal criteria.pub_year_to criteria.pub_year_from %}
+ {% trans "to" %} {{criteria.pub_year_to}}
+ {% endifnotequal %}
+ </li>
+ {% endif %}
+ {% if criteria.sound %}
+ <li><b>{% trans "Sound" %}:</b> {{criteria.sound}}</li>
+ {% endif %}
+</ul>
+{% endif %}
+
+{% ifequal type 'items' %}
+
+ <p><a href="{% url telemeta-search-collections %}?{{criteria|build_query_string}}">Collections ({{collections_num}})</a> | <b>Items ({{items_num}})</b></p>
+
+ {% with object_list as items %}
+ <div class="fullpage">
+ {% include "telemeta/inc/mediaitem_list.html" %}
+ </div>
+ {% endwith %}
+
+{% else %}
+
+ <p><b>Collections ({{collections_num}})</b> | <a href="{% url telemeta-search-items %}?{{criteria|build_query_string}}">Items ({{items_num}})</a>
+ </p>
+
+ {% with object_list as collections %}
+ <div class="fullpage">
+ {% include "telemeta/inc/collection_list.html" %}
+ </div>
+ {% endwith %}
+
+{% endifequal %}
+
+{% endblock %}
-{% extends "telemeta_default/users.html" %}
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block head_title %}{% trans "Users" %} - {{ block.super }}{% endblock %}
+
+{% block title %}
+ <img src="{% url telemeta-images "user_red.png" %}" alt="user" style="vertical-align:middle" /> {% trans "Users" %}
+{% endblock %}
+
+{% block content %}
+ {% if users %}
+ <br />
+ {% include "telemeta/inc/user_list.html" %}
+ {% else %}
+ <p class="help">{% trans "No users" %}</p>
+ {% endif %}
+{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block stylesheets %}
-{{ block.super }}
-<link rel="stylesheet" type="text/css" href="{% url telemeta-css "admin.css" %}" />
-{% endblock %}
-
-{% block title %}
-<h1><img src="{% url telemeta-images "admin_red.png" %}" style="vertical-align:middle" /> {% trans "Administration" %}</h1>
-{% endblock %}
-
-{% block content %}
-
-{% block tab %}
-<div class="tabs">
-<ul>
-<li><a href="{% url telemeta-admin-general %}">{% trans "General administration" %}</a></li>
-<li><a href="{% url telemeta-admin-users %}">{% trans "Users" %}</a></li>
-<li><a href="{% url telemeta-admin-enumerations %}">{% trans "Enumerations" %}</a></li>
-<li><a href="{% url telemeta-instrument-edit %}">{% trans "Instruments" %}</a></li>
-</ul>
-</div>
-{% endblock tab %}
-
-<div class="tabcontents">
- {% block tabcontents %}
- {% endblock %}
-</div>
-
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block tabcontents %}
- <h4>{% trans "Enumerations" %}</h4>
-
-{% if enumerations %}
-
- <table class="listing">
- <thead>
- <tr><th>{% trans "Title"%}</th></tr>
- </thead><tbody>
- {% for enum in enumerations %}
- <tr><td><a href="{% url telemeta-enumeration-edit enum.id %}">
- {{ enum.name|capfirst }}</a></td></tr>
- {% endfor %}
- </tbody>
- </table>
-
- {% else %}
- <p class="help">{% trans "No enumerations" %}</p>
- {% endif %}
-
-{% endblock %}
-
-
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load i18n %}
-
-{% block tabcontents %}
- <iframe align="middle" frameborder="0" width="100%" height="600px" src="{% url telemeta-home %}admin/django/" />
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block tabcontents %}
- <h4>{% trans "Users" %}</h4>
-
- {% if users %}
- <ul>
- {% for user in users %}
- <li>{{user.username}}</li>
- {% endfor %}
- </ul>
- {% else %}
- <p class="help">{% trans "No users" %}</p>
- {% endif %}
-
-{% endblock %}
-
-
-
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block tabcontents %}
- <h4>{% trans "Users" %}</h4>
-
- {% if users %}
- {% include "telemeta/inc/user_list.html" %}
- {% else %}
- <p class="help">{% trans "No users" %}</p>
- {% endif %}
-
-{% endblock %}
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-{% load i18n %}
-{% load telemeta_utils %}
-{% get_current_language as LANGUAGE_CODE %}
-{% get_available_languages as LANGUAGES %}
-<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
-
-<head>
-<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>{%block head_title %}{% description %} - Telemeta{% endblock %}</title>
-
-{% block stylesheets %}
-<link rel="stylesheet" type="text/css" href="{% url telemeta-css "telemeta.css" %}" />
-<link rel="alternate" href="/rss" title="RSS 2.0" type="application/rss+xml" />
-<!--[if IE]>
-<link rel="stylesheet" type="text/css" href="{% url telemeta-css "telemeta_ie.css" %}" />
-<![endif]-->
-<!--[if lte IE 6]>
-<link rel="stylesheet"type="text/css" href="{% url telemeta-css "telemeta_ie6.css" %}" />
-<![endif]-->
-{% endblock %}
-
-{% block javascript %}
-<script src="{% url django.views.i18n.javascript_catalog %}" type="text/javascript"></script>
-<!--<script src="{% url telemeta-js "jquery-1.6.min.js" %}" type="text/javascript"></script>-->
-<script src="{% url telemeta-timeside "js/libs/jquery-1.6.min.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "locale.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "application.js" %}" type="text/javascript"></script>
-{% if user.is_authenticated %}
-<script type='text/javascript'>var CURRENT_USER_NAME="{{ user.username }}";</script>
-{% else %}
-<script type='text/javascript'>var CURRENT_USER_NAME=undefined;</script>
-{% endif %}
-{% endblock %}
-
-{% block extra_javascript %}{% endblock %}
-</head>
-
-<body>
-{% block layout %}
-<div id="layout">
-{% block header %}
-<div id="header">
-<div id="logo">
-{% block logo %}
-<a href="{% url telemeta-home %}"><img src="{% url telemeta-images "logo_telemeta_2.png" %}" alt="Telemeta" /></a>
-{% endblock %}
-</div>
-
-<div id="auth_info">
-{% if user.is_authenticated %}
-<img src="{% url telemeta-images "user.png" %}" alt="user" style="vertical-align:middle" />
-{% trans "Welcome" %},
-{% if user.first_name and user.last_name %}
-{{ user.first_name }} {{ user.last_name }} |
-{% else %}
-{{ user.username }} |
-{% endif %}
-<a href="{% url telemeta-profile-detail user.username %}">{% trans "Profile" %}</a> |
-<a href="{% url telemeta-flatpage "help" %}">{% trans "Help" %}</a> |
-<a href="{% url telemeta-logout %}">{% trans "Sign out" %}
-<img src="{% url telemeta-images "logout.png" %}" alt="logout" style="vertical-align:middle" /></a>
-{% else %}
-<a href="{% url telemeta-flatpage "help" %}">{% trans "Help" %}</a> |
-<a href="{% url telemeta-login %}?next={{ request.path|urlencode }}">{% trans "Sign in" %}</a>
-{% endif %}
-</div>
-
-<div id="quick_search">
-<form action="{% url telemeta-search %}" id="_quickSearchForm" method="get">
-<input type="text" id="quick_search_pattern" name="pattern" />
-<a href="#" class="component button"
- onclick="document.getElementById('_quickSearchForm').submit(); return false;">{% trans "Search" %}</a>
-</form>
-</div>
-
-<div id="menu" class="nav">
-{% block menu %}
-
-{# spaces between li and a elements breaks layout #}
-
-<!--<ul id="nav">
- <a href="{% url telemeta-home %}" class="darkblue">{% trans "Home" %}</a>
- <a href="{% url telemeta-collections %}" class="blue">{% trans "Collections" %}</a>
- <a href="{% url telemeta-items %}" class="green">{% trans "Items" %}</a></li>
- <a href="{% url telemeta-geo-continents %}" class="yellow">{% trans "Geo Navigator" %}</a>
- <a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Advanced search" %}</a>
- {% if user.is_authenticated %}
- <a href="{% url telemeta-users %}" class="red">{% trans "Users" %}</a>
- {% endif %}
- {% if user.is_staff %}
- <a href="{% url telemeta-admin %}" class="violet">{% trans "Admin" %}</a>
-{% endif %}
-</ul>-->
-
-<ul id="nav">
- <li><a href="{% url telemeta-home %}" class="blue">{% trans "Home" %}</a></li>
-
- <li><a href="{% url telemeta-archives %}" class="green">{% trans "Archives" %}</a>
- <ul>
- <li><a href="{% url telemeta-funds %}">{% trans "Funds" %}</a></li>
- <li><a href="{% url telemeta-corpus %}">{% trans "Corpus" %}</a></li>
- <li><a href="{% url telemeta-collections %}">{% trans "Collections" %}</a></li>
- <li><a href="{% url telemeta-items %}">{% trans "Items" %}</a></li>
- </ul>
- <div class="clear"></div>
- </li>
- <li><a href="{% url telemeta-geo-continents %}" class="yellow">{% trans "Geo Navigator" %}</a></li>
- <li><a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Advanced search" %}</a></li>
- {% if user.is_authenticated %}
- <li><a href="{% url telemeta-users %}" class="red">{% trans "Users" %}</a></li>
- {% endif %}
- {% if user.is_staff %}
- <li><a href="{% url telemeta-admin %}" class="violet">{% trans "Admin" %}</a></li>
-{% endif %}
-</ul>
-<div class="clear"></div>
-
-{% endblock %}
-</div>
-</div>
-{% endblock header %}
-
-<div id="content">
- <table id="content_header"><tr>
- <td class="leftcol"><h1>{% block title %}{% endblock %}</h1></td>
- <td class="rightcol">{% block title_buttons %}{% endblock %}</td>
- </tr></table>
-{% block content %}{% endblock %}
-<div class="nett"></div>
-{% block delete %}{% endblock %}
-</div>
-
-{% block footer %}
-<div id="footer">
- <hr />
- <table width="100%">
- <tr>
- <td>
- <a id="telemeta_powered" href="{% telemeta_url %}" target="_blank"><img src="{% url telemeta-images "logo_mini_2.png" %}" height="30" width="93"
- alt="Telemeta Powered"/></a>
- <p class="left">
- {% trans "Powered by" %} <a href="{% telemeta_url %}" target="_blank"><strong>Telemeta {% telemeta_version %}</strong></a><br />
- {% trans "By" %} <a href="http://www.parisson.com/">Parisson SARL</a>
- </p>
- </td>
- <td>
- <p class="center">
- {% trans "Usage of the archives in the respect of cultural heritage of the original communities." %}
- </p>
- </td>
- <td>
- <p class="right">
- Copyright © {% current_year %} {% organization %}<br />
- <a href="{% url telemeta-flatpage "legal_notices" %}">{% trans "Legal notices" %}</a>
- </p>
- </td>
- </tr>
- </table>
-</div>
-{% endblock %}
-</div>
-{% endblock layout %}
-
-{% block analytics %}
-{% endblock analytics %}
-
-</body>
-</html>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<playlist version="1" xmlns="http://xspf.org/ns/0/">
-{% block listinfo %}{% endblock %}
- <trackList>
- {% block tracklist %}{% endblock %}
- </trackList>
-</playlist>
-
-
+++ /dev/null
-#EXTM3U{% load telemeta_utils %}{% for item in collection.items.all %}
-#EXTINF:{{ item.get_duration }},{{ item }}
-http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}{% endfor %}
+++ /dev/null
-{% extends "telemeta/collection_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title %}
- <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> Collection : NEW
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-collections %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block infos %}
- <div class="infos">
- <form method="post" id ="_addCollectionForm" action="">{% csrf_token %}
- <table>
- <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
- {% for field in form %}
- <tr>
- {% if field.html_name == "copied_from_item" or field.html_name == "doctype_code" %}
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- {% else %}
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-collections %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_addCollectionForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
-{% endblock infos%}
-
-{% block delete %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block head_title %}{% trans "Collection" %}{{collection|prepend:' : '}} - {{ block.super }}{% endblock %}
-
-{% block extra_javascript %}
-<script src="{% url telemeta-js "swfobject.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "popupdiv.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script>
-<script>
- {% if user.is_authenticated %}
- jQuery(document).ready(function(){
- var p = playlistUtils;
-
- {% for playlist in playlists %}
- p.addPlaylist('{{ playlist.playlist.title }}','{{playlist.playlist.public_id}}');
- {% endfor %}
-
- {% if collection %}
- var anchor = jQuery('#_add_to_playlist');
- if(anchor.length){
- anchor.click(function(){
- p.showAddResourceToPlaylist(anchor,'collection','{{collection.id}}',gettrans('collection added to the selected playlist'));return false;
- });
- }
- {% endif %}
- });
- {% endif %}
-</script>
-{% endblock %}
-
-{% if collection %}
-
-{% block title %}
- <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" />
- Collection :
- <a href="{% url telemeta-collection-detail collection.public_id %}">{{ collection.title }}</a>
-{% endblock %}
-
-{% block title_buttons %}
- <div class="fixedWidthAsPlayer">
- {% if user.is_authenticated and perms.telemeta.change_mediacollection %}
- <a href="{% url telemeta-collection-edit collection.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
- <a href="{% url telemeta-collection-copy collection.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
- <a href="{% url telemeta-collection-additem collection.public_id %}" class="component_icon button icon_add">{% trans "Add item" %}</a>
- {% endif %}
- {% if user.is_authenticated %}
- <a href=# id ="_add_to_playlist" class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
- {% endif %}
- <a href="{% url telemeta-collection-dublincore collection.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
- </div>
-{% endblock %}
-
-{% block content %}
- <div class="{% if collection.has_mediafile %}{% if public_access or perms.telemeta.can_play_all_items %}with-rightcol{% endif %}{% endif %}">
- {% if collection.has_mediafile %}
- {% if public_access or perms.telemeta.can_play_all_items %}
- <div id="rightcol">
- <div id="collection_player">
- <div class="title">
- <h3><b>{% trans "Listen to this collection" %}</b>
- (<a href="{% url telemeta-collection-m3u collection.public_id %}">M3U</a>,
- <a href="{% url telemeta-collection-xspf collection.public_id %}">XSPF</a>)</h3>
- </div>
- <!-- This is Jeroen Wijering's Flash MP3 Player,
- under CC Attribution-NonCommercial-ShareAlike 2.0 license
- from: http://www.jeroenwijering.com/?item=Flash_MP3_Player-->
- <p id="collection_player_c">
- <a href="http://www.macromedia.com/go/getflashplayer">Get Flash</a> to see this player.
- </p>
- <script type="text/javascript">
- var so = new SWFObject('{% url telemeta-swf "mp3player.swf" %}','playlist','362','200','7');
- so.addVariable("file","{% url telemeta-collection-xspf collection.public_id %}");
- so.addVariable("displayheight","0");
- so.addParam("wmode", "opaque");
- so.write('collection_player_c');
- </script>
- </div>
- </div>
- {% endif %}
- {% endif %}
- {% block infos %}
- <div class="intro">
- <span><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% if collection.items.count %}{{ collection.items.count }} {% ifequal collection.items.count 1 %}item{% else %}items{% endifequal %}{% else %}No item{% endif %}</span>
- </div>
- <div class="infos">
- {% block general_info %}
- <dl class="listing">
- {% dl_field collection "reference" %}
- {% dl_field collection "title" %}
- {% dl_field collection "alt_title" %}
- {% dl_field collection "creator" placeholder %}
- {% dl_field collection "recording_context" %}
- <dt>{% trans "Recording period" %}</dt>
- <dd>{% if collection.recorded_from_year %}{{ collection.recorded_from_year }}{% endif %}{% if collection.recorded_from_year and collection.recorded_to_year %} - {% endif %}{% if collection.recorded_to_year %}{{ collection.recorded_to_year}}{% endif %}</dd>
- {% dl_field collection "year_published" placeholder %}
- </dl>
- {% endblock general_info %}
- </div>
- <div class="extraInfos">
- {% block geoethnic_data %}
- <div>
- <h4><a href="#">{% trans "Geographic and cultural informations" %}</a></h4>
- <div>
- <dl class="listing">
- {% dl_field collection "countries" join with ", " %}
- {% dl_field collection "ethnic_groups" join with ", " placeholder %}
- </dl>
- </div>
- </div>
- {% endblock geoethnic_data %}
- </div>
- <div class="extraInfos">
- {% block legal_data %}
- <div>
- <h4><a href="#">{% trans "Legal notices" %}</a></h4>
- <div>
- <dl class="listing">
- {% if collection.collector_is_creator %}
- {% if collection.creator %}
- <dt>{% trans "Recordist" %}</dt><dd>{{ collection.creator }}</dd>
- {% endif%}
- {% else %}
- {% dl_field collection "collector" %}
- {% endif %}
- {% dl_field collection "publisher" %}
- {% dl_field collection "publisher_collection" %}
- {% dl_field collection "publisher_serial" %}
- {% dl_field collection "booklet_author" %}
- <dt>{% trans "Bibliographic references" %}</dt>
- <dd>{{ collection.external_references|html_line_break|safe }}</dd>
- {% dl_field collection "doctype_code" %}
- {% dl_field collection "public_access_label" %}
- {% dl_field collection "legal_rights" %}
- </dl>
- </div>
- </div>
- {% endblock legal_data %}
- </div>
- <div class="extraInfos">
- {% block archive_data %}
- <div>
- <h4><a href="#">{% trans "Archiving data" %}</a></h4>
- <div>
- <dl class="listing">
- {% dl_field collection "acquisition_mode" %}
- {% dl_field collection "cnrs_contributor" %}
- {% dl_field collection "metadata_author" %}
- <dt>{% trans "Related documentation" %}</dt>
- <dd>{{ collection.booklet_description|html_line_break|safe }}</dd>
- {% dl_field collection "publishing_status" %}
- {% dl_field collection "alt_ids" %}
- <dt>{% trans "Comments" %}</dt>
- <dd>{{ collection.comment|html_line_break|safe }}</dd>
- {% dl_field collection "metadata_writer" %}
- {% dl_field collection "travail" %}
- {% dl_field collection "items_done" %}
- {% dl_field collection "conservation_site" %}
- </dl>
- </div>
- </div>
- {% endblock archive_data %}
- </div>
- <div class="extraInfos">
- {% block technical_data %}
- <div>
- <h4><a href="#">{% trans "Technical data" %}</a></h4>
- <div>
- <dl class="listing">
- {% dl_field collection "code" %}
- {% dl_field collection "old_code" %}
- <dt>{% trans "Media type" %}</dt><dd>{% trans "Audio" %}</dd>
- {% dl_field collection "approx_duration" %}
- {% dl_field collection "computed_duration" %}
- {% dl_field collection "physical_items_num" %}
- <div class="wazing"></div>
- <dt>{% trans "Number of items" %}</dt><dd>{{ collection.items.count }}</dd>
- {% dl_field collection "physical_format" %}
- {% dl_field collection "ad_conversion" %}
- </dl>
- </div>
- </div>
- {% endblock technical_data %}
- </div>
-
- <div class="extraInfos">
- {% block related %}
- {% include "telemeta/inc/collection_related.html" %}
- {% endblock related %}
- </div>
-
- <div class="extraInfos">
- <h4><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> Items</h4>
- {% with "1" as location_name %}
- {% include "telemeta/inc/mediaitem_list.html" %}
- {% endwith %}
- </div>
-
- {% endblock infos %}
- </div>
-{% endblock %}
-
-{% block delete %}
-{% if user.is_authenticated and perms.telemeta.delete_mediacollection %}
- <a href="#" onclick="if(confirm(gettrans('delete the collection permanently?'))){window.location.href='{% url telemeta-collection-delete collection.public_id %}';};return false;"
- class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
-{% endif %}
-
-{% endblock %}
-
-{% else %}
- <p>No such collection</p>
-{% endif %}
-
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Collection" %}{{collection|prepend:': '}} - {{ block.super }}{% endblock %}
-
-{% if collection %}
-{% block title %}
-<h1>Collection: {{ collection }}</h1>
-{% endblock %}
-{% block title_buttons %}
- <a class="component_icon button icon_previous" href="{% url telemeta-collection-detail collection.public_id %}">{% trans "Normal View" %}</a>
-{% endblock %}
-
-{% block content %}
-{% with collection|to_dublincore as resource %}
-{% include "telemeta/inc/dublincore.html" %}
-{% endwith %}
-
-{% endblock %}
-{% else %}
- <p>{% trans "No such collection" %}</p>
-{% endif %}
+++ /dev/null
-{% extends "telemeta/collection_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title %}
- <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> Collection : {{ collection }}
-{% endblock %}
-{% block title_buttons %}
- <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block infos %}
- <div class="infos">
- <form method="post" id="_editCollectionForm" action="">{% csrf_token %}
- <table>
- <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
- {% for field in form %}
- <tr>
- {% if field.html_name == "copied_from_item" or field.html_name == "doctype_code" %}
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- {% else %}
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
-{% endblock infos%}
-
-{% block delete %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Media Collections" %} - {{ block.super }}{% endblock %}
-
-{% block title%}
- <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> {% trans "Media Collections" %}
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-collections %}" class="component_icon button icon_filter">{% trans "All" %}</a>
- <a href="{% url telemeta-collections-unpublished %}" class="component_icon button icon_filter">{% trans "Unpublished" %}</a>
- <a href="{% url telemeta-collections-published %}" class="component_icon button icon_filter">{% trans "Published" %}</a>
- <a href="{% url telemeta-collections-sound %}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
- {% if user.is_authenticated and perms.telemeta.add_mediacollection %}
- <a href="{% url telemeta-collection-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
- {% endif %}
-{% endblock %}
-
-{% block content %}
-{% with object_list as collections %}
-<div class="fullpage">
-{% include "telemeta/inc/collection_list.html" %}
-</div>
-{% endwith %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/collection_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block extra_javascript %}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> Collection : {{ collection }}
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="infos">
- <form enctype="multipart/form-data" method="post" id="_editMediaCollectionRelatedFileForm" action="">{% csrf_token %}
-
- {{ formset.management_form }}
- {% for form in formset.forms %}
- <hr>
- <table>
- <tr><td><b>{% trans "Media" %} :</b><td></td></tr>
- {% for field in form %}
- <tr><td class="error">{{ field.errors }}</td></tr>
- <tr>
- {% if "media_collection" in field.html_name or "id" in field.html_name or "collection" in field.html_name or "mime_type" in field.html_name %}
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- {% else %}
- <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <br />
- {% endfor %}
- <div align="center">
- <a href="{% url telemeta-collection-detail collection.public_id %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editMediaCollectionRelatedFileForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
- {% endblock infos %}
-{% endblock content %}
+++ /dev/null
-{% extends "telemeta/base_xspf.xml" %}
-{% load telemeta_utils %}
-
-{% block listinfo %}
-{% with collection.to_dublincore.flatten as dc %}
- <creator>{{ dc.creator }}</creator>
- <title>{{ dc.title }}</title>
- <info>http://{{ host }}{% url telemeta-collection-detail collection.public_id %}</info>
-{% endwith %}
-{% endblock %}
-
-{% block tracklist %}
-{% for item in collection.items.all %}
- <track>
- <title>{{ item }}</title>
- <meta rel="type">mp3</meta>
- <location>http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}</location>
- <duration>{{ item.computed_duration.as_seconds|mul:1000 }}</duration>
- <info>http://{{ host }}{% url telemeta-item-detail item.public_id %}</info>
- </track>
-{% endfor %}
-{% endblock %}
-
+++ /dev/null
-{% extends "telemeta/corpus_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title %}
- <img src="{% url telemeta-images "corpus_red.png" %}" style="vertical-align:middle" /> Corpus : NEW
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-corpus %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block infos %}
- <div class="infos">
- <form method="post" id ="_addCorpusForm" action="">{% csrf_token %}
- <table>
- <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
- {% for field in form %}
- <tr>
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-corpus %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_addCorpusForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
-{% endblock infos%}
-
-{% block delete %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block head_title %}{% trans "Corpus" %}{{corpus|prepend:' : '}} - {{ block.super }}{% endblock %}
-
-{% block extra_javascript %}
-{% endblock %}
-
-{% if corpus %}
-
-{% block title %}
- <img src="{% url telemeta-images "corpuss_red.png" %}" style="vertical-align:middle" />
- Collection :
- <a href="{% url telemeta-corpus-detail corpus.public_id %}">{{ corpus.title }}</a>
-{% endblock %}
-
-{% block title_buttons %}
- <div class="fixedWidthAsPlayer">
- {% if user.is_authenticated and perms.telemeta.change_mediacorpus %}
- <a href="{% url telemeta-corpus-edit corpus.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
- <a href="{% url telemeta-corpus-copy corpus.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
- {% endif %}
- {% if user.is_authenticated %}
- <a href=# id ="_add_to_playlist" class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
- {% endif %}
- <a href="{% url telemeta-corpus-dublincore corpus.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
- </div>
-{% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="intro">
- <span><img src="{% url telemeta-images "collection_title.png" %}" style="vertical-align:middle" /> {% if corpus.items.count %}{{ corpus.collections.count }} {% ifequal corpus.collections.count 1 %}item{% else %}collections{% endifequal %}{% else %}No collection% endif %}</span>
- </div>
- <div class="infos">
- {% block general_info %}
- <dl class="listing">
- {% dl_field corpus "reference" %}
- {% dl_field corpus "title" %}
- {% dl_field corpus "description" %}
- {% dl_field corpus "code" %}
- </dl>
- {% endblock general_info %}
-
- <div class="extraInfos">
- {% block related %}
- {% include "telemeta/inc/corpus_related.html" %}
- {% endblock related %}
- </div>
-
- <div class="extraInfos">
- <h4><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> Collections</h4>
- {% with "1" as location_name %}
- {% include "telemeta/inc/mediacollection_list.html" %}
- {% endwith %}
- </div>
-
- {% endblock infos %}
- </div>
-{% endblock %}
-
-{% block delete %}
-{% if user.is_authenticated and perms.telemeta.delete_mediacorpus %}
- <a href="#" onclick="if(confirm(gettrans('delete the corpus permanently?'))){window.location.href='{% url telemeta-corpus-delete corpus.public_id %}';};return false;"
- class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
-{% endif %}
-
-{% endblock %}
-
-{% else %}
- <p>No such corpus</p>
-{% endif %}
-
+++ /dev/null
-{% extends "telemeta/corpus_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title %}
- <img src="{% url telemeta-images "corpus_red.png" %}" style="vertical-align:middle" /> Corpus : {{ corpus }}
-{% endblock %}
-{% block title_buttons %}
- <a href="{% url telemeta-corpus-detail corpus.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block infos %}
- <div class="infos">
- <form method="post" id="_editCollectionForm" action="">{% csrf_token %}
- <table>
- <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
- {% for field in form %}
- <tr>
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-corpus-detail corpus.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
-{% endblock infos%}
-
-{% block delete %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Media Corpus" %} - {{ block.super }}{% endblock %}
-
-{% block title%}
- <img src="{% url telemeta-images "corpus_red.png" %}" style="vertical-align:middle" /> {% trans "Media Corpus" %}
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-corpus %}" class="component_icon button icon_filter">{% trans "All" %}</a>
- {% if user.is_authenticated and perms.telemeta.add_mediacorpus %}
- <a href="{% url telemeta-corpus-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
- {% endif %}
-{% endblock %}
-
-{% block content %}
-{% with object_list as corpus %}
-<div class="fullpage">
-{% include "telemeta/inc/corpus_list.html" %}
-</div>
-{% endwith %}
-{% endblock %}
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-
-<h2>{{ country }}</h2>
-<p>
-<a href="{% url telemeta-geo-country-items continent.flatname,country.flatname %}">
-{{ country.items|resources_num }}
-</a>
-{% trans "in" %}
-<a href="{% url telemeta-geo-country-collections continent.flatname,country.flatname %}">
-{{ country.collections|resources_num }}
-</a>
-</p>
-<!--
-{% with country.items.all.ethnic_groups as ethnic_groups %}
-{% if ethnic_groups %}
-<p>
-<b>{% trans "Populations / Social groups" %}:</b>
-{{ ethnic_groups|join:', ' }}
-</p>
-{% endif %}
-{% endwith %}
--->
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Enumeration" %}: {{ enumeration_name|capfirst }} - {{ block.super }}{% endblock %}
-
-{% block tabcontents %}
- <h4>{% trans "Enumeration" %}: {{ enumeration_name|capfirst }}</h4>
-
- <form class="addnew" id="_addenum" method="POST"
- action="{% url telemeta-enumeration-add enumeration_id %}">{% csrf_token %}
- <fieldset>
- <legend>{% trans "Add entry" %}</legend>
- <div class="field">
- <label>{% trans "Value" %}: <input id="id_value_add" type="text" name="value"></label>
-
- </div>
- <div class="buttons">
- <br />
- <a href="#" class="component_icon button icon_add"
- onclick="document.getElementById('_addenum').submit(); return false;">{% trans "Add" %}</a>
- </div>
- </fieldset>
- </form>
- {% if enumeration_values %}
- <form id="_updateenum" method="POST" action="{% url telemeta-enumeration-update enumeration_id %}">{% csrf_token %}
- <table class="listing">
- <thead>
- <tr><th class="sel"> </th><th>{% trans "Value"%}</th>
-
- </tr>
- </thead><tbody>
- {% for record in enumeration_values %}
- <tr>
- <td><input type="checkbox" name="sel" value="{{record.id}}" /></td>
- <td><a href="{% url telemeta-enumeration-record-edit enumeration_id,record.id %}">
- {{record.value}}</a></td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- <div class="buttons">
- <br />
- <a href="#" class="component_icon button icon_cancel"
- onclick="document.getElementById('_updateenum').submit(); return false;">{% trans "Remove selected items" %}</a>
- </div>
- </form>
- {% else %}
- <p class="help">{% trans "This enumeration is empty" %}</p>
- {% endif %}
-
- <br style="clear: right"/>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Enumeration" %}: {{ enumeration_name|capfirst }} - {{ block.super }}{% endblock %}
-
-{% block tabcontents %}
- <h4>{% trans "Enumeration" %}: {{ enumeration_name|capfirst }}</h4>
-
- <form class="mod" id="addenum" method="post"
- action="{% url telemeta-enumeration-record-update enumeration_id,enumeration_record.id %}">{% csrf_token %}
- <fieldset>
- <legend>{% trans "Modify an entry" %}</legend>
- <div class="field">
- <label>{% trans "Value" %}: <input id="id_value_edit" type="text" name="value" value="{{enumeration_record.value}}" /></label>
-
- </div>
- <br />
- <div class="buttons">
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('addenum').submit(); return false;">{% trans "Save" %}</a>
- <a href="{% url telemeta-enumeration-edit enumeration_id %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- </div>
- </fieldset>
- </form>
- <br style="clear: right"/>
-
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% block content %}
-{{ page_content|render_flatpage }}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/fund_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title %}
- <img src="{% url telemeta-images "fund_red.png" %}" style="vertical-align:middle" /> Corpus : NEW
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-fund %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block infos %}
- <div class="infos">
- <form method="post" id ="_addCorpusForm" action="">{% csrf_token %}
- <table>
- <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
- {% for field in form %}
- <tr>
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-fund %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_addCorpusForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
-{% endblock infos%}
-
-{% block delete %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block head_title %}{% trans "Funds" %}{{fund|prepend:' : '}} - {{ block.super }}{% endblock %}
-
-{% block extra_javascript %}
-{% endblock %}
-
-{% if fund %}
-
-{% block title %}
- <img src="{% url telemeta-images "funds_red.png" %}" style="vertical-align:middle" />
- Collection :
- <a href="{% url telemeta-fund-detail fund.public_id %}">{{ fund.title }}</a>
-{% endblock %}
-
-{% block title_buttons %}
- <div class="fixedWidthAsPlayer">
- {% if user.is_authenticated and perms.telemeta.change_mediafund %}
- <a href="{% url telemeta-fund-edit fund.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
- <a href="{% url telemeta-fund-copy fund.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
- {% endif %}
- {% if user.is_authenticated %}
- <a href=# id ="_add_to_playlist" class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
- {% endif %}
- <a href="{% url telemeta-fund-dublincore fund.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
- </div>
-{% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="intro">
- <span><img src="{% url telemeta-images "corpus_title.png" %}" style="vertical-align:middle" /> {% if fund.corpus.count %}{{ fund.corpus.count }} {% ifequal fund.corpus.count 1 %}item{% else %}corpus{% endifequal %}{% else %}No corpus% endif %}</span>
- </div>
- <div class="infos">
- {% block general_info %}
- <dl class="listing">
- {% dl_field fund "reference" %}
- {% dl_field fund "title" %}
- {% dl_field fund "description" %}
- {% dl_field fund "code" %}
- </dl>
- {% endblock general_info %}
-
- <div class="extraInfos">
- {% block related %}
- {% include "telemeta/inc/fund_related.html" %}
- {% endblock related %}
- </div>
-
- <div class="extraInfos">
- <h4><img src="{% url telemeta-images "copus_title.png" %}" style="vertical-align:middle" /> Corpus</h4>
- {% with "1" as location_name %}
- {% include "telemeta/inc/corpus_list.html" %}
- {% endwith %}
- </div>
-
- {% endblock infos %}
- </div>
-{% endblock %}
-
-{% block delete %}
-{% if user.is_authenticated and perms.telemeta.delete_mediafund %}
- <a href="#" onclick="if(confirm(gettrans('delete the fund permanently?'))){window.location.href='{% url telemeta-fund-delete fund.public_id %}';};return false;"
- class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
-{% endif %}
-
-{% endblock %}
-
-{% else %}
- <p>No such fund</p>
-{% endif %}
-
+++ /dev/null
-{% extends "telemeta/fund_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title %}
- <img src="{% url telemeta-images "fund_red.png" %}" style="vertical-align:middle" /> Fund : {{ fund }}
-{% endblock %}
-{% block title_buttons %}
- <a href="{% url telemeta-fund-detail fund.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block infos %}
- <div class="infos">
- <form method="post" id="_editCollectionForm" action="">{% csrf_token %}
- <table>
- <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
- {% for field in form %}
- <tr>
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-fund-detail fund.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
-{% endblock infos%}
-
-{% block delete %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Media Funds" %} - {{ block.super }}{% endblock %}
-
-{% block title%}
- <img src="{% url telemeta-images "funds_red.png" %}" style="vertical-align:middle" /> {% trans "Media Funds" %}
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-funds %}" class="component_icon button icon_filter">{% trans "All" %}</a>
- {% if user.is_authenticated and perms.telemeta.add_mediafunds %}
- <a href="{% url telemeta-funds-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
- {% endif %}
-{% endblock %}
-
-{% block content %}
-{% with object_list as funds %}
-<div class="fullpage">
-{% include "telemeta/inc/fund_list.html" %}
-</div>
-{% endwith %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
-
-{% block extra_javascript %}
-{% if gmap_key %}
-<script src="http://www.google.com/jsapi?key={{ gmap_key }}" type="text/javascript"></script>
-<script src="{% url telemeta-js "resourcemap.js" %}" type="text/javascript"></script>
-<script type="text/javascript">
-var resourceMap = new ResourceMap('.continents', {
- 'countryInfoUri': '/geo/country_info/RESOURCEID/'
-});
-</script>
-{% endif %}
-{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "world_red.png" %}" alt="geo-navigator" style="vertical-align:middle" /> {% trans "Geographic Navigator" %}
-{% endblock %}
-
-{% block title_buttons %}
- {% if continents %}
- <a href="#" onclick="resourceMap.toggle('map'); return false;" class="component button">{% trans "Map" %}</a> |
- <a href="#" onclick="resourceMap.toggle('list'); return false;" class="component button">{% trans "List" %}</a>
- {% endif %}
-{% endblock %}
-
-{% block content %}
-{% if continents %}
-<ul class="continents">
-{% for group in continents %}
- <li class="name {% if not forloop.counter0|divisibleby:"2" %}odd{% endif %}"><b><a href="{% url telemeta-geo-countries group.continent.flatname %}">{{ group.continent }}</a></b>
- <ul>
- {% for country in group.countries %}
- <li id="resource-{{country.id}}" class="country_name resourcemap-element">
- <a href="{% url telemeta-geo-country-collections group.continent.flatname,country.flatname %}">
- <span class="resourcemap-name">{{ country }}</span></a>
- {% if not country.latitude|is_none and not country.longitude|is_none %}
- <input type="hidden" class="resourcemap-lat" value="{{country.latitude}}" />
- <input type="hidden" class="resourcemap-lng" value="{{country.longitude}}" />
- {% endif %}
- </li>
- {% endfor %}
- </ul>
- </li>
-{% endfor %}
-</ul>
-{% else %}
-<p>No data</p>
-{% endif %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{{ continent }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "world_red.png" %}" alt="geo-countries" style="vertical-align:middle" /> <a href="{% url telemeta-geo-continents %}">{% trans "World" %}</a> / {{ continent }}
-{% endblock title %}
-
-{% block content %}
-<table class="listing">
- <tr>
- <th>{% trans "Country" %}</th>
- <th>{% trans "Number of collections" %}</th>
- <th>{% trans "Number of items" %}</th>
- </tr>
- {% for country in countries %}
- <tr>
- <td>{{ country }}</td>
- <td>
- {% with country.collections.count as num %}
- <a href="{% url telemeta-geo-country-collections continent.flatname,country.flatname %}">
- {% blocktrans count num as counter %}1 collection{% plural %}{{ counter }} collections{% endblocktrans %}
- </a>
- {% endwith %}
- </td>
- <td>
- {% with country.items.count as num %}
- <a href="{% url telemeta-geo-country-items continent.flatname,country.flatname %}">
- {% blocktrans count num as counter %}1 item{% plural %}{{ counter }} items {% endblocktrans %}
- </a>
- {% endwith %}
- </td>
- </tr>
-{% endfor %}
-</table>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{{ country }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
-
-{% block title %}
-<img src="{% url telemeta-images "world_red.png" %}" alt="geo-country" style="vertical-align:middle" /> <a href="{% url telemeta-geo-continents %}">{% trans "World" %}</a> /
- <a href="{% url telemeta-geo-countries continent.flatname %}">{{ continent }}</a> / {{ country }}
-{% endblock title %}
-
-{% block content %}
-{% with object_list as collections %}
-<div class="fullpage">
-{% include "telemeta/inc/collection_list.html" %}
-</div>
-{% endwith %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{{ country }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
-
-{% block title %}
-<a href="{% url telemeta-geo-continents %}">{% trans "World" %}</a> /
- <a href="{% url telemeta-geo-countries continent.flatname %}">{{ continent }}</a>
- / {{ country }}
-{% endblock title %}
-
-{% block content %}
-{% with object_list as items %}
-<div class="fullpage">
-{% include "telemeta/inc/mediaitem_list.html" %}
-</div>
-{% endwith %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block extra_javascript %}
-<script src="{% url telemeta-js "popupdiv-min.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script>
-<script>
- jQuery(window).ready(function(){
- var p = playlistUtils;
- var a = jQuery('#_new_playlist');
- a.unbind('click').click(function(){p.showAdd(a);return false;});
- });
-
-</script>
-{% endblock %}
-
-{% block content %}
-<div id="module-set" style="width: 33%">
- {% block modules %}
- {% include "telemeta/inc/module_revisions.html" %}
- {% endblock %}
-</div>
-<div class="home-description">
- <h1><img src="{% url telemeta-images "playlist_title.png" %}" alt="playlists" style="vertical-align:middle" /> {% trans "Playlists" %}</h1>
- <a href=# id="_new_playlist" style="float:right" class="component_icon button icon_add">
- {% trans "Add" %}</a>
- {% for playlist in playlists %}
- <table class="listing" style="width:100%;margin-top: 3em">
- <tr>
- <td style="border-bottom:1px solid #6A0307;color:#6A0307;font-size: 100%">{{ playlist.playlist.title }}</td>
- <td style="width:66ex; padding-right: 0; border-bottom:1px solid #6A0307; text-align:right">
- <a href="{% url telemeta-playlist-csv-export playlist.playlist.public_id 'collections' %}" class="component_icon button icon_csv">CSV Collections</a>
- <a href="{% url telemeta-playlist-csv-export playlist.playlist.public_id 'items' %}" class="component_icon button icon_csv">CSV Items</a>
- <a href="#" id="{{playlist.playlist.public_id}}" onclick="playlistUtils.remove(this.id);return false;" class="component_icon button icon_cancel">{% trans "Delete" %}</a>
- </td>
- </tr>
- {% if playlist.playlist.description %}
- <tr>
- <td colspan="2" style="border-bottom:1px solid #6A0307;color:#6A0307;font-size: 80%">{{ playlist.playlist.description }}</td>
- </tr>
- {% endif %}
- </table>
- <table class="listing" width="100%">
- <tr>
- <th class="highlight">{% trans "Title" %}</th>
- <th>{% trans "Type" %}</th>
- <th>{% trans "Code" %}</th>
- <th>{% trans "Recordist" %}</th>
- <th>{% trans "Recording period" %}</th>
- <th>{% trans "Sound" %}</th>
- <th>{% trans "Action" %}</th>
- </tr>
- {% for resource in playlist.resources %}
- <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
- <td>
- {% if resource.type == "item" and not resource.element == None %}
- <a href="{% url telemeta-item-detail resource.element.public_id %}">{{ resource.element }}</a>
- {% endif %}
- {% if resource.type == "collection" and not resource.element == None %}
- <a href="{% url telemeta-collection-detail resource.element.public_id %}">{% if resource.element.title %}{{ resource.element.title }}{% else %}{{ resource.element }}{% endif %}</a>
- {% endif %}
- {% if resource.type == "marker" and not resource.element == None %}
- <a href="{% url telemeta-item-detail-marker resource.element.public_id %}">{{ resource.element }}</a>
- {% endif %}
- {% if resource.element == None %}{% trans "deleted" %}{% endif %}
- </td>
- <td>{{ resource.type }}</td>
- <td>
- {{ resource.element.public_id }}
- </td>
- <td>{{ resource.element.apparent_collector }}</td>
-
- <td>
- {% if resource.element.recorded_from_date %}
- {{ resource.element.recorded_from_date.year }}
- {% if resource.element.recorded_to_date and not resource.element.recorded_to_date.year|equals:resource.element.recorded_from_date.year %}
- - {{ resource.element.recorded_to_date.year }}
- {% endif %}
- {% endif %}
- </td>
- <td align="center" style="vertical-align:middle">
- {% if resource.element.file or resource.element.has_mediafile %}
- <img src="{% url telemeta-images "ok.png" %}" alt="yes" style="vertical-align:middle" /></a>
- {% endif %}
- </td>
- <td style="vertical-align:middle">
- <a href="#" onclick="playlistUtils.removeResource('{{resource.public_id}}');return false;" class="component_icon button icon_cancel" style="padding: 4px 12px;"></a>
- </td>
- </tr>
- {% endfor %}
- </table>
- {% endfor %}
-</div>
-{% endblock %}
-
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-{% if collections %}
-{% if hits %}
-
-<p class="pagination">
-{% blocktrans %}Collections {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
-| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
-</p>
-{% endif %}
-<table class="listing">
-<tr>
- <th class="highlight">{% trans "Title" %}</th>
- <th>{% trans "Code" %}</th>
- <th>{% field_label "MediaCollection" "creator" %}</th>
- <th>{% trans "Recordist" %}</th>
- <th>{% trans "Recording period" %}</th>
- <th>{% trans "Sound" %}</th>
-</tr>
-{% for collection in collections %}
-<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
- <td class="highlight">
- <a href="{% url telemeta-collection-detail collection.public_id %}">{{ collection.title }}</a>
- </td>
- <td>
- {{ collection.code|default:collection.old_code }}
- </td>
- <td>{{ collection.creator }}</td>
- <td>{{ collection.apparent_collector }}</td>
- <td>
- {% if collection.recorded_from_year %}
- {{ collection.recorded_from_year }}
- {% if collection.recorded_to_year and not collection.recorded_to_year|equals:collection.recorded_from_year %}
- - {{ collection.recorded_to_year }}
- {% endif %}
- {% endif %}
- </td>
- <td>
- {% if collection.has_mediafile %}
- <img src="images/ok.png" alt="yes" style="vertical-align:middle" />
- {% endif %}
- </td>
-</tr>
-{% endfor %}
-</table>
-{% else %}
- <p>{% trans "No collection" %}</p>
-{% endif %}
-
+++ /dev/null
-{% load i18n %}
-{% load telemeta_utils %}
-
- <div>
- <h4><a href="#">{% trans "Related media" %}</a></h4>
- {% if related_media %}
- <div>
- <table class="instruments" width="100%">
- <thead>
- <tr>
- <td>{% trans "Media" %}</td>
- <td>{% trans "Preview" %}</td>
- </tr>
- </thead>
- <tbody>
- {% for media in related_media %}
- <tr>
- <td style="font-size: 1em;">
- <dl class="listing">
- <dt>{% trans "Title" %}</dt>
- <dd>
- {% if media.url %}
- <a href="{{ media.url }}" target="_blank">
- {% if media.title %}
- {{ media.title }}</a>
- {% else %}
- {{ media.url|get_filename }}</a>
- {% endif %}
- {% else %}
- <a href="{% url telemeta-collection-related collection.public_id media.id %}" target="_blank">
- {% if media.title %}
- {{ media.title }}</a>
- {% else %}
- {{ media.file|get_filename }}</a>
- {% endif %}
- {% endif %}
- </dd>
- <dt>{% trans "Description" %}</dt>
- <dd>{{ media.description|html_line_break|safe }}</dd>
- <dt>{% trans "Credits" %}</dt>
- <dd>{{ media.credits }}</dd>
- {% dl_field media "mime_type" %}
- <dt>{% trans "URL" %}</dt>
- <dd>
- {% if media.url %}
- <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
- {% else %}
- {% if media.file %}
- <a href="{% url telemeta-collection-related collection.public_id media.id %}" target="_blank">
- {% url telemeta-collection-related collection.public_id media.id %}
- </a>
- {% endif %}
- {% endif %}
- </dd>
- </dl>
- </td>
-
- <td style="padding-bottom: 1em;">{% if media.is_image %}
- {% if media.url %}
- <a href="{{ media.url }}">
- <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
- {% else %}
- <a href="{% url telemeta-collection-related collection.public_id media.id %}">
- <img src="{% url telemeta-collection-related collection.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
- {% endif %}
- {% else %}
- {% if media.url %}
- {% if "youtu" in media.url %}
- <iframe width="251" height="200" src="{{ media.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
- {% endif %}
- {% endif %}
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% endif %}
- {% if user.is_authenticated and perms.telemeta.change_mediacollection %}
- <br /><a href="{% url telemeta-collection-related_edit collection.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
- {% endif %}
- </div>
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-{% if corpi %}
-{% if hits %}
-
-<p class="pagination">
-{% blocktrans %}Corpus {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
-| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
-</p>
-{% endif %}
-<table class="listing">
-<tr>
- <th class="highlight">{% trans "Title" %}</th>
- <th>{% trans "Description" %}</th>
- <th>{% trans "Code" %}</th>
- <th>{% trans "Reference" %}</th>
-</tr>
-{% for corpus in corpi %}
-<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
- <td class="highlight">
- <a href="{% url telemeta-corpus-detail corpus.public_id %}">{{ corpus.title }}</a>
- </td>
- <td>{{ corpus.code }}</td>
- <td>{{ corpus.reference }}</td>
-</tr>
-{% endfor %}
-</table>
-{% else %}
- <p>{% trans "No corpus" %}</p>
-{% endif %}
-
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-
- <h4 class="dublincore">{% trans "Dublin Core Metadata" %}</h4>
- <dl class="dublincore">
- <dt class="caption"><span>Element</span>Refinement</dt><dd class="caption">Value</dd>
- {% for element in resource.elements %}
- <dt><span>{{ element.name }}</span>{{ element.refinement|default:" " }}</dt>
- <dd>
- {% if element.related|is_item or element.related|is_collection %}
- {% if element.related|is_item %}
- <a href="{% url telemeta-item-dublincore element.related.public_id %}">{{ element.value }}</a>
- {% else %}
- <a href="{% url telemeta-collection-dublincore element.related.public_id %}">{{ element.value }}</a>
- {% endif %}
- {% else %}
- {{ element.value }}
- {% endif %}
- </dd>
- {% endfor %}
- </dl>
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-{% if funds %}
-{% if hits %}
-
-<p class="pagination">
-{% blocktrans %}Funds {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
-| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
-</p>
-{% endif %}
-<table class="listing">
-<tr>
- <th class="highlight">{% trans "Title" %}</th>
- <th>{% trans "Description" %}</th>
- <th>{% trans "Code" %}</th>
- <th>{% trans "Reference" %}</th>
-</tr>
-{% for fund in funds %}
-<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
- <td class="highlight">
- <a href="{% url telemeta-funds-detail funds.public_id %}">{{ fund.title }}</a>
- </td>
- <td>{{ fund.code }}</td>
- <td>{{ fund.reference }}</td>
-</tr>
-{% endfor %}
-</table>
-{% else %}
- <p>{% trans "No fund" %}</p>
-{% endif %}
-
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-{% if items %}
-
-{% if hits %}
-<p class="pagination">
-{% blocktrans %}Items {{ first_on_page }} to {{ last_on_page }} on {{ hits }}{% endblocktrans %}
-| Pages : {% if pages == 1 %}1{% else %}{% if is_paginated %}{% load paginator %}{% paginator 5 %}{% endif %}{% endif %}
-</p>
-{% endif %}
-
-<table class="listing">
-<tr>
- <th class="highlight">{% trans "Title" %}</th>
- <th>{% trans "Code" %}</th>
- <th>{% trans "Recordist" %}</th>
- {% if location_name %}
- <th>{% trans "Location" %}</th>
- {% else %}
- <th>{% trans "Country/Continent" %}</th>
- {% endif %}
- <th>{% trans "Year of recording" %}</th>
- <th>{% trans "Sound" %}</th>
-</tr>
-{% for item in items %}
-<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
- <td class="highlight">
- <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
- </td>
- <td>
- {{ item.code|default:item.old_code }}
- </td>
- <td>{{ item.apparent_collector }}</td>
- {% if location_name %}
- <td>{{ item.location.name }}</td>
- {% else %}
- <td>{{ item.country_or_continent|default:' ' }}</td>
- {% endif %}
- <td>
- {% if item.recorded_from_date %}
- {{ item.recorded_from_date.year }}
- {% if item.recorded_to_date and not item.recorded_to_date.year|equals:item.recorded_from_date.year %}
- - {{ item.recorded_to_date.year }}
- {% endif %}
- {% endif %}
- </td>
- <td align="center">
- {% if item.file %}
- <a href="{% url telemeta-item-detail item.public_id %}">
- <img src="images/ok.png" alt="yes" style="vertical-align:middle" /></a>
- {% endif %}
- </td>
-</tr>
-{% endfor %}
-</table>
-
-{% else %}
- <p>{% trans "No item" %}</p>
-{% endif %}
-
+++ /dev/null
-{% load i18n %}
-{% load telemeta_utils %}
-
- <div>
- <h4><a href="#">{% trans "Related media" %}</a></h4>
- {% if related_media %}
- <div>
- <table class="instruments" width="100%">
- <thead>
- <tr>
- <td>{% trans "Media" %}</td>
- <td>{% trans "Preview" %}</td>
- </tr>
- </thead>
- <tbody>
- {% for media in related_media %}
- <tr>
- <td style="font-size: 1em;">
- <dl class="listing">
- <dt>{% trans "Title" %}</dt>
- <dd>
- {% if media.url %}
- <a href="{{ media.url }}" target="_blank">
- {% if media.title %}
- {{ media.title }}</a>
- {% else %}
- {{ media.url|get_filename }}</a>
- {% endif %}
- {% else %}
- <a href="{% url telemeta-item-related item.public_id media.id %}" target="_blank">
- {% if media.title %}
- {{ media.title }}</a>
- {% else %}
- {{ media.file|get_filename }}</a>
- {% endif %}
- {% endif %}
- </dd>
- <dt>{% trans "Description" %}</dt>
- <dd>{{ media.description|html_line_break|safe }}</dd>
- <dt>{% trans "Credits" %}</dt>
- <dd>{{ media.credits }}</dd>
- {% dl_field media "mime_type" %}
- <dt>{% trans "URL" %}</dt>
- <dd>
- {% if media.url %}
- <a href="{{ media.url }}" target="_blank">{{ media.url }}</a>
- {% else %}
- {% if media.file %}
- <a href="{% url telemeta-item-related item.public_id media.id %}" target="_blank">
- {% url telemeta-item-related item.public_id media.id %}
- </a>
- {% endif %}
- {% endif %}
- </dd>
- </dl>
- </td>
-
- <td style="padding-bottom: 1em;">{% if media.is_image %}
- {% if media.url %}
- <a href="{{ media.url }}">
- <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
- {% else %}
- <a href="{% url telemeta-item-related item.public_id media.id %}">
- <img src="{% url telemeta-item-related item.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
- {% endif %}
- {% else %}
- {% if media.url %}
- {% if "youtu" in media.url %}
- <iframe width="251" height="200" src="{{ media.url|get_youtube }}" frameborder="0" allowfullscreen></iframe>
- {% endif %}
- {% endif %}
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% endif %}
- {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
- <br /><a href="{% url telemeta-item-related_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
- {% endif %}
- </div>
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-
- <div class="module">
- <h3><a href="{% url telemeta-rss %}">
- <img src="{% url telemeta-images "rss.png" %}" alt="rss" style="vertical-align:middle" /></a>
- {% trans "Last changes" %}</h3>
- <a href="/rss" style="float:right" class="icon_rss"> </a>
- <div class="vscroll">
- <table class="listing" bgcolor="#FFFFFF" style="width: 100%">
- <tr>
- <th class="highlight">{% trans "Date" %}</th>
- <th>{% trans "Title" %}</th>
- <th>{% trans "Type" %}</th>
- <th>{% trans "User" %}</th>
- </tr>
- {% for r in revisions %}
- <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
- <td>{{ r.revision.time }}</td>
- <td>
- {% if r.element %}
- {% if r.revision.element_type == "collection" %}
- <a href="{% url telemeta-collection-detail r.element.public_id %}">{{ r.element.title }}</a>
- {% endif %}
- {% if r.revision.element_type == "item" %}
- <a href="{% url telemeta-item-detail r.element.public_id %}">
- {% if r.element.title != '' %}{{ r.element.title }}{% else %}{{ r.element.collection.title }} - {{ r.element.track }}{% endif %}</a>
- {% endif %}
- {% if r.revision.element_type == "marker" %}
- <a href="{% url telemeta-item-detail-marker r.element.public_id %}">{{ r.element.title }}</a>
- {% endif %}
- {% else %}
- {% trans "deleted" %}
- {% endif %}
- </td>
- <td>{{ r.revision.element_type }}</td>
- <td>{% if r.revision.user %}<a href="{% url telemeta-profile-detail r.revision.user.username %}">{{ r.revision.user.username }}</a>{% endif %}</td>
- </tr>
- {% endfor %}
- </table>
- </div>
- </div>
\ No newline at end of file
+++ /dev/null
-{% load i18n %}
-{% load telemeta_utils %}
-
- <table class="listing" width="100%">
- <thead>
- <tr><th>{% trans "User"%}</th>
- <th>{% trans "First Name"%}</th>
- <th>{% trans "Last Name"%}</th>
- <th>{% trans "E-mail"%}</th>
- <th>{% trans "Groups"%}</th>
- </tr>
- </thead><tbody>
- {% for user in users %}
- <tr>
- <td><a href="{% url telemeta-profile-detail user.username %}">{{user.username}}</a></td>
- <td>{{ user.first_name }}</td>
- <td>{{ user.last_name }}</td>
- <td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>
- <td>{% for group in user.groups.all %}{{ group }} {% endfor %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
\ No newline at end of file
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block content %}
-<div class="home-content">
-<div id="module-set">
-
-{% block modules %}
-
-{% if sound_pub_item %}
-<div id="module" class="module">
- <h3><img src="{% url telemeta-images "module_playlist.png" %}" alt="playlist" style="vertical-align:middle" />
- {% trans "Musical selection" %}</h3>
- <ul class="playlist">
- <li><a href="{% url telemeta-item-detail sound_pub_item.public_id %}"><b>{{ sound_pub_item }}</b></a>{% if sound_pub_item.alt_title %} ({{ sound_pub_item.alt_title }}){% endif %}<br /><span style="font-size: 90%">{{ sound_pub_item.location.fullnames|to_string }}</span><br />
-<iframe width='376' height='215' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/items/{{ sound_pub_item.public_id }}/player/362x130/'></iframe>
- </li>
- </ul>
-</div>
-{% endif %}
-
-<div class="module">
- <h3><img src="{% url telemeta-images "module_world.png" %}" alt="world" style="vertical-align:middle" />
- {% trans "Geo Navigator" %}</h3>
- <a class="image-link" href="{% url telemeta-geo-continents %}">
- <img class="map-thumbnail" src="{% url telemeta-images "world2.png" %}" alt="{% trans "Open the geographic navigator" %}" style="width:398px" /></a>
-</div>
-
-{% include "telemeta/inc/module_revisions.html" %}
-
-{{ block.super }}
-<div id="module" class="module">
- <h3><img src="/images/module_playlist.png" style="vertical-align:middle" />
- Partenaires</h3><br />
- <div style="background-color: white; padding: 1ex;" align="center">
- <a href="http://www.cnrs.fr"><img class="image-link" src="{% url telemeta-images "logo-CNRS.png" %}" alt="CNRS"></a>
- <a href="http://www.culture.gouv.fr"><img class="image-link" src="{% url telemeta-images "logo_mcc_2.png" %}" alt="MCC"></a>
- <a href="http://www.mnhn.fr"><img class="image-link" src="{% url telemeta-images "logo-mnhn.gif" %}" alt="MNHN"></a>
- <br /><br />
- <a href="http://www.tge-adonis.fr"><img class="image-link" src="{% url telemeta-images "logo-adonis.jpg" %}" alt="TGE Adonis"></a>
- </div>
-</div>
-
-{% endblock %}
-
-</div>
-
-<div class="home-description">
-<img class="align-left" src="{% url telemeta-images "vox.png" %}" alt="vox" style="vertical-align:middle;" />
-{{ page_content|render_flatpage }}
-</div>
-
-{% if sound_pub_items %}
-<div style="margin-top: 1ex;">
-<h1><img src="{% url telemeta-images "playlist_title.png" %}" alt="playlists" style="vertical-align:middle" />
- {% trans "Musical selection" %}</h1>
-<table style="font-size: 90%"><tr>
-{% for item in sound_pub_items %}
-<td width="390"><a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>{% if item.alt_title %} ({{ item.alt_title }}){% endif %}<br /><span style="font-size: 80%">{{ item.location.fullnames|to_string }}</span><br />
-<iframe width='376' height='220' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='/items/{{ item.public_id }}/player/362x130/'></iframe></td>
-{% endfor %}
-</tr>
-</table>
-</div>
-{% endif %}
-
-</div>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Instruments" %} - {{ block.super }}{% endblock %}
-
-{% block tabcontents %}
- <h4>{% trans "Instruments" %}</h4>
- <form class="addnew" id="_addinstru" method="POST"
- action="{% url telemeta-instrument-add %}">{% csrf_token %}
- <fieldset>
- <legend>{% trans "Add entry" %}</legend>
- <div class="field">
- <label>{% trans "Name" %}: <input type="text" name="value"></label>
-
- </div>
- <div class="buttons">
- <br />
- <a href="#" class="component_icon button icon_add"
- onclick="document.getElementById('_addinstru').submit(); return false;">{% trans "Add" %}</a>
- </div>
- </fieldset>
- </form>
- {% if instruments %}
- <form id="_updateinstru" method="POST" action="{% url telemeta-instrument-update %}">{% csrf_token %}
- <table class="listing">
- <thead>
- <tr><th class="sel"> </th><th>{% trans "Name"%}</th></tr>
- </thead><tbody>
- {% for record in instruments %}
- <tr>
- <td><input type="checkbox" name="sel" value="{{record.id}}" /></td>
- <td><a href="{% url telemeta-instrument-record-edit record.id %}">
- {{record.name}}</a></td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- <div class="buttons">
- <br />
- <a href="#" class="component_icon button icon_cancel"
- onclick="document.getElementById('_updateinstru').submit(); return false;">{% trans "Remove selected items" %}</a>
- </div>
- </form>
- {% else %}
- <p class="help">{% trans "This instrument list is empty" %}</p>
- {% endif %}
-
- <br style="clear: right"/>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/admin.html" %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Instruments" %} - {{ block.super }}{% endblock %}
-
-{% block tabcontents %}
- <h4>{% trans "Instruments" %}</h4>
- <form class="mod" id="addinstru" method="post"
- action="{% url telemeta-instrument-record-update instrument.id %}">{% csrf_token %}
- <fieldset>
- <legend>{% trans "Modify an entry" %}</legend>
- <div class="field">
- <label>{% trans "Name" %}: <input type="text" name="value" value="{{instrument.name}}" /></label>
-
- </div>
- <br />
- <div class="buttons">
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('addinstru').submit(); return false;">{% trans "Save" %}</a>
- <a href="{% url telemeta-instrument-edit %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- </div>
- </fieldset>
- </form>
- <br style="clear: right"/>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-
-{% block title %}
- <img src="{% url telemeta-images "user_red.png" %}" style="vertical-align:middle" /> {% trans "User authentication" %}
-{% endblock %}
-
-{% block content %}
-{% if form.errors %}
-<p class="login-error">{% trans "Your username and password didn't match. Please try again." %}</p>
-{% endif %}
-<form class="login" id="_loginForm" method="post" action="{% url telemeta-login %}">{% csrf_token %}
-<p>
-{{ form.username.label_tag }}
-{{ form.username }}<br />
-{{ form.password.label_tag }}
-{{ form.password }}
-</p>
-<a href="#" class="component_icon button icon_login" style="float: right;"
- onclick="document.getElementById('_loginForm').submit(); return false;">{% trans "Sign in" %}</a>
-<input type="hidden" name="next" value="{{ next }}" />
-<span style="align: right;"><a href="{% url telemeta-password-reset %}">{% trans "Password forgotten" %} ?</a></span>
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Item" %}- {{ block.super }}{% endblock %}
-
-{% if item %}
-{% block title %}
- <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> Item : NEW
-{% endblock %}
-
-{% block title_buttons %}
- {% if perms.telemeta.add_mediaitem %}
- <a href="{% url telemeta-items %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- {% endif %}
-{% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="infos">
- <form method="post" id="_addItemForm" action="" enctype="multipart/form-data">{% csrf_token %}
- <ul>{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</ul>
- <table>
- {% for field in form %}
- <tr>
- {% if field.html_name == "copied_from_item" %}
- <td>{{ field.label_tag.as_hidden }}{{ field.as_hidden }}</td>
- {% else %}
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td>
- {% if field.html_name == "collection" %}
- <td> {% trans "Title"Â %} : {{ item.collection.title }}<br />
- {% trans "Code"Â %} : {{ item.collection.code }}<br />
- {{ field }}</td>
- {% else %}
- <td>{{ field }}</td>
- {% endif %}
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-items %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="var d=document; d.getElementById('wait-img').style.display='inline'; setTimeout(function(){d.getElementById('_addItemForm').submit();},300); return false;">{% trans "Save" %}</a>
- <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{% url telemeta-images "wait.gif" %}" />
- </div>
- </form>
- </div>
- {% endblock infos %}
-</div> <!-- with-rightcol -->
-{% endblock %}
-
-{% block delete %}
-{% endblock %}
-
-{% else %}
-<p>No such item</p>
-{% endif %}
+++ /dev/null
-{% extends "telemeta/mediaitem_detail.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Item" %}- {{ block.super }}{% endblock %}
-
-{% block extra_javascript %}
-{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> Item : NEW
-{% endblock %}
-
-{% block title_buttons %}
- {% if user.is_authenticated and perms.telemeta.add_mediaitem %}
- <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- {% endif %}
-{% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="infos">
- <form enctype="multipart/form-data" id="_mediaItemCopyForm" method="post" action="">{% csrf_token %}
- <ul>{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</ul>
- <table>
- {% for field in form %}
- <tr>
- {% if field.html_name == "copied_from_item" %}
- <td>{{ field.label_tag.as_hidden }}{{ field.as_hidden }}</td>
- {% else %}
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td>
- {% if field.html_name == "collection" %}
- <td> {% trans "Title"Â %} : {{ item.collection.title }}<br />
- {% trans "Code"Â %} : {{ item.collection.code }}<br />
- {{ field }}</td>
- {% else %}
- <td>{{ field }}</td>
- {% endif %}
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_mediaItemCopyForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
- {% endblock infos %}
-{% endblock %}
-
-{% block delete %}
-{% endblock %}
-
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Item" %} : {% if item.title %}{{ item.title }}{% else %}{{ item.public_id}}{% endif %} - {{ block.super }}{% endblock %}
-
-{% block stylesheets %}
-{{ block.super }}
- <link rel="stylesheet" type="text/css" href="{% url telemeta-timeside "skins/lab/style.css" %}" />
- <link rel="stylesheet" type="text/css" href="{% url telemeta-css "player.css" %}" />
-{% endblock %}
-
-{% block extra_javascript %}
-{% if item %}
-
-{% if item.file %}
-{% if public_access or perms.telemeta.can_play_all_items %}
-<script src="{% url telemeta-timeside "js/libs/soundmanager2-nodebug-jsmin.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-timeside "js/timeside.js" %}" type="text/javascript"></script>
-{% endif %}
-{% endif %}
-
-<script src="{% url telemeta-js "popupdiv-min.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script>
-
-{% if item.file %}
-{% if public_access or perms.telemeta.can_play_all_items %}
-<script src="{% url telemeta-js "playerLoader.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "divmarker.js" %}" type="text/javascript"></script>
-{% endif %}
-{% endif %}
-
-<script type="text/javascript">
- {% if item.file %}
- {% if public_access or perms.telemeta.can_play_all_items %}
- //initializing soundManager default properties
- soundManager.flashVersion = 9;
- soundManager.url = "{% url telemeta-timeside "swf/" %}";
- soundManager.debugMode = false;
- soundManager.allowPolling = true;
- soundManager.useHTML5Audio = true;
- soundManager.preferFlash = true;
-
- //initializing the visualizers to be passed to the player
- var visualizers = {};
- {% for v in visualizers %}
- visualizers["{{v.name}}"] = "{% url telemeta-item-visualize item.public_id,v.id,"WIDTH","HEIGHT" %}";
- {% endfor %}
- {% if user.is_superuser %}
- loadPlayer('{% url telemeta-item-analyze-xml item.public_id %}',
- "{% url telemeta-item-export item.public_id,"mp3" %}", undefined, '{{item.id}}', visualizers,
- CURRENT_USER_NAME, //undefined if !user.is_authenticated
- true); //true because superuser
- {% else %}
- loadPlayer('{% url telemeta-item-analyze-xml item.public_id %}',
- "{% url telemeta-item-export item.public_id,"mp3" %}", undefined, '{{item.id}}', visualizers,
- CURRENT_USER_NAME, //undefined if !user.is_authenticated
- false); //false because not superuser
- {% endif %}
- {% endif %}
- {% endif %}
- //playlists:
- {% if user.is_authenticated %}
- {% for playlist in playlists %}
- playlistUtils.addPlaylist('{{ playlist.playlist.title }}','{{playlist.playlist.public_id}}');
- {% endfor %}
- jQuery(window).ready(function(){
- var anchor = jQuery('#_add_to_playlist');
- if(anchor.length){
- anchor.unbind('click').click(function(){
- playlistUtils.showAddResourceToPlaylist(anchor,'item','{{item.id}}',gettrans('item added to the selected playlist'));
- return false;
- });
- }
- });
- {% endif %}
-</script>
-{% endif %}
-{% endblock %}
-
-{% if item %}
-
-{% block title %}
-<img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" />
-Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
-{% endblock %}
-
-{% block title_buttons %}
-<div class="fixedWidthAsPlayer">
- {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
- <a href="{% url telemeta-item-edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
- <a href="{% url telemeta-item-copy item.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
- {% endif %}
- {% if user.is_authenticated %}
- <a id="_add_to_playlist" href='#' class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
- {% endif %}
- <a href="{% url telemeta-item-detail previous %}" class="component_icon button icon_previous">{% trans "Previous" %}</a>
- <a href="{% url telemeta-item-detail next %}" class="component_icon button icon_next">{% trans "Next" %}</a>
- <a href="{% url telemeta-item-dublincore item.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
-</div>
-{% endblock %}
-
-{% block content %}
-<div class="{% if item.file %}{% if public_access or perms.telemeta.can_play_all_items %}with-rightcol{% endif %}{% endif %}">
- {% if item.file %}
- {% if public_access or perms.telemeta.can_play_all_items %}
- <div id="player_maximized" class="ts-skin-lab">
- <a href="#" class="toggle">Minimize</a>
- <a href="#" class="embed_player_frame"></></a>
- <div class="wazing"></div>
- </div>
- <div id="rightcol">
- <div id="player_minimized" class="ts-skin-lab">
- <a href="#" class="toggle">Maximize</a>
- <a href="#" class="embed_player_frame"></></a>
- <div class="wazing"></div>
- <div id="player" class="ts-player">
- </div>
- </div>
-
- <!-- </div> -->
- <div id="tabs_container">
- <!-- this div will be hidden when everything is fully loaded-->
- <span id="loading_span" href="#"><img style="vertical-align:middle" alt="wait" src="{% url telemeta-images "wait.gif" %}" />
- <span id="loading_span_text">Loading...</span></span>
- <a id="tab_analysis" style="display:none" class ="tab" href="#">{% trans "Analysis" %}</a><!--
- do not let space here as it appears in the document!!!!!
- --><a id="tab_markers" style="display:none" class="tab" href="#">{% trans "Markers" %}</a>
- </div>
-
- <div class="markers" id="markers_div_id"></div>
-
- <div class="analyzer" id="analyzer_div_id">
- <table width="100%">
- <tr class="analyzer-title">
- <td>{% trans "Property" %}</td>
- <td>{% trans "Value" %}</td>
- <td>{% trans "Unit" %}</td>
- </tr>
- </table>
- </div>
- <!--</div>-->
-
- {% if audio_export_enabled or perms.telemeta.can_download_all_items or user.is_superuser %}
- <div class="exporter">
- <p><img src="{% url telemeta-images "download.png" %}" alt="download" style="vertical-align:middle" /> {% trans "Download:" %}
- {% for format in export_formats %}
- <a href="{% url telemeta-item-export item.public_id,format.extension %}">
- <img src="images/{{ format.extension }}.png" style="vertical-align:middle" alt="{{ format.extension }}" /></a>
- {% endfor %}</p>
- </div>
- {% endif %}
-
- </div>
- {% endif %}
- {% endif %}
-
- {% block infos %}
- <div class="infos">
- {% block general_info %}
- <dl class="listing">
- {% dl_field item "title" placeholder %}
- {% dl_field item "alt_title" %}
- {% dl_field item "collector" placeholder %}
- <dt>{% field_label item "collection" %}</dt>
- <dd><a href="{% url telemeta-collection-detail item.collection.public_id %}">{{ item.collection }}</a></dd>
- <dt>{% trans "Recording date" %}</dt>
-
- <dd>{% if item.recorded_from_date %}{{ item.recorded_from_date }}{% endif %}{% if item.recorded_from_date and item.recorded_to_date%} - {% endif %}{% if item.recorded_to_date %}{{ item.recorded_to_date}}{% endif %}</dd>
-
- </dl>
- {% endblock general_info %}
- </div>
- <div class="extraInfos">
- {% block geoethnic_data %}
- <div>
- <h4><a href="#">{% trans "Geographic and cultural informations" %}</a></h4>
- <dl class="listing">
- <dt>{% trans "Location" %}</dt>
- <dd>{% if item.location %}{{ item.location.fullnames|join:"<br/>" }}{% endif %}</dd>
- {% dl_field item "location_comment" %}
- {% dl_field item "cultural_area" %}
- {% dl_field item "language" %}
- {% if item.language_iso %}
- <dt>{% trans "Language ISO" %}</dt>
- <dd>{{ item.language_iso.name|to_utf8 }}</dd>
- {% endif %}
- {% dl_field item "ethnic_group" placeholder %}
- <dt>{% trans "Ethnographic context" %}</dt>
- <dd>{{ item.context_comment|html_line_break|safe }}</dd>
- {% dl_field item "keywords" join with ", " %}
- </dl>
- </div>
- {% endblock geoethnic_data %}
- </div>
- {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
- <a href="{% url telemeta-item-keywords_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %} {% trans "keywords" %}</a>
- {% endif %}
- <div class="extraInfos">
- {% block musical_data %}
- <div>
- <h4><a href="#">{% trans "Musical informations" %}</a></h4>
- <dl class="listing">
- {% dl_field item "vernacular_style" %}
- {% dl_field item "generic_style" %}
- {% dl_field item "author" %}
- </dl>
- {% if item.performances %}
- <div class="instruments">
- <table class="instruments">
- <thead>
- <tr>
- <td>{% field_label "MediaItemPerformance" "instruments_num" %}</td>
- <td>{% field_label "MediaItemPerformance" "instrument" %}</td>
- <td>{% field_label "MediaItemPerformance" "alias" %}</td>
- <td>{% field_label "MediaItemPerformance" "musicians" %}</td>
- </tr>
- </thead>
- <tbody>
- {% for performance in item.performances.all %}
- <tr>
- <td>{{ performance.instruments_num }}</td>
- <td>{{ performance.instrument|default:"" }}</td>
- <td>{{ performance.alias|default:"" }}</td>
- <td>{{ performance.musicians }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% endif %}
- </div>
- {% endblock musical_data %}
- </div>
- {% if user.is_authenticated and perms.telemeta.change_mediaitem %}
- <a href="{% url telemeta-item-performances_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "performance"%}</a>
- {% endif %}
- <div class="extraInfos">
- {% block general_data %}
- <div>
- <h4><a href="#">{% trans "General informations" %}</a></h4>
- <dl class="listing">
- <dt>{% trans "Remarks" %}</dt>
- <dd>{{ item.comment|html_line_break|safe }}</dd>
- {% dl_field item "collector_selection" %}
- </dl>
- </div>
- {% endblock general_data %}
- </div>
- <div class="extraInfos">
- {% block archive_data %}
- <div>
- <h4><a href="#">{% trans "Archiving data" %}</a></h4>
- <dl class="listing">
- {% dl_field item "code" %}
- {% dl_field item "old_code" %}
- {% dl_field item "track" %}
- {% dl_field item "creator_reference" %}
- <dt>{% trans "Published references" %}</dt>
- <dd>{{ item.external_references|html_line_break|safe }}</dd>
- {% dl_field item "public_access_label" %}
- </dl>
- </div>
- {% endblock archive_data %}
- </div>
- <div class="extraInfos">
- {% block technical_data %}
- <div>
- <h4><a href="#">{% trans "Technical data" %}</a></h4>
- <div>
- <dl class="listing">
- <dt>{% trans "Media type" %}</dt><dd>{% trans "Audio" %}</dd>
- {% dl_field item "approx_duration" %}
- </dl>
- </div>
- </div>
- {% endblock technical_data %}
- </div>
- {% endblock infos %}
-</div> <!-- with-rightcol -->
-
-<div class="extraInfos">
- {% block related %}
- {% include "telemeta/inc/mediaitem_related.html" %}
- {% endblock related %}
-</div>
-
-{% endblock %}
-
-{% block delete %}
-{% if user.is_authenticated and perms.telemeta.delete_mediaitem %}
- <a href="#" onclick="if(confirm(gettrans('delete the item permanently?'))){window.location.href='{% url telemeta-item-delete item.public_id %}';};return false;"
- class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
-{% endif %}
-{% endblock %}
-
-{% else %}
-<p>No such item</p>
-{% endif %}
+++ /dev/null
-{% extends "telemeta/mediaitem_detail.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% if item %}
-{% block title_buttons %}
- <a class="component_icon button icon_previous" href="{% url telemeta-item-detail item.public_id %}">{% trans "Normal View" %}</a>
-{% endblock %}
-
-{% block infos %}
-{% with item|to_dublincore as resource %}
-{% include "telemeta/inc/dublincore.html" %}
-{% endwith %}
-{% endblock %}
-{% else %}
- <p>{% trans "No such item" %}</p>
-{% endif %}
-
-{% block related %}
-{% endblock related %}
+++ /dev/null
-{% extends "telemeta/mediaitem_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title %}
-<img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> Item : {{ item }}
-{% endblock %}
-
-{% block title_buttons %}
-<a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block infos %}
-<div class="infos">
- <form enctype="multipart/form-data" id="_editItemForm" method="post" action="">{% csrf_token %}
- <table>
- <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
- {% for field in form %}
- <tr>
- {% if field.html_name == "copied_from_item" %}
- <td>{{ field.label_tag.as_hidden }}{{ field.as_hidden }}</td>
- {% else %}
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{{ field.label_tag }}:</td>
- {% if field.html_name == "collection" %}
- <td> {% trans "Title"Â %} : {{ item.collection.title }}<br />
- {% trans "Code"Â %} : {{ item.collection.code }}<br />
- {{ field }}</td>
- {% else %}
- <td>{{ field }}</td>
- {% endif %}
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <div align="center" style="margin-top:3ex;">
- <a href="{% url telemeta-item-detail item.public_id %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
-onclick="var d=document; d.getElementById('wait-img').style.display='inline'; setTimeout(function(){d.getElementById('_editItemForm').submit();},300); return false;">{% trans "Save" %}</a>
- <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{% url telemeta-images "wait.gif" %}" />
- </div>
- </form>
-</div>
-{% endblock infos %}
-
-{% block related %}
-{% endblock %}
-
-{% block delete %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/mediaitem_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block extra_javascript %}
-{% endblock %}
-
- {% block title %}
- <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> <h1>Item : {{ item }}</h1>
- {% endblock %}
- {% block title_buttons %}
- <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- {% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="infos">
- <form method="post" id="_editForm" action="">{% csrf_token %}
-
- {{ formset.management_form }}
- {% for form in formset.forms %}
- <table>
- <tr><td><b>{% trans "Keyword" %} :</b><td></td></tr>
- {% for field in form %}
- <tr>
- {% if "item" in field.html_name or "id" in field.html_name %}
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- {% else %}
- <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <br />
- {% endfor %}
-
- <div align="center">
- <a href="{% url telemeta-item-detail item.public_id %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
-
- </form>
- </div>
-
- {% endblock infos %}
-{% endblock content %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block head_title %}{% trans "Media Items" %} - {{ block.super }}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> {% trans "Media Items" %}
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-items %}" class="component_icon button icon_filter">{% trans "All" %}</a>
- <a href="{% url telemeta-items-sound %}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
- {% if user.is_authenticated and perms.telemeta.add_mediaitem %}
- <a href="{% url telemeta-item-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
- {% endif %}
-{% endblock %}
-
-{% block content %}
-{% with object_list as items %}
-<div class="fullpage">
-{% include "telemeta/inc/mediaitem_list.html" %}
-</div>
-{% endwith %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/mediaitem_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block extra_javascript %}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> Item : {{ item }}
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="infos">
- <form method="post" id="_editPerformanceForm" action="">{% csrf_token %}
-
- {{ formset.management_form }}
- {% for form in formset.forms %}
- <hr>
- <table>
- <tr><td><b>{% trans "Performance" %} :</b><td></td></tr>
- {% for field in form %}
- <tr>
- {% if not "media_item" in field.html_name %}
- {% if "id" in field.html_name %}
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- {% else %}
- <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
- {% endif %}
- {% else %}
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <br />
- {% endfor %}
- <div align="center">
- <a href="{% url telemeta-item-detail item.public_id %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editPerformanceForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
- {% endblock infos %}
-{% endblock content %}
+++ /dev/null
-{% extends "telemeta/mediaitem_detail.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-
-{% block stylesheets %}
-{{ block.super }}
- <style type="text/css">
- #rightcol {
- width: {{width}}px;
- }
- .ts-skin-lab .ts-player .ts-wave {
- height: {{height}}px;
- }
- </style>
-{% endblock %}
-
-{% block title %}{% endblock %}
-{% block title_buttons %}{% endblock %}
-
-{% block layout %}
-{% block content %}
-<div>
-{% if item.file %}
- {% if public_access or user.is_staff %}
- <div id="rightcol" style="float: left; padding-bottom:0;">
- <div id="player_minimized" class="ts-skin-lab">
- <div class="wazing"></div>
- <div id="player" class="ts-player">
- </div>
- </div>
- <div>
- <span style="font-size:65%; float:left">{% organization %} - Item : <a href="{% url telemeta-item-detail item.public_id %}" target="_blank">{% if item.code %}{{ item.code }}{% else %}{{ item.old_code }}{% endif %}</a></span>
- <span style="font-size:65%; float:right"><a href="http://telemeta.org" target="_blank">Telemeta</a> powered</span>
- </div>
- </div>
- {% endif %}
-{% endif %}
-</div>
-
-{% endblock content%}
-{% endblock layout %}
-
-{% block footer %}{% endblock %}
+++ /dev/null
-{% extends "telemeta/mediaitem_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block extra_javascript %}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "item.png" %}" style="vertical-align:middle" /> Item : {{ item }}
-{% endblock %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block content %}
- {% block infos %}
- <div class="infos">
- <form enctype="multipart/form-data" method="post" id="_editMediaItemRelatedFileForm" action="">{% csrf_token %}
-
- {{ formset.management_form }}
- {% for form in formset.forms %}
- <hr>
- <table>
- <tr><td><b>{% trans "Media" %} :</b><td></td></tr>
- {% for field in form %}
- <tr><td class="error">{{ field.errors }}</td></tr>
- <tr>
- {% if "media_item" in field.html_name or "id" in field.html_name or "item" in field.html_name or "mime_type" in field.html_name %}
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- {% else %}
- <td>{{ field.label_tag }}: </td><td>{{ field }}</td>
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <br />
- {% endfor %}
- <div align="center">
- <a href="{% url telemeta-item-detail item.public_id %}"
- class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editMediaItemRelatedFileForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
- {% endblock infos %}
-{% endblock content %}
+++ /dev/null
-{% extends "telemeta/base_xspf.xml" %}
-{% load telemeta_utils %}
-
-{% block tracklist %}
- <track>
- <title>{{ item }}</title>
- <meta rel="type">mp3</meta>
- <location>http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}</location>
- <duration>{{ item.get_duration|mul:1000 }}</duration>
- <info>http://{{ host }}{% url telemeta-item-detail item.public_id %}</info>
- </track>
-{% endblock %}
-
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-
-{% block content %}
-{% if messages %}
- {% for message in messages %}
- <h1>{{ message }}</h1>
- <p>{{ description }}
- {% endfor %}
-{% endif %}
-{% endblock %}
-
+++ /dev/null
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% if has_previous %}
- <a href="?page={{ previous }}&{{ criteria|build_query_string }}">< {% trans "Previous" %}</a>
-{% endif %}
-
-{% if show_first %}
-<a href="?page=1">1</a> ...
-{% endif %}
-{% for linkpage in page_numbers %}
- {% ifequal linkpage page %}
- {{ page }}
- {% else %}
- <a href="?page={{ linkpage }}&{{ criteria|build_query_string }}">{{ linkpage }}</a>
- {% endifequal %}
-{% endfor %}
-{% if show_last %}
- ...
- <a href="?page=last">{{ pages }}</a>
-{% endif %}
-{% if has_next %}
- <a href="?page={{ next }}&{{ criteria|build_query_string }}">{% trans "Next" %} ></a>
-{% endif %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block head_title %}{% trans "User Profile" %} : {{ usr.username }}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "user_red.png" %}" alt="user" style="vertical-align:middle" /> {% trans "User profile" %} : {{ usr.username }}
-{% endblock %}
-
-{% block content %}
- <div id="module-set" style="width: 33%">
- {% block modules %}
- <div class="module">
- <h3><img src="{% url telemeta-images "module_playlist.png" %}" alt="playlists" style="vertical-align:middle" />
- {% trans "Playlists" %}</h3>
- <ul class="playlist">
- {% for p in playlists %}
- <li>
- <b>{{ p.playlist.title }}</b>
- <br />
- <span class="info">{{ p.playlist.description }}</span>
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endblock %}
- </div>
-
- <div class="infos" style="padding-top: 1em;">
- <dl class="listing">
- <dt>{% trans "First Name" %}</dt><dd>{{ usr.first_name }}</dd>
- <dt>{% trans "Last Name" %}</dt><dd>{{ usr.last_name }}</dd>
- <dt>{% trans "Email" %}</dt><dd>{{ usr.email }}</dd>
-
- <dt>{% trans "Institution" %}</dt><dd>{% if profile %}{{ profile.institution }}{% endif %}</dd>
- <dt>{% trans "Function" %}</dt><dd>{% if profile %}{{ profile.function }}{% endif %}</dd>
- <dt>{% trans "Address" %}</dt><dd>{% if profile %}{{ profile.address }}{% endif %}</dd>
- <dt>{% trans "Telephone" %}</dt><dd>{% if profile %}{{ profile.telephone }}{% endif %}</dd>
- <dt>{% trans "Expiration date" %}</dt><dd>{% if profile %}{{ profile.expiration_date }}{% endif %}</dd>
-
- <dt>{% trans "Is staff" %}</dt><dd>{{ usr.is_staff }}</dd>
- <dt>{% trans "Is superuser" %}</dt><dd>{{ usr.is_superuser }}</dd>
- <dt>{% blocktrans count user.groups.all.count as counter %}Group{% plural %}Groups{% endblocktrans %}</dt><dd>{% for group in usr.groups.all %}{{ group }} {% endfor %}</dd>
- <dt>{% trans "Last login" %}</dt><dd>{{ usr.last_login }}</dd>
- {% if user.is_authenticated and user.username == usr.username %}
- <dt>{% trans "Language" %}</dt><dd><form id="setlang" action="/i18n/setlang/" method="post">{% csrf_token %}
- <input name="next" type="hidden" value="" />
- <select name="language">
- {% for lang in LANGUAGES %}
- <option {% if lang.0 == LANGUAGE_CODE %}selected{% endif %} value="{{ lang.0 }}">{{ lang.1 }}</option>
- {% endfor %}
- </select>
- <a href="#" class="component_icon button icon_ok"
- onclick="document.getElementById('setlang').submit(); return false;">{% trans "Apply" %}</a>
- </form>
- </dd>
- {% endif %}
- </dl>
- </div>
-
- {% if user.is_authenticated and user.username == usr.username or user.is_staff %}
- <a href="{% url telemeta-profile-edit usr.username %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
- {% endif %}
- {% if user.is_authenticated and user.username == usr.username %}
- <a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Change password" %}</a>
- {% endif %}
-
- </div>
-{% endblock %}
-
+++ /dev/null
-{% extends "telemeta/profile_detail.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block title_buttons %}
- <a href="{% url telemeta-profile-detail usr.username %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
-{% block content %}
- <div class="infos" style="padding-top: 1em;">
- <form method="POST" id="_editUserProfileForm" action="">{% csrf_token %}
- <table>
- {% for form in forms %}
- {% for field in form %}
- {% if not field.html_name in user_hidden_fields %}
- <tr>
- <tr><td class="error">{{ field.errors }}</td></tr>
- <td>{% trans field.label_tag %} : </td><td>{{ field }}</td>
- </tr>
- {% else %}
- <tr>
- <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
- </tr>
- {% endif %}
- {% endfor %}
- {% endfor %}
- </table>
- <div align="center">
- <a href="{% url telemeta-profile-detail usr.username %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('_editUserProfileForm').submit(); return false;">{% trans "Save" %}</a>
- </div>
- </form>
- </div>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-
-{% block content %}
-
-<p>{% trans "Thanks for spending some quality time with the Web site today." %}</p>
-
-<p><a href="../">{% trans 'Log in again' %}</a></p>
-
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-{% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}{% trans 'Change password' %} / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %}
-
-{% block title %}<br />{% trans 'Password change successful' %}{% endblock %}
-
-{% block content %}
-
-<p>{% trans 'Your password was changed.' %}</p>
-
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n adminmedia %}
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
-{% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} / <a href="../logout/">{% trans 'Log out' %}</a>{% endblock %}
-
-{% block title %}<br />{% trans 'Password change' %}{% endblock %}
-
-{% block content %}<div id="content-main">
-
-<form id="password_change" action="" method="post">{% csrf_token %}
-<div>
-{% if form.errors %}
- <p class="errornote">
- {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
- </p>
-{% endif %}
-
-<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
-
-<fieldset class="aligned wide">
-
-<div class="form-row">
- {{ form.old_password.errors }}
- <label for="id_old_password" class="required">{% trans 'Old password' %}:</label>{{ form.old_password }}
-</div>
-
-<div class="form-row">
- {{ form.new_password1.errors }}
- <label for="id_new_password1" class="required">{% trans 'New password' %}:</label>{{ form.new_password1 }}
-</div>
-
-<div class="form-row">
-{{ form.new_password2.errors }}
- <label for="id_new_password2" class="required">{% trans 'Password (again)' %}:</label>{{ form.new_password2 }}
-</div>
-
-</fieldset>
-
-<br />
-<div class="submit-row">
- <a href="#" class="component_icon button icon_save"
- onclick="document.getElementById('password_change').submit(); return false;">{% trans 'Change my password' %}</a>
-</div>
-
-<script type="text/javascript">document.getElementById("id_old_password").focus();</script>
-</div>
-</form></div>
-
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-
-{% block title %}<br />{% trans 'Password reset complete' %}{% endblock %}
-
-{% block content %}
-<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
-<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-
-{% block title %}<br />{% trans 'Password reset' %}{% endblock %}
-
-{% block content %}
-{% if validlink %}
-<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
-
-<form id="password_confirm" action="" method="post">{% csrf_token %}
-{{ form.new_password1.errors }}
-<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
-{{ form.new_password2.errors }}
-<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
-<p><a href="#" class="component_icon button icon_save" onclick="document.getElementById('password_confirm').submit(); return false;">{% trans 'Change my password' %}</a></p>
-</form>
-
-{% else %}
-<h1>{% trans 'Password reset unsuccessful' %}</h1>
-<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
-
-{% endif %}
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-
-{% block title %}<br />{% trans 'Password reset successful' %}{% endblock %}
-
-{% block content %}
-<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
-{% endblock %}
+++ /dev/null
-{% load i18n %}{% autoescape off %}
-{% trans "You're receiving this e-mail because you requested a password reset" %}
-{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}.
-
-{% trans "Please go to the following page and choose a new password:" %}
-{% block reset_link %}
-{{ protocol }}://{{ domain }}{% url telemeta-password-reset-confirm uidb36=uid token=token %}
-{% endblock %}
-{% trans "Your username, in case you've forgotten:" %} {{ user.username }}
-
-{% trans "Thanks for using our site!" %}
-
-{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
-
-{% endautoescape %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-
-{% block title %}<br />{% trans "Password reset" %}{% endblock %}
-
-{% block content %}
-<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p>
-
-<form id="password_reset" action="" method="post">{% csrf_token %}
-{{ form.email.errors }}
-<p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <a href="#" class="component_icon button icon_ok" onclick="document.getElementById('password_reset').submit(); return false;">{% trans 'Reset my password' %}</a></p>
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Advanced Search" %} - {{ block.super }}{% endblock %}
-
-{% block stylesheets %}
-{{ block.super }}
-<link rel="stylesheet" type="text/css" href="{% url telemeta-css "jquery.autocomplete.css" %}" />
-{% endblock %}
-
-{% block extra_javascript %}
-<script src="{% url telemeta-js "jquery.bgiframe.js" %}" type="text/javascript"></script>
-<script src="{% url telemeta-js "jquery.autocomplete.js" %}" type="text/javascript"></script>
-<script type="text/javascript">
-function update_period(source, from_field, to_field) {
- var from_year = $(from_field);
- var to_year = $(to_field);
-
- if (from_year.val() == "0") {
- to_year.attr('disabled', '1');
- to_year.val('0');
- } else {
- to_year.removeAttr('disabled');
- if ($(source).is(to_field)) {
- if (parseInt(from_year.val()) > parseInt(to_year.val()))
- from_year.val(to_year.val());
- } else if (parseInt(from_year.val()) > parseInt(to_year.val())) {
- to_year.val(from_year.val());
- }
- }
-}
-
-$(document).ready(function () {
- $('#location').autocomplete('{% url telemeta-complete-location %}', {
- max: 20,
- formatResult: function(data) {
- return data[0].replace(/ *\([0-9]+.*\) *$/, '');
- }
- });
- update_period('#rec_year_from', '#rec_year_to');
- $('#rec_year_from, #rec_year_to').change(function () {
- update_period(this, '#rec_year_from', '#rec_year_to');
- });
- update_period('#pub_year_from', '#pub_year_to');
- $('#pub_year_from, #pub_year_to').change(function () {
- update_period(this, '#pub_year_from', '#pub_year_to');
- });
-});
-
-</script>
-{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "adv_search_red.png" %}" alt="advanced-search" style="vertical-align:middle" /> {% trans "Advanced Search" %}
-{% endblock %}
-
-{% block content %}
-<form action="{% url telemeta-search %}" id="searchform">{% csrf_token %}
-<fieldset>
-
- <p>
- <label for="location">{% field_label "Location" %}</label>
- <input type="text" name="location" id="location" value="{{ criteria.location }}" />
- </p>
-
- <p>
- <label for="ethnic_group">{% field_label "EthnicGroup" %}</label>
- <select id="ethnic_group" name="ethnic_group">
- <option value="">All ethnic groups</option>
- {% for group in ethnic_groups %}
- <option value="{{group.id}}" {% ifequal criteria.ethnic_group.id group.id %}selected {% endifequal %}>{{group|escape}}</option>
- {% endfor %}
- </select>
- </p>
-
- <p>
- <label for="title">{% trans "Title" %}</label>
- <input type="text" id="title" name="title" />
- </p>
-
- <p>
- <label for="creator">{% field_label "MediaCollection" "creator" %}</label>
- <input type="text" id="creator" name="creator" />
- </p>
-
- <p>
- <label for="collector">{% field_label "MediaCollection" "collector" %}</label>
- <input type="text" id="collector" name="collector" />
- </p>
-
- {% if rec_years %}
- <p>
- <label for="rec_date_from">{% trans "Year of recording" %}</label>
- <select id="rec_year_from" name="rec_year_from" class="tiny">
- <option value="0"></option>
- {% for year in rec_years %}
- <option value="{{ year }}" {% ifequal criteria.rec_year_from year %}selected {% endifequal %}>{{year}}</option>
- {% endfor %}
- </select>
- {% trans "to" %}
- <select id="rec_year_to" name="rec_year_to" class="tiny">
- <option value="0"></option>
- {% for year in rec_years %}
- <option value="{{ year }}" {% ifequal criteria.rec_year_to year %}selected {% endifequal %}>{{year}}</option>
- {% endfor %}
- </select>
- </p>
- {% endif %}
-
- {% if pub_years %}
- <p>
- <label for="pub_date_from">{% trans "Year of publication" %}</label>
- <select id="pub_year_from" name="pub_year_from" class="tiny">
- <option value="0"></option>
- {% for year in pub_years %}
- <option value="{{ year }}" {% ifequal criteria.pub_year_from year %}selected {% endifequal %}>{{year}}</option>
- {% endfor %}
- </select>
- {% trans "to" %}
- <select id="pub_year_to" name="pub_year_to" class="tiny">
- <option value="0"></option>
- {% for year in pub_years %}
- <option value="{{ year }}" {% ifequal criteria.pub_year_to year %}selected {% endifequal %}>{{year}}</option>
- {% endfor %}
- </select>
- </p>
- {% endif %}
-
- <p><label for="sound">{% trans "Sound" %}</label>
- <input type="checkbox" name="sound" value="True" align="left" />
- </p>
-
-</fieldset>
-
-<p class="input">
-<a href="#" class="component_icon button icon_search"
- onclick="document.getElementById('searchform').submit(); return false;">{% trans 'Search' %}</a>
-</p>
-
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load telemeta_utils %}
-{% load i18n %}
-
-{% block head_title %}{% trans "Search Results" %} - {{ block.super }}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "search_red.png" %}" alt="search-results" style="vertical-align:middle" /> {% trans "Search Results" %}
-{% endblock %}
-
-{% block title_buttons %}
- {% ifequal type 'items' %}
- <a href="{% url telemeta-search-items %}?{{criteria|with_no_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "All" %}</a>
- <a href="{% url telemeta-search-items %}?{{criteria|with_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
- {% else %}
- <a href="{% url telemeta-search-collections %}?{{criteria|with_no_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "All" %}</a>
- <a href="{% url telemeta-search-collections %}?{{criteria|with_sound|build_query_string}}" class="component_icon button icon_filter">{% trans "Sounds" %}</a>
- {% endifequal %}
-{% endblock %}
-
-{% block content %}
-{% if criteria %}
-<ul>
- {% if criteria.pattern %}
- <li><b>{% trans "Search pattern" %}:</b> {{criteria.pattern}}</li>
- {% endif %}
- {% if criteria.location %}
- <li><b>{% field_label "Location" %}:</b> {{criteria.location}}</li>
- {% endif %}
- {% if criteria.ethnic_group %}
- <li><b>{% field_label "EthnicGroup" %}:</b> {{criteria.ethnic_group}}</li>
- {% endif %}
- {% if criteria.creator %}
- <li><b>{% field_label "MediaCollection" "creator" %}:</b> {{criteria.creator}}</li>
- {% endif %}
- {% if criteria.collector %}
- <li><b>{% field_label "MediaCollection" "collector" %}:</b> {{criteria.collector}}</li>
- {% endif %}
- {% if criteria.title %}
- <li><b>{% trans "Title" %}:</b> {{criteria.title}}</li>
- {% endif %}
- {% if criteria.rec_year_from %}
- <li><b>{% trans "Year of recording" %}:</b> {{criteria.rec_year_from}}
- {% ifnotequal criteria.rec_year_to criteria.rec_year_from %}
- {% trans "to" %} {{criteria.rec_year_to}}
- {% endifnotequal %}
- </li>
- {% endif %}
- {% if criteria.pub_year_from %}
- <li><b>{% trans "Year of publication" %}:</b> {{criteria.pub_year_from}}
- {% ifnotequal criteria.pub_year_to criteria.pub_year_from %}
- {% trans "to" %} {{criteria.pub_year_to}}
- {% endifnotequal %}
- </li>
- {% endif %}
- {% if criteria.sound %}
- <li><b>{% trans "Sound" %}:</b> {{criteria.sound}}</li>
- {% endif %}
-</ul>
-{% endif %}
-
-{% ifequal type 'items' %}
-
- <p><a href="{% url telemeta-search-collections %}?{{criteria|build_query_string}}">Collections ({{collections_num}})</a> | <b>Items ({{items_num}})</b></p>
-
- {% with object_list as items %}
- <div class="fullpage">
- {% include "telemeta/inc/mediaitem_list.html" %}
- </div>
- {% endwith %}
-
-{% else %}
-
- <p><b>Collections ({{collections_num}})</b> | <a href="{% url telemeta-search-items %}?{{criteria|build_query_string}}">Items ({{items_num}})</a>
- </p>
-
- {% with object_list as collections %}
- <div class="fullpage">
- {% include "telemeta/inc/collection_list.html" %}
- </div>
- {% endwith %}
-
-{% endifequal %}
-
-{% endblock %}
+++ /dev/null
-{% extends "telemeta/base.html" %}
-{% load i18n %}
-{% load telemeta_utils %}
-
-{% block head_title %}{% trans "Users" %} - {{ block.super }}{% endblock %}
-
-{% block title %}
- <img src="{% url telemeta-images "user_red.png" %}" alt="user" style="vertical-align:middle" /> {% trans "Users" %}
-{% endblock %}
-
-{% block content %}
- {% if users %}
- <br />
- {% include "telemeta/inc/user_list.html" %}
- {% else %}
- <p class="help">{% trans "No users" %}</p>
- {% endif %}
-{% endblock %}
import os
import datetime
from django.conf import settings
+from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
def to_utf8(word):
return word.encode('utf-8')
+
+@register.filter
+@stringfilter
+def capitalize(value):
+ return value.capitalize()
from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to
-from telemeta.models import MediaItem, MediaCollection, MediaItemMarker, MediaCorpus, MediaFund
+from telemeta.models import MediaItem, MediaCollection, MediaItemMarker, MediaCorpus, MediaFonds
from telemeta.views.base import GeneralView, AdminView, CollectionView, ItemView, \
InstrumentView, PlaylistView, ProfileView, GeoView, \
- LastestRevisionsFeed
+ LastestRevisionsFeed, ResourceView
from jsonrpc import jsonrpc_site
import os.path
import telemeta.config
playlist_view = PlaylistView()
profile_view = ProfileView()
geo_view = GeoView()
+resource_view = ResourceView()
# query sets for Django generic views
all_items = { 'queryset': MediaItem.objects.enriched().order_by('code', 'old_code') }
all_collections_published = { 'queryset': MediaCollection.objects.filter(code__contains='_E_'), }
all_collections_sound = { 'queryset': MediaCollection.objects.sound().order_by('code', 'old_code') }
all_corpus = { 'queryset': MediaCorpus.objects.all().order_by('title') }
-all_funds = { 'queryset': MediaFund.objects.all().order_by('title') }
+all_fonds = { 'queryset': MediaFonds.objects.all().order_by('title') }
# ID's regular expressions
export_extensions = "|".join(item_view.list_export_extensions())
# TODO: make a real archives tree view
url(r'^archives/$', redirect_to, {'url': '/archives/collections/'},
name="telemeta-archives"),
-
+
# items
- url(r'^archives/items/$', 'django.views.generic.list_detail.object_list',
+ url(r'^archives/items/$', 'django.views.generic.list_detail.object_list',
dict(all_items, paginate_by=20, template_name="telemeta/mediaitem_list.html"),
name="telemeta-items"),
url(r'^archives/items_sound/$', 'django.views.generic.list_detail.object_list',
dict(all_items_sound, paginate_by=20, template_name="telemeta/mediaitem_list.html"), name="telemeta-items-sound"),
- url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/$', item_view.item_detail,
+ url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/$', item_view.item_detail,
name="telemeta-item-detail"),
- url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/dc/$', item_view.item_detail,
+ url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/dc/$', item_view.item_detail,
{'template': 'telemeta/mediaitem_detail_dc.html'},
name="telemeta-item-dublincore"),
- url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/dc/xml/$', item_view.item_detail,
+ url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/dc/xml/$', item_view.item_detail,
{'format': 'dublin_core_xml'},
name="telemeta-item-dublincore-xml"),
- url(r'^archives/items/download/(?P<public_id>[A-Za-z0-9._-]+)\.(?P<extension>'
- + export_extensions + ')$',
+ url(r'^archives/items/download/(?P<public_id>[A-Za-z0-9._-]+)\.(?P<extension>'
+ + export_extensions + ')$',
item_view.item_export,
name="telemeta-item-export"),
- url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/visualize/(?P<visualizer_id>[0-9a-z_]+)/(?P<width>[0-9A-Z]+)x(?P<height>[0-9A-Z]+)/$',
+ url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/visualize/(?P<visualizer_id>[0-9a-z_]+)/(?P<width>[0-9A-Z]+)x(?P<height>[0-9A-Z]+)/$',
item_view.item_visualize,
name="telemeta-item-visualize"),
- url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/analyze/xml/$',
+ url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/analyze/xml/$',
item_view.item_analyze_xml,
name="telemeta-item-analyze-xml"),
- url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/item_xspf.xml$',
- item_view.item_playlist,
+ url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/item_xspf.xml$',
+ item_view.item_playlist,
dict(template="telemeta/mediaitem_xspf.xml", mimetype="application/xspf+xml"),
name="telemeta-item-xspf"),
url(r'^archives/items/(?P<public_id>[A-Za-z0-9._-]+)/edit/$', item_view.item_edit,
url(r'^markers/(?P<marker_id>[A-Za-z0-9]+)/$', item_view.item_detail, name="telemeta-item-detail-marker"),
# FIXME: need all paths
url(r'^items/(?P<path>[A-Za-z0-9._-s/]+)/$', redirect_to, {'url': '/archives/items/%(path)s/', 'permanent': False}, name="telemeta-item-redir"),
-
+
# collections
url(r'^archives/collections/$', 'django.views.generic.list_detail.object_list',
dict(all_collections, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections"),
dict(all_collections_unpublished, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-unpublished"),
url(r'^archives/collections_published/$', 'django.views.generic.list_detail.object_list',
dict(all_collections_published, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-published"),
- url(r'^archives/collections/?page=(?P<page>[0-9]+)$',
+ url(r'^archives/collections/?page=(?P<page>[0-9]+)$',
'django.views.generic.list_detail.object_list',
dict(all_collections, paginate_by=20)),
url(r'^archives/collections/(?P<public_id>[A-Za-z0-9._-]+)/$', collection_view.collection_detail,
dict(template="telemeta/collection_detail.html"), name="telemeta-collection-detail"),
url(r'^archives/collections/(?P<public_id>[A-Za-z0-9._-]+)/dc/$', collection_view.collection_detail,
dict(template="telemeta/collection_detail_dc.html"), name="telemeta-collection-dublincore"),
- url(r'^archives/collections/(?P<public_id>[A-Za-z0-9._-]+)/collection_xspf.xml$',
- collection_view.collection_playlist,
+ url(r'^archives/collections/(?P<public_id>[A-Za-z0-9._-]+)/collection_xspf.xml$',
+ collection_view.collection_playlist,
dict(template="telemeta/collection_xspf.xml", mimetype="application/xspf+xml"),
name="telemeta-collection-xspf"),
url(r'^archives/collections/(?P<public_id>[A-Za-z0-9._-]+)/collection.m3u$',
- collection_view.collection_playlist,
+ collection_view.collection_playlist,
dict(template="telemeta/collection.m3u", mimetype="audio/mpegurl"),
name="telemeta-collection-m3u"),
url(r'^archives/collections/(?P<public_id>[A-Za-z0-9._-]+)/edit/$', collection_view.collection_edit,
dict(all_collections_sound, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-sound"),
# FIXME: need all paths
url(r'^collections/(?P<path>[A-Za-z0-9._-s/]+)/$', redirect_to, {'url': '/archives/collections/%(path)s/', 'permanent': False}, name="telemeta-collection-redir"),
-
- # Corpus
+
+ # RESOURCES
+ # Corpus list
url(r'^archives/corpus/$', 'django.views.generic.list_detail.object_list',
- dict(all_corpus, paginate_by=20, template_name="telemeta/corpus_list.html"), name="telemeta-corpus"),
- url(r'^archives/corpus/(?P<public_id>[A-Za-z0-9._-]+)/$', corpus_view.corpus_detail,
- dict(template="telemeta/corpus_detail.html"), name="telemeta-corpus-detail"),
- url(r'^archives/corpus/(?P<public_id>[A-Za-z0-9._-]+)/dc/$', corpus_view.corpus_detail,
- dict(template="telemeta/corpus_detail_dc.html"), name="telemeta-corpus-dublincore"),
- url(r'^archives/corpus/(?P<public_id>[A-Za-z0-9._-]+)/edit/$', corpus_view.corpus_edit,
- dict(template='telemeta/corpus_edit.html'), name="telemeta-corpus-edit"),
- url(r'^archives/corpus/(?P<public_id>[A-Za-z0-9._-]+)/copy/$', corpus_view.corpus_copy,
- dict(template='telemeta/corpus_edit.html'), name="telemeta-corpus-copy"),
- url(r'^archives/corpus_new/add/$', corpus_view.corpus_add,
- dict(template='telemeta/corpus_add.html'), name="telemeta-corpus-add"),
-
- # Funds
- url(r'^archives/funds/$', 'django.views.generic.list_detail.object_list',
- dict(all_funds, paginate_by=20, template_name="telemeta/fund_list.html"), name="telemeta-funds"),
- url(r'^archives/funds/(?P<public_id>[A-Za-z0-9._-]+)/$', fund_view.fund_detail,
- dict(template="telemeta/fund_detail.html"), name="telemeta-fund-detail"),
- url(r'^archives/funds/(?P<public_id>[A-Za-z0-9._-]+)/dc/$', fund_view.fund_detail,
- dict(template="telemeta/fund_detail_dc.html"), name="telemeta-fund-dublincore"),
- url(r'^archives/funds/(?P<public_id>[A-Za-z0-9._-]+)/edit/$', fund_view.fund_edit,
- dict(template='telemeta/fund_edit.html'), name="telemeta-fund-edit"),
- url(r'^archives/funds/(?P<public_id>[A-Za-z0-9._-]+)/copy/$', fund_view.fund_copy,
- dict(template='telemeta/fund_edit.html'), name="telemeta-fund-copy"),
- url(r'^archives/fund/add/$', fund_view.fund_add,
- dict(template='telemeta/fund_add.html'), name="telemeta-fund-add"),
-
+ dict(all_corpus, paginate_by=20, template_name="telemeta/resource_list.html", extra_context={'type':'corpus'}), name="telemeta-corpus"),
+ # Fonds list
+ url(r'^archives/fonds/$', 'django.views.generic.list_detail.object_list',
+ dict(all_fonds, paginate_by=20, template_name="telemeta/resource_list.html", extra_context={'type':'fonds'}), name="telemeta-fonds"),
+
+ # Generic resource
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/$', resource_view.detail,
+ dict(template="telemeta/resource_detail.html"), name="telemeta-resource-detail"),
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/dc/$', resource_view.detail,
+ dict(template="telemeta/resource_detail_dc.html"), name="telemeta-resource-dublincore"),
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/edit/$', resource_view.edit,
+ dict(template='telemeta/resource_edit.html'), name="telemeta-resource-edit"),
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/copy/$', resource_view.copy,
+ dict(template='telemeta/resource_edit.html'), name="telemeta-resource-copy"),
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)_add$', resource_view.add,
+ dict(template='telemeta/resource_add.html'), name="telemeta-resource-add"),
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/delete/$', resource_view.delete, name="telemeta-resource-delete"),
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/related/(?P<media_id>[A-Za-z0-9._-]+)$', resource_view.related_stream, name="telemeta-resource-related"),
+ url(r'^archives/(?P<type>[A-Za-z0-9._-]+)/(?P<public_id>[A-Za-z0-9._-]+)/related_edit/$', resource_view.related_edit, dict(template='telemeta/resource_related_edit.html'), name="telemeta-resource-related_edit"),
+
# search
url(r'^search/$', general_view.search, name="telemeta-search"),
- url(r'^search/collections/$', general_view.search, {'type': 'collections'},
+ url(r'^search/collections/$', general_view.search, {'type': 'collections'},
name="telemeta-search-collections"),
- url(r'^search/items/$', general_view.search, {'type': 'items'},
+ url(r'^search/items/$', general_view.search, {'type': 'items'},
name="telemeta-search-items"),
url(r'^search/criteria/$', general_view.edit_search, name="telemeta-search-criteria"),
url(r'^complete_location/$', general_view.complete_location, name="telemeta-complete-location"),
- # administration
- url(r'^admin/$', admin_view.admin_index, name="telemeta-admin"),
- url(r'^admin/general/$', admin_view.admin_general, name="telemeta-admin-general"),
- url(r'^admin/enumerations/$', admin_view.admin_enumerations, name="telemeta-admin-enumerations"),
- url(r'^admin/users/$', admin_view.admin_users, name="telemeta-admin-users"),
-
+ # administration
+ url(r'^admin/$', admin_view.admin_index, name="telemeta-admin"),
+ url(r'^admin/general/$', admin_view.admin_general, name="telemeta-admin-general"),
+ url(r'^admin/enumerations/$', admin_view.admin_enumerations, name="telemeta-admin-enumerations"),
+ url(r'^admin/users/$', admin_view.admin_users, name="telemeta-admin-users"),
+
# instruments administration
- url(r'^admin/instruments/$',
+ url(r'^admin/instruments/$',
instrument_view.edit_instrument ,
- name="telemeta-instrument-edit"),
- url(r'^admin/instruments/add/$',
+ name="telemeta-instrument-edit"),
+ url(r'^admin/instruments/add/$',
instrument_view.add_to_instrument,
- name="telemeta-instrument-add"),
- url(r'^admin/instruments/update/$',
+ name="telemeta-instrument-add"),
+ url(r'^admin/instruments/update/$',
instrument_view.update_instrument,
- name="telemeta-instrument-update"),
+ name="telemeta-instrument-update"),
url(r'^admin/instruments/'
+ r'(?P<value_id>[0-9]+)/$',
instrument_view.edit_instrument_value,
- name="telemeta-instrument-record-edit"),
+ name="telemeta-instrument-record-edit"),
url(r'^admin/instruments/'
+ r'(?P<value_id>[0-9]+)/update/$',
- instrument_view.update_instrument_value,
- name="telemeta-instrument-record-update"),
-
+ instrument_view.update_instrument_value,
+ name="telemeta-instrument-record-update"),
+
# enumerations administration
- url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/$',
+ url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/$',
admin_view.edit_enumeration ,
- name="telemeta-enumeration-edit"),
- url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/add/$',
+ name="telemeta-enumeration-edit"),
+ url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/add/$',
admin_view.add_to_enumeration,
- name="telemeta-enumeration-add"),
- url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/update/$',
+ name="telemeta-enumeration-add"),
+ url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/update/$',
admin_view.update_enumeration,
- name="telemeta-enumeration-update"),
+ name="telemeta-enumeration-update"),
url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/'
+ r'(?P<value_id>[0-9]+)/$',
admin_view.edit_enumeration_value,
- name="telemeta-enumeration-record-edit"),
+ name="telemeta-enumeration-record-edit"),
url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/'
+ r'(?P<value_id>[0-9]+)/update/$',
- admin_view.update_enumeration_value,
- name="telemeta-enumeration-record-update"),
+ admin_view.update_enumeration_value,
+ name="telemeta-enumeration-record-update"),
# Geographic browsing
url(r'^geo/$', geo_view.list_continents, name="telemeta-geo-continents"),
- url(r'^geo/(?P<continent>[a-z_]+)/$', geo_view.list_countries,
+ url(r'^geo/(?P<continent>[a-z_]+)/$', geo_view.list_countries,
name="telemeta-geo-countries"),
- url(r'^geo/collections/(?P<continent>[a-z_]+)/(?P<country>[a-z_]+)/$',
- geo_view.list_country_collections,
+ url(r'^geo/collections/(?P<continent>[a-z_]+)/(?P<country>[a-z_]+)/$',
+ geo_view.list_country_collections,
name="telemeta-geo-country-collections"),
- url(r'^geo/items/(?P<continent>[a-z_]+)/(?P<country>[a-z_]+)/$',
- geo_view.list_country_items,
+ url(r'^geo/items/(?P<continent>[a-z_]+)/(?P<country>[a-z_]+)/$',
+ geo_view.list_country_items,
name="telemeta-geo-country-items"),
- url(r'^geo/country_info/(?P<id>[0-9a-z]+)/$',
+ url(r'^geo/country_info/(?P<id>[0-9a-z]+)/$',
geo_view.country_info, name="telemeta-country-info"),
# CSS+Images (FIXME: for developement only)
- url(r'^css/(?P<path>.*)$', 'django.views.static.serve',
+ url(r'^css/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': htdocs+'/css'},
name="telemeta-css"),
- url(r'images/(?P<path>.*)$', 'django.views.static.serve',
+ url(r'images/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': htdocs+'/images'},
name="telemeta-images"),
- url(r'^js/(?P<path>.*)$', 'django.views.static.serve',
+ url(r'^js/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': htdocs+'/js'},
name="telemeta-js"),
- url(r'^swf/(?P<path>.*)$', 'django.views.static.serve',
+ url(r'^swf/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': htdocs+'/swf'},
name="telemeta-swf"),
- url(r'^timeside/(?P<path>.*)$', 'django.views.static.serve',
+ url(r'^timeside/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': htdocs+'/timeside'},
name="telemeta-timeside"),
# Users
url(r'^users/$', general_view.users, name="telemeta-users"),
-
+
# Profiles
url(r'^users/(?P<username>[A-Za-z0-9._-]+)/profile/$', profile_view.profile_detail, name="telemeta-profile-detail"),
url(r'^users/(?P<username>[A-Za-z0-9._-]+)/profile/edit/$', profile_view.profile_edit, name="telemeta-profile-edit"),
-
+
# Registration
url(r'^accounts/password_change/$', 'django.contrib.auth.views.password_change', {'template_name': 'telemeta/registration/password_change_form.html'}, name="telemeta-password-change"),
url(r'^accounts/password_change_done/$', 'django.contrib.auth.views.password_change_done', {'template_name': 'telemeta/registration/password_change_done.html'}, name="telemeta-password-change-done"),
-
+
url(r'^accounts/password_reset/$', 'django.contrib.auth.views.password_reset', {'template_name': 'telemeta/registration/password_reset_form.html', 'email_template_name': 'telemeta/registration/password_reset_email.html'}, name="telemeta-password-reset"),
url(r'^accounts/password_reset_done/$', 'django.contrib.auth.views.password_reset_done', {'template_name': 'telemeta/registration/password_reset_done.html'}, name="telemeta-password-reset-done"),
url(r'^accounts/password_reset_confirm/(?P<uidb36>[A-Za-z0-9._-]+)/(?P<token>[A-Za-z0-9._-]+)/$', 'django.contrib.auth.views.password_reset_confirm', {'template_name': 'telemeta/registration/password_reset_confirm.html'}, name="telemeta-password-reset-confirm"),
url(r'^accounts/password_reset_complete/$', 'django.contrib.auth.views.password_reset_complete', {'template_name': 'telemeta/registration/password_reset_complete.html'}, name="telemeta-password-reset-complete"),
url(r'^accounts/password_reset_complete/$', 'django.contrib.auth.views.password_reset_complete', {'template_name': 'telemeta/registration/password_reset_complete.html'}, name="telemeta-password-reset-complete"),
-
+
# JSON RPC
url(r'json/$', jsonrpc_site.dispatch, name='jsonrpc_mountpoint'),
# for the graphical browser/web console only, omissible
- # url(r'json/browse/', 'jsonrpc.views.browse', name="jsonrpc_browser"),
-
+ # url(r'json/browse/', 'jsonrpc.views.browse', name="jsonrpc_browser"),
+
# Playlists
url(r'^playlists/(?P<public_id>[a-zA-Z0-9]+)/(?P<resource_type>[a-zA-Z0-9]+)/csv/$', playlist_view.playlist_csv_export, name="telemeta-playlist-csv-export"),
-
+
# RSS feeds
url(r'^rss/$', LastestRevisionsFeed(), name="telemeta-rss"),
element = MediaItemMarker.objects.get(pk=revision.element_id)
except:
element = None
+ if revision.element_type == 'corpus':
+ try:
+ element = MediaCorpus.objects.get(pk=revision.element_id)
+ except:
+ element = None
+ if revision.element_type == 'fonds':
+ try:
+ element = MediaFonds.objects.get(pk=revision.element_id)
+ except:
+ element = None
+
if not element == None:
revisions.append({'revision': revision, 'element': element})
return revisions
media.set_mime_type()
media.save()
if not media.title and media.url:
- try:
- from lxml import etree
- parser = etree.HTMLParser()
- tree = etree.parse(media.url, parser)
- title = tree.find(".//title").text
- title = title.replace('\n', '').strip()
- media.title = title
- except:
- media.title = media.url
+ import lxml.etree
+ parser = lxml.etree.HTMLParser()
+ parser = lxml.etree.HTMLParser()
+ tree = lxml.etree.parse(media.url, parser)
+ title = tree.find(".//title").text
+ media.title = title.replace('\n', '').strip()
media.save()
-
+
class GeneralView(object):
"""Provide general web UI methods"""
related_media = MediaCollectionRelated.objects.filter(collection=collection)
check_related_media(related_media)
-
+
return render(request, template, {'collection': collection, 'playlists': playlists, 'public_access': public_access, 'items': items, 'related_media': related_media})
@method_decorator(permission_required('telemeta.change_mediacollection'))
related_media = MediaItemRelated.objects.filter(item=item)
check_related_media(related_media)
-
+
return render(request, template,
{'item': item, 'export_formats': formats,
'visualizers': graphers, 'visualizer_id': grapher_id,
-class CorpusView(object):
- """Provide Corpus web UI methods"""
-
- def corpus_detail(self, request, public_id, template='telemeta/corpus_detail.html'):
- corpus = MediaCorpus.objects.get(public_id=public_id)
- items = corpus.items.enriched()
- items = items.order_by('code', 'old_code')
-
- if corpus.public_access == 'none' and not (request.user.is_staff or request.user.is_superuser):
- mess = ugettext('Access not allowed')
- title = ugettext('Corpus') + ' : ' + public_id + ' : ' + mess
- description = ugettext('Please login or contact the website administator to get a private access.')
- messages.error(request, title)
- return render(request, 'telemeta/messages.html', {'description' : description})
-
- public_access = get_public_access(corpus.public_access, corpus.recorded_from_year,
- corpus.recorded_to_year)
- playlists = get_playlists(request)
-
- related_media = MediaCorpusRelated.objects.filter(corpus=corpus)
+class ResourceView(object):
+ """Provide Resource web UI methods"""
+
+ types = {'corpus':
+ {'model': MediaCorpus,
+ 'form' : MediaCorpusForm,
+ 'related': MediaCorpusRelated,
+ 'related_form': MediaCorpusRelatedForm
+ },
+ 'fonds':
+ {'model': MediaFonds,
+ 'form' : MediaFondsForm,
+ 'related': MediaFondsRelated,
+ 'related_form': MediaFondsRelatedForm
+ }
+ }
+
+ def setup(self, type):
+ self.model = self.types[type]['model']
+ self.form = self.types[type]['form']
+ self.related = self.types[type]['related']
+ self.related_form = self.types[type]['related_form']
+ self.type = type
+
+ def detail(self, request, type, public_id, template='telemeta/resource_detail.html'):
+ self.setup(type)
+ resource = self.model.objects.get(code=public_id)
+ children = resource.children.all()
+ children = children.order_by('code')
+
+ related_media = self.related.objects.filter(resource=resource)
check_related_media(related_media)
- return render(request, template, {'corpus': corpus, 'playlists': playlists, 'public_access': public_access, 'items': items, 'related_media': related_media})
+ return render(request, template, {'resource': resource, 'type': type, 'children': children, 'related_media': related_media})
- @method_decorator(permission_required('telemeta.change_mediacorpus'))
- def corpus_edit(self, request, public_id, template='telemeta/corpus_edit.html'):
- corpus = MediaCorpus.objects.get(public_id=public_id)
+ def edit(self, request, type, public_id, template='telemeta/resource_edit.html'):
+ self.setup(type)
+ resource = self.model.objects.get(code=public_id)
if request.method == 'POST':
- form = MediaCorpusForm(data=request.POST, files=request.FILES, instance=corpus)
+ form = self.form(data=request.POST, files=request.FILES, instance=resource)
if form.is_valid():
code = form.cleaned_data['code']
if not code:
code = public_id
form.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/corpus/'+code)
+ resource.set_revision(request.user)
+ return HttpResponseRedirect('/archives/'+self.type+'/'+code)
else:
- form = MediaCorpusForm(instance=corpus)
+ form = self.form(instance=resource)
+ return render(request, template, {'resource': resource, 'type': type, 'form': form,})
- return render(request, template, {'corpus': corpus, "form": form,})
-
- @method_decorator(permission_required('telemeta.add_mediacorpus'))
- def corpus_add(self, request, template='telemeta/corpus_add.html'):
- corpus = MediaCorpus()
+ def add(self, request, type, template='telemeta/resource_add.html'):
+ self.setup(type)
+ resource = self.model()
if request.method == 'POST':
- form = MediaCorpusForm(data=request.POST, files=request.FILES, instance=corpus)
+ form = self.form(data=request.POST, files=request.FILES, instance=resource)
if form.is_valid():
code = form.cleaned_data['code']
if not code:
code = public_id
form.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/corpus/'+code)
+ resource.set_revision(request.user)
+ return HttpResponseRedirect('/archives/'+self.type +'/'+code)
else:
- form = MediaCorpusForm(instance=corpus)
-
- return render(request, template, {'corpus': corpus, "form": form,})
+ form = self.form(instance=resource)
+ return render(request, template, {'resource': resource, 'type': type, 'form': form,})
- @method_decorator(permission_required('telemeta.add_mediacorpus'))
- def corpus_copy(self, request, public_id, template='telemeta/corpus_edit.html'):
+ def copy(self, request, type, public_id, template='telemeta/resource_edit.html'):
+ self.setup(type)
if request.method == 'POST':
- corpus = MediaCorpus()
- form = MediaCorpusForm(data=request.POST, files=request.FILES, instance=corpus)
+ resource = self.model()
+ form = self.form(data=request.POST, files=request.FILES, instance=resource)
if form.is_valid():
code = form.cleaned_data['code']
if not code:
code = public_id
- form.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/corpus/'+code)
+ resource.save()
+ resource.set_revision(request.user)
+ return HttpResponseRedirect('/archives/'+self.type +'/'+code)
else:
- corpus = MediaCorpus.objects.get(public_id=public_id)
- form = MediaCorpusForm(instance=corpus)
-
- return render(request, template, {'corpus': corpus, "form": form,})
-
- @method_decorator(permission_required('telemeta.delete_mediacorpus'))
- def corpus_delete(self, request, public_id):
- """Delete a given corpus"""
- corpus = MediaCorpus.objects.get(public_id=public_id)
- corpus.delete()
- return HttpResponseRedirect('/corpus/')
-
- def related_media_corpus_stream(self, request, corpus_public_id, media_id):
- corpus = MediaCorpus.objects.get(public_id=corpus_public_id)
- media = MediaCorpusRelated.objects.get(corpus=corpus, id=media_id)
- response = HttpResponse(stream_from_file(media.file.path), mimetype=media.mime_type)
-# response['Content-Disposition'] = 'attachment'
- return response
-
- @method_decorator(permission_required('telemeta.change_mediacorpus'))
- def related_media_edit(self, request, public_id, template):
- corpus = MediaCorpus.objects.get(public_id=public_id)
- MediaCorpusRelatedFormSet = inlineformset_factory(MediaCorpus, MediaCorpusRelated, form=MediaCorpusRelatedForm)
- if request.method == 'POST':
- formset = MediaCorpusRelatedFormSet(data=request.POST, files=request.FILES, instance=corpus)
- if formset.is_valid():
- formset.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/corpus/'+public_id)
- else:
- formset = MediaCorpusRelatedFormSet(instance=corpus)
-
- return render(request, template, {'corpus': corpus, 'formset': formset,})
+ resource = self.model.objects.get(code=public_id)
+ form = self.form(instance=resource)
+ return render(request, template, {'resource': resource, 'type': type, "form": form,})
-class CorpusView(object):
- """Provide Corpuss web UI methods"""
-
- def corpus_detail(self, request, public_id, template='telemeta/corpus_detail.html'):
- corpus = MediaCorpus.objects.get(public_id=public_id)
- collections = corpus.collections.enriched()
- collections = collections.order_by('code')
-
- if corpus.public_access == 'none' and not (request.user.is_staff or request.user.is_superuser):
- mess = ugettext('Access not allowed')
- title = ugettext('Corpus') + ' : ' + public_id + ' : ' + mess
- description = ugettext('Please login or contact the website administator to get a private access.')
- messages.error(request, title)
- return render(request, 'telemeta/messages.html', {'description' : description})
-
- related_media = MediaCorpusRelated.objects.filter(corpus=corpus)
- check_related_media(related_media)
-
- return render(request, template, {'corpus': corpus, 'collections': collections, 'related_media': related_media})
-
- @method_decorator(permission_required('telemeta.change_mediacorpus'))
- def corpus_edit(self, request, public_id, template='telemeta/corpus_edit.html'):
- corpus = MediaCorpus.objects.get(public_id=public_id)
- if request.method == 'POST':
- form = MediaCorpusForm(data=request.POST, files=request.FILES, instance=corpus)
- if form.is_valid():
- code = form.cleaned_data['code']
- if not code:
- code = public_id
- form.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/archives/corpus/'+code)
- else:
- form = MediaCorpusForm(instance=corpus)
-
- return render(request, template, {'corpus': corpus, "form": form,})
-
- @method_decorator(permission_required('telemeta.add_mediacorpus'))
- def corpus_add(self, request, template='telemeta/corpus_add.html'):
- corpus = MediaCorpus()
- if request.method == 'POST':
- form = MediaCorpusForm(data=request.POST, files=request.FILES, instance=corpus)
- if form.is_valid():
- code = form.cleaned_data['code']
- if not code:
- code = public_id
- form.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/archives/corps/'+code)
- else:
- form = MediaCorpusForm(instance=corpus)
-
- return render(request, template, {'corpus': corpus, "form": form,})
-
- @method_decorator(permission_required('telemeta.add_mediacorpus'))
- def corpus_copy(self, request, public_id, template='telemeta/corpus_edit.html'):
- if request.method == 'POST':
- corpus = MediaCorpus()
- form = MediaCorpusForm(data=request.POST, files=request.FILES, instance=corpus)
- if form.is_valid():
- code = form.cleaned_data['code']
- if not code:
- code = public_id
- form.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/archives/corpus/'+code)
- else:
- corpus = MediaCorpus.objects.get(public_id=public_id)
- form = MediaCorpusForm(instance=corpus)
-
- return render(request, template, {'corpus': corpus, "form": form,})
-
- def corpus_playlist(self, request, public_id, template, mimetype):
+ def playlist(self, request, type, public_id, template, mimetype):
+ self.setup(type)
try:
- corpus = MediaCorpus.objects.get(public_id=public_id)
+ resource = self.model.objects.get(code=public_id)
except ObjectDoesNotExist:
raise Http404
template = loader.get_template(template)
- context = RequestContext(request, {'corpus': corpus, 'host': request.META['HTTP_HOST']})
+ context = RequestContext(request, {'resource': resource, 'host': request.META['HTTP_HOST']})
return HttpResponse(template.render(context), mimetype=mimetype)
- @method_decorator(permission_required('telemeta.delete_mediacorpus'))
- def corpus_delete(self, request, public_id):
- """Delete a given corpus"""
- corpus = MediaCorpus.objects.get(public_id=public_id)
- corpus.delete()
- return HttpResponseRedirect('/archives/corpus/')
+ def delete(self, request, type, public_id):
+ self.setup(type)
+ resource = self.model.objects.get(code=public_id)
+ resource.delete()
+ return HttpResponseRedirect('/archives/'+self.type+'/')
- def related_media_corpus_stream(self, request, corpus_public_id, media_id):
- corpus = MediaCorpus.objects.get(public_id=corpus_public_id)
- media = MediaCorpusRelated.objects.get(corpus=corpus, id=media_id)
+ def related_stream(self, request, type, public_id, media_id):
+ self.setup(type)
+ resource = self.model.objects.get(code=public_id)
+ media = self.related.objects.get(resource=resource, id=media_id)
response = HttpResponse(stream_from_file(media.file.path), mimetype=media.mime_type)
# response['Content-Disposition'] = 'attachment'
return response
- @method_decorator(permission_required('telemeta.change_mediacorpus'))
- def related_media_edit(self, request, public_id, template):
- corpus = MediaCorpus.objects.get(public_id=public_id)
- MediaCorpusRelatedFormSet = inlineformset_factory(MediaCorpus, MediaCorpusRelated, form=MediaCorpusRelatedForm)
+ def related_edit(self, request, type, public_id, template):
+ self.setup(type)
+ resource = self.model.objects.get(code=public_id)
+ ResourceRelatedFormSet = inlineformset_factory(self.model, self.related, form=self.related_form)
if request.method == 'POST':
- formset = MediaCorpusRelatedFormSet(data=request.POST, files=request.FILES, instance=corpus)
+ formset = ResourceRelatedFormSet(data=request.POST, files=request.FILES, instance=resource)
if formset.is_valid():
formset.save()
- corpus.set_revision(request.user)
- return HttpResponseRedirect('/archives/corpus/'+public_id)
+ resource.set_revision(request.user)
+ return HttpResponseRedirect('/archives/'+self.type+'/'+public_id)
else:
- formset = MediaCorpusRelatedFormSet(instance=corpus)
+ formset = ResourceRelatedFormSet(instance=resource)
+ return render(request, template, {'resource': resource, 'type': type, 'formset': formset,})
- return render(request, template, {'corpus': corpus, 'formset': formset,})