| 1 | {% extends "telemeta/base.html" %} |
|---|
| 2 | {% load telemeta_utils %} |
|---|
| 3 | {% load i18n %} |
|---|
| 4 | |
|---|
| 5 | {% block head_title %}{% trans "Item" %} : {% if item.title %}{{ item.title }}{% else %}{{ item.public_id}}{% endif %} - {{ block.super }}{% endblock %} |
|---|
| 6 | |
|---|
| 7 | {% block stylesheets %} |
|---|
| 8 | {{ block.super }} |
|---|
| 9 | <link rel="stylesheet" type="text/css" href="{% url telemeta-timeside "skins/lab/style.css" %}" /> |
|---|
| 10 | <link rel="stylesheet" type="text/css" href="{% url telemeta-css "player.css" %}" /> |
|---|
| 11 | {% endblock %} |
|---|
| 12 | |
|---|
| 13 | {% block extra_javascript %} |
|---|
| 14 | {% if item %} |
|---|
| 15 | |
|---|
| 16 | {% if item.file %} |
|---|
| 17 | {% if public_access or perms.telemeta.can_play_all_items %} |
|---|
| 18 | <script src="{% url telemeta-timeside "js/libs/soundmanager2-nodebug-jsmin.js" %}" type="text/javascript"></script> |
|---|
| 19 | <script src="{% url telemeta-timeside "js/timeside.js" %}" type="text/javascript"></script> |
|---|
| 20 | {% endif %} |
|---|
| 21 | {% endif %} |
|---|
| 22 | |
|---|
| 23 | <script src="{% url telemeta-js "popupdiv-min.js" %}" type="text/javascript"></script> |
|---|
| 24 | <script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script> |
|---|
| 25 | |
|---|
| 26 | {% if item.file %} |
|---|
| 27 | {% if public_access or perms.telemeta.can_play_all_items %} |
|---|
| 28 | <script src="{% url telemeta-js "playerLoader.js" %}" type="text/javascript"></script> |
|---|
| 29 | <script src="{% url telemeta-js "divmarker.js" %}" type="text/javascript"></script> |
|---|
| 30 | {% endif %} |
|---|
| 31 | {% endif %} |
|---|
| 32 | |
|---|
| 33 | <script type="text/javascript"> |
|---|
| 34 | {% if item.file %} |
|---|
| 35 | {% if public_access or perms.telemeta.can_play_all_items %} |
|---|
| 36 | //initializing soundManager default properties |
|---|
| 37 | soundManager.flashVersion = 9; |
|---|
| 38 | soundManager.url = "{% url telemeta-timeside "swf/" %}"; |
|---|
| 39 | soundManager.debugMode = false; |
|---|
| 40 | soundManager.allowPolling = true; |
|---|
| 41 | soundManager.useHTML5Audio = true; |
|---|
| 42 | soundManager.preferFlash = true; |
|---|
| 43 | |
|---|
| 44 | //initializing the visualizers to be passed to the player |
|---|
| 45 | var visualizers = {}; |
|---|
| 46 | {% for v in visualizers %} |
|---|
| 47 | visualizers["{{v.name}}"] = "{% url telemeta-item-visualize item.public_id,v.id,"WIDTH","HEIGHT" %}"; |
|---|
| 48 | {% endfor %} |
|---|
| 49 | {% if user.is_superuser %} |
|---|
| 50 | loadPlayer('{% url telemeta-item-analyze-xml item.public_id %}', |
|---|
| 51 | "{% url telemeta-item-export item.public_id,"mp3" %}", undefined, '{{item.id}}', visualizers, |
|---|
| 52 | CURRENT_USER_NAME, //undefined if !user.is_authenticated |
|---|
| 53 | true); //true because superuser |
|---|
| 54 | {% else %} |
|---|
| 55 | loadPlayer('{% url telemeta-item-analyze-xml item.public_id %}', |
|---|
| 56 | "{% url telemeta-item-export item.public_id,"mp3" %}", undefined, '{{item.id}}', visualizers, |
|---|
| 57 | CURRENT_USER_NAME, //undefined if !user.is_authenticated |
|---|
| 58 | false); //false because not superuser |
|---|
| 59 | {% endif %} |
|---|
| 60 | {% endif %} |
|---|
| 61 | {% endif %} |
|---|
| 62 | //playlists: |
|---|
| 63 | {% if user.is_authenticated %} |
|---|
| 64 | {% for playlist in playlists %} |
|---|
| 65 | playlistUtils.addPlaylist('{{ playlist.playlist.title }}','{{playlist.playlist.public_id}}'); |
|---|
| 66 | {% endfor %} |
|---|
| 67 | jQuery(window).ready(function(){ |
|---|
| 68 | var anchor = jQuery('#_add_to_playlist'); |
|---|
| 69 | if(anchor.length){ |
|---|
| 70 | anchor.unbind('click').click(function(){ |
|---|
| 71 | playlistUtils.showAddResourceToPlaylist(anchor,'item','{{item.id}}',gettrans('item added to the selected playlist')); |
|---|
| 72 | return false; |
|---|
| 73 | }); |
|---|
| 74 | } |
|---|
| 75 | }); |
|---|
| 76 | {% endif %} |
|---|
| 77 | </script> |
|---|
| 78 | {% endif %} |
|---|
| 79 | {% endblock %} |
|---|
| 80 | |
|---|
| 81 | {% if item %} |
|---|
| 82 | |
|---|
| 83 | {% block title %} |
|---|
| 84 | <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> |
|---|
| 85 | Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a> |
|---|
| 86 | {% endblock %} |
|---|
| 87 | |
|---|
| 88 | {% block title_buttons %} |
|---|
| 89 | <div class="fixedWidthAsPlayer"> |
|---|
| 90 | {% if user.is_authenticated and perms.telemeta.change_mediaitem %} |
|---|
| 91 | <a href="{% url telemeta-item-edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a> |
|---|
| 92 | <a href="{% url telemeta-item-copy item.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a> |
|---|
| 93 | {% endif %} |
|---|
| 94 | {% if user.is_authenticated %} |
|---|
| 95 | <a id="_add_to_playlist" href='#' class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a> |
|---|
| 96 | {% endif %} |
|---|
| 97 | <a href="{% url telemeta-item-detail previous %}" class="component_icon button icon_previous">{% trans "Previous" %}</a> |
|---|
| 98 | <a href="{% url telemeta-item-detail next %}" class="component_icon button icon_next">{% trans "Next" %}</a> |
|---|
| 99 | <a href="{% url telemeta-item-dublincore item.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a> |
|---|
| 100 | </div> |
|---|
| 101 | {% endblock %} |
|---|
| 102 | |
|---|
| 103 | {% block content %} |
|---|
| 104 | <div class="{% if item.file %}{% if public_access or perms.telemeta.can_play_all_items %}with-rightcol{% endif %}{% endif %}"> |
|---|
| 105 | {% if item.file %} |
|---|
| 106 | {% if public_access or perms.telemeta.can_play_all_items %} |
|---|
| 107 | <div id="player_maximized" class="ts-skin-lab"> |
|---|
| 108 | <a href="#" class="toggle">Minimize</a> |
|---|
| 109 | <a href="#" class="embed_player_frame"></></a> |
|---|
| 110 | <div class="wazing"></div> |
|---|
| 111 | </div> |
|---|
| 112 | <div id="rightcol"> |
|---|
| 113 | <div id="player_minimized" class="ts-skin-lab"> |
|---|
| 114 | <a href="#" class="toggle">Maximize</a> |
|---|
| 115 | <a href="#" class="embed_player_frame"></></a> |
|---|
| 116 | <div class="wazing"></div> |
|---|
| 117 | <div id="player" class="ts-player"> |
|---|
| 118 | </div> |
|---|
| 119 | </div> |
|---|
| 120 | |
|---|
| 121 | <!-- </div> --> |
|---|
| 122 | <div id="tabs_container"> |
|---|
| 123 | <!-- this div will be hidden when everything is fully loaded--> |
|---|
| 124 | <span id="loading_span" href="#"><img style="vertical-align:middle" alt="wait" src="{% url telemeta-images "wait.gif" %}" /> |
|---|
| 125 | <span id="loading_span_text">Loading...</span></span> |
|---|
| 126 | <a id="tab_analysis" style="display:none" class ="tab" href="#">{% trans "Analysis" %}</a><!-- |
|---|
| 127 | do not let space here as it appears in the document!!!!! |
|---|
| 128 | --><a id="tab_markers" style="display:none" class="tab" href="#">{% trans "Markers" %}</a> |
|---|
| 129 | </div> |
|---|
| 130 | |
|---|
| 131 | <div class="markers" id="markers_div_id"></div> |
|---|
| 132 | |
|---|
| 133 | <div class="analyzer" id="analyzer_div_id"> |
|---|
| 134 | <table width="100%"> |
|---|
| 135 | <tr class="analyzer-title"> |
|---|
| 136 | <td>{% trans "Property" %}</td> |
|---|
| 137 | <td>{% trans "Value" %}</td> |
|---|
| 138 | <td>{% trans "Unit" %}</td> |
|---|
| 139 | </tr> |
|---|
| 140 | </table> |
|---|
| 141 | </div> |
|---|
| 142 | <!--</div>--> |
|---|
| 143 | |
|---|
| 144 | {% if audio_export_enabled or perms.telemeta.can_download_all_items or user.is_superuser %} |
|---|
| 145 | <div class="exporter"> |
|---|
| 146 | <p><img src="{% url telemeta-images "download.png" %}" alt="download" style="vertical-align:middle" /> {% trans "Download:" %} |
|---|
| 147 | {% for format in export_formats %} |
|---|
| 148 | <a href="{% url telemeta-item-export item.public_id,format.extension %}"> |
|---|
| 149 | <img src="images/{{ format.extension }}.png" style="vertical-align:middle" alt="{{ format.extension }}" /></a> |
|---|
| 150 | {% endfor %}</p> |
|---|
| 151 | </div> |
|---|
| 152 | {% endif %} |
|---|
| 153 | |
|---|
| 154 | </div> |
|---|
| 155 | {% endif %} |
|---|
| 156 | {% endif %} |
|---|
| 157 | |
|---|
| 158 | {% block infos %} |
|---|
| 159 | <div class="infos"> |
|---|
| 160 | {% block general_info %} |
|---|
| 161 | <dl class="listing"> |
|---|
| 162 | {% dl_field item "title" placeholder %} |
|---|
| 163 | {% dl_field item "alt_title" %} |
|---|
| 164 | {% dl_field item "collector" placeholder %} |
|---|
| 165 | <dt>{% field_label item "collection" %}</dt> |
|---|
| 166 | <dd><a href="{% url telemeta-collection-detail item.collection.public_id %}">{{ item.collection }}</a></dd> |
|---|
| 167 | <dt>{% trans "Recording date" %}</dt> |
|---|
| 168 | |
|---|
| 169 | <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> |
|---|
| 170 | |
|---|
| 171 | </dl> |
|---|
| 172 | {% endblock general_info %} |
|---|
| 173 | </div> |
|---|
| 174 | <div class="extraInfos"> |
|---|
| 175 | {% block geoethnic_data %} |
|---|
| 176 | <div> |
|---|
| 177 | <h4><a href="#">{% trans "Geographic and cultural informations" %}</a></h4> |
|---|
| 178 | <dl class="listing"> |
|---|
| 179 | <dt>{% trans "Location" %}</dt> |
|---|
| 180 | <dd>{% if item.location %}{{ item.location.fullnames|join:"<br/>" }}{% endif %}</dd> |
|---|
| 181 | {% dl_field item "location_comment" %} |
|---|
| 182 | {% dl_field item "cultural_area" %} |
|---|
| 183 | {% dl_field item "language" %} |
|---|
| 184 | {% if item.language_iso %} |
|---|
| 185 | <dt>{% trans "Language ISO" %}</dt> |
|---|
| 186 | <dd>{{ item.language_iso.name|to_utf8 }}</dd> |
|---|
| 187 | {% endif %} |
|---|
| 188 | {% dl_field item "ethnic_group" placeholder %} |
|---|
| 189 | <dt>{% trans "Ethnographic context" %}</dt> |
|---|
| 190 | <dd>{{ item.context_comment|html_line_break|safe }}</dd> |
|---|
| 191 | {% dl_field item "keywords" join with ", " %} |
|---|
| 192 | </dl> |
|---|
| 193 | </div> |
|---|
| 194 | {% endblock geoethnic_data %} |
|---|
| 195 | </div> |
|---|
| 196 | {% if user.is_authenticated and perms.telemeta.change_mediaitem %} |
|---|
| 197 | <a href="{% url telemeta-item-keywords_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %} {% trans "keywords" %}</a> |
|---|
| 198 | {% endif %} |
|---|
| 199 | <div class="extraInfos"> |
|---|
| 200 | {% block musical_data %} |
|---|
| 201 | <div> |
|---|
| 202 | <h4><a href="#">{% trans "Musical informations" %}</a></h4> |
|---|
| 203 | <dl class="listing"> |
|---|
| 204 | {% dl_field item "vernacular_style" %} |
|---|
| 205 | {% dl_field item "generic_style" %} |
|---|
| 206 | {% dl_field item "author" %} |
|---|
| 207 | </dl> |
|---|
| 208 | {% if item.performances %} |
|---|
| 209 | <div class="instruments"> |
|---|
| 210 | <table class="instruments"> |
|---|
| 211 | <thead> |
|---|
| 212 | <tr> |
|---|
| 213 | <td>{% field_label "MediaItemPerformance" "instruments_num" %}</td> |
|---|
| 214 | <td>{% field_label "MediaItemPerformance" "instrument" %}</td> |
|---|
| 215 | <td>{% field_label "MediaItemPerformance" "alias" %}</td> |
|---|
| 216 | <td>{% field_label "MediaItemPerformance" "musicians" %}</td> |
|---|
| 217 | </tr> |
|---|
| 218 | </thead> |
|---|
| 219 | <tbody> |
|---|
| 220 | {% for performance in item.performances.all %} |
|---|
| 221 | <tr> |
|---|
| 222 | <td>{{ performance.instruments_num }}</td> |
|---|
| 223 | <td>{{ performance.instrument|default:"" }}</td> |
|---|
| 224 | <td>{{ performance.alias|default:"" }}</td> |
|---|
| 225 | <td>{{ performance.musicians }}</td> |
|---|
| 226 | </tr> |
|---|
| 227 | {% endfor %} |
|---|
| 228 | </tbody> |
|---|
| 229 | </table> |
|---|
| 230 | </div> |
|---|
| 231 | {% endif %} |
|---|
| 232 | </div> |
|---|
| 233 | {% endblock musical_data %} |
|---|
| 234 | </div> |
|---|
| 235 | {% if user.is_authenticated and perms.telemeta.change_mediaitem %} |
|---|
| 236 | <a href="{% url telemeta-item-performances_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "performance"%}</a> |
|---|
| 237 | {% endif %} |
|---|
| 238 | <div class="extraInfos"> |
|---|
| 239 | {% block general_data %} |
|---|
| 240 | <div> |
|---|
| 241 | <h4><a href="#">{% trans "General informations" %}</a></h4> |
|---|
| 242 | <dl class="listing"> |
|---|
| 243 | <dt>{% trans "Remarks" %}</dt> |
|---|
| 244 | <dd>{{ item.comment|html_line_break|safe }}</dd> |
|---|
| 245 | {% dl_field item "collector_selection" %} |
|---|
| 246 | </dl> |
|---|
| 247 | </div> |
|---|
| 248 | {% endblock general_data %} |
|---|
| 249 | </div> |
|---|
| 250 | <div class="extraInfos"> |
|---|
| 251 | {% block archive_data %} |
|---|
| 252 | <div> |
|---|
| 253 | <h4><a href="#">{% trans "Archiving data" %}</a></h4> |
|---|
| 254 | <dl class="listing"> |
|---|
| 255 | {% dl_field item "code" %} |
|---|
| 256 | {% dl_field item "old_code" %} |
|---|
| 257 | {% dl_field item "track" %} |
|---|
| 258 | {% dl_field item "creator_reference" %} |
|---|
| 259 | <dt>{% trans "Published references" %}</dt> |
|---|
| 260 | <dd>{{ item.external_references|html_line_break|safe }}</dd> |
|---|
| 261 | {% dl_field item "public_access_label" %} |
|---|
| 262 | </dl> |
|---|
| 263 | </div> |
|---|
| 264 | {% endblock archive_data %} |
|---|
| 265 | </div> |
|---|
| 266 | <div class="extraInfos"> |
|---|
| 267 | {% block technical_data %} |
|---|
| 268 | <div> |
|---|
| 269 | <h4><a href="#">{% trans "Technical data" %}</a></h4> |
|---|
| 270 | <div> |
|---|
| 271 | <dl class="listing"> |
|---|
| 272 | <dt>{% trans "Media type" %}</dt><dd>{% trans "Audio" %}</dd> |
|---|
| 273 | {% dl_field item "approx_duration" %} |
|---|
| 274 | </dl> |
|---|
| 275 | </div> |
|---|
| 276 | </div> |
|---|
| 277 | {% endblock technical_data %} |
|---|
| 278 | </div> |
|---|
| 279 | {% endblock infos %} |
|---|
| 280 | </div> <!-- with-rightcol --> |
|---|
| 281 | |
|---|
| 282 | <div class="extraInfos"> |
|---|
| 283 | {% block related %} |
|---|
| 284 | {% include "telemeta/inc/mediaitem_related.html" %} |
|---|
| 285 | {% endblock related %} |
|---|
| 286 | </div> |
|---|
| 287 | |
|---|
| 288 | {% endblock %} |
|---|
| 289 | |
|---|
| 290 | {% block delete %} |
|---|
| 291 | {% if user.is_authenticated and perms.telemeta.delete_mediaitem %} |
|---|
| 292 | <a href="#" onclick="if(confirm(gettrans('delete the item permanently?'))){window.location.href='{% url telemeta-item-delete item.public_id %}';};return false;" |
|---|
| 293 | class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a> |
|---|
| 294 | {% endif %} |
|---|
| 295 | {% endblock %} |
|---|
| 296 | |
|---|
| 297 | {% else %} |
|---|
| 298 | <p>No such item</p> |
|---|
| 299 | {% endif %} |
|---|