]> git.parisson.com Git - telemeta.git/commitdiff
- fix save / cancel buttons for various forms
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 20 Nov 2014 15:53:08 +0000 (16:53 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 20 Nov 2014 15:53:08 +0000 (16:53 +0100)
- cannot modify input button for resources because of a bug in the
  dynamic children selection tool

telemeta/locale/fr/LC_MESSAGES/django.po
telemeta/models/media.py
telemeta/templates/telemeta/collection_add.html
telemeta/templates/telemeta/collection_edit.html
telemeta/templates/telemeta/mediaitem_add.html
telemeta/templates/telemeta/mediaitem_edit.html
telemeta/templates/telemeta/resource_add.html
telemeta/templates/telemeta/resource_detail.html
telemeta/templates/telemeta/resource_edit.html

index 0b70389ae6849a6a7d11b041e16e0d0f18d8a9f3..4dd2f1a7eb8241f601f67b375ef2abbe84c99f8a 100644 (file)
@@ -1278,7 +1278,7 @@ msgstr "Copier"
 #: templates/telemeta/geo_continents.html:26
 #: templates/telemeta/mediaitem_detail.html:119
 msgid "List"
-msgstr "Liste"
+msgstr "Lister"
 
 #: templates/telemeta/collection_detail.html:64
 msgid "Add item"
index ff2700901f8885818c1e506316e1c76aae74325b..d9c046b4beb4fc065a0bcc40415b4a1dd318d806 100644 (file)
@@ -384,7 +384,7 @@ class MediaItem(MediaResource):
     rights                = WeakForeignKey('Rights', verbose_name=_('rights'))
 
     # Archiving data
-    code                  = CharField(_('code'), unique=True, blank=True, required=True, help_text=_('CollectionCode-ItemCode'))
+    code                  = CharField(_('code'), unique=True, blank=True, required=True, help_text=_('CollectionCode_ItemCode'))
     old_code              = CharField(_('original code'), unique=False, blank=True)
     track                 = CharField(_('item number'))
     collector_selection   = CharField(_('collector selection'))
index d6200a12e649f527a1370e99f8d290a62d0a2364..ac66b00e59a8843089df0b53d3ab63f9bb199bdb 100644 (file)
@@ -6,10 +6,19 @@
     <img src="{{ STATIC_URL }}telemeta/images/collections_red.png" style="vertical-align:middle" /> Collection : {% trans "New" %}
 {% endblock %}
 
-{% block title_buttons %}
-     <a href="{% url "telemeta-collections" %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
-
     {% block cancel %}
-            <a href="{% url "telemeta-collections" %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-    {% endblock %}
\ No newline at end of file
+    <a id="cancel" href="{% url "telemeta-collections" %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+    </a>
+    {% endblock %}
+
+     {% block cancel2 %}
+     <a id="cancel" href="{% url "telemeta-collections" %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+     </a>
+     {% endblock %}
+
index cb794b22f20c962127c568768ae57315dda2a79c..1ea79a6e808d2b68392f29918bd0d805d9fe7632 100644 (file)
@@ -8,7 +8,23 @@
 {% endblock %}
 
 {% block title_buttons %}
-    <a href="{% url "telemeta-collection-detail" object.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+<div class="fixedWidthAsPlayer">
+    <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{{ STATIC_URL }}telemeta/images/wait.gif" />
+    {% block cancel %}
+    <a id="cancel" href="{% url "telemeta-collection-detail" object.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+    </a>
+    {% endblock %}
+    {% if perms.telemeta.change_mediacollection %}
+    <a id="save" href="#" onclick="var d=document; d.getElementById('wait-img').style.display='inline'; $('#_editForm').submit();">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-floppy-disk"></span> {% trans "Save" %}
+      </button>
+    </a>
+    {% endif %}
+</div>
 {% endblock %}
 
 {% block infos %}
       {% endfor %}
 
     <div align="center" style="margin-top:3ex;">
-      {% block cancel %}
-       <a href="{% url "telemeta-collection-detail" object.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-      {% endblock %}
-       {% if perms.telemeta.change_mediacollection %}
-        <input type="submit" value="{% trans "Save" %}" class="default" name="_save"/>
-       {% endif %}
+    {% block cancel2 %}
+    <a id="cancel" href="{% url "telemeta-collection-detail" object.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+    </a>
+    {% endblock %}
+    {% if perms.telemeta.change_mediacollection %}
+    <a id="save" href="#" onclick="var d=document; d.getElementById('wait-img').style.display='inline'; $('#_editForm').submit();">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-floppy-disk"></span> {% trans "Save" %}
+      </button>
+    </a>
+    {% endif %}
+
     </div>
 
    </form>
index d19bf25dd8c5a8606a545e602186ebbd69f5dcc6..787aec4539fec1e392cbfeeaa786fdf56c67fb1d 100644 (file)
@@ -8,10 +8,18 @@
     <img src="{{ STATIC_URL }}telemeta/images/item.png" alt="item" style="vertical-align:middle" /> Item : {% trans "New" %}
 {% endblock %}
 
-{% block title_buttons %}
-      <a href="{% url "telemeta-items" %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
+    {% block cancel %}
+    <a id="cancel" href="{% url "telemeta-items" %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+    </a>
+    {% endblock %}
 
-     {% block cancel %}
-     <a href="{% url "telemeta-items" %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+     {% block cancel2 %}
+     <a id="cancel" href="{% url "telemeta-items" %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+     </a>
      {% endblock %}
index 02cefe67d4e19828fe471156cce998a3f0ccccbb..237c5c6a998aa9628e0d87f54ab46b38e4367c83 100644 (file)
@@ -9,7 +9,21 @@
 
 {% block title_buttons %}
 <div class="fixedWidthAsPlayer">
-    <a href="{% url "telemeta-item-detail" item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+    <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{{ STATIC_URL }}telemeta/images/wait.gif" />
+    {% block cancel %}
+    <a id="cancel" href="{% url "telemeta-item-detail" item.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+    </a>
+    {% endblock %}
+    {% if perms.telemeta.change_mediaitem %}
+    <a id="save" href="#" onclick="var d=document; d.getElementById('wait-img').style.display='inline'; $('#_editForm').submit();">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-floppy-disk"></span> {% trans "Save" %}
+      </button>
+    </a>
+    {% endif %}
 </div>
 {% endblock %}
 
 
     {% endblock player %}
 
-
-
 {% block infos %}
   <div>
-    <form enctype="multipart/form-data" id="_editItemForm" method="post" action="">{% csrf_token %}
+    <form enctype="multipart/form-data" id="_editForm" method="post" action="">{% csrf_token %}
 
     <ul class="nav nav-tabs" role="tablist">
       <li class="active"><a href="#general" role="tab" data-toggle="tab">{% trans "General" %}</a></li>
     </div>
 
     <div align="center" style="margin-top:3ex;">
-     {% block cancel %}
-     <a href="{% url "telemeta-item-detail" item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+     {% block cancel2 %}
+     <a id="cancel" href="{% url "telemeta-item-detail" item.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+     </a>
      {% endblock %}
-
      {% if perms.telemeta.change_mediaitem %}
-      <input type="submit" value="{% trans "Save" %}" class="default" name="_save" onclick="var d=document; d.getElementById('wait-img').style.display='inline'; setTimeout(function(){d.getElementById('_editItemForm').submit();},300); return false;"/>
-      <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{{ STATIC_URL }}telemeta/images/wait.gif" />
+     <a id="save" href="#" onclick="var d=document; d.getElementById('wait-img').style.display='inline'; $('#_editForm').submit();">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-floppy-disk"></span> {% trans "Save" %}
+      </button>
+     </a>
      {% endif %}
     </div>
 
index a445b6d66b1e429fb62241e08b9508808b0d623e..06c4215b0beb6e121769fe122789a9a351eba974 100644 (file)
@@ -7,10 +7,18 @@
 <img src="{{ STATIC_URL }}telemeta/images/{{ type }}.png" style="vertical-align:middle" /> {{ type }} : {% trans "New" %}
 {% endblock %}
 
-{% block title_buttons %}
-    <a href="{% url "telemeta-resource-list" type %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-{% endblock %}
+    {% block cancel %}
+    <a id="cancel" href="{% url "telemeta-resource-list" type %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+    </a>
+    {% endblock %}
 
-      {% block cancel %}
-       <a href="{% url "telemeta-resource-list" type %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-       {% endblock %}
+     {% block cancel2 %}
+     <a id="cancel" href="{% url "telemeta-resource-list" type %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+     </a>
+     {% endblock %}
index fb15dbe100f43476e53063e286804e8dd7f99c48..33c39acbcc1ed4b648d52abf35e3fe6cf82aaea7 100644 (file)
@@ -38,17 +38,28 @@ jQuery(document).ready(function(){
 {% endblock %}
 
 {% block title_buttons %}
-  <div class="fixedWidthAsPlayer">
+<div class="fixedWidthAsPlayer">
     {% if perms.telemeta.change_mediacorpus or perms.telemeta.change_mediafonds %}
-      <a href="{% url "telemeta-resource-edit" type resource.public_id %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
-    {% endif %}
-    {% if perms.telemeta.add_mediacorpus or perms.telemeta.add_mediafonds %}
-      <a href="{% url "telemeta-resource-copy" type resource.public_id %}" class="component_icon button icon_copy">{% trans "Copy" %}</a>
+    <a href="{% url "telemeta-resource-edit" type resource.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-edit"></span> {% trans "Edit" %}
+      </button>
+    </a>
+    <a href="{% url "telemeta-resource-copy" type resource.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-new-window"></span> {% trans "Copy" %}
+      </button>
+    </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>
+    <a id="_add_to_playlist" href='#'>
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-pushpin"></span> {% trans "List" %}
+      </button>
+    </a>
     {% endif %}
-   </div>
+
+</div>
 {% endblock %}
 
 {% block content %}
index 0741241fbd284033228fb917e36abf36c80394ed..3ada96213df5c4ceb4b0c4bcd306aeb7a7b24c5f 100644 (file)
@@ -8,7 +8,25 @@
 {% endblock %}
 
 {% block title_buttons %}
-    <a href="{% url "telemeta-resource-detail" type resource.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
+<div class="fixedWidthAsPlayer">
+    <img id="wait-img" style="display:none" style="vertical-align:middle" alt="wait" src="{{ STATIC_URL }}telemeta/images/wait.gif" />
+    {% block cancel %}
+    <a id="cancel" href="{% url "telemeta-resource-detail" type resource.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+    </a>
+    {% endblock %}
+    <!--
+    {% if perms.telemeta.change_mediaresource %}
+    <a id="save" href="#" onclick="var d=document; d.getElementById('wait-img').style.display='inline'; $('#_editForm').submit();">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-floppy-disk"></span> {% trans "Save" %}
+      </button>
+    </a>
+    {% endif %}
+    -->
+</div>
 {% endblock %}
 
 {% block infos %}
     </div>
 
     <div align="center" style="margin-top:3ex;">
-      {% block cancel %}
-       <a href="{% url "telemeta-resource-detail" type resource.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
-       {% endblock %}
-       {% if perms.telemeta.change_mediacorpus or perms.telemeta.change_mediafonds %}
-        <input type="submit" value="{% trans "Save" %}" class="default" name="_save"/>
-       {% endif %}
+     {% block cancel2 %}
+     <a id="cancel" href="{% url "telemeta-resource-detail" type resource.public_id %}">
+      <button type="button" class="btn btn-default">
+        <span class="glyphicon glyphicon-remove"></span> {% trans "Cancel" %}
+      </button>
+     </a>
+     {% endblock %}
+     {% if perms.telemeta.change_mediacorpus or perms.telemeta.change_mediafonds %}
+     <input type="submit" value="{% trans "Save" %}" class="default" name="_save"/>
+     <!--
+     <a id="save" href="#" onclick="var d=document; d.getElementById('wait-img').style.display='inline'; $('#_editForm').submit();">
+      <button type="submit" class="btn btn-default" name="_save">
+        <span class="glyphicon glyphicon-floppy-disk"></span> {% trans "Save" %}
+      </button>
+     </a>
+     -->
+     {% endif %}
     </div>
 
    </form>