Skip to content

Commit c602a7f

Browse files
authored
Merge branch 'main' into views/forms/final-sprint
2 parents d54122e + a7af330 commit c602a7f

File tree

10 files changed

+34
-18
lines changed

10 files changed

+34
-18
lines changed

Wampus/Wampus/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
path('search/', views.search_projects_view, name='search-projects'),
2828
path('logout/', views.logout_view),
2929
path('register/', views.register_view),
30-
path('project/<str:project_name>', views.project_view, name='project-page'),
30+
path('project/<slug:project_id>', views.project_view, name='project-page'),
3131
path('profile/', views.profilepage_view),
3232
path('about-us/', views.aboutus_view),
3333
path('create-project/', views.createproject_view),

Wampus/app/static/main.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ a {
198198
.projectCard {
199199
min-width: 330px;
200200
min-height: 225px;
201-
width:360px;
201+
width:330px;
202202
height: 225px;
203203
display: flex;
204204
margin: 2% 2% 2% 2%;
@@ -354,6 +354,7 @@ a {
354354
max-height: 500px;
355355
height: fit-content;
356356
margin: 2% 0 0 0;
357+
padding: 0 auto 0 auto;
357358
overflow-x: auto;
358359
}
359360

@@ -823,13 +824,11 @@ a {
823824
height: fit-content;
824825
min-height: 250px;
825826
margin: 2% 0 0 2%;
826-
text-align: center;
827827
}
828828

829829
.project__rows{
830830
display: flex;
831831
flex-direction: row;
832-
justify-content: center;
833832
}
834833

835834
.inputField--tags {

Wampus/app/templates/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h3 style="font-family: Lora">Meet The Team:</h3>
2020
{% with name="Dhavani Patel" github="//github.com/dhav15" linkedin="//linkedin.com/in/dhavani-patel/" image="../static/images/dhavani.jpeg" %}
2121
{% include "components/teamMemberComponent.html" %}
2222
{% endwith %}
23-
{% with name="Jon O'Brien" github="//github.com/jonobrien99" linkedin="" image="../static/images/jon.jpeg"%}
23+
{% with name="Jon O'Brien" github="//github.com/jonobrien99" linkedin="//linkedin.com/in/jon-anthony-obrien/" image="../static/images/jon.jpeg"%}
2424
{% include "components/teamMemberComponent.html" %}
2525
{% endwith %}
2626
{% with name="Mobina Tooranisama" github="//github.com/MobinaToorani" linkedin="//linkedin.com/in/mobina-tooranisama-029222202" image="../static/images/mobina.jpeg" %}

Wampus/app/templates/components/projectCardComponent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div class="projectCard">
44
<div class="project__text">
5-
<h2 class="projectCard__title"><a href="{% url 'project-page' name %}">{{ name }}</a></h2>
5+
<h2 class="projectCard__title"><a href="{% url 'project-page' id %}">{{ name }}</a></h2>
66
<h2 class="projectCard__description">{{ desc }}</h2>
77
</div>
88

Wampus/app/templates/components/teamMemberComponent.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div style="background-color:#eeeeee;background-image: url('{{ image }}'); background-size:contain;background-repeat:no-repeat;background-position:center center;" class="memberPic"></div>
55
<div class="memberInfo">
66
<a style="font-family: Karla;font-size: large;">{{ name }}<br></a>
7-
<a href="{{ github }}" ><img style="width: 20px; height: 20px;" src="../../static/images/github-logo.png"></a>
8-
<a href="{{ linkedin }}" ><img style="width: 20px; height: 20px;" src="../../static/images/linkedin-logo.png"></a>
7+
<a href="{{ github }}" target="_blank"><img style="width: 20px; height: 20px;" src="../../static/images/github-logo.png"></a>
8+
<a href="{{ linkedin }}" target="_blank"><img style="width: 20px; height: 20px;" src="../../static/images/linkedin-logo.png"></a>
99
</div>
1010
</div>

Wampus/app/templates/homepage.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h1 style="font-family: Lora;">Your Projects</h1>
1212
<div class="contentContainer contentContainer--yourProjects--homepage">
1313
{% if projects %}
1414
{% for project in projects %}
15-
{% with name=project.name desc=project.description %}
15+
{% with name=project.name desc=project.description id=project.id %}
1616
{% include "components/projectCardComponent.html" %}
1717
{% endwith %}
1818
{% endfor %}
@@ -47,13 +47,13 @@ <h3 style="font-family: Karla;font-size:small;">No Tags available</h3>
4747
{% if popular_projects %}
4848
{% for project in popular_projects %}
4949
{% if forloop.counter|divisibleby:2 %}
50-
{% with name=project.name desc=project.description %}
50+
{% with name=project.name desc=project.description id=project.id %}
5151
{% include "components/projectCardComponent.html" %}
5252
{% endwith %}
5353
</div>
5454
{% else %}
5555
<div class="project__rows">
56-
{% with name=project.name desc=project.description %}
56+
{% with name=project.name desc=project.description id=project.id %}
5757
{% include "components/projectCardComponent.html" %}
5858
{% endwith %}
5959
{% endif %}
@@ -78,7 +78,7 @@ <h1 style="font-family: Lora;">Favourites</h1>
7878
<div class="contentContainer contentContainer--favourite--homepage">
7979
{% if favorites %}
8080
{% for project in favorites %}
81-
{% with name=project.project.name desc=project.project.description %}
81+
{% with name=project.project.name desc=project.project.description id=project.id %}
8282
{% include "components/projectCardComponent.html" %}
8383
{% endwith %}
8484
{% endfor %}

Wampus/app/templates/profile.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ <h1 style="font-family: Lora;">Your Projects</h1>
1414
{% with name=project.name desc=project.description id=project.id %}
1515
{% include "components/projectCardComponent.html" %}
1616
{% endwith %}
17+
</div>
1718
{% else %}
1819
<div class="project__rows">
1920
{% with name=project.name desc=project.description id=project.id %}
2021
{% include "components/projectCardComponent.html" %}
2122
{% endwith %}
2223
{% endif %}
2324
{% endfor %}
25+
{% if popular_projects|length|divisibleby:2 %}
26+
{% else %}
27+
</div>
28+
{% endif %}
2429
{% else %}
2530
<div class="yourprojects--noProjects">
2631
<h1 style="font-family: Karla;font-size: large;">No Projects?</h1>

Wampus/app/templates/project.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ <h2 style="font-family: Lora;">Description</h2>
3434
<div class="individualpage--bottom">
3535
<h2 style="font-family: Lora;">Tags</h2>
3636
<div class="contentContainer contentContainer--tags--individualproject">
37-
{% include "components/tagComponent.html" %}
37+
{% if tags %}
38+
{% for tag in project.tags %}
39+
{% with name=tag.name %}
40+
{% include "components/tagComponent.html" %}
41+
{% endwith %}
42+
{% endfor %}
43+
{% else %}
44+
<div class="noTags">
45+
<h3 style="font-family: Karla;font-size:small;">No Tags available</h3>
46+
</div>
47+
{% endif %}
3848
</div>
3949
{% with name="Delete Project" classes="btn btn--deleteProject" type="" click="" %}
4050
{% include "components/buttonComponent.html" %}

Wampus/app/templates/search-projects.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<div class="contentContainer contentContainer--searched ">
1010
{% for project in search_results %}
1111
{% if forloop.counter|divisibleby:2 %}
12-
{% with name=project.name desc=project.description %}
12+
{% with name=project.name desc=project.description id=project.id %}
1313
{% include "components/projectCardComponent.html" %}
1414
{% endwith %}
1515
</div>
1616
{% else %}
1717
<div class="project__rows">
18-
{% with name=project.name desc=project.description %}
18+
{% with name=project.name desc=project.description id=project.id %}
1919
{% include "components/projectCardComponent.html" %}
2020
{% endwith %}
2121
{% endif %}

Wampus/app/views.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ def profilepage_view(request):
125125
return render(request, template_name, context)
126126

127127

128-
def project_view(request, project_name):
128+
def project_view(request, project_id):
129129
user = request.user # Get the user object
130130

131131
profile = Profile.objects.get(user=user) # Get the user's profile
132-
project = Project.objects.get(name=project_name)
132+
project = Project.objects.get(id=project_id)
133133

134134
form = CommentForm()
135135

@@ -148,6 +148,8 @@ def project_view(request, project_name):
148148

149149
template_name = 'project.html'
150150

151+
print(project.tags)
152+
151153
return render(request, template_name, context)
152154

153155
@login_required(login_url='/login/')
@@ -164,7 +166,7 @@ def createproject_view(request):
164166
project = form.save(commit=False)
165167
project.profile = profile
166168
project.save()
167-
return redirect("/project/" + project.name)
169+
return redirect("/project/" + str(project.id))
168170

169171
context = {
170172
'profile': profile,

0 commit comments

Comments
 (0)