diff --git a/HISTORY.rst b/HISTORY.rst index c67211ebac..083cd61898 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -294,6 +294,7 @@ * Use select2 for the content type filed of the access grant and remove action. * Add Latvian translation. +* Support search model selection. 3.1.11 (2019-04-XX) =================== diff --git a/docs/releases/3.2.rst b/docs/releases/3.2.rst index 0324346eb6..226c0cb2f6 100644 --- a/docs/releases/3.2.rst +++ b/docs/releases/3.2.rst @@ -723,6 +723,8 @@ Other changes - Use select2 for the content type filed of the access grant and remove action. - Add Latvian translation. +- Support search model selection. + Removals -------- diff --git a/mayan/apps/appearance/templates/appearance/home.html b/mayan/apps/appearance/templates/appearance/home.html index 17701fb347..dc0b693aa7 100644 --- a/mayan/apps/appearance/templates/appearance/home.html +++ b/mayan/apps/appearance/templates/appearance/home.html @@ -42,31 +42,7 @@ -
-
-
-
-
- - - - {% trans 'Advanced' %} - -
-
-
-
-
- - - - {% trans 'Advanced' %} - -
-
-
-
-
+ {% include 'dynamic_search/search_box.html' %} {% render_dashboard 'main' %} diff --git a/mayan/apps/dynamic_search/templates/dynamic_search/search_box.html b/mayan/apps/dynamic_search/templates/dynamic_search/search_box.html new file mode 100644 index 0000000000..d9005b2224 --- /dev/null +++ b/mayan/apps/dynamic_search/templates/dynamic_search/search_box.html @@ -0,0 +1,42 @@ +{% load i18n %} + +{% load search_tags %} +{% get_search_models as search_models %} + +
+
+
+ +
+
+
+ + diff --git a/mayan/apps/dynamic_search/templatetags/__init__.py b/mayan/apps/dynamic_search/templatetags/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/dynamic_search/templatetags/search_tags.py b/mayan/apps/dynamic_search/templatetags/search_tags.py new file mode 100644 index 0000000000..4f51c11998 --- /dev/null +++ b/mayan/apps/dynamic_search/templatetags/search_tags.py @@ -0,0 +1,14 @@ +from __future__ import unicode_literals + +from django.template import Library +from django.utils.module_loading import import_string +from django.utils.translation import ugettext_lazy as _ + +register = Library() + +from ..classes import SearchModel + + +@register.simple_tag +def get_search_models(): + return SearchModel.all()