minor changes
This commit is contained in:
parent
8ccb3c634f
commit
e06e10f5e6
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,3 +6,5 @@
|
|||||||
/static/posts/
|
/static/posts/
|
||||||
/static/thumbnails/
|
/static/thumbnails/
|
||||||
/static/videos/
|
/static/videos/
|
||||||
|
/venv/
|
||||||
|
/__pycache__/
|
31
README.md
31
README.md
@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
**Приватный репозиторий для разработки и тестирования новых версий веб-приложения artberry**
|
**Приватный репозиторий для разработки и тестирования новых версий веб-приложения artberry**
|
||||||
|
|
||||||
|
------------
|
||||||
|
|
||||||
|
|
||||||
### используемые технологии
|
### используемые технологии
|
||||||
#### backend:
|
#### backend:
|
||||||
- ##### ЯП: [Python](http://https://www.python.org/ "Python")
|
- ##### ЯП: [Python](http://https://www.python.org/ "Python")
|
||||||
@ -14,4 +17,32 @@
|
|||||||
- ##### CSS
|
- ##### CSS
|
||||||
- ##### JAVASCRIPT
|
- ##### 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)`
|
||||||
|
|
||||||
|
------------
|
||||||
|
|
||||||
|
BIN
requirements.txt
Normal file
BIN
requirements.txt
Normal file
Binary file not shown.
@ -78,9 +78,6 @@ body {
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
nav .button:hover {
|
|
||||||
background-color: #9a6fa0;
|
|
||||||
}
|
|
||||||
a {
|
a {
|
||||||
color:yellow;
|
color:yellow;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@ -180,28 +177,6 @@ header {
|
|||||||
.input-field::placeholder {
|
.input-field::placeholder {
|
||||||
color: #DDDDDD;
|
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 {
|
footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -14,126 +14,46 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<nav class="nav">
|
{% include 'navbar.html' %}
|
||||||
<div class="nav-buttons">
|
|
||||||
{% if content_type == 'art' %}
|
|
||||||
|
|
||||||
{% if current_user.is_authenticated %}
|
|
||||||
<a href="{{ url_for('upload') }}" class="button">Upload</a>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ url_for('videos') }}" class="button">Videos</a>
|
|
||||||
<a href="{{ url_for('comics') }}" class="button">Comics</a>
|
|
||||||
{% elif content_type == 'video' %}
|
|
||||||
|
|
||||||
{% if current_user.is_authenticated %}
|
|
||||||
<a href="{{ url_for('upload_video') }}" class="button">Upload</a>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ url_for('index') }}" class="button">Arts</a>
|
|
||||||
<a href="{{ url_for('comics') }}" class="button">Comics</a>
|
|
||||||
{% elif content_type == 'comic' %}
|
|
||||||
|
|
||||||
{% if current_user.is_authenticated %}
|
|
||||||
<a href="{{ url_for('comic_upload') }}" class="button">Upload</a>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ url_for('index') }}" class="button">Arts</a>
|
|
||||||
<a href="{{ url_for('videos') }}" class="button">Videos</a>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if current_user.is_authenticated %}
|
|
||||||
<a href="{{ url_for('logout') }}" class="button">Logout</a>
|
|
||||||
<a href="{{ url_for('shop') }}" class="button">{{ user_cookies }} 🍪</a>
|
|
||||||
{% else %}
|
|
||||||
<a href="{{ url_for('register') }}" class="button">Register</a>
|
|
||||||
<a href="{{ url_for('login') }}" class="button">Login</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<h1 class="title"><a href="{{url_for('index')}}" style="color:white;">🫐artberry🫐</a></h1>
|
|
||||||
<form method="GET"
|
<form method="GET"
|
||||||
action="{{ search_url if search_url else url_for(request.endpoint, pub_type=pub_type, username=username) }}"
|
action="{{ search_url if search_url else url_for(request.endpoint, pub_type=pub_type, username=username) }}"
|
||||||
class="search-form">
|
class="search-form">
|
||||||
<input type="text" name="search" id="search-input" placeholder="Search by tags"
|
<!-- </form>
|
||||||
class="input-field search-field" autocomplete="off">
|
|
||||||
<button type="submit" class="button search-button">Search</button>
|
|
||||||
</form>
|
|
||||||
<div id="autocomplete-suggestions" class="autocomplete-suggestions"></div>
|
<div id="autocomplete-suggestions" class="autocomplete-suggestions"></div>
|
||||||
</form>
|
</form>
|
||||||
|
подсказки будут добавлены позже -->
|
||||||
</header>
|
</header>
|
||||||
<section class="content" id="content">
|
<section class="content" id="content">
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% if content_type in ['art', 'video', 'comic'] %}
|
||||||
{% if content_type == 'art' or content_type == 'video' or content_type == 'comic' %}
|
<div class="{{ content_type }}-details">
|
||||||
<div class="{{ content_type }}-details">
|
<h2>{{ content.title }}</h2>
|
||||||
<h2>{{ content.title }}</h2>
|
{% if content_type == 'art' %}
|
||||||
{% if content_type == 'art' %}
|
<img src="{{ url_for('static', filename='uploads/' + content.filename) }}" alt="{{ content.title }}"
|
||||||
<img src="{{ url_for('static', filename='uploads/' + content.filename) }}" alt="{{ content.title }}"
|
class="art-image" loading="lazy" width="800" height="600">
|
||||||
class="art-image" loading="lazy" width="800" height="600">
|
{% elif content_type == 'video' %}
|
||||||
{% elif content_type == 'video' %}
|
<video controls class="video-player">
|
||||||
<video controls class="video-player">
|
<source src="{{ url_for('static', filename='uploads/videos/' + content.filename) }}" type="video/mp4">
|
||||||
<source src="{{ url_for('static', filename='uploads/videos/' + content.filename) }}" type="video/mp4">
|
Your browser does not support the video tag.
|
||||||
Your browser does not support the video tag.
|
</video>
|
||||||
</video>
|
{% elif content_type == 'comic' %}
|
||||||
{% elif content_type == 'comic' %}
|
<div class="comic-pages">
|
||||||
<div class="comic-pages">
|
{% for page in content.pages %}
|
||||||
{% for page in content.pages %}
|
<img src="{{ url_for('static', filename='uploads/comics/' + content.name + '/' + page) }}"
|
||||||
<img src="{{ url_for('static', filename='uploads/comics/' + content.name + '/' + page) }}"
|
alt="Comic Page {{ loop.index }}" class="comic-page">
|
||||||
alt="Comic Page {{ loop.index }}" class="comic-page">
|
{% endfor %}
|
||||||
{% endfor %}
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
<p>Uploaded by: <a href="{{ url_for('profile', username=content.username) }}">{{ content.username }}</a></p>
|
|
||||||
<p>Description: {{ content.description }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="vote-section">
|
|
||||||
<p>Votes: {{ content.cookie_votes }} 🍪</p>
|
|
||||||
{% if current_user.is_authenticated %}
|
|
||||||
<form action="{{ url_for('vote_content', content_type=content_type, content_id=content.id) }}"
|
|
||||||
method="POST">
|
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
||||||
<button type="submit" class="button">Vote</button>
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<p>You need to <a href="{{ url_for('login') }}">log in</a> to vote.</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Unknown content type.</p>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="comments-section">
|
|
||||||
<h3>Comments</h3>
|
|
||||||
{% if comments %}
|
|
||||||
<ul class="comments-list">
|
|
||||||
{% for comment in comments %}
|
|
||||||
<li>
|
|
||||||
<img src="{{ url_for('static', filename='avatars/' + avatars[comment.username]) }}" alt="Avatar"
|
|
||||||
class="comment-avatar">
|
|
||||||
<strong>{{ comment.username }}</strong>: {{ comment.comment_text }}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
{% else %}
|
|
||||||
<p>No comments yet. Be the first to comment!</p>
|
|
||||||
{% endif %}
|
|
||||||
{% if current_user.is_authenticated %}
|
|
||||||
<form method="POST" class="comment-form">
|
|
||||||
<textarea name="comment" placeholder="Write your comment..." maxlength="44" required
|
|
||||||
class="input-textarea"></textarea>
|
|
||||||
<button type="submit" class="button">Post Comment</button>
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<p>You need to <a href="{{ url_for('login') }}">log in</a> to comment.</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% if pagination %}
|
|
||||||
|
<!-- {% if pagination %}
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
{% if pagination.has_prev %}
|
{% if pagination.has_prev %}
|
||||||
<a href="{{ url_for(request.endpoint, page=pagination.prev_num, search=request.args.get('search')) }}"
|
<a href="{{ url_for(request.endpoint, page=pagination.prev_num, search=request.args.get('search')) }}"
|
||||||
@ -152,16 +72,7 @@
|
|||||||
class="button">»</a>
|
class="button">»</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %} -->
|
||||||
|
|
||||||
<footer class="footer">
|
|
||||||
<p>
|
|
||||||
<a href="{{ url_for('privacy_policy') }}" class="button">Privacy</a>
|
|
||||||
<a href="{{ url_for('terms_of_use') }}" class="button">TOS</a>
|
|
||||||
<a href="{{ url_for('publication_rules') }}" class="button">Pub Rules</a>
|
|
||||||
<a href="https://discord.gg/yRFyPjceWj" target="_blank" class="button" rel="noopener noreferrer">Discord</a>
|
|
||||||
</p>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<div class="modal-overlay" id="ageVerificationModal">
|
<div class="modal-overlay" id="ageVerificationModal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@ -173,7 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<!-- <script>
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
var modal = document.getElementById('ageVerificationModal');
|
var modal = document.getElementById('ageVerificationModal');
|
||||||
var body = document.body;
|
var body = document.body;
|
||||||
@ -234,7 +145,7 @@
|
|||||||
})
|
})
|
||||||
.catch(error => console.error('Error fetching autocomplete data:', error));
|
.catch(error => console.error('Error fetching autocomplete data:', error));
|
||||||
});
|
});
|
||||||
</script>
|
</script> -->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -146,5 +146,43 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class="vote-section">
|
||||||
|
<p>Votes: {{ content.cookie_votes }} 🍪</p>
|
||||||
|
{% if current_user.is_authenticated %}
|
||||||
|
<form action="{{ url_for('vote_content', content_type=content_type, content_id=content.id) }}"
|
||||||
|
method="POST">
|
||||||
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
|
<button type="submit" class="button">Vote</button>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<p>You need to <a href="{{ url_for('login') }}">log in</a> to vote.</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="comments-section">
|
||||||
|
<h3>Comments</h3>
|
||||||
|
{% if comments %}
|
||||||
|
<ul class="comments-list">
|
||||||
|
{% for comment in comments %}
|
||||||
|
<li>
|
||||||
|
<img src="{{ url_for('static', filename='avatars/' + (avatars.get(comment.username) or 'default_avatar.png')) }}" alt="Avatar"
|
||||||
|
class="comment-avatar">
|
||||||
|
<strong>{{ comment.username }}</strong>: {{ comment.comment_text }}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>No comments yet. Be the first to comment!</p>
|
||||||
|
{% endif %}
|
||||||
|
{% if current_user.is_authenticated %}
|
||||||
|
<form method="POST" class="comment-form">
|
||||||
|
<textarea name="comment" placeholder="Write your comment..." maxlength="44" required
|
||||||
|
class="input-textarea"></textarea>
|
||||||
|
<button type="submit" class="button">Post Comment</button>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<p>You need to <a href="{{ url_for('login') }}">log in</a> to comment.</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user