Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

comment gallery item not gallery itself

  • Loading branch information...
commit 6e8cdaed419e3fc61db9974333036ea196aab4dd 1 parent d122627
@kvbik kvbik authored
Showing with 7 additions and 4 deletions.
  1. +3 −0  ella_galleries/models.py
  2. +4 −4 ella_galleries/views.py
View
3  ella_galleries/models.py
@@ -5,6 +5,7 @@
from ella.core.models import Publishable
from ella.core.cache import cache_this, CachedForeignKey
from ella.core.custom_urls import resolver
+from ella.core.views import get_templates_from_publishable
from ella.photos.models import Photo
@@ -112,4 +113,6 @@ def get_absolute_url(self):
return self.gallery.get_absolute_url()
return resolver.reverse(self.gallery, 'gallery-item-detail', self.get_slug())
+ def get_templates(self, name):
+ return get_templates_from_publishable(name, self.gallery)
View
8 ella_galleries/views.py
@@ -24,9 +24,6 @@ def gallery_item_detail(request, context, item_slug=None, url_remainder=None):
# TODO: log empty gallery
raise Http404()
- if url_remainder:
- return custom_urls.resolver.call_custom_view(request, gallery, url_remainder, context)
-
if item_slug is None:
item = item_sorted_dict.value_for_index(0)
if count > 1:
@@ -44,7 +41,6 @@ def gallery_item_detail(request, context, item_slug=None, url_remainder=None):
next = item_sorted_dict.value_for_index(item_index + 1)
position = item_index + 1
-
context.update({
'gallery': gallery,
'item': item,
@@ -56,6 +52,10 @@ def gallery_item_detail(request, context, item_slug=None, url_remainder=None):
'position' : position,
})
+ if url_remainder:
+ context['object'] = context['item']
+ return custom_urls.resolver.call_custom_view(request, gallery, url_remainder, context)
+
if request.is_ajax():
template_name = "item-ajax.html"
else:
Please sign in to comment.
Something went wrong with that request. Please try again.