Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update resource description field to a WYSIWYG editor in the admin. #241

Merged
merged 5 commits into from
Nov 17, 2023

Conversation

Afani97
Copy link
Contributor

@Afani97 Afani97 commented Oct 25, 2023

What's changed:

  • Add django-ckeditor package and update requirements
  • Update ResourceAdmin class with form that uses CKEditorWidget for the description field

Preview:
Screenshot 2023-10-25 at 7 15 18 PM

@@ -357,3 +358,5 @@ def __init__(self, tz_name=None):

# Contact us Email
CONTACT_US_EMAILS = os.getenv("CONTACT_US_EMAILS", "forwardjustice-team@caktusgroup.com").split(":")

CKEDITOR_BASEPATH = "/static/ckeditor/ckeditor/"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check if the deployment runs collectstatic

Copy link
Contributor Author

@Afani97 Afani97 Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copelco Is hard coding the path to static ok in prod? I see the Dockerfile sets a UWSGI_STATIC_MAP to something different. Or is that totally unrelated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work!

@Afani97 Afani97 requested a review from copelco October 31, 2023 12:19
Copy link
Member

@copelco copelco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@@ -70,6 +80,7 @@ class ResourceAdmin(admin.ModelAdmin):
filter_horizontal = ("agencies",)
inlines = [InlineResourceFile]
readonly_fields = ("created_date",)
form = ResourceForm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formfield_overrides might work here, but not required!

@@ -357,3 +358,5 @@ def __init__(self, tz_name=None):

# Contact us Email
CONTACT_US_EMAILS = os.getenv("CONTACT_US_EMAILS", "forwardjustice-team@caktusgroup.com").split(":")

CKEDITOR_BASEPATH = "/static/ckeditor/ckeditor/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work!

@github-actions github-actions bot temporarily deployed to staging November 16, 2023 22:35 Destroyed
@Afani97 Afani97 merged commit 6087289 into develop Nov 17, 2023
@Afani97 Afani97 deleted the CU-868656ku9 branch November 17, 2023 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants