bitsof / selecto

1 stars 0 forks source link

Website redesign #118

Open shane-co opened 1 year ago

shane-co commented 1 year ago

This replaces all of the previous templates with new ones using bootstrap. Alongside:

It lacks a lot of additional stylings, and needs a lot of tweaks. But the core of the products page (image carousel laid out alongside product description, paginated reviews) and index page (paginated products displayed as bootstrap cards with both description and image) are done, and just need small additional features and stylings.

shane-co commented 1 year ago

@CodiumAI-Agent

CodiumAI-Agent commented 1 year ago

PR Analysis

How to use

Tag me in a comment '@CodiumAI-Agent' to ask for a new review after you update the PR. You can also tag me and ask any question, for example '@CodiumAI-Agent is the PR ready for merge?'

shane-co commented 1 year ago

relevant file: web/selecto/products/templatetags/pagination_tags.py suggestion content: Consider using Django's built-in pagination support instead of manually generating the HTML for the pagination links. This would make the code cleaner and easier to maintain. [important]

Will fix. An example of good use of template tags (presumably) https://github.com/django/django/blob/main/django/templatetags/static.py does not just generate bulk html, and uses a bit more complex techniques. Will replace the template tag with an html template and include something along the lines of

{% include 'pagination.html' with page_obj=reviews %}

relevant file: web/selecto/products/views.py suggestion content: Consider using Django's built-in class-based views for pagination. This would make the code cleaner and easier to maintain. [important]

I don't believe this is relevant, since the class based view is for details of a product, and the pagination is for the reviews corresponding to the project. The class based views for pagination are for lists of a given object corresponding to a database table.

relevant file: web/selecto/products/management/commands/init_db.py suggestion content: Consider using Django's built-in fixtures support instead of manually loading the data in the init_db command. This would make the code cleaner and easier to maintain. [medium]

Not relevant since that command uses djangos built in support for fixtures.

relevant file: web/selecto/products/utils.py suggestion content: Consider using Django's built-in support for internationalization and localization instead of manually generating the page title. This would make the code cleaner and easier to maintain, and would also make it easier to support multiple languages in the future. [medium]

Not relevant since the internalization and localization tools seem more focused on automatically translating the names rather than managing the generation of specialized names for each page of a given website. https://docs.djangoproject.com/en/4.2/topics/i18n/