Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Commit

Permalink
Merge 06f8b7b into aa6048f
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbegbie committed Mar 19, 2018
2 parents aa6048f + 06f8b7b commit bc6337e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
24 changes: 0 additions & 24 deletions molo/surveys/templates/wagtailsurveys/list_forms.html

This file was deleted.

3 changes: 2 additions & 1 deletion molo/surveys/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

from django.conf.urls import url
from molo.surveys.views import (
SurveySuccess, submission_article, get_segment_user_count
index, SurveySuccess, submission_article, get_segment_user_count
)


urlpatterns = [
url(r'^surveys/index/', index, name='index'),
url(
r"^(?P<slug>[\w-]+)/success/$",
SurveySuccess.as_view(),
Expand Down
17 changes: 17 additions & 0 deletions molo/surveys/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,32 @@
from django.shortcuts import render
from django.http import JsonResponse
from django.utils.translation import ugettext as _
from wagtail.utils.pagination import paginate

from wagtail.wagtailadmin import messages
from wagtail.wagtailadmin.utils import permission_required
from wagtail_personalisation.forms import SegmentAdminForm
from wagtail_personalisation.models import Segment

from wagtailsurveys.models import get_surveys_for_user

from .forms import CSVGroupCreationForm


def index(request):
survey_pages = get_surveys_for_user(request.user)
survey_pages = (
survey_pages.objects.descendant_of(request.site.root_page)
.filter(languages__language__is_main_language=True)
.specific()
)
paginator, survey_pages = paginate(request, survey_pages)

return render(request, 'wagtailsurveys/index.html', {
'survey_pages': survey_pages,
})


class SegmentCountForm(SegmentAdminForm):
class Meta:
model = Segment
Expand Down

0 comments on commit bc6337e

Please sign in to comment.