def get(self,request,*args,**kwargs): from common.templates import get_template_user_window, get_template_anon_user_window self.list = SurveyList.objects.get(pk=self.kwargs["pk"]) if request.user.is_authenticated: self.template_name = get_template_user_window(self.list, "user_survey/load/", "list.html", request.user, request.META['HTTP_USER_AGENT'], request.user.is_doc_manager()) else: self.template_name = get_template_anon_user_window(self.list, "user_survey/load/", "list.html", request.META['HTTP_USER_AGENT']) return super(UserLoadSurveylist,self).get(request,*args,**kwargs)
def get(self,request,*args,**kwargs): from common.templates import get_template_user_window, get_template_anon_user_window self.list = DocList.objects.get(pk=self.kwargs["pk"]) if self.list.creator.pk == request.user.pk: self.doc_list = self.list.get_staff_items() else: self.doc_list = self.list.get_items() if request.user.is_authenticated: self.template_name = get_template_user_window(self.list, "user_docs/load/", "list.html", request.user, request.META['HTTP_USER_AGENT'], request.user.is_doc_manager()) else: self.template_name = get_template_anon_user_window(self.list, "user_docs/load/", "list.html", request.META['HTTP_USER_AGENT']) return super(UserLoadDoclist,self).get(request,*args,**kwargs)
def get(self, request, *args, **kwargs): from common.model.comments import BlogComment from common.templates import get_template_user_window, get_template_anon_user_window self.photo = Photo.objects.get(pk=self.kwargs["photo_pk"]) self.comment = BlogComment.objects.get(pk=self.kwargs["pk"]) self.photos = self.comment.get_attach_photos() if request.user.is_authenticated: self.template_name = get_template_user_window( self.photo, "user_gallery/blog_comment_photo/", "list.html", request.user, request.META['HTTP_USER_AGENT'], request.user.is_photo_manager()) else: self.template_name = get_template_anon_user_window( self.photo, "user_gallery/blog_comment_photo/", "list.html", request.META['HTTP_USER_AGENT']) return super(UserBlogCommentPhoto, self).get(request, *args, **kwargs)
def get(self, request, *args, **kwargs): from chat.models import Chat from common.templates import get_template_user_window, get_template_anon_user_window self.photo = Photo.objects.get(pk=self.kwargs["photo_pk"]) self.chat = Chat.objects.get(pk=self.kwargs["pk"]) self.photos_ids = self.chat.get_attach_photos_ids() if request.user.is_authenticated: self.template_name = get_template_user_window( self.photo, "chat/attach/photo/u/", "photo.html", request.user, request.META['HTTP_USER_AGENT'], request.user.is_photo_manager()) else: self.template_name = get_template_anon_user_window( self.photo, "chat/attach/photo/u/anon_photo.html", request.user, request.META['HTTP_USER_AGENT']) return super(MessagePhotoDetail, self).get(request, *args, **kwargs)
def get(self, request, *args, **kwargs): from common.templates import get_template_user_window, get_template_anon_user_window self.photo, self.list = Photo.objects.get( pk=self.kwargs["pk"]), PhotoList.objects.get( uuid=self.kwargs["uuid"]) if request.user.is_authenticated: self.template_name = get_template_user_window( self.photo, "user_gallery/photo/", "list.html", request.user, request.META['HTTP_USER_AGENT'], request.user.is_photo_manager()) else: self.template_name = get_template_anon_user_window( self.photo, "user_gallery/photo/", "list.html", request.META['HTTP_USER_AGENT']) if request.user.pk == self.photo.creator.pk: self.photos = self.list.get_staff_items() else: self.photos = self.list.get_items() self.next = self.photos.filter( pk__gt=self.photo.pk).order_by('pk').first() self.prev = self.photos.filter( pk__lt=self.photo.pk).order_by('-pk').first() return super(UserListPhoto, self).get(request, *args, **kwargs)