source: telemeta/templates/telemeta/resource_detail.html @ b85e1be

cremcrem2crem3devdev2diademsdj1.6feature/breadcrumbsfeature/ts-0.5feature/ts-0.5.4feature/writecacheformagenericinstru_searchlamlam2mapsv3mergenlivemultiprobproductionrelease/1.4.4sabiodsearchsecurityserversocialstoragetelecastertest
Last change on this file since b85e1be was 72b372a, checked in by yomguy <yomguy@…>, 3 years ago

fix add to list for corpus and fonds
fix locales

  • Property mode set to 100644
File size: 3.8 KB
Line 
1{% extends "telemeta/base.html" %}
2{% load i18n %}
3{% load telemeta_utils %}
4
5{% block head_title %}{% trans type %}{{resource|prepend:' : '}} - {{ block.super }}{% endblock %}
6
7{% block extra_javascript %}
8<script src="{% url telemeta-js "popupdiv.js" %}" type="text/javascript"></script>
9<script src="{% url telemeta-js "playlist.js" %}" type="text/javascript"></script>
10<script>
11{% if user.is_authenticated %}
12jQuery(document).ready(function(){
13    var p = playlistUtils;
14   
15    {% for playlist in playlists %}
16    p.addPlaylist('{{ playlist.playlist.title }}','{{playlist.playlist.public_id}}');
17    {% endfor %}
18   
19    {% if resource %}
20    var anchor = jQuery('#_add_to_playlist');
21    if(anchor.length){
22        anchor.click(function(){
23            p.showAddResourceToPlaylist(anchor,'{{type}}','{{resource.id}}',gettrans('resource added to the selected playlist'));return false;
24            });
25            }
26    {% endif %}
27    });
28    {% endif %}
29    </script>
30{% endblock %}
31
32{% if resource %}
33
34{% block title %}
35    <img src="{% url telemeta-type-images type %}" style="vertical-align:middle" />
36    {{ type|capitalize }} :
37    <a href="{% url telemeta-resource-detail type resource.public_id %}">{{ resource.title }}</a>
38{% endblock %}
39
40{% block title_buttons %}
41  <div class="fixedWidthAsPlayer">
42    {% if user.is_authenticated and perms.telemeta.change_mediaresource %}
43      <a href="{% url telemeta-resource-edit type resource.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
44      <a href="{% url telemeta-resource-copy type resource.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
45     {% endif %}
46    {% if user.is_authenticated %}
47    <a href="#" id ="_add_to_playlist" class="component_icon button icon_add_to_playlist">{% trans "Add to playlist" %}</a>
48    {% endif %}
49    <a href="{% url telemeta-resource-dublincore type resource.public_id %}" class="component_icon button icon_dublin_core">Dublin Core</a>
50   </div>
51{% endblock %}
52
53{% block content %}
54      {% block infos %}
55        <div class="intro">
56
57        </div>
58        <div class="infos">
59        {% block general_info %}
60            <dl class="listing">
61              {% for field in resource.get_fields %}
62               {% if "id" in field.name %}
63                {{ field.label_tag.as_hidden }}{{ field.as_hidden }}
64               {% else %}
65                {% dl_field resource field.name %}
66               {% endif %}
67              {% endfor %}
68              {% for parent in parents %}
69              <dt>{% trans parent.element_type|capitalize %}</dt>
70              <dd><a href="{% url telemeta-resource-detail parent.element_type parent.public_id %}">{{ parent.title }}</a></dd>
71               {% endfor %}
72            </dl>
73        {% endblock general_info %}
74
75        <div class="extraInfos">
76            {% block related %}
77                {% include "telemeta/inc/resource_related.html" %}
78            {% endblock related %}
79        </div>
80
81        <div class="extraInfos">
82        <h4><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" />{{resource.children_type|capitalize }} </h4>
83        {% with resource.children.all as children %}
84            {% include "telemeta/inc/children_list.html" %}
85        {% endwith %}
86        </div>
87
88        {% endblock infos %}
89    </div>
90{% endblock %}
91
92{% block delete %}
93{% if user.is_authenticated and perms.telemeta.delete_mediaresource %}
94 <a href="#" onclick="if(confirm(gettrans('delete the resource permanently?'))){window.location.href='{% url telemeta-resource-delete type resource.public_id %}';};return false;"
95        class="component_icon button icon_delete" style="float:right;margin-top:0.5em;margin-bottom:1em">{% trans "Delete" %}</a>
96{% endif %}
97
98{% endblock %}
99
100{% else %}
101    <p>{% trans "No such resource" %}</p>
102{% endif %}
103
Note: See TracBrowser for help on using the repository browser.