Changed document index links icons and index rebuild confirmation icon, updated list view to display icon for the type of index instance content
This commit is contained in:
@@ -36,15 +36,23 @@
|
|||||||
{% if multi_select or multi_select_as_buttons %}
|
{% if multi_select or multi_select_as_buttons %}
|
||||||
<th class="first"><input type="checkbox" class="checkbox toggle" /></th>
|
<th class="first"><input type="checkbox" class="checkbox toggle" /></th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if not hide_object %}
|
{% if not hide_object %}
|
||||||
<th>{% trans "Identifier" %}</th>
|
<th>{% trans "Identifier" %}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% for column in extra_columns_preffixed %}
|
||||||
|
<th>{{ column.name|capfirst }}</th>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{% for column in object_list.0|get_model_list_columns %}
|
{% for column in object_list.0|get_model_list_columns %}
|
||||||
<th>{{ column.name|capfirst }}</th>
|
<th>{{ column.name|capfirst }}</th>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for column in extra_columns %}
|
{% for column in extra_columns %}
|
||||||
<th>{{ column.name|capfirst }}</th>
|
<th>{{ column.name|capfirst }}</th>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if not hide_links %}
|
{% if not hide_links %}
|
||||||
<th class=""> </th>
|
<th class=""> </th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -64,6 +72,15 @@
|
|||||||
<td>{% if not hide_link %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% else %}{{ object }}{% endif %}</td>
|
<td>{% if not hide_link %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% else %}{{ object }}{% endif %}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% for column in extra_columns_preffixed %}
|
||||||
|
{% if column.keep_together %}
|
||||||
|
<td>
|
||||||
|
{{ object|object_property:column.attribute|safe|make_non_breakable }}
|
||||||
|
</td>
|
||||||
|
{% else %}
|
||||||
|
<td>{{ object|object_property:column.attribute|safe }}</td>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
{% if not hide_columns %}
|
{% if not hide_columns %}
|
||||||
{% for column in object|get_model_list_columns %}
|
{% for column in object|get_model_list_columns %}
|
||||||
<td>{{ object|object_property:column.attribute|safe }}</td>
|
<td>{{ object|object_property:column.attribute|safe }}</td>
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ set_namespace_title('document_indexing', _(u'indexing'))
|
|||||||
register_permission(PERMISSION_DOCUMENT_INDEXING_VIEW)
|
register_permission(PERMISSION_DOCUMENT_INDEXING_VIEW)
|
||||||
register_permission(PERMISSION_DOCUMENT_INDEXING_REBUILD_INDEXES)
|
register_permission(PERMISSION_DOCUMENT_INDEXING_REBUILD_INDEXES)
|
||||||
|
|
||||||
index_list = {'text': _(u'index list'), 'view': 'index_instance_list', 'famfam': 'folder_link', 'permissions': [PERMISSION_DOCUMENT_INDEXING_VIEW]}
|
index_list = {'text': _(u'index list'), 'view': 'index_instance_list', 'famfam': 'folder_page', 'permissions': [PERMISSION_DOCUMENT_INDEXING_VIEW]}
|
||||||
|
|
||||||
register_menu([
|
register_menu([
|
||||||
{'text': _('indexes'), 'view': 'index_instance_list', 'links': [
|
{'text': _('indexes'), 'view': 'index_instance_list', 'links': [
|
||||||
], 'famfam': 'folder_link', 'position': 2, 'permissions': [PERMISSION_DOCUMENT_INDEXING_VIEW]}])
|
], 'famfam': 'folder_link', 'position': 2, 'permissions': [PERMISSION_DOCUMENT_INDEXING_VIEW]}])
|
||||||
|
|
||||||
rebuild_index_instances = {'text': _('rebuild indexes'), 'view': 'rebuild_index_instances', 'famfam': 'folder_link', 'permissions': [PERMISSION_DOCUMENT_INDEXING_REBUILD_INDEXES], 'description': _(u'Deletes and creates from scratch all the document indexes.')}
|
rebuild_index_instances = {'text': _('rebuild indexes'), 'view': 'rebuild_index_instances', 'famfam': 'folder_page', 'permissions': [PERMISSION_DOCUMENT_INDEXING_REBUILD_INDEXES], 'description': _(u'Deletes and creates from scratch all the document indexes.')}
|
||||||
|
|
||||||
register_tool(rebuild_index_instances, namespace='document_indexing', title=_(u'Indexes'))
|
register_tool(rebuild_index_instances, namespace='document_indexing', title=_(u'Indexes'))
|
||||||
|
|||||||
@@ -15,6 +15,12 @@ from document_indexing.api import get_breadcrumbs, get_instance_link, \
|
|||||||
do_rebuild_all_indexes
|
do_rebuild_all_indexes
|
||||||
|
|
||||||
|
|
||||||
|
def _index_instance_item_link(index_instance_item):
|
||||||
|
icon = u'folder_page' if isinstance(index_instance_item, IndexInstance) else u'page'
|
||||||
|
return u'<span class="famfam active famfam-%(icon)s"></span><a href="%(url)s">%(text)s</a>' % {
|
||||||
|
'url': index_instance_item.get_absolute_url(), 'icon': icon, 'text': index_instance_item}
|
||||||
|
|
||||||
|
|
||||||
def index_instance_list(request, index_id=None):
|
def index_instance_list(request, index_id=None):
|
||||||
check_permissions(request.user, [PERMISSION_DOCUMENT_INDEXING_VIEW])
|
check_permissions(request.user, [PERMISSION_DOCUMENT_INDEXING_VIEW])
|
||||||
|
|
||||||
@@ -33,8 +39,15 @@ def index_instance_list(request, index_id=None):
|
|||||||
|
|
||||||
return render_to_response('generic_list.html', {
|
return render_to_response('generic_list.html', {
|
||||||
'object_list': index_instance_list,
|
'object_list': index_instance_list,
|
||||||
|
'extra_columns_preffixed': [
|
||||||
|
{
|
||||||
|
'name': _(u'item'),
|
||||||
|
'attribute': lambda x: _index_instance_item_link(x)
|
||||||
|
}
|
||||||
|
],
|
||||||
'title': title,
|
'title': title,
|
||||||
'hide_links': True,
|
'hide_links': True,
|
||||||
|
'hide_object': True,
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
@@ -48,8 +61,9 @@ def rebuild_index_instances(request):
|
|||||||
return render_to_response('generic_confirm.html', {
|
return render_to_response('generic_confirm.html', {
|
||||||
'previous': previous,
|
'previous': previous,
|
||||||
'next': next,
|
'next': next,
|
||||||
|
'title': _(u'Are you sure you wish to rebuild all indexes?'),
|
||||||
'message': _(u'On large databases this operation may take some time to execute.'),
|
'message': _(u'On large databases this operation may take some time to execute.'),
|
||||||
'form_icon': u'folder_link.png',
|
'form_icon': u'folder_page.png',
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
BIN
site_media/images/icons/folder_page.png
Normal file
BIN
site_media/images/icons/folder_page.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user