Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rinkitadhana
Copy link
Contributor

@rinkitadhana rinkitadhana commented Mar 23, 2025

Fixes #4038

Description:

This PR adds a Style Guide page to ensure design consistency across the project. The guide includes typography, colors, buttons, icons, and menu headers. Additionally, Figma links for all pages are provided for easy reference and collaboration.

Preview:

2025-03-24.02-18-59.mp4

Summary by CodeRabbit

  • New Features
    • A comprehensive style guide is now available, offering detailed guidelines on design principles, colors, typography, and UI components.
    • Users can easily access the style guide via a new navigation link with active state indications for an enhanced browsing experience.
    • A dedicated view for rendering the style guide has been introduced, improving the application's view capabilities.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 23, 2025

Walkthrough

The pull request introduces a style guide feature into the application. It defines a new URL route and corresponding view for the style guide page, adds an HTML template detailing the design system, and updates the sidebar navigation to include a link to this new page. These changes extend the routing and presentation layers without affecting existing functionality, ensuring that users can access comprehensive style guide information through a dedicated endpoint.

Changes

File(s) Change Summary
blt/urls.py, website/views/core.py Added a new URL pattern for /style-guide/ and introduced the StyleGuideView class to render the style guide template.
website/templates/includes/sidenav.html, website/templates/style_guide.html Introduced a new sidebar link for the style guide and added a complete HTML template for displaying the style guide details.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant DjangoRouter
    participant StyleGuideView
    participant TemplateRenderer

    User->>Browser: Click "Style Guide" link
    Browser->>DjangoRouter: GET request to /style-guide/
    DjangoRouter->>StyleGuideView: Dispatch request to StyleGuideView
    StyleGuideView->>TemplateRenderer: Render "style_guide.html"
    TemplateRenderer-->>StyleGuideView: Rendered HTML content
    StyleGuideView-->>Browser: Return HTML response
    Browser-->>User: Display Style Guide page
Loading

Assessment against linked issues

Objective Addressed Explanation
Add a style guide page (#4038)

Possibly related PRs

Suggested reviewers

  • DonnieBLT

📜 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 a80cf22 and c0512d5.

📒 Files selected for processing (1)
  • website/templates/style_guide.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/templates/style_guide.html
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Run Tests
  • GitHub Check: docker-test

🪧 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
website/templates/style_guide.html (1)

22-926: Comprehensive Style Guide Content
The remainder of the template provides very thorough content on the design system, including sections on design principles, colors, typography, components, layout, icons, responsive design, accessibility, and links to Figma files. The structured use of Tailwind CSS classes and semantic HTML helps in maintaining visual consistency and clarity.

As the file is quite extensive, you might consider modularizing some of the content into partials (for example, separating individual sections into their own include files) if further expansion is anticipated. This would enhance maintainability in the long run.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b7d0fff and a80cf22.

📒 Files selected for processing (4)
  • blt/urls.py (2 hunks)
  • website/templates/includes/sidenav.html (1 hunks)
  • website/templates/style_guide.html (1 hunks)
  • website/views/core.py (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
blt/urls.py (1)
website/views/core.py (1)
  • StyleGuideView (2837-2838)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Run Tests
  • GitHub Check: docker-test
  • GitHub Check: Analyze (python)
🔇 Additional comments (6)
website/views/core.py (1)

2837-2838: Looks good - properly implemented view for style guide page.

The StyleGuideView class correctly inherits from Django's built-in TemplateView and specifies the template to render. This follows Django best practices for simple template rendering.

blt/urls.py (2)

87-87: Import correctly added.

The StyleGuideView import is properly added to the existing imports from the core module.


1100-1100: URL route properly configured.

The URL pattern for the style guide is correctly implemented:

  • Uses Django's path function with appropriate parameters
  • URL path uses kebab-case ("style-guide/") following web conventions
  • URL name uses snake_case ("style_guide") following Python conventions
  • View is properly referenced using the as_view() method

This route will make the style guide accessible at /style-guide/ in the application.

website/templates/includes/sidenav.html (1)

672-679: New "Style Guide" Navigation Link Added
The new anchor element for the Style Guide is well integrated into the sidebar. The conditional classes correctly toggle the active state based on whether the current request path contains /style-guide/. Please verify that the corresponding URL pattern named "style_guide" is defined and that the view renders the Style Guide page as expected.

website/templates/style_guide.html (2)

1-14: Template Header and Meta Blocks
The template correctly extends the base layout, loads static assets, and sets up the title, description, keywords, and extra CSS (including the Font Awesome stylesheet). This configuration provides a solid foundation for the style guide page.


15-20: Content Block and Sidebar Inclusion
The {% block content %} is defined appropriately and the inclusion of the sidebar via {% include "includes/sidenav.html" %} ensures consistent navigation. Confirm that having the sidebar on the style guide page is intentional for your design requirements.

@DonnieBLT DonnieBLT merged commit ff15498 into OWASP-BLT:main Mar 23, 2025
10 checks passed
@rinkitadhana rinkitadhana deleted the fix/style-guide branch March 23, 2025 22:04
mahii-17 pushed a commit to mahii-17/BLT that referenced this pull request Mar 27, 2025
* style-guide page completed

* nav-link added

* icon section added

* pre-commit error
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.

Add a style guide page.

2 participants