Skip to content

Commit

Permalink
getting profile ready to handle json
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMarin committed Nov 8, 2021
1 parent 0a6a161 commit afe9f2c
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 36 deletions.
4 changes: 3 additions & 1 deletion application.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sklearn
from datetime import date
from testData import rslts
from profileLoadingTestData import profileResult

from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
Expand Down Expand Up @@ -92,7 +93,8 @@ def user(usr):

@application.route("/profile/")
def profile():
return render_template("profile.html")

return render_template("profile.html", profileResult=profileResult )

@application.route("/profileEdit")
def profileEdit():
Expand Down
53 changes: 26 additions & 27 deletions profileLoadingTestData.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
profileResult={
"profile": {
"userName": "Joe Swanson",
"labor": "Gardener",
"location": "Fresno",
"imgLink": "https://a.ltrbxd.com/resized/film-poster/2/0/9/3/8/2/209382-thor-ragnarok-0-460-0-690-crop.jpg?k=02c656f39b",
},
"projects" : [
{
"projectName" : "Estate Garden",
profileResult={
"profile": {
"userName": "Joe Swanson",
"labor": "Gardener",
"location": "Fresno",
"imgLink": "https://a.ltrbxd.com/resized/film-poster/2/0/9/3/8/2/209382-thor-ragnarok-0-460-0-690-crop.jpg?k=02c656f39b"
},
"projects": [{
"projectName": "Estate Garden",
"projectDescription": " gabba gabbe",
"photoLink1" : "..\static\Images\testData Images\projectImg1.jpg",
"photoLink2" : "..\static\Images\testData Images\projectImg2.jpg",
"photoLink3" : "..\static\Images\testData Images\projectImg3.jpg",
"photoLink4" : "..\static\Images\testData Images\projectImg4.jpg"
"photoLink1": "../static/Images/testDataImages/projectImg1.jpg",
"photoLink2": "../static/Images/testDataImages/projectImg2.jpg",
"photoLink3": "../static/Images/testDataImages/projectImg3.jpg",
"photoLink4": "../static/Images/testDataImages/projectImg4.jpg"
},
{
"projectName" : "Estate Garden",
"projectName": "Estate Garden",
"projectDescription": " gabba gabbe",
"photoLink1" : "..\static\Images\testData Images\projectImg1.jpg",
"photoLink2" : "..\static\Images\testData Images\projectImg2.jpg",
"photoLink3" : "..\static\Images\testData Images\projectImg3.jpg",
"photoLink4" : "..\static\Images\testData Images\projectImg4.jpg"
"photoLink1": "../static/Images/testDataImages/projectImg1.jpg",
"photoLink2": "../static/Images/testDataImages/projectImg2.jpg",
"photoLink3": "../static/Images/testDataImages/projectImg3.jpg",
"photoLink4": "../static/Images/testDataImages/projectImg4.jpg"
},
{
"projectName" : "Estate Garden",
"projectName": "Estate Garden",
"projectDescription": " gabba gabbe",
"photoLink1" : "..\static\Images\testData Images\projectImg1.jpg",
"photoLink2" : "..\static\Images\testData Images\projectImg2.jpg",
"photoLink3" : "..\static\Images\testData Images\projectImg3.jpg",
"photoLink4" : "..\static\Images\testData Images\projectImg4.jpg"
"photoLink1": "../static/Images/testDataImages/projectImg1.jpg",
"photoLink2": "../static/Images/testDataImages/projectImg2.jpg",
"photoLink3": "../static/Images/testDataImages/projectImg3.jpg",
"photoLink4": "../static/Images/testDataImages/projectImg4.jpg"
}
]
}
]

}
14 changes: 13 additions & 1 deletion static/CSS/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,17 @@
gap:20px;
}
#profileContent{
margin-left:2%;
margin-left:3%;
}
#profilePic{
width:30%;
margin-right:1%;

}
#userImg{
width:100%;

}
.projectPhoto{
width:25%;
}
15 changes: 8 additions & 7 deletions templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
<div id ="profilePic">


<img src = "profilePic" id = "userImg">
<img src = "{{profileResult.profile.imgLink}}" id = "userImg">
<div id = "ratings">ratings</div>

</div>

<div id = "userDescriptionContainer">
<div id ="info">
<div id = "username"> Username</div>
<div id = "location">Location</div>
<div id = "username"> <h2> {{profileResult.profile.userName}}</h2></div>
<div id = "location">{{profileResult.profile.location}}</div>
</div>

<div id = "userDescription">
Expand All @@ -53,18 +53,19 @@
</section>
<section id = "userProjects">
<h2>Projects</h2>

{% for project in profileResult.projects %}
<article id = "projectContainer">
<h3>Project Title</h3>
<h3>{{project.projectName}}</h3>
<div id = "projectContent">
<img src = "" alt = "photo1" class = "projectPhoto">
<img src = "" alt = "photo2" class = "projectPhoto">
<img src = "{{project.photoLink1}}" alt = "photo1" class = "projectPhoto">
<img src = "{{project.photoLink2}}" alt = "photo2" class = "projectPhoto">
<div id = "projectDescription">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolor repellendus accusamus atque blanditiis voluptate rerum illo.
Ratione at veritatis ab animi? Sunt consequuntur provident, ea tempore nesciunt fugiat esse deserunt?</p>
</div>
</div>
</article>
{% endfor%}
</section>
</section>

Expand Down

0 comments on commit afe9f2c

Please sign in to comment.