Add blank result messages for the index, index instance and favorited documents views.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ icon_index_level_up = Icon(
|
|||||||
driver_name='fontawesomecss', css_classes='fa-level-up-alt fa-rotate-90'
|
driver_name='fontawesomecss', css_classes='fa-level-up-alt fa-rotate-90'
|
||||||
)
|
)
|
||||||
icon_index = Icon(driver_name='fontawesome', symbol='list-ul')
|
icon_index = Icon(driver_name='fontawesome', symbol='list-ul')
|
||||||
|
icon_index_create = Icon(driver_name='fontawesome', symbol='plus')
|
||||||
icon_node_with_documents = Icon(driver_name='fontawesome', symbol='folder')
|
icon_node_with_documents = Icon(driver_name='fontawesome', symbol='folder')
|
||||||
icon_rebuild_index_instances = Icon(
|
icon_rebuild_index_instances = Icon(
|
||||||
driver_name='fontawesome', symbol='list-ul'
|
driver_name='fontawesome', symbol='list-ul'
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from navigation import Link, get_cascade_condition
|
from navigation import Link, get_cascade_condition
|
||||||
|
|
||||||
from .icons import (
|
from .icons import (
|
||||||
icon_document_index_list, icon_index, icon_rebuild_index_instances
|
icon_document_index_list, icon_index, icon_index_create,
|
||||||
|
icon_rebuild_index_instances,
|
||||||
)
|
)
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
permission_document_indexing_create, permission_document_indexing_edit,
|
permission_document_indexing_create, permission_document_indexing_edit,
|
||||||
@@ -42,6 +43,7 @@ link_index_setup_list = Link(
|
|||||||
text=_('Indexes'), view='indexing:index_setup_list'
|
text=_('Indexes'), view='indexing:index_setup_list'
|
||||||
)
|
)
|
||||||
link_index_setup_create = Link(
|
link_index_setup_create = Link(
|
||||||
|
icon_class=icon_index_create,
|
||||||
permissions=(permission_document_indexing_create,), text=_('Create index'),
|
permissions=(permission_document_indexing_create,), text=_('Create index'),
|
||||||
view='indexing:index_setup_create'
|
view='indexing:index_setup_create'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
|||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
|
from django.template import RequestContext
|
||||||
from django.urls import reverse, reverse_lazy
|
from django.urls import reverse, reverse_lazy
|
||||||
from django.utils.html import mark_safe
|
from django.utils.html import mark_safe
|
||||||
from django.utils.translation import ugettext_lazy as _, ungettext
|
from django.utils.translation import ugettext_lazy as _, ungettext
|
||||||
@@ -16,6 +17,8 @@ from documents.permissions import permission_document_view
|
|||||||
from documents.views import DocumentListView
|
from documents.views import DocumentListView
|
||||||
|
|
||||||
from .forms import IndexListForm, IndexTemplateNodeForm
|
from .forms import IndexListForm, IndexTemplateNodeForm
|
||||||
|
from .icons import icon_index
|
||||||
|
from .links import link_index_setup_create
|
||||||
from .models import (
|
from .models import (
|
||||||
DocumentIndexInstanceNode, Index, IndexInstance, IndexInstanceNode,
|
DocumentIndexInstanceNode, Index, IndexInstance, IndexInstanceNode,
|
||||||
IndexTemplateNode
|
IndexTemplateNode
|
||||||
@@ -71,6 +74,17 @@ class SetupIndexListView(SingleObjectListView):
|
|||||||
def get_extra_context(self):
|
def get_extra_context(self):
|
||||||
return {
|
return {
|
||||||
'hide_object': True,
|
'hide_object': True,
|
||||||
|
'no_results_icon': icon_index,
|
||||||
|
'no_results_main_link': link_index_setup_create.resolve(
|
||||||
|
context=RequestContext(request=self.request)
|
||||||
|
),
|
||||||
|
'no_results_text': _(
|
||||||
|
'Indexes group document automatically into levels. Indexe are '
|
||||||
|
'defined using template whose markers are replaced with '
|
||||||
|
'direct properties of documents like label or description, or '
|
||||||
|
'that of extended properties like metadata.'
|
||||||
|
),
|
||||||
|
'no_results_title': _('There are no indexes.'),
|
||||||
'title': _('Indexes'),
|
'title': _('Indexes'),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,6 +231,16 @@ class IndexListView(SingleObjectListView):
|
|||||||
def get_extra_context(self):
|
def get_extra_context(self):
|
||||||
return {
|
return {
|
||||||
'hide_links': True,
|
'hide_links': True,
|
||||||
|
'no_results_icon': icon_index,
|
||||||
|
'no_results_main_link': link_index_setup_create.resolve(
|
||||||
|
context=RequestContext(request=self.request)
|
||||||
|
),
|
||||||
|
'no_results_text': _(
|
||||||
|
'This could mean that no index templates have been '
|
||||||
|
'created or that there index templates '
|
||||||
|
'but they are no properly defined.'
|
||||||
|
),
|
||||||
|
'no_results_title': _('There are no index instances available.'),
|
||||||
'title': _('Indexes'),
|
'title': _('Indexes'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ from ..permissions import (
|
|||||||
permission_empty_trash
|
permission_empty_trash
|
||||||
)
|
)
|
||||||
from ..settings import (
|
from ..settings import (
|
||||||
setting_print_width, setting_print_height, setting_recent_added_count
|
setting_favorite_count, setting_print_width, setting_print_height,
|
||||||
|
setting_recent_added_count
|
||||||
)
|
)
|
||||||
from ..tasks import task_delete_document, task_update_page_count
|
from ..tasks import task_delete_document, task_update_page_count
|
||||||
from ..utils import parse_range
|
from ..utils import parse_range
|
||||||
@@ -825,6 +826,12 @@ class FavoriteDocumentListView(DocumentListView):
|
|||||||
context = super(FavoriteDocumentListView, self).get_extra_context()
|
context = super(FavoriteDocumentListView, self).get_extra_context()
|
||||||
context.update(
|
context.update(
|
||||||
{
|
{
|
||||||
|
'no_results_icon': icon_document_list_favorites,
|
||||||
|
'no_results_text': _(
|
||||||
|
'Favorited documents will be listed in this view. '
|
||||||
|
'Up to %(count)d documents can be favorited per user. '
|
||||||
|
) % {'count': setting_favorite_count.value},
|
||||||
|
'no_results_title': _('There are no favorited documents.'),
|
||||||
'title': _('Favorites'),
|
'title': _('Favorites'),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -201,16 +201,14 @@ class TagListView(SingleObjectListView):
|
|||||||
'hide_link': True,
|
'hide_link': True,
|
||||||
'hide_object': True,
|
'hide_object': True,
|
||||||
'no_results_icon': icon_menu_tags,
|
'no_results_icon': icon_menu_tags,
|
||||||
|
'no_results_main_link': link_tag_create.resolve(
|
||||||
|
context=RequestContext(request=self.request)
|
||||||
|
),
|
||||||
'no_results_text': _(
|
'no_results_text': _(
|
||||||
'Tags are color coded properties that can be attached or '
|
'Tags are color coded properties that can be attached or '
|
||||||
'removed from documents.'
|
'removed from documents.'
|
||||||
),
|
),
|
||||||
'no_results_title': _('No tags available'),
|
'no_results_title': _('No tags available'),
|
||||||
'no_results_main_link': link_tag_create.resolve(
|
|
||||||
context=RequestContext(
|
|
||||||
self.request, {}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'title': _('Tags'),
|
'title': _('Tags'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user