Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayliable committed Mar 25, 2024
1 parent fd82cca commit bbea781
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ docs/_build/
home/__pycache__/models.cpython-39.pyc
home/__pycache__/urls.cpython-39.pyc
home/__pycache__/views.cpython-39.pyc
db.sqlite3
6 changes: 6 additions & 0 deletions home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class UserUpload(models.Model):
('option_two', 'Photography'),
('option_three', 'Illustration'),
('option_four', 'Graphic Design'),
('option_five', 'Animation'),
('option_six', '3D'),
('option_seven', 'Painting'),
]

OPTIONS2 = [ # privacy options
Expand Down Expand Up @@ -70,6 +73,9 @@ class UserUploadURL(models.Model): # user upload for URL images
('option_two', 'Photography'),
('option_three', 'Illustration'),
('option_four', 'Graphic Design'),
('option_five', 'Animation'),
('option_six', '3D'),
('option_seven', 'Painting'),
]

OPTIONS2 = [ # privacy options
Expand Down
5 changes: 4 additions & 1 deletion home/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
path("extra_view/", views.extra_view, name="extra_view"),
path("detail_view/", views.detail_view, name="detail_view"),
path("SignIn/", views.SignIn_view, name="SignIn_view"),

path("graphic_design/", views.graphic_design, name="graphic_design"),
path("3d/", views.threedee, name="3d"),
path("animation/", views.animation, name="animation"),
path("painting/", views.painting, name="painting"),
]
30 changes: 29 additions & 1 deletion home/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
#Do something here!!!!
# Do something here!!!!
name = form.cleaned_data['name']
email = form.cleaned_data['email']
subject = form.cleaned_data['subject']
Expand Down Expand Up @@ -89,6 +89,34 @@ def illustration(request):
return render(request, 'illustration.html', {'images': filtered_images, 'url_images': filtered_images_url})


def graphic_design(request):
# Filter through images based on tag and privacy
filtered_images = UserUpload.objects.filter(tags='option_four', privacy='option_one')
filtered_images_url = UserUploadURL.objects.filter(tags='option_two', privacy='option_one')
return render(request, 'graphicDesign.html', {'images': filtered_images, 'url_images': filtered_images_url})


def animation(request):
# Filter through images based on tag and privacy
filtered_images = UserUpload.objects.filter(tags='option_five', privacy='option_one')
filtered_images_url = UserUploadURL.objects.filter(tags='option_two', privacy='option_one')
return render(request, 'animation.html', {'images': filtered_images, 'url_images': filtered_images_url})


def threedee(request):
# Filter through images based on tag and privacy
filtered_images = UserUpload.objects.filter(tags='option_six', privacy='option_one')
filtered_images_url = UserUploadURL.objects.filter(tags='option_two', privacy='option_one')
return render(request, '3d.html', {'images': filtered_images, 'url_images': filtered_images_url})


def painting(request):
# Filter through images based on tag and privacy
filtered_images = UserUpload.objects.filter(tags='option_seven', privacy='option_one')
filtered_images_url = UserUploadURL.objects.filter(tags='option_two', privacy='option_one')
return render(request, 'painting.html', {'images': filtered_images, 'url_images': filtered_images_url})


def accpieces_view(request): # home page of site
return render(request, "acc-viewpieces.html")

Expand Down
32 changes: 32 additions & 0 deletions templates/3d.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "nav-bar.html" %}
{% load static %}
{% block title %}
Tag: Photography - Portfol.io
{% endblock %}

{% block content %}
<head>
<meta charset="UTF-8">
<title> 3D </title>
<link rel="stylesheet" type="text/css" href="/static/style/generalStyle.css">
<link rel="stylesheet" type="text/css" href="static/style/generalTagStyle.css">
</head>
<body>
<div class="tagHeader">
<h4 style="font-size: 20px; text-align: center"> Current Tag: </h4>
<h3 style="font-size: 45px; text-align: center"> 3D </h3>
</div>
<div class="imageDisplay">
{% for image in images %} <!-- prints out all images -->
{% if image.image_compressed %} <!-- makes sure one exists -->
<img src="{{ image.image_compressed.url }}" alt="Image">
{% endif %}
{% endfor %}
{% for image in url_images %} <!-- prints out all images -->
{% if image.url_upload %} <!-- makes sure one exists -->
<img src="{{ image.url_upload }}" alt="Image">
{% endif %}
{% endfor %}
</div>
</body>
{% endblock %}
32 changes: 32 additions & 0 deletions templates/animation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "nav-bar.html" %}
{% load static %}
{% block title %}
Tag: Photography - Portfol.io
{% endblock %}

