-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow users to edit the document fulltext
This allows users that have the suitable permission to edit the fulltext field of Documents. This field is used when searching, so it allows users to remove frontmatter from PDFs which are irrelevant, or paste a plaintext version for a Google Doc link, for example. The field is only shown to those with the relevant permission to avoid confusing people who may not understand what it is for. When a PDF is edited for a Document, unless the fulltext is also edited at the same time (within the same form submission), it will take priority and overwrite the old fulltext (even if edited prior).
- Loading branch information
Showing
5 changed files
with
162 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 5.0.8 on 2024-11-05 09:30 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('general', '0013_rename_documentfile_document_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='document', | ||
options={'permissions': [('can_edit_fulltext', 'Can edit document fulltext (used for search)')], 'verbose_name': 'Document', 'verbose_name_plural': 'Documents'}, | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
app/general/migrations/0015_alter_document_document_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.0.8 on 2024-11-07 09:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('general', '0014_alter_document_options'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='document', | ||
name='document_data', | ||
field=models.TextField(blank=True, help_text="This is the document's full-text which users can search through. By default, this is extracted from the document's PDF (if exists), but it can also be edited.", verbose_name='Searchable content'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters