]> git.parisson.com Git - teleforma.git/commitdiff
add read icons, fix admin
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 15 Feb 2013 14:29:59 +0000 (15:29 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 15 Feb 2013 14:29:59 +0000 (15:29 +0100)
teleforma/admin.py
teleforma/templates/teleforma/answer_form.html
teleforma/templates/teleforma/inc/document_simple_list.html
teleforma/templates/teleforma/inc/media_package_list.html
teleforma/templates/teleforma/inc/media_step.html

index 73a67e59085feb612953b7b5e28b7b24f9d05a6e..10ca0ea2ea65a662b697e55f0b44de71be13ce18 100644 (file)
@@ -56,7 +56,7 @@ class DocumentAdmin(admin.ModelAdmin):
 
 class MediaAdmin(admin.ModelAdmin):
     exclude = ['readers']
-    search_fields = ['id', 'title']
+    search_fields = ['id', 'title', 'course__title', 'course__code']
 
 class ConferenceAdmin(admin.ModelAdmin):
     exclude = ['readers']
index b5aae31b392819588c6e6aae2556446706bfe791..eee7e8f35d2439b244a4801ca36e8eb573c25df7 100644 (file)
@@ -6,12 +6,14 @@
 <script src="{{ STATIC_URL }}teleforma/js/charCount.js" type="text/javascript"></script>
 <script type="text/javascript">
 
+{% if not user.is_staff %}
 $(document).ready(function(){
   $('#id_answer').live("paste",function(e) {
       e.preventDefault();
       new Messi(gettext('Sorry, it is not allowed to paste text here.'), {buttons: [{id: 0, label: gettext('OK'), val: 'X'}], modal: true});
   });
 });
+{% endif %}
 
 $(document).ready(function(){   
     //default usage
index b11cd279f680e5d6d358db52dd963cffc5fc1a04..83df34bb3c3639a70482f361fe1fc5073533e563 100644 (file)
@@ -5,8 +5,8 @@
     <tbody>
         {% for doc in docs.all %}
             <tr>
-            <td {% if forloop.first %}class="border-top"{% endif %} width="95%">{% if doc.file %}<a href="{% url teleforma-document-view seminar.id doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ doc.title }}{% if doc.file %}</a>{% endif %}</td>
-            <td {% if forloop.first %}class="border-top"{% endif %} width="5%" align="center">{% if doc.file %}<a href="{% url teleforma-document-download seminar.id doc.id %}"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="90%">{% if doc.file %}<a href="{% url teleforma-document-view seminar.id doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ doc.title }}{% if doc.file %}</a>{% endif %}</td>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="10%" align="center">{% if doc.file %}{% if user in doc.readers.all %}<img src="{{ STATIC_URL }}telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans ' viewed' %}" /> {% endif %}<a href="{% url teleforma-document-download seminar.id doc.id %}"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
             </tr>
         {% endfor %}
     </tbody>
index e7fca1b5c762263b9b4410b79d8459961bd7a13f..8c0a0c269203f3cedec8a8975ceb405d5c1b62e4 100644 (file)
                  </div>
             </td>
             <td {% if forloop.first %}class="border-top"{% endif %} width="10%" align="center">
-            {% if media.is_published and user.is_staff %}
-             <img src="{{ STATIC_URL }}telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans ' published' %}" />
-            {% elif not media.is_published and user.is_staff %}
-             <img src="{{ STATIC_URL }}telemeta/images/delete.png" style="vertical-align:middle" alt="" title="{% trans ' rejected' %}" />
+            {% if user in media.readers.all %}
+             <img src="{{ STATIC_URL }}telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans ' viewed' %}" />
             {% endif %}
             {% if media.item.file %}
              <a href="{{ MEDIA_URL }}{{ media.item.file }}">
index 62515ddb2d71ba325c21dab8ffcfa6c388a2ca00..8e5af06b33870ab623fb490cb182ac0bec1c20f3 100644 (file)
@@ -8,7 +8,7 @@
         {% if media.is_published or user.is_staff %}
             <tr>
             <td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
-              <a href="{% url teleforma-media-video seminar.id media.id %}" title="{% trans "Play" %}">
+              <a href="{% url teleforma-media-video seminar.id media.id %}" target="_blank" title="{% trans "Play" %}">
               <img src="{{ STATIC_URL }}/teleforma/images/tool-animator.png" style="vertical-align:middle" alt="" /> {{ media.item.title }}
             </a>
           </td>
@@ -16,4 +16,4 @@
         {% endif %}
       {% endfor %}
    </tbody>
-</table>
\ No newline at end of file
+</table>