{% block content %}
<head>
<meta charset="UTF-8">
<title> Animation </title>
<link rel="stylesheet" type="text/css" href="/static/style/generalStyle.css">
<link rel="stylesheet" type="text/css" href="static/style/generalTagStyle.css">
</head>
<body>
<div class="tagHeader">
<h4 style="font-size: 20px; text-align: center"> Current Tag: </h4>
<h3 style="font-size: 45px; text-align: center"> Animation </h3>
</div>
<div class="imageDisplay">
{% for image in images %} <!-- prints out all images -->
{% if image.image_compressed %} <!-- makes sure one exists -->
<img src="{{ image.image_compressed.url }}" alt="Image">
{% endif %}
{% endfor %}
{% for image in url_images %} <!-- prints out all images -->
{% if image.url_upload %} <!-- makes sure one exists -->
<img src="{{ image.url_upload }}" alt="Image">
{% endif %}
{% endfor %}
</div>
</body>
{% endblock %}
32 changes: 32 additions & 0 deletions templates/graphicDesign.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "nav-bar.html" %}
{% load static %}
{% block title %}
Tag: Photography - Portfol.io
{% endblock %}

{% block content %}
<head>
<meta charset="UTF-8">
<title> Graphic Design </title>
<link rel="stylesheet" type="text/css" href="/static/style/generalStyle.css">
<link rel="stylesheet" type="text/css" href="static/style/generalTagStyle.css">
</head>
<body>
<div class="tagHeader">
<h4 style="font-size: 20px; text-align: center"> Current Tag: </h4>
<h3 style="font-size: 45px; text-align: center"> Graphic Design </h3>
</div>
<div class="imageDisplay">
{% for image in images %} <!-- prints out all images -->
{% if image.image_compressed %} <!-- makes sure one exists -->
<img src="{{ image.image_compressed.url }}" alt="Image">
{% endif %}
{% endfor %}
{% for image in url_images %} <!-- prints out all images -->
{% if image.url_upload %} <!-- makes sure one exists -->
<img src="{{ image.url_upload }}" alt="Image">
{% endif %}
{% endfor %}
</div>
</body>
{% endblock %}
8 changes: 4 additions & 4 deletions templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ <h4 style="font-size: 20px; text-align: center"> Browse Categories! </h4>
<a href="/illustration"> <!-- links to the illustration page -->
<img src="{% static 'tags/illustration.png' %}" alt="img" class="categoryimg">
</a>
<a href="#"> <!-- links to the page of art -->
<a href="/graphic_design"> <!-- links to the page of art -->
<img src="{% static 'tags/graphicdesign.png' %}" alt="img" class="categoryimg">
</a>
<a href="#"> <!-- links to the page of art -->
<a href="/painting"> <!-- links to the page of art -->
<img src="{% static 'tags/painting.png' %}" alt="img" class="categoryimg">
</a>
<a href="#"> <!-- links to the page of art -->
<a href="/animation"> <!-- links to the page of art -->
<img src="{% static 'tags/animation.png' %}" alt="img" class="categoryimg">
</a>
<a href="#"> <!-- links to the page of art -->
<a href="/3d"> <!-- links to the page of art -->
<img src="{% static 'tags/3dmodel.png' %}" alt="img" class="categoryimg">
</a>
</div>
Expand Down
32 changes: 32 additions & 0 deletions templates/painting.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "nav-bar.html" %}
{% load static %}
{% block title %}
Tag: Painting - Portfol.io
{% endblock %}

{% block content %}
<head>
<meta charset="UTF-8">
<title> Painting </title>
<link rel="stylesheet" type="text/css" href="/static/style/generalStyle.css">
<link rel="stylesheet" type="text/css" href="static/style/generalTagStyle.css">
</head>
<body>
<div class="tagHeader">
<h4 style="font-size: 20px; text-align: center"> Current Tag: </h4>
<h3 style="font-size: 45px; text-align: center"> Painting </h3>
</div>
<div class="imageDisplay">
{% for image in images %} <!-- prints out all images -->
{% if image.image_compressed %} <!-- makes sure one exists -->
<img src="{{ image.image_compressed.url }}" alt="Image">
{% endif %}
{% endfor %}
{% for image in url_images %} <!-- prints out all images -->
{% if image.url_upload %} <!-- makes sure one exists -->
<img src="{{ image.url_upload }}" alt="Image">
{% endif %}
{% endfor %}
</div>
</body>
{% endblock %}

0 comments on commit bbea781

Please sign in to comment.