-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes in layout and single items view page
- Loading branch information
Showing
5 changed files
with
66 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
<%@page import="java.util.List"%> | ||
|
||
<a href="ProfileServlet"> users only!</a> | ||
<a href="ExploreServlet"> Explore Page </a> | ||
<!-- Items --> | ||
<h3 class="w3-margin">New Items!</h3> | ||
<div class='w3-row'> | ||
<% | ||
model.Model mod = (model.Model)getServletContext().getAttribute("model"); | ||
List<model.Items> items=mod.getAllItemsList(); | ||
request.setAttribute("items", items); | ||
%> | ||
<jsp:include page="ShowItems.jsp"> | ||
<jsp:param value="${items}" name="items"/> | ||
</jsp:include> | ||
<%/* | ||
String url=request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath()+"/images/"; | ||
String pictureUrl; | ||
for (int i = 0; i < 4; i++) { | ||
out.print("<div class='w3-col s12 m4 l3 w3-center w3-card-4' style=''>"); | ||
out.print("<a href=ItemDetails?id="+i+"><img src='photos/ladder.jpg' class='w3-round w3-padding-16' height='150' width='150'>"); | ||
pictureUrl=url+"default"; | ||
out.print("<div class='w3-col s12 m4 l3 w3-center' style=''>"); | ||
out.print("<div class='w3-card-4 w3-margin'>"); | ||
out.print("<div style='height: 80%; width: 100%; object-fit: contain'>"); | ||
out.print("<a href=ItemDetailsServlet?id="+i+"><img src='"+pictureUrl+"' class='w3-round w3-padding-16' style='height: 100%; width: 80%; object-fit: contain'>"); | ||
out.print("</div>"); | ||
out.print("<div style='height: 20%; width: 100%; object-fit: contain'>"); | ||
out.print("<h5>item " + i + "</h5>"); | ||
out.print("</div>"); | ||
out.print("</div>"); | ||
out.print("</div>"); | ||
} | ||
*/ | ||
%> | ||
|
||
</div> | ||
<!-- | ||
<div class="w3-row"> | ||
<div class="w3-col m1 w3-center w3-grey">1</div> | ||
<div class="w3-col m1 w3-center">2</div> | ||
<div class="w3-col m1 w3-center w3-grey">3</div> | ||
<div class="w3-col m1 w3-center">4</div> | ||
<div class="w3-col m1 w3-center w3-grey">5</div> | ||
<div class="w3-col m1 w3-center">6</div> | ||
<div class="w3-col m1 w3-center w3-grey">7</div> | ||
<div class="w3-col m1 w3-center">8</div> | ||
<div class="w3-col m1 w3-center w3-grey">9</div> | ||
<div class="w3-col m1 w3-center">10</div> | ||
<div class="w3-col m1 w3-center w3-grey">11</div> | ||
<div class="w3-col m1 w3-center">12</div> | ||
</div> | ||
--> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,6 @@ | ||
this is list of ${name} items | ||
<div class="w3-row"> | ||
<% | ||
model.Items[] items=(model.Items[])request.getAttribute("items"); | ||
String url=request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath()+"/images/"; | ||
String pictureUrl; | ||
for(int i=0;i<items.length;i++){ | ||
if(items[i].getPicture().equals("1")) { | ||
pictureUrl=url+items[i].getItemID(); | ||
} else{ | ||
pictureUrl=url+"default"; | ||
} | ||
out.print("<div class='w3-col s12 m4 l3 w3-center w3-card-4' style=''>"); | ||
out.print("<img src='" + pictureUrl + "' class='w3-round w3-padding-16' height='42' width='42'>"); | ||
out.print("<h5>item " + i + "</h5></div>"); | ||
} | ||
%> | ||
|
||
</div> | ||
<%@page import="java.util.List"%> | ||
<%@page import="model.Items"%> | ||
<jsp:include page="ShowItems.jsp"> | ||
<jsp:param value="${items}" name="items"/> | ||
</jsp:include> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<%@page import="java.util.*"%> | ||
<%@page import="model.Items"%> | ||
<div class='w3-row'> | ||
<% | ||
List<Items> results=(List<Items>)request.getAttribute("items"); | ||
String url=request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath()+"/images/"; | ||
String pictureUrl; | ||
Items item; | ||
for(int i=0;i<results.size();i++){ | ||
item=results.get(i); | ||
if(results.get(i).getPicture().equals("1")){ | ||
pictureUrl=url+item.getItemID(); | ||
}else { | ||
pictureUrl=url+"default"; | ||
} | ||
out.print("<div class='w3-col s12 m4 l3 w3-center' style=''>"); | ||
out.print("<div class='w3-card-4 w3-margin'>"); | ||
out.print("<div style='height: 80%; width: 100%; object-fit: contain'>"); | ||
out.print("<a href=ItemDetailsServlet?id="+item.getItemID()+"><img src='"+pictureUrl+"' class='w3-round w3-padding-16 ' height='150' width='150' >"); | ||
out.print("</div>"); | ||
out.print("<div style='height: 20%; width: 100%; object-fit: contain'>"); | ||
out.print("<h5>" + item.getName() + "</h5>"); | ||
out.print("</div>"); | ||
out.print("</div>"); | ||
out.print("</div>"); | ||
//style='height: 100%; width: 80%; object-fit: contain' | ||
} | ||
%> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters