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

Implement organizer onboarding process | Pricing/Privacy/Terms Pages #434

Open
wants to merge 19 commits into
base: development
Choose a base branch
from

Conversation

lcduong
Copy link
Contributor

@lcduong lcduong commented Nov 14, 2024

This PR is part of issue #379 Implement organizer onboarding process
It implement:

  1. in Admin area /control/admin, create a new page on left sidebar, allow Admin to create/update content for Pricing/Privacy/Terms page which will be showed on login/register page.

image

  1. In login/register page, add header to show Pricing/Privacy/Terms page

image

Summary by Sourcery

Implement a new admin page for managing Pricing, Privacy, and Terms content, and integrate Quill Editor for rich text editing.

New Features:

  • Add a new admin page in the control panel to create and update content for Pricing, Privacy, and Terms pages, which are displayed on the login/register page.

Enhancements:

  • Integrate Quill Editor for rich text editing capabilities in the admin panel for page content management.

Documentation:

  • Add documentation for the new admin page functionality, detailing how to create and update Pricing, Privacy, and Terms pages.

Copy link

sourcery-ai bot commented Nov 14, 2024

Reviewer's Guide by Sourcery

This PR implements functionality to manage content pages (Pricing/Privacy/Terms) in the admin area and display them on the login/register page. The implementation uses Quill editor for rich text editing and includes proper content sanitization.

Class diagram for the new PageSettingsForm and PageCreate classes

classDiagram
    class PageSettingsForm {
        +GlobalSettingsObject obj
        +String page_name
        +clean() I18nFormField
        +_clean_content_field(content_field) I18nFormField
        +_store_image(image_src) String
    }
    class PageCreate {
        +get_form_kwargs() kwargs
        +get_context_data() ctx
        +form_valid(form) success
        +form_invalid(form) error
        +get_success_url() url
    }
    PageCreate --> PageSettingsForm
    note for PageSettingsForm "Handles form logic for page settings"
    note for PageCreate "View for creating and updating page content"
Loading

File-Level Changes

Change Details Files
Added new admin interface for managing content pages
  • Created new admin navigation menu item for Pages with sub-items for FAQ, Pricing, Privacy and Terms
  • Implemented PageCreate view to handle page content management
  • Added PageSettingsForm to handle page title and content fields with i18n support
src/pretix/control/navigation.py
src/pretix/eventyay_common/views/pages.py
src/pretix/eventyay_common/forms/page.py
Implemented content display functionality on login/register pages
  • Added header navigation links to show Pricing/Privacy/Terms pages
  • Created ShowPageView to display page content
  • Added content sanitization using bleach library
  • Implemented context variables to control page visibility
src/pretix/control/templates/pretixcontrol/auth/base.html
src/pretix/eventyay_common/views/pages.py
Integrated Quill rich text editor
  • Added Quill editor JavaScript and CSS files
  • Implemented image upload handling in form processing
  • Added content display styling for rendered pages
src/pretix/static/pages/js/quill.core.js
src/pretix/static/pages/css/quill.snow.css
src/pretix/static/pages/css/quill-show.css

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@lcduong lcduong marked this pull request as ready for review November 14, 2024 09:18
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @lcduong - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding access controls to the uploaded images storage to prevent unauthorized access. The current implementation stores them with public access which could be a security concern.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 2 issues found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

src/pretix/eventyay_common/forms/page.py Show resolved Hide resolved
src/pretix/eventyay_common/forms/page.py Show resolved Hide resolved
src/pretix/eventyay_common/views/pages.py Show resolved Hide resolved
src/pretix/control/navigation.py Show resolved Hide resolved
@mariobehling
Copy link
Member

Please resolve conflicts.

@lcduong
Copy link
Contributor Author

lcduong commented Nov 21, 2024

Please resolve conflicts.

Hi @mariobehling, conflict is resolved

Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please follow the design / style of other pages. There is always a box and a default indent. The current indent is different to that.

Compare most other pages, e.g. as below. Do you see the box "General" for example?

Screenshot from 2024-11-21 22-14-21

@mariobehling
Copy link
Member

Regarding the implementation I recommend to follow the example of the pages module for organisers more closely. Find more details here #379 (comment)

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