]> git.parisson.com Git - telemeta.git/commitdiff
move all edit buttons to main edit pages
authoryomguy <yomguy@parisson.com>
Mon, 20 Feb 2012 16:49:50 +0000 (17:49 +0100)
committeryomguy <yomguy@parisson.com>
Mon, 20 Feb 2012 16:49:50 +0000 (17:49 +0100)
telemeta/models/media.py
telemeta/templates/telemeta/collection_detail.html
telemeta/templates/telemeta/collection_edit.html
telemeta/templates/telemeta/inc/collection_related.html
telemeta/templates/telemeta/inc/mediaitem_related.html
telemeta/templates/telemeta/inc/resource_related.html
telemeta/templates/telemeta/mediaitem_detail.html
telemeta/templates/telemeta/mediaitem_edit.html
telemeta/templates/telemeta/resource_detail.html
telemeta/templates/telemeta/resource_edit.html
telemeta/views/base.py

index 2b5c9426bc93bbb8325bcddc25a559eb261542d2..ae1eb94d5e17c7d0901f2fce3b3c4e36a459897c 100644 (file)
@@ -681,7 +681,7 @@ class Format(ModelCore):
 
     item = ForeignKey(MediaItem, related_name="formats", verbose_name=_('item'))
     original_code = CharField(_('original code'), required=True)
-    support_number = CharField(_('support number'))
+    tape_number = CharField(_('tape number'))
     status = CharField(_('status'))
     conservation_state = CharField(_('conservation state'))
     comments = TextField(_('comments'))
index 20a372bad48da879eb01ac9c30e820d7829f7e79..f72b9ccbb0b0831bce6dfe73d6f1a962dcdca18c 100644 (file)
             </div>
         {% endblock technical_data %}
         </div>
-        
+
+        {% if related_media %}
         <div class="extraInfos">
             {% block related %}
                 {% include "telemeta/inc/collection_related.html" %}
             {% endblock related %}
         </div>
+        {% endif %}
         
         <div class="extraInfos">
         <h4><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> Items</h4>
index 6cd84fad85522485ed6cf6f3f5d328a98fce33d1..305915cbcbed21d60323e4c3838d1560596616d2 100644 (file)
@@ -27,6 +27,9 @@
        </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>
+         {% if perms.telemeta.change_mediacollection %}
+         <a href="{% url telemeta-collection-related_edit collection.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+         {% endif %}
          <a href="#" class="component_icon button icon_save"
    onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
         </div>
index 14a3513a371e5bbe876cdedf239a98558ba58dbe..9f73569688866ce5831c2661745a8dba6da84441 100644 (file)
@@ -77,7 +77,4 @@
                 </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>
index ecb5448ee8c42548f3e76fadf5af81772f0e3206..458c266986790f6fc209272ff53724829b7a07f5 100644 (file)
@@ -77,7 +77,4 @@
                 </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>
index a20ae04bb12eb5613bde8b4ceb8f2ccd7a57dbf2..442c7bfc129080a61bf2808ef767d513d0371f17 100644 (file)
@@ -78,7 +78,4 @@
                 </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>
index 0c585c7554e8e06be211a024e81879911052e4f9..6044e68a3f0c5bd598cf0ce9d883371baae36f73 100644 (file)
@@ -225,9 +225,7 @@ Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
         </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>
@@ -264,9 +262,7 @@ Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
         </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>
@@ -303,7 +299,24 @@ Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
                 <dl class="listing">
                 <dt>{% trans "Media type" %}</dt><dd>{% trans mime_type|mime_to_media_type %}</dd>
                     {% dl_field item "approx_duration" %}
+
+                    {% if physical_format %}
+                     {% dl_field physical_format "original_code" %}
+                     {% dl_field physical_format "tape_number" %}
+                     {% dl_field physical_format "status" %}
+                     {% dl_field physical_format "conservation_state" %}
+                     {% dl_field physical_format "tape_length" %}
+                     {% dl_field physical_format "tape_width" %}
+                     {% dl_field physical_format "tape_speed" %}
+                     {% dl_field physical_format "tape_vendor" %}
+                     {% dl_field physical_format "tape_thickness" %}
+                     {% dl_field physical_format "tape_diameter" %}
+                     {% dl_field physical_format "tape_reference" %}
+                     <dt>{% trans "Remarks" %}</dt>
+                     <dd>{{ physical_format.comments|html_line_break|safe }}</dd>
+                    {% endif %}
                 </dl>
+
             </div>
         </div>
         {% endblock technical_data %}
@@ -311,11 +324,13 @@ Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
     {% endblock infos %}
 </div> <!-- with-rightcol -->
 
+{% if related_media %}
 <div class="extraInfos">
     {% block related %}
         {% include "telemeta/inc/mediaitem_related.html" %}
     {% endblock related %}
 </div>
+{% endif %}
 
 {% endblock %}
 
index 5767f76916113e2412abb8684c8b3780df936518..68e4d529a5e4ba50b2083efae1f3a6369cabe35e 100644 (file)
     {% 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="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+    {% if 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 %}
+    {% if 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 %}
+    {% if perms.telemeta.change_mediaitem %}
+    <a href="{% url telemeta-item-related_edit item.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+    {% endif %}
     <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" %}" />
+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>
index 94c3b5f70ff0ca1487f086a75ad4016815448fef..74e900da79f9d8e76c09ae12c2a4c14396ad3d8e 100644 (file)
@@ -77,12 +77,14 @@ jQuery(document).ready(function(){
             
         {% endblock general_info %}
 
+        {% if related_media %}
         <div class="extraInfos">
             {% block related %}
                 {% include "telemeta/inc/resource_related.html" %}
             {% endblock related %}
         </div>
-
+        {% endif %}
+        
         <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 %}
index 8b4439f9d8892beaaa323ffcb1546523449957e4..a8ddadf49154ec9c40bfb4a8660445844a41bdd4 100644 (file)
@@ -27,6 +27,9 @@
        </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>
+         {% if perms.telemeta.change_mediaresource %}
+         <a href="{% url telemeta-resource-related_edit type resource.public_id %}" class="component_icon button icon_edit">{% trans "Edit"%} {% trans "related media"%}</a>
+         {% endif %}
          <a href="#" class="component_icon button icon_save"
    onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
         </div>
index caa72a6a7eae0ea07e612c3e9d5214b84b34531b..0f22a48212ba50b2afbe2bba7f50c95ae75c2851 100644 (file)
@@ -643,6 +643,10 @@ class ItemView(object):
         else:
             last_revision = None
 
+        physical_format = Format.objects.filter(item=item)
+        if physical_format:
+            physical_format = physical_format[0]
+
         return render(request, template,
                     {'item': item, 'export_formats': formats,
                     'visualizers': graphers, 'visualizer_id': grapher_id,
@@ -650,6 +654,7 @@ class ItemView(object):
                     'previous' : previous, 'next' : next, 'marker': marker_id, 'playlists' : playlists,
                     'public_access': public_access, 'width': width, 'height': height,
                     'related_media': related_media, 'mime_type': mime_type, 'last_revision': last_revision,
+                    'physical_format': physical_format,
                     })
 
     @method_decorator(permission_required('telemeta.change_mediaitem'))