Skip to content

Commit

Permalink
Bootstrapped
Browse files Browse the repository at this point in the history
bh5k committed Feb 7, 2013
1 parent 7608133 commit 011dbda
Showing 13 changed files with 9,326 additions and 109 deletions.
Original file line number Diff line number Diff line change
@@ -35,6 +35,10 @@ public String addMinutes(@Valid @ModelAttribute ("exercise") Exercise exercise,
System.out.println("exercise: " + exercise.getMinutes());
System.out.println("exercise activity: " + exercise.getActivity());

if(result.hasErrors()) {
return "addMinutes";
}

return "addMinutes";
}

2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/config/servlet-config.xml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

<mvc:annotation-driven/>

<mvc:resources location="images" mapping="/images/**"/>
<mvc:resources location="assets" mapping="/assets/**"/>
<mvc:resources location="pdfs" mapping="/pdfs/**"/>

<context:component-scan base-package="com.pluralsight"/>
122 changes: 83 additions & 39 deletions src/main/webapp/WEB-INF/jsp/addGoal.jsp
Original file line number Diff line number Diff line change
@@ -3,45 +3,89 @@

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add Goal</title>

<style>
.error {
color: #ff0000;
}
.errorblock {
color: #000;
background-color: #ffEEEE;
border: 3px solid #ff0000;
padding: 8px;
margin: 16px;
}
</style>

</head>
<body>

<form:form commandName="goal">
<form:errors path="*" cssClass="errorblock" element="div" />
<table>
<tr>
<td>Enter Minutes:</td>
<td><form:input path="minutes" cssErrorClass="error" /></td>
<td><form:errors path="minutes" cssClass="error" /></td>
</tr>
<tr>
<td colspan="3">
<input type="submit" value="Enter Goal Minutes"/>
</td>
</tr>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<style>
body { padding-top: 60px; /* 60px to make the container go all the way
to the bottom of the topbar */ }
</style>
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
</script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
<style>
.error {
color: #ff0000;
}
</table>
</form:form>
.errorblock {
color: #000;
background-color: #ffEEEE;
border: 3px solid #ff0000;
padding: 8px;
margin: 16px;
}
</style>
</head>
<body>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">
Add Goal
</a>
<ul class="nav">
</ul>
</div>
</div>
</div>
<div class="container">
<div>
<h1>
Add Goal
</h1>
<p>
Add your workout goal in minutes for the day.
<br>
&nbsp;
</p>
</div>

<form:form commandName="goal">
<form:errors path="*" cssClass="errorblock" element="div" />
<label for="textinput1">
Enter Minutes:
</label>
<form:input path="minutes" cssErrorClass="error" />
<form:errors path="minutes" cssClass="error" />
<br/>
<input type="submit" class="btn" value="Enter Goal Minutes"/>
</form:form>

<div class="control-group">
</div>
</div>

</body>
</html>
<script src="jquery-1.8.3.js">
</script>
<script src="assets/js/bootstrap.js">
</script>
</body>
</html>
192 changes: 138 additions & 54 deletions src/main/webapp/WEB-INF/jsp/addMinutes.jsp
Original file line number Diff line number Diff line change
@@ -3,59 +3,143 @@
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add Minutes Page</title>

<script type="text/javascript" src="jquery-1.8.3.js"></script>

<script type="text/javascript">
$(document).ready(
function() {
$.getJSON('<spring:url value="activities.json"/>', {
ajax : 'true'
}, function(data){
var html = '<option value="">--Please select one--</option>';
var len = data.length;
for (var i = 0; i < len; i++) {
html += '<option value="' + data[i].desc + '">'
+ data[i].desc + '</option>';
}
html += '</option>';


<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<style>
body { padding-top: 60px; /* 60px to make the container go all the way
to the bottom of the topbar */ }
</style>
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js">
</script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">

<script type="text/javascript" src="jquery-1.8.3.js"></script>

<script type="text/javascript">
$(document).ready(
function() {
$.getJSON('<spring:url value="activities.json"/>', {
ajax : 'true'
}, function(data){
var html = '<option value="">--Please select one--</option>';
var len = data.length;
for (var i = 0; i < len; i++) {
html += '<option value="' + data[i].desc + '">'
+ data[i].desc + '</option>';
}
html += '</option>';
$('#activities').html(html);
});
$('#activities').html(html);
});
});
</script>

</head>
<body>
<h1>Add Minutes Exercised</h1>

Language : <a href="?language=en">English</a> | <a href="?language=es">Spanish</a>

<form:form commandName="exercise">
<table>
<tr>
<td><spring:message code="goal.text" /></td>
<td><form:input path="minutes"/></td>
<td>
<form:select id="activities" path="activity"></form:select>
</td>
</tr>
<tr>
<td colspan="3">
<input type="submit" value="Enter Exercise"/>
</td>
</tr>
</table>
</form:form>

<h1>Our goal for the day is: ${goal.minutes}</h1>

</body>
</html>
</script>
<style>
.error {
color: #ff0000;
}
.errorblock {
color: #000;
background-color: #ffEEEE;
border: 3px solid #ff0000;
padding: 8px;
margin: 16px;
}
</style>
</head>
<body>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">
Add Minutes Exercised
</a>
<ul class="nav">
</ul>
</div>
</div>
</div>
<div class="container">
<div>
<h1>
Add Minutes Exercised
</h1>
</div>
<a class="btn" href="?language=en">
English
</a>
<a class="btn" href="?language=es">
Spanish
</a>

<form:form commandName="exercise">
<form:errors path="*" cssClass="errorblock" element="div" />
<div class="control-group">
<label for="textinput1">
<spring:message code="goal.text" />
</label>
<form:input path="minutes"/>
<form:errors path="minutes" cssClass="error" />
</div>

<div class="control-group">
<label for="selectinput1">
Activity
</label>
<form:select id="activities" path="activity" />
</div>

<input type="submit" class="btn" value="Enter Exercise"/>

</form:form>

<span class="label">
Our goal for the day is: ${goal.minutes}
</span>
</div>

<script src="assets/js/bootstrap.js">
</script>
</body>
</html>




















Loading
Oops, something went wrong.

0 comments on commit 011dbda

Please sign in to comment.