mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Increase link area in documents listing
Increase the link area to include the whole visual header. Fixes #335
This commit is contained in:
		| @@ -132,9 +132,10 @@ | ||||
|     {# 3: Image #} | ||||
|     {# 4: Correspondent #} | ||||
|     {# 5: Tags #} | ||||
|     {# 6: Document edit url #} | ||||
|     <div class="box"> | ||||
|       <div class="result"> | ||||
|         <div class="header"> | ||||
|         <div class="header" onclick="location.href='{{ result.6 }}';" style="cursor: pointer;"> | ||||
|           <div class="checkbox">{{ result.0 }}</div> | ||||
|           <div class="info"> | ||||
|             {{ result.4 }}<br /> | ||||
|   | ||||
| @@ -1,3 +1,5 @@ | ||||
| import re | ||||
|  | ||||
| from django.contrib.admin.templatetags.admin_list import ( | ||||
|     result_headers, | ||||
|     result_hidden_fields, | ||||
| @@ -6,6 +8,8 @@ from django.contrib.admin.templatetags.admin_list import ( | ||||
| from django.template import Library | ||||
|  | ||||
|  | ||||
| EXTRACT_URL = re.compile(r'href="(.*?)"') | ||||
|  | ||||
| register = Library() | ||||
|  | ||||
|  | ||||
| @@ -25,4 +29,15 @@ def result_list(cl): | ||||
|             'result_hidden_fields': list(result_hidden_fields(cl)), | ||||
|             'result_headers': headers, | ||||
|             'num_sorted_fields': num_sorted_fields, | ||||
|             'results': list(results(cl))} | ||||
|             'results': map(add_doc_edit_url, results(cl))} | ||||
|  | ||||
|  | ||||
| def add_doc_edit_url(result): | ||||
|     """ | ||||
|     Make the document edit URL accessible to the view as a separate item | ||||
|     """ | ||||
|     title = result[1] | ||||
|     match = re.search(EXTRACT_URL, title) | ||||
|     edit_doc_url = match[1] | ||||
|     result.append(edit_doc_url) | ||||
|     return result | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Erik Arvstedt
					Erik Arvstedt