Skip to content
This repository has been archived by the owner on Jul 17, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik authored and Fredrik committed Oct 24, 2012
2 parents e85803a + 2c0d487 commit 20e9cba
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 19 deletions.
Binary file removed Dokument/uml_webapp.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/java/dat076/frukostklubben/bb/CartBB.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class CartBB implements Serializable {
*/
public String addFlight(Flight flight) {
cartEJB.addFlight(flight);
return "cart?faces-redirect=true";
return "/users/cart?faces-redirect=true";
}

public List<Flight> getFlights() {
Expand All @@ -45,7 +45,7 @@ public List<Flight> getFlights() {

public String removeFlight(Long id) {
cartEJB.removeItem(flightEJB.find(id));
return "cart?faces-redirect=true";
return "/users/cart?faces-redirect=true";
}

public String checkout(String mail) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FinnishedOrder implements Serializable {
@OneToMany(cascade = CascadeType.ALL)
List<Flight> flights = new ArrayList<>();

@ManyToOne(cascade = CascadeType.ALL)
@ManyToOne
User user;

public FinnishedOrder(){
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<!-- Change to "Production" when you are ready to deploy -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
<param-value>Production</param-value>
</context-param>
<!-- JSF mapping -->
<servlet>
Expand Down
8 changes: 2 additions & 6 deletions src/main/webapp/jsf/template/sideboxTop.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
xmlns:c="http://java.sun.com/jsp/jstl/core">
<body>
<ui:composition>

<h:form rendered="#{not empty request.remoteUser}">
<h1 class="titleRibbon"><strong class="titleContent">Welcome</strong></h1>


<h1 class="titleRibbon"><strong class="titleContent">Welcome</strong></h1>

<h:commandButton action="#{changeInfo.fetchUser}" value="Change Details" class="inputButton">
<f:setPropertyActionListener target="#{changeInfo.currentMail}" value="${request.remoteUser}"/>
</h:commandButton>

</h:commandButton>

<h:form>
<h:commandButton action="#{auth.logout}" class="inputButton" value="Logout"/>
Expand Down
63 changes: 57 additions & 6 deletions src/main/webapp/resources/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
*/

// This is a bug-fix.
function greeting()
{
alert("hej");
}

var $ = jQuery;
$(document).ready(function() {

Expand All @@ -31,4 +26,60 @@ $(document).ready(function() {
$(this).addClass("arrow_right");
}
}); // toggle end
}); // document ready end
}); // document ready end


//This adds an autocomplete function to the From and To fields.
//delay a bit in the textfield after entering a letter...
$(document).ready(function() {
$(function() {
var availableTags = [
"Arlanda (Stockholm)",

"Schiphol (Amsterdam)",

"Bangkok International",

"Beijing Capital International",

"Dubai International",

"Frankfurt Airport",

"Haneda Airport (Tokyo)",

"Heathrow (London)",

"Hong Kong International",

"O'Hare (Chicago)",

"John F. Kennedy (New York City)",

"Landvetter (Gothenburg)",

"Leonardo da Vinci-Fiumicino (Rome)",

"London Gatwick",

"Los Angeles International",

"Madrid Barajas",

"McCarran International (Las Vegas)",

"Munich Airport",

"Newark Liberty (New Jersey)",

"Paris-Charles de Gaulle",

"San Francisco International",

"Singapore Changi",
];
$( ".autoCompleteInputForm" ).autocomplete({
source: availableTags
});
});
});
6 changes: 3 additions & 3 deletions src/main/webapp/users/changeInfo.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ul>
</article>

<h3><br/>Change your personal info:</h3>
<h4><br/>Change your personal info:</h4>
<f:view>
<h:form>
<p>
Expand Down Expand Up @@ -56,7 +56,7 @@


<h:panelGrid columns="2">
<h3><br/>Change password </h3>
<h4><br/>Change password </h4>
<ace:checkboxButton id="changePasswdCheckBox" value="#{changeInfo.selected}">
<ace:ajax execute="@this" event="activate" render="newPassword confirmPassword"/>
</ace:checkboxButton>
Expand All @@ -78,7 +78,7 @@
<h:message for="confirmPassword" class="error" /></p>

<footer>
<h3>Verify with current Password:</h3>
<h4>Verify with current Password:</h4>
<p><h:outputLabel for="password" value="Password: " /><br />
<h:inputSecret id="password" value="#{changeInfo.checkPasswd}" class="inputForm"
required="true" requiredMessage=" - required" validator="#{changeInfo.correctPasswd}"/>
Expand Down

0 comments on commit 20e9cba

Please sign in to comment.