11extends layout
22
33block content
4- .container
5- .profile-card
6- .profile-avatar
7- .avatar-large #{user .first_name .charAt (0 )}#{user .last_name .charAt (0 )}
8- .profile-details
9- h1 #{user .first_name } #{user .last_name }
10- p.email #{user .email }
11- - var joinDate = user .created_at ? new Date (user .created_at ).toDateString () : ' Unknown'
12- p.joined Joined: #{joinDate}
13- p.stats Total reviews: #{reviews .length }
4+ section.hero.pub-hero
5+ .container ( style ="display: flex; align-items: center; justify-content: flex-start; gap: 20px;" )
6+ .avatar-large ( style ="box-shadow: 0 4px 10px rgba(0,0,0,0.3);" ) #{user .first_name .charAt (0 )}#{user .last_name .charAt (0 )}
7+ div( style ="text-align: left;" )
8+ h1( style ="margin: 0; text-shadow: none;" ) #{user .first_name } #{user .last_name }
9+ p( style ="margin: 10px 0 0 0;" )
10+ - var joinDate = user .created_at ? new Date (user .created_at ).toDateString () : ' Unknown'
11+ if user .id == user_id
12+ | #[ i.fa-solid.fa-envelope ( style ="margin-right: 8px;" ) ] #{user .email }
1413
15- h2.reviews-title Reviews by #{user .first_name }
16- .reviews-grid
17- each review in reviews
18- .review-card
19- .review-header
20- span.pub-name 📍 #{review .pub_name }
21- span.beer-name 🍺 #{review .beer_name }
22- .review-rating
23- - var rating = parseInt (review .rating ) || 0
24- - for (var i = 1 ; i <= 5 ; i++ )
25- if i <= rating
26- span.star-filled ★
27- else
28- span.star-empty ☆
29- span.rating-value (#{rating} /5)
30- if review .ai_pour_score
31- - var aiScore = parseFloat (review .ai_pour_score ) || 0
32- .ai-score AI Pour Score: #{aiScore .toFixed (1 )} /5
33- .review-comment "#{review .comment } "
34- - var reviewDate = review .created_at ? new Date (review .created_at ).toLocaleDateString () : ' Unknown'
35- .review-date #{reviewDate}
14+ main.container
15+ .section-row
16+ section.w-two-thirds.remove-styling
17+ h2( style ="margin-top: 0;" ) Reviews by #{user .first_name }
18+ .section-row
19+ each review in reviews
20+ section.w-third
21+ .review-header ( style ="margin-bottom: 8px;" )
22+ p( style ="margin: 0; font-weight: bold;" ) #[ i.fa-solid.fa-location-dot ( style ="margin-right: 6px;" ) ] #{review .pub_name }
23+ .review-rating ( style ="margin-bottom: 8px;" )
24+ - var rating = parseInt (review .rating ) || 0
25+ - for (var i = 1 ; i <= 5 ; i++ )
26+ if i <= rating
27+ span.star-filled ( style ="color: #FFCC00;" ) #[ i.fa-solid.fa-star ]
28+ else
29+ span.star-empty ( style ="color: #ccc;" ) #[ i.fa-regular.fa-star ]
30+ span.rating-value ( style ="margin-left: 5px; font-size: 0.9em;" ) (#{rating} /5)
31+ p( style ="margin: 0 0 8px 0; color: #555;" ) #[ i.fa-solid.fa-beer-mug-empty ( style ="margin-right: 4px;" ) ] #{review .beer_name }
32+ if review .ai_pour_score
33+ - var aiScore = parseFloat (review .ai_pour_score ) || 0
34+ p( style ="margin: 0 0 8px 0; font-size: 0.9em; color: #777;" ) AI Pour Score: #{aiScore .toFixed (1 )} /5
35+ p( style ="margin: 0 0 10px 0; font-style: italic;" ) "#{review .comment } "
36+ - var reviewDate = review .created_at ? new Date (review .created_at ).toLocaleDateString () : ' Unknown'
37+ p( style ="margin: 0; font-size: 0.8em; color: #999; text-align: right;" ) #{reviewDate}
3638
37- if reviews .length === 0
38- p.no-reviews No reviews yet.
39+ if reviews .length === 0
40+ p.no-reviews ( style ="width: 100%;" ) No reviews yet.
41+
42+ section.w-third.remove-styling ( style ="padding-left: 30px;" )
43+ h2( style ="margin-top: 0;" ) User Stats
44+ div.beer-item ( style ="margin-bottom: 15px; text-align: center;" )
45+ strong Total Reviews
46+ p( style ="margin: 5px 0 0 0; font-size: 1.5em; color: #B87333;" ) #{reviews .length }
47+ div.beer-item ( style ="margin-bottom: 15px; text-align: center;" )
48+ strong Average rating
49+ p( style ="margin: 5px 0 0 0; font-size: 1.5em; color: #B87333;" ) #{reviews .length > 0 ? (reviews .reduce ((acc , review ) => acc + review .rating , 0 ) / reviews .length ).toFixed (1 ) : 0 }
50+ div.beer-item ( style ="margin-bottom: 15px; text-align: center;" )
51+ strong Date joined
52+ p( style ="margin: 5px 0 0 0; font-size: 1.5em; color: #B87333;" ) #{joinDate}
0 commit comments