]> git.parisson.com Git - telemeta.git/commitdiff
fix success url for new resources
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 20 Nov 2014 13:56:53 +0000 (14:56 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 20 Nov 2014 13:57:12 +0000 (14:57 +0100)
telemeta/templates/telemeta/mediaitem_detail.html
telemeta/views/collection.py
telemeta/views/item.py

index 36bdfe28318c70f3835e8a821d0828f3523438d9..f35adcaf53a9af5e204539962e0adfb14328fdf3 100644 (file)
@@ -11,6 +11,7 @@
 {% endblock %}
 
 {% block extra_javascript %}
+
 {% if item %}
 
 <script src="{{ STATIC_URL }}telemeta/js/popupdiv-min.js" type="text/javascript"></script>
@@ -27,7 +28,7 @@
 
 <script type="text/javascript">
     {% if item.file or item.url %}
-    {% if access == 'full' or perms.telemeta.can_play_all_items %}
+     {% if access == 'full' or perms.telemeta.can_play_all_items %}
         //initializing soundManager default properties
         soundManager.flashVersion = 9;
         soundManager.url = "{{ STATIC_URL }}timeside/swf/";
@@ -55,7 +56,7 @@
              CURRENT_USER_NAME,  //undefined if !user.is_authenticated
              false); //false because not superuser
         {% endif %}
-    {% endif %}
+     {% endif %}
     {% endif %}
     //playlists:
     {% if user.is_authenticated %}
     {% block player %}
 
     {% if access == 'full' or perms.telemeta.can_play_all_items %}
+
     <div id="player_maximized" class="ts-skin-lab">
        <div id="player_header">
         <a href="#" class="toggle">Minimize</a>
index a3cf0567fa5b7ec2f7c44e16de1dc2111dc38aed..337e7fabec7f6b23a95847053acc8b2f5d9a5b6d 100644 (file)
@@ -319,7 +319,7 @@ class CollectionAddView(CollectionViewMixin, CreateWithInlinesView):
     inlines = [CollectionRelatedInline, CollectionIdentifierInline]
 
     def get_success_url(self):
-        return reverse_lazy('telemeta-collections')
+        return reverse_lazy('telemeta-collection-detail', kwargs={'public_id':self.object.code})
 
 
 class CollectionCopyView(CollectionAddView):
@@ -330,4 +330,4 @@ class CollectionCopyView(CollectionAddView):
         return model_to_dict(self.get_object())
 
     def get_success_url(self):
-        return reverse_lazy('telemeta-collections')
+        return reverse_lazy('telemeta-collection-detail', kwargs={'public_id':self.object.code})
index 438edf744fb407a73230921bb1f1ee9cab4fa65c..e2fa3e734c0a5b3a918f61f6bed9d18a2e869a9f 100644 (file)
@@ -730,7 +730,7 @@ class ItemEditView(ItemViewMixin, UpdateWithInlinesView):
         return super(ItemEditView, self).form_valid(form)
 
     def get_success_url(self):
-        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.get_object().code})
+        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.object.code})
 
     def get_context_data(self, **kwargs):
         context = super(ItemEditView, self).get_context_data(**kwargs)
@@ -766,7 +766,7 @@ class ItemAddView(ItemViewMixin, CreateWithInlinesView):
         return model_to_dict(item)
 
     def get_success_url(self):
-        return reverse_lazy('telemeta-items')
+        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.object.code})
 
 
 class ItemCopyView(ItemAddView):
@@ -778,7 +778,7 @@ class ItemCopyView(ItemAddView):
         return model_to_dict(self.get_object())
 
     def get_success_url(self):
-        return reverse_lazy('telemeta-items')
+        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.object.code})
 
 
 class ItemDetailView(ItemViewMixin, DetailView):