Skip to content

Feat/Add video request feature and display request list#280

Closed
Vatsal565 wants to merge 5 commits into
alphaonelabs:mainfrom
Vatsal565:feat/video-request
Closed

Feat/Add video request feature and display request list#280
Vatsal565 wants to merge 5 commits into
alphaonelabs:mainfrom
Vatsal565:feat/video-request

Conversation

@Vatsal565
Copy link
Copy Markdown

@Vatsal565 Vatsal565 commented Mar 24, 2025

Fixes : #254

This PR implements the ability for someone to request an educational video.

Features Implemented

  • Added

    • Created a new view for requesting videos in web/views.py.
    • Added VideoRequest model in web/models.py.
    • Added a form for video requests in web/forms.py.
    • Created a template for requesting videos in web/templates/videos/request_video.html.
  • Displayed the list of video requests.

    • Created two new views uploaded_videos_list and requested_videos_list to get details and displaying them using educational_videos_list in web/views.py.
    • Modified a template for displaying video requests in web/templates/videos/list.html.

image
image
image

Summary by CodeRabbit

  • New Features
    • Introduced a video request feature that allows users to submit requests for educational videos via an intuitive form.
    • Enhanced the video viewing experience with a tabbed interface to easily toggle between uploaded videos and video requests.
    • Added a dedicated page to display a list of all video requests for streamlined browsing and interaction.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces a new video request feature. It adds a dedicated VideoRequestForm and a corresponding VideoRequest model (with migration) to handle video request data. New view functions are provided to process video request submissions and to combine uploaded and requested video listings. The URL routing is updated to include a new endpoint for video requests, and several HTML templates are added or modified to support listing and submitting video requests.

Changes

File(s) Change Summary
web/forms.py Added VideoRequestForm as a new ModelForm with a custom Meta class and widget configurations for title, description, and category.
web/models.py, web/migrations/…/0044_videorequest.py Introduced a new VideoRequest model with fields (title, description, category, requester, requested_at) and a matching migration file.
web/views.py, web/urls.py Renamed educational_videos_list to uploaded_videos_list; added requested_videos_list, a combined educational_videos_list, and a new request_video view with an associated URL route.
web/templates/videos/list.html, web/templates/videos/request_list.html, web/templates/videos/request_video.html Updated the video list template to include a “Request Video” button and tabbed interface; added templates for listing video requests and for submitting new video requests.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant B as Browser
    participant V as RequestVideoView
    participant DB as Database

    U->>B: Navigate to /videos/request/
    B->>V: Sends GET request for video request form
    V-->>B: Returns video request form
    U->>B: Fills and submits the form
    B->>V: POST /videos/request/ with form data
    V->>V: Validate form data
    alt Data is valid
        V->>DB: Create new VideoRequest record
        DB-->>V: Confirmation of save
        V-->>B: Redirect to success page
    else Data is invalid
        V-->>B: Re-render form with error messages
    end
Loading
sequenceDiagram
    participant B as Browser
    participant EV as EducationalVideosListView
    participant UV as UploadedVideosListView
    participant RV as RequestedVideosListView
    participant DB as Database

    B->>EV: GET request for videos page
    EV->>UV: Retrieve uploaded videos data
    UV->>DB: Query for uploaded videos
    DB-->>UV: Return uploaded videos list
    EV->>RV: Retrieve requested videos data
    RV->>DB: Query for video request records
    DB-->>RV: Return video requests list
    EV->>B: Return combined context with videos and requests
Loading

Possibly related PRs

Suggested labels

CR:!

Suggested reviewers

  • A1L13N

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83dd5b2 and a7f150e.

📒 Files selected for processing (8)
  • web/forms.py (3 hunks)
  • web/migrations/0044_videorequest.py (1 hunks)
  • web/models.py (1 hunks)
  • web/templates/videos/list.html (3 hunks)
  • web/templates/videos/request_list.html (1 hunks)
  • web/templates/videos/request_video.html (1 hunks)
  • web/urls.py (1 hunks)
  • web/views.py (5 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

🚨 Missing Issue Link

This pull request appears to not reference any GitHub issue.

As per our workflow requirements, all PRs should address an existing issue. This ensures:

  • Changes are properly tracked
  • Work is discussed before implementation
  • Code reviews are more focused

How to Fix This

Please link this PR to an existing issue using one of these methods:

  1. Reference the issue in your PR description: "Fixes darkmode/about #123" or "Addresses darkmode/about #123"
  2. Use GitHub's interface to link the PR to an issue in the Development section
    • Look for the section that says "Development" on the right side of your PR
    • Click "Link an issue" or "Link issues"
    • Select the relevant issue(s)
  3. If no issue exists yet, please create one first

This PR will be automatically closed. Feel free to reopen it once you've linked it to an issue or added appropriate labels.

Thank you for your contribution!

@github-actions github-actions Bot closed this Mar 24, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Missing Issue Link

This pull request appears to not reference any GitHub issue.

As per our workflow requirements, all PRs should address an existing issue. This ensures:

  • Changes are properly tracked
  • Work is discussed before implementation
  • Code reviews are more focused

How to Fix This

Please link this PR to an existing issue using one of these methods:

  1. Reference the issue in your PR description: "Fixes darkmode/about #123" or "Addresses darkmode/about #123"
  2. Use GitHub's interface to link the PR to an issue in the Development section
    • Look for the section that says "Development" on the right side of your PR
    • Click "Link an issue" or "Link issues"
    • Select the relevant issue(s)
  3. If no issue exists yet, please create one first

This PR will be automatically closed. Feel free to reopen it once you've linked it to an issue or added appropriate labels.

Thank you for your contribution!

@Vatsal565
Copy link
Copy Markdown
Author

Fixes : #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant