Skip to content

Commit f4fc079

Browse files
authored
Merge pull request #406 from VigneshDevHub/test
Merging changes from test to main
2 parents a1e8fac + 23e45db commit f4fc079

File tree

4 files changed

+130
-96
lines changed

4 files changed

+130
-96
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "🌐 UI Issue Report"
2+
description: "Create a detailed report to help us improve the UI user experience."
3+
title: "UI ISSUE:"
4+
labels: ["UI", "Bug"]
5+
body:
6+
- type: checkboxes
7+
attributes:
8+
label: "Preliminary Checks"
9+
description: "Please confirm the following before reporting a UI issue."
10+
options:
11+
- label: "I have checked the browser console for errors"
12+
required: true
13+
- label: "I have searched the existing issues"
14+
required: true
15+
- label: "I have included my browser name and version"
16+
required: true
17+
- label: "I have included my operating system"
18+
required: true
19+
- label: "I have included my device type (desktop/mobile/tablet)"
20+
required: true
21+
- type: textarea
22+
attributes:
23+
label: "Issue Summary"
24+
description: "Provide a concise summary of the issue, including what you expected to happen and what actually happened."
25+
validations:
26+
required: true
27+
- type: textarea
28+
attributes:
29+
label: "Steps to Reproduce"
30+
description: "List the steps to reproduce the issue, including which pages or components are affected."
31+
validations:
32+
required: true
33+
- type: textarea
34+
attributes:
35+
label: "Expected vs Actual Behavior"
36+
description: "What did you expect to happen instead of the current behavior?"
37+
validations:
38+
required: false
39+
- type: textarea
40+
attributes:
41+
label: "Screenshots/Recordings"
42+
description: "If applicable, attach screenshots or recordings illustrating the issue."
43+
validations:
44+
required: false
45+
- type: checkboxes
46+
attributes:
47+
label: "Additional Information"
48+
options:
49+
- label: "I agree to follow this project's Code of Conduct"
50+
required: true
51+
- label: "I can provide more details if needed"

.github/ISSUE_TEMPLATE/ui-change-issue-template.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

public/stylesheets/review.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.review-container{
2+
overflow-y: scroll;
3+
height: 100%;
4+
max-height: 200px;
5+
margin-bottom: 2rem;
6+
7+
scrollbar-width: 5px;
8+
9+
}

views/campgrounds/show.ejs

Lines changed: 70 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<%layout('layouts/boilerplate')%>
22
<link rel="stylesheet" href="/stylesheets/stars.css">
3+
<link rel="stylesheet" href="/stylesheets/review.css">
34

