-
+
{% trans 'No Users.' %}
+ {% if request.GET.search != "" %}
+ {% trans "Your search query doesn't match any users." %}
+ {% else %}
{% trans 'Currently no users exist. How did you even get here.' %}
+ {% endif %}
{% trans 'Create' %}
diff --git a/passbook/admin/views/applications.py b/passbook/admin/views/applications.py
index 112e6c57cd..2b53b2159b 100644
--- a/passbook/admin/views/applications.py
+++ b/passbook/admin/views/applications.py
@@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.core.forms.applications import ApplicationForm
@@ -20,7 +21,11 @@ from passbook.lib.views import CreateAssignPermView
class ApplicationListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all applications"""
@@ -29,6 +34,15 @@ class ApplicationListView(
ordering = "name"
template_name = "administration/application/list.html"
+ search_fields = [
+ "name",
+ "slug",
+ "meta_launch_url",
+ "meta_icon_url",
+ "meta_description",
+ "meta_publisher",
+ ]
+
class ApplicationCreateView(
SuccessMessageMixin,
diff --git a/passbook/admin/views/certificate_key_pair.py b/passbook/admin/views/certificate_key_pair.py
index c1620a0394..a221cd8ebe 100644
--- a/passbook/admin/views/certificate_key_pair.py
+++ b/passbook/admin/views/certificate_key_pair.py
@@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.crypto.forms import CertificateKeyPairForm
@@ -20,7 +21,11 @@ from passbook.lib.views import CreateAssignPermView
class CertificateKeyPairListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all keypairs"""
@@ -29,6 +34,8 @@ class CertificateKeyPairListView(
ordering = "name"
template_name = "administration/certificatekeypair/list.html"
+ search_fields = ["name"]
+
class CertificateKeyPairCreateView(
SuccessMessageMixin,
diff --git a/passbook/admin/views/flows.py b/passbook/admin/views/flows.py
index 48cd779ea4..b67ad35af0 100644
--- a/passbook/admin/views/flows.py
+++ b/passbook/admin/views/flows.py
@@ -14,6 +14,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.flows.forms import FlowForm, FlowImportForm
@@ -28,7 +29,11 @@ from passbook.lib.views import CreateAssignPermView
class FlowListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all flows"""
@@ -36,6 +41,7 @@ class FlowListView(
permission_required = "passbook_flows.view_flow"
ordering = "name"
template_name = "administration/flow/list.html"
+ search_fields = ["name", "slug", "designation", "title"]
class FlowCreateView(
diff --git a/passbook/admin/views/groups.py b/passbook/admin/views/groups.py
index dfbe32f413..64609d7e27 100644
--- a/passbook/admin/views/groups.py
+++ b/passbook/admin/views/groups.py
@@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.core.forms.groups import GroupForm
@@ -20,7 +21,11 @@ from passbook.lib.views import CreateAssignPermView
class GroupListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all groups"""
@@ -28,6 +33,7 @@ class GroupListView(
permission_required = "passbook_core.view_group"
ordering = "name"
template_name = "administration/group/list.html"
+ search_fields = ["name", "attributes"]
class GroupCreateView(
diff --git a/passbook/admin/views/outposts.py b/passbook/admin/views/outposts.py
index 7874d9dc79..43a6b88c2a 100644
--- a/passbook/admin/views/outposts.py
+++ b/passbook/admin/views/outposts.py
@@ -15,6 +15,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.lib.views import CreateAssignPermView
@@ -23,7 +24,11 @@ from passbook.outposts.models import Outpost, OutpostConfig
class OutpostListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all outposts"""
@@ -31,6 +36,7 @@ class OutpostListView(
permission_required = "passbook_outposts.view_outpost"
ordering = "name"
template_name = "administration/outpost/list.html"
+ search_fields = ["name", "_config"]
class OutpostCreateView(
diff --git a/passbook/admin/views/policies.py b/passbook/admin/views/policies.py
index 26d4be81dd..1de8f1bc94 100644
--- a/passbook/admin/views/policies.py
+++ b/passbook/admin/views/policies.py
@@ -22,6 +22,7 @@ from passbook.admin.views.utils import (
InheritanceCreateView,
InheritanceListView,
InheritanceUpdateView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.policies.models import Policy, PolicyBinding
@@ -29,7 +30,11 @@ from passbook.policies.process import PolicyProcess, PolicyRequest
class PolicyListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ InheritanceListView,
):
"""Show list of all policies"""
@@ -37,6 +42,7 @@ class PolicyListView(
permission_required = "passbook_policies.view_policy"
ordering = "name"
template_name = "administration/policy/list.html"
+ search_fields = ["name"]
class PolicyCreateView(
diff --git a/passbook/admin/views/property_mapping.py b/passbook/admin/views/property_mapping.py
index 89d228756a..9324badfb7 100644
--- a/passbook/admin/views/property_mapping.py
+++ b/passbook/admin/views/property_mapping.py
@@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView,
InheritanceListView,
InheritanceUpdateView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.core.models import PropertyMapping
class PropertyMappingListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ InheritanceListView,
):
"""Show list of all property_mappings"""
@@ -28,6 +33,7 @@ class PropertyMappingListView(
permission_required = "passbook_core.view_propertymapping"
template_name = "administration/property_mapping/list.html"
ordering = "name"
+ search_fields = ["name", "expression"]
class PropertyMappingCreateView(
diff --git a/passbook/admin/views/providers.py b/passbook/admin/views/providers.py
index 02ee7508ee..fd4de6ac69 100644
--- a/passbook/admin/views/providers.py
+++ b/passbook/admin/views/providers.py
@@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView,
InheritanceListView,
InheritanceUpdateView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.core.models import Provider
class ProviderListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ InheritanceListView,
):
"""Show list of all providers"""
@@ -28,6 +33,7 @@ class ProviderListView(
permission_required = "passbook_core.add_provider"
template_name = "administration/provider/list.html"
ordering = "id"
+ search_fields = ["id"]
class ProviderCreateView(
diff --git a/passbook/admin/views/sources.py b/passbook/admin/views/sources.py
index e0a5c907f1..8d84fd9f8b 100644
--- a/passbook/admin/views/sources.py
+++ b/passbook/admin/views/sources.py
@@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView,
InheritanceListView,
InheritanceUpdateView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.core.models import Source
class SourceListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ InheritanceListView,
):
"""Show list of all sources"""
@@ -28,6 +33,7 @@ class SourceListView(
permission_required = "passbook_core.view_source"
ordering = "name"
template_name = "administration/source/list.html"
+ search_fields = ["name", "slug"]
class SourceCreateView(
diff --git a/passbook/admin/views/stages.py b/passbook/admin/views/stages.py
index e7778864ed..72619b39ad 100644
--- a/passbook/admin/views/stages.py
+++ b/passbook/admin/views/stages.py
@@ -14,13 +14,18 @@ from passbook.admin.views.utils import (
InheritanceCreateView,
InheritanceListView,
InheritanceUpdateView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.flows.models import Stage
class StageListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ InheritanceListView,
):
"""Show list of all stages"""
@@ -28,6 +33,7 @@ class StageListView(
template_name = "administration/stage/list.html"
permission_required = "passbook_flows.view_stage"
ordering = "name"
+ search_fields = ["name"]
class StageCreateView(
diff --git a/passbook/admin/views/stages_invitations.py b/passbook/admin/views/stages_invitations.py
index 5dec555af1..9765cf5c9a 100644
--- a/passbook/admin/views/stages_invitations.py
+++ b/passbook/admin/views/stages_invitations.py
@@ -13,6 +13,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.lib.views import CreateAssignPermView
@@ -22,7 +23,11 @@ from passbook.stages.invitation.signals import invitation_created
class InvitationListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all invitations"""
@@ -30,6 +35,7 @@ class InvitationListView(
permission_required = "passbook_stages_invitation.view_invitation"
template_name = "administration/stage_invitation/list.html"
ordering = "-expires"
+ search_fields = ["created_by__username", "expires", "fixed_data"]
class InvitationCreateView(
diff --git a/passbook/admin/views/stages_prompts.py b/passbook/admin/views/stages_prompts.py
index 6fb92169d8..fb72e147d0 100644
--- a/passbook/admin/views/stages_prompts.py
+++ b/passbook/admin/views/stages_prompts.py
@@ -12,6 +12,7 @@ from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.lib.views import CreateAssignPermView
@@ -20,7 +21,11 @@ from passbook.stages.prompt.models import Prompt
class PromptListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all prompts"""
@@ -28,6 +33,12 @@ class PromptListView(
permission_required = "passbook_stages_prompt.view_prompt"
ordering = "order"
template_name = "administration/stage_prompt/list.html"
+ search_fields = [
+ "field_key",
+ "label",
+ "type",
+ "placeholder",
+ ]
class PromptCreateView(
diff --git a/passbook/admin/views/tokens.py b/passbook/admin/views/tokens.py
index d72f281682..65014e0e65 100644
--- a/passbook/admin/views/tokens.py
+++ b/passbook/admin/views/tokens.py
@@ -5,12 +5,20 @@ from django.utils.translation import gettext as _
from django.views.generic import ListView
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
-from passbook.admin.views.utils import DeleteMessageView, UserPaginateListMixin
+from passbook.admin.views.utils import (
+ DeleteMessageView,
+ SearchListMixin,
+ UserPaginateListMixin,
+)
from passbook.core.models import Token
class TokenListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all tokens"""
@@ -18,6 +26,11 @@ class TokenListView(
permission_required = "passbook_core.view_token"
ordering = "expires"
template_name = "administration/token/list.html"
+ search_fields = [
+ "intent",
+ "user__username",
+ "description",
+ ]
class TokenDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView):
diff --git a/passbook/admin/views/users.py b/passbook/admin/views/users.py
index 9275acc8da..11ce427330 100644
--- a/passbook/admin/views/users.py
+++ b/passbook/admin/views/users.py
@@ -21,6 +21,7 @@ from passbook.admin.forms.users import UserForm
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
+ SearchListMixin,
UserPaginateListMixin,
)
from passbook.core.models import Token, User
@@ -28,7 +29,11 @@ from passbook.lib.views import CreateAssignPermView
class UserListView(
- LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView
+ LoginRequiredMixin,
+ PermissionListMixin,
+ UserPaginateListMixin,
+ SearchListMixin,
+ ListView,
):
"""Show list of all users"""
@@ -36,6 +41,7 @@ class UserListView(
permission_required = "passbook_core.view_user"
ordering = "username"
template_name = "administration/user/list.html"
+ search_fields = ["username", "name", "attributes"]
def get_queryset(self):
return super().get_queryset().exclude(pk=get_anonymous_user().pk)