added basic style and navbar

feature/product_models_refactor
mtyton 2023-05-03 20:17:49 +02:00
rodzic fedd0bee20
commit 8db06afb86
10 zmienionych plików z 96 dodań i 27 usunięć

3
.gitignore vendored
Wyświetl plik

@ -135,3 +135,6 @@ GitHub.sublime-settings
!.vscode/launch.json
!.vscode/extensions.json
.history
#postgres pass files
*.my_pgpass

Wyświetl plik

@ -1,5 +1,5 @@
# Use an official Python runtime based on Debian 10 "buster" as a parent image.
FROM python:3.8.1-slim-buster
FROM python:3.11.3-buster
# Add user that will be used in the container.
RUN useradd wagtail

Wyświetl plik

@ -0,0 +1,36 @@
# Use an official Python runtime based on Debian 10 "buster" as a parent image.
FROM python:3.11.3-buster
# Port used by this container to serve HTTP.
EXPOSE 8000
# Set environment variables.
# 1. Force Python stdout and stderr streams to be unbuffered.
# 2. Set PORT variable that is used by Gunicorn. This should match "EXPOSE"
# command.
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system packages required by Wagtail and Django.
RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \
build-essential \
libpq-dev \
libmariadbclient-dev \
libjpeg62-turbo-dev \
zlib1g-dev \
libwebp-dev \
&& rm -rf /var/lib/apt/lists/*
# Install the project requirements.
COPY requirements.txt /
RUN pip install -r /requirements.txt
# Use /app folder as a directory where the source code is stored.
WORKDIR /app
# Copy the source code of the project into the container.
COPY ./ /app
# Collect static files.
RUN python manage.py collectstatic --noinput --clear
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

Wyświetl plik

@ -88,12 +88,13 @@ WSGI_APPLICATION = "artel.wsgi.application"
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
import dj_database_url as db_url
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
"default": db_url.parse(
"postgres://comfy:password@db/comfy_shop"
)
}

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 33 KiB

Wyświetl plik

@ -26,6 +26,7 @@
{# Global stylesheets #}
<link rel="stylesheet" type="text/css" href="{% static 'css/artel.css' %}">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
{% block extra_css %}
{# Override this in templates to add extra stylesheets #}
@ -34,17 +35,20 @@
<body class="{% block body_class %}{% endblock %}">
{% wagtailuserbar %}
<div class="row">
<div class="col s3">
{% main_menu template="menu/custom_main_menu.html" %}
</div>
<div class="col s9">
{% block content %}{% endblock %}
<div class="container">
<div class="row">
<div class="col-3">
{% main_menu max_levels=3 template="menu/custom_main_menu.html" %}
</div>
<div class="col-9 mt-5 ml-2">
{% block content %}{% endblock %}
</div>
</div>
</div>
{# Global javascript #}
<script type="text/javascript" src="{% static 'js/artel.js' %}"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
{% block extra_js %}
{# Override this in templates to add extra javascript #}

Wyświetl plik

@ -1,14 +1,18 @@
<ul>
{% for item in menu_items %}
<li class="{{ item.active_class }}">
<a href="{{ item.href }}">{{ item.text }}</a>
{% if item.sub_menu %}
<ul class="sub-menu">
{% for sub_item in item.sub_menu.items %}
<li class="{{ sub_item.active_class }}"><a href="{{ sub_item.href }}">{{ sub_item.text }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% load static %}
<div class="d-flex flex-column flex-shrink-0 p-3 mr-5" style="width: 280px;">
<svg class="bi me-2" width="40" height="32">
<img src="{% static 'images/las_ruinas_PL.png' %}"/>
</svg>
<hr>
<ul class="nav nav-pills flex-column mb-auto">
{% for item in menu_items %}
<li class="nav-item">
<a href="{{ item.href }}" class="nav-link" aria-current="page">
{{ item.text }}
</a>
</li>
{% endfor %}
</ul>
<hr>
</div>

Wyświetl plik

@ -0,0 +1,20 @@
version: "3.8"
services:
comfy:
build:
dockerfile: Dockerfile.local
context: ./
ports:
- "8000:8000"
volumes:
- .:/app
db:
image: postgres
restart: always
environment:
POSTGRES_ROOT_PASSWORD: password
POSTGRES_USER: comfy
POSTGRES_PASSWORD: password
POSTGRES_DB: comfy_shop
volumes:
- ../postgres/:/var/lib/postgresql

Wyświetl plik

@ -1,3 +1,5 @@
Django>=4.1,<4.2
wagtail>=4.2,<4.3
wagtailmenus>=3.1.5, <=3.1.7
wagtailmenus>=3.1.5,<=3.1.7
psycopg2>=2.9.5,<=2.9.6
dj-database-url<=2.0.0

Wyświetl plik

@ -31,4 +31,3 @@ class ProductConfig(models.Model):
class Product(models.Model):
template = models.ForeignKey(ProductTemplate, on_delete=models.CASCADE)
config = models.ForeignKey(ProductConfig, on_delete=models.CASCADE)