Beispiel #1
0
 def __call__(self):
     return {
         'header':
         render_object_header(self.context,
                              self.request,
                              stat=render_object_stat(
                                  self.context, self.request))
     }
Beispiel #2
0
    def __call__(self):
        result = {'stat': ''}
        is_homepage = self.request.view_name in ('index', '')
        picture = getattr(self.context, 'homepage_picture', None)
        if not is_homepage or (is_homepage and picture):
            return result

        result['stat'] = render_object_stat(self.context, self.request)
        return result
Beispiel #3
0
    def __call__(self):
        result = {'stat': ''}
        is_homepage = self.request.view_name in ('index', '')
        picture = getattr(self.context, 'homepage_picture', None)
        if not is_homepage or (is_homepage and picture):
            return result

        result['stat'] = render_object_stat(self.context, self.request)
        return result
Beispiel #4
0
    def __call__(self):
        is_homepage = self.request.view_name in ('index', '')
        picture = getattr(self.context, 'homepage_picture', None)
        result = {
            'is_homepage': is_homepage,
            'picture': picture,
        }
        if is_homepage and picture:
            result['text'] = getattr(self.context, 'homepage_text', None)
            result['stat'] = render_object_stat(self.context, self.request)

        return result
Beispiel #5
0
    def __call__(self):
        is_homepage = self.request.view_name in ('index', '')
        picture = getattr(self.context, 'homepage_picture', None)
        result = {
            'is_homepage': is_homepage,
            'picture': picture,
        }
        if is_homepage and picture:
            result['text'] = getattr(self.context, 'homepage_text', None)
            result['stat'] = render_object_stat(self.context, self.request) 

        return result
Beispiel #6
0
    def __call__(self):
        challenge = getattr(self.context, 'challenge', None)
        if challenge is None or 'challenge' not in self.request.content_to_manage:
            return {}

        try:
            SeeChallenge.get_validator().validate(challenge, self.request)
        except ValidationError as error:
            return {}

        result = {
            'challenge': challenge,
            'current_user': get_current(),
            'stat': render_object_stat(challenge, self.request)}
        return result
Beispiel #7
0
    def __call__(self):
        challenge = getattr(self.context, 'challenge', None)
        if challenge is None or 'challenge' not in self.request.content_to_manage:
            return {}

        try:
            SeeChallenge.get_validator().validate(challenge, self.request)
        except ValidationError as error:
            return {}

        result = {
            'challenge': challenge,
            'current_user': get_current(),
            'stat': render_object_stat(challenge, self.request)
        }
        return result
Beispiel #8
0
 def __call__(self):
     return {
         'header': render_object_header(
             self.context, self.request,
             stat=render_object_stat(self.context, self.request))}