Пример #1
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     is_staff = self.request.user.is_staff
     context['show_pdf'] = self.request.user.profile.should_see_pdf()
     context['body_class'] = 'admin'
     if is_staff:
         context['ALL_TAG_NAMES'] = TagsService.get_all_used_tag_names()
         context['results'] = \
             SubmissionsService.get_submissions_for_followups(
                 self.request.GET.get('page'))
         context['app_index_tabs'], count = get_tabs_for_staff_user(
             'All Applications')
         context['app_index_scope_title'] = 'Applications'
     else:
         context['results'] = \
             AppsService.get_all_applications_for_org_user(
                 self.request.user, self.request.GET.get('page'))
         context['app_index_tabs'], count = get_tabs_for_org_user(
             self.request.user.profile.organization, 'All')
         context['app_index_scope_title'] = "All Applications To {}".format(
             self.request.user.profile.organization.name)
     if count == 0:
         context['no_results'] = 'You have no applications.'
         context['csv_download_link'] = None
     else:
         context['csv_download_link'] = reverse('intake-csv_download')
     context['page_counter'] = \
         utils.get_page_navigation_counter(
             page=context['results'],
             wing_size=9)
     return context
Пример #2
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     is_staff = self.request.user.is_staff
     context['show_pdf'] = self.request.user.profile.should_see_pdf()
     context['body_class'] = 'admin'
     if is_staff:
         context['ALL_TAG_NAMES'] = TagsService.get_all_used_tag_names()
         context['results'] = \
             SubmissionsService.get_submissions_for_followups(
                 self.request.GET.get('page'))
         context['app_index_tabs'], count = get_tabs_for_staff_user(
             'All Applications')
         context['app_index_scope_title'] = 'Applications'
     else:
         context['results'] = \
             AppsService.get_all_applications_for_org_user(
                 self.request.user, self.request.GET.get('page'))
         context['app_index_tabs'], count = get_tabs_for_org_user(
             self.request.user.profile.organization, 'All')
         context['app_index_scope_title'] = "All Applications To {}".format(
             self.request.user.profile.organization.name)
     if count == 0:
         context['no_results'] = 'You have no applications.'
         context['csv_download_link'] = None
     else:
         context['csv_download_link'] = reverse('intake-csv_download')
     context['page_counter'] = \
         utils.get_page_navigation_counter(
             page=context['results'],
             wing_size=9)
     return context
Пример #3
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     is_staff = self.request.user.is_staff
     context['show_pdf'] = self.request.user.profile.should_see_pdf()
     context['body_class'] = 'admin'
     context['search_form'] = forms.ApplicationSelectForm()
     if is_staff:
         context['ALL_TAG_NAMES'] = TagsService.get_all_used_tag_names()
         context['results'] = \
             SubmissionsService.get_submissions_for_followups()
     else:
         context['results'] = \
             AppsService.get_applications_index_for_org_user(
                 self.request.user, self.request.GET.get('page'))
         context['page_counter'] = \
             utils.get_page_navigation_counter(
                 page=context['results'],
                 wing_size=9)
     return context
Пример #4
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     is_staff = self.request.user.is_staff
     context['show_pdf'] = self.request.user.profile.should_see_pdf()
     context['body_class'] = 'admin'
     if is_staff:
         context['ALL_TAG_NAMES'] = TagsService.get_all_used_tag_names()
         context['results'] = \
             SubmissionsService.get_submissions_for_followups(
                 self.request.GET.get('page'))
     else:
         context['results'] = \
             AppsService.get_applications_index_for_org_user(
                 self.request.user, self.request.GET.get('page'))
     context['page_counter'] = \
         utils.get_page_navigation_counter(
             page=context['results'],
             wing_size=9)
     return context