45
<div class="row" id="showinfo">
56
<div class="col-md-6">
@@ -105,81 +106,84 @@
105106
</div>
106107
</div>
107108
<% } else {%>
108-
<% for (let i=0; i<campground.reviews.length; i++) {%>
109-
<% let review = campground.reviews[i]; %>
110-
111-
<div class="card text-white bg-dark mb-3">
112-
<div class="card-body">
113-
<div class="heading">
114-
<h6 class="card-subtitle mb-2 text-grey"><img src="/icons/user2.webp" alt="" class="user2">&nbsp;&nbsp;&nbsp;<%= review.author.username %></h6>
115-
<% if((currentUser && review.author.equals(currentUser._id))||(currentUser && currentUser.role === ROLE_ADMIN)) {%>
116-
<form
117-
action="/campgrounds/<%=campground._id%>/reviews/<%=review._id%>?_method=DELETE"
118-
method="POST">
119-
<button class="button cursor-pointer"><img src="/icons/bin.webp" class="bin" alt="delete"></button>
120-
</form>
121-
<% } %>
122-
</div>
123-
124-
<p class="card-text">
125-
<% for (let i = 1; i <= 5; i++) { %>
126-
<% if (i <= review.rating) { %>
127-
<img src="/icons/solid.webp" class="star" alt="star">
128-
<% } else { %>
129-
<img src="/icons/outline.webp" class="star" alt="star">
109+
<h1>Reviews :</h1>
110+
<div class="review-container">
111+
<% for (let i=0; i<campground.reviews.length; i++) {%>
112+
<% let review = campground.reviews[i]; %>
113+
114+
<div class="card text-white bg-dark mb-3">
115+
<div class="card-body">
116+
<div class="heading">
117+
<h6 class="card-subtitle mb-2 text-grey"><img src="/icons/user2.webp" alt="" class="user2">&nbsp;&nbsp;&nbsp;<%= review.author.username %></h6>
118+
<% if((currentUser && review.author.equals(currentUser._id))||(currentUser && currentUser.role === ROLE_ADMIN)) {%>
119+
<form
120+
action="/campgrounds/<%=campground._id%>/reviews/<%=review._id%>?_method=DELETE"
121+
method="POST">
122+
<button class="button cursor-pointer"><img src="/icons/bin.webp" class="bin" alt="delete"></button>
123+
</form>
130124
<% } %>
131-
<% } %>
132-
<br>
133-
<span class="comment">
134-
<%= review.body.length > 250 ? review.body.substring(0, 260) + ".... " : review.body%>
135-
<!-- <%= review.body %></span> -->
136-
<% if(review.body.length > 250) {%>
137-
<a class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-<%= i %>" style="cursor: pointer;">Read more</a>
138-
<% } %>
139-
</span>
140-
</p>
141-
125+
</div>
126+
127+
<p class="card-text">
128+
<% for (let i = 1; i <= 5; i++) { %>
129+
<% if (i <= review.rating) { %>
130+
<img src="/icons/solid.webp" class="star" alt="star">
131+
<% } else { %>
132+
<img src="/icons/outline.webp" class="star" alt="star">
133+
<% } %>
134+
<% } %>
135+
<br>
136+
<span class="comment">
137+
<%= review.body.length > 250 ? review.body.substring(0, 260) + ".... " : review.body%>
138+
<!-- <%= review.body %></span> -->
139+
<% if(review.body.length > 250) {%>
140+
<a class="text-primary" data-bs-toggle="modal" data-bs-target="#modal-<%= i %>" style="cursor: pointer;">Read more</a>
141+
<% } %>
142+
</span>
143+
</p>
144+
145+
</div>
142146
</div>
143-
</div>
144147
145-
146-
<!-- Modal with Unique ID for Each Review -->
147-
<div class="modal fade" id="modal-<%= i %>" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="modalLabel-<%= i %>" aria-hidden="true">
148-
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
149-
<div class="modal-content review-popup">
150-
<div class="modal-header">
151-
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
152-
</div>
153-
<div class="modal-body">
154-
155-
<div class="user-credential">
156-
<h4><img src="/icons/user2.webp" alt="" class="user5">&nbsp;&nbsp;&nbsp;<%= review.author.username %></h4>
148+
<!-- Modal with Unique ID for Each Review -->
149+
<div class="modal fade" id="modal-<%= i %>" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="modalLabel-<%= i %>" aria-hidden="true">
150+
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
151+
<div class="modal-content review-popup">
152+
<div class="modal-header">
153+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
157154
</div>
158-
159-
160-
161-
<div class="model-star">
162-
<% for (let i = 1; i <= 5; i++) { %>
163-
<% if (i <= review.rating) { %>
164-
<img src="/icons/solid.webp" class="star" alt="star">
165-
<% } else { %>
166-
<img src="/icons/outline.webp" class="star" alt="star">
155+
<div class="modal-body">
156+
157+
<div class="user-credential">
158+
<h4><img src="/icons/user2.webp" alt="" class="user5">&nbsp;&nbsp;&nbsp;<%= review.author.username %></h4>
159+
</div>
160+
161+
162+
163+
<div class="model-star">
164+
<% for (let i = 1; i <= 5; i++) { %>
165+
<% if (i <= review.rating) { %>
166+
<img src="/icons/solid.webp" class="star" alt="star">
167+
<% } else { %>
168+
<img src="/icons/outline.webp" class="star" alt="star">
169+
<% } %>
167170
<% } %>
168-
<% } %>
171+
</div>
172+
173+
174+
<span class="popup-comment"><%= review.body %></span> <!-- Display the full comment here -->
175+
</div>
176+
<div class="modal-footer">
177+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
169178
</div>
170-
171-
172-
<span class="popup-comment"><%= review.body %></span> <!-- Display the full comment here -->
173-
</div>
174-
<div class="modal-footer">
175-
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
176179
</div>
177180
</div>
178181
</div>
179-
</div>
180-
181-
<% } %>
182-
<% } %>
182+
183+
<% } %>
184+
</div>
185+
<% }
186+
%>
183187
</div>
184188
</div>
185189

0 commit comments

Comments
 (0)