diff --git a/.gitignore b/.gitignore index 73adaa5..0c24a22 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ /static/posts/ /static/thumbnails/ /static/videos/ +/venv/ +/__pycache__/ \ No newline at end of file diff --git a/README.md b/README.md index 4c3ed42..80b1065 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ **Приватный репозиторий для разработки и тестирования новых версий веб-приложения artberry** +------------ + + ### используемые технологии #### backend: - ##### ЯП: [Python](http://https://www.python.org/ "Python") @@ -14,4 +17,32 @@ - ##### CSS - ##### JAVASCRIPT +------------ + + +#### ЗАПУСК И ТЕСТИРОВАНИЕ +**Для удобства и скорости разработки выполните следующие шаги:** + +#### создайте виртуальное окружение: +`python -m venv venv` + +#### запустите виртуальное окружение: +WINDOWS: +**powershell: **` .\venv\Scripts\Activate` +**CMD: **`venv\Scripts\activate.bat` + +LINUX | MAC: +`source venv/bin/activate` + +#### установите зависимости: +`pip install -r requirements.txt` + +#### запустите проект +`python app.py` или `flask run` + +##### Для отладки в конце файла `app.py` измените: + +`app.run(debug=False)` **на:** `app.run(debug=True)` + +------------ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a91a4ec Binary files /dev/null and b/requirements.txt differ diff --git a/static/css/styles.css b/static/css/styles.css index 5024679..afb4d23 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -78,9 +78,6 @@ body { margin-top: 10px; margin-bottom: 10px; } -nav .button:hover { - background-color: #9a6fa0; -} a { color:yellow; text-decoration: none; @@ -180,28 +177,6 @@ header { .input-field::placeholder { color: #DDDDDD; } -nav { - display: flex; - justify-content: center; - align-items: center; - background-color: #6a4664; - width: 100%; - height: 60px; - box-sizing: border-box; - position: fixed; - top: 0; - left: 0; - z-index: 1000; -} -nav .button { - padding: 10px 45px; - text-decoration: none; - color: white; - border: none; - border-radius: 5px; - cursor: pointer; - background-color: #845e80; -} footer { display: flex; justify-content: center; diff --git a/templates/content.html b/templates/content.html index 05c2b26..5f177fc 100644 --- a/templates/content.html +++ b/templates/content.html @@ -14,126 +14,46 @@ - + {% include 'navbar.html' %}
-

🫐artberry🫐

- - -
+
-
+
{% block content %} - - {% if content_type == 'art' or content_type == 'video' or content_type == 'comic' %} -
-

{{ content.title }}

- {% if content_type == 'art' %} - {{ content.title }} - {% elif content_type == 'video' %} - - {% elif content_type == 'comic' %} -
- {% for page in content.pages %} - Comic Page {{ loop.index }} - {% endfor %} + {% if content_type in ['art', 'video', 'comic'] %} +
+

{{ content.title }}

+ {% if content_type == 'art' %} + {{ content.title }} + {% elif content_type == 'video' %} + + {% elif content_type == 'comic' %} +
+ {% for page in content.pages %} + Comic Page {{ loop.index }} + {% endfor %} +
+ {% endif %}
- {% endif %} -

Uploaded by: {{ content.username }}

-

Description: {{ content.description }}

-
- -
-

Votes: {{ content.cookie_votes }} 🍪

- {% if current_user.is_authenticated %} -
- - -
- {% else %} -

You need to log in to vote.

- {% endif %} -
- {% else %} -

Unknown content type.

{% endif %} - -
-

Comments

- {% if comments %} -
    - {% for comment in comments %} -
  • - Avatar - {{ comment.username }}: {{ comment.comment_text }} -
  • - {% endfor %} -
- {% else %} -

No comments yet. Be the first to comment!

- {% endif %} - {% if current_user.is_authenticated %} -
- - -
- {% else %} -

You need to log in to comment.

- {% endif %} -
- {% endblock %}
- {% if pagination %} + + - --> \ No newline at end of file diff --git a/templates/view.html b/templates/view.html index 6525cc6..0c2620f 100644 --- a/templates/view.html +++ b/templates/view.html @@ -146,5 +146,43 @@ {% endif %} {% endif %} +
+

Votes: {{ content.cookie_votes }} 🍪

+ {% if current_user.is_authenticated %} +
+ + +
+ {% else %} +

You need to log in to vote.

+ {% endif %} +
+ +
+

Comments

+ {% if comments %} + + {% else %} +

No comments yet. Be the first to comment!

+ {% endif %} + {% if current_user.is_authenticated %} +
+ + +
+ {% else %} +

You need to log in to comment.

+ {% endif %} +