Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipes - Tamira - BackTREK #23

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
93337ca
made Trip model and TripList collection
tvojnar Nov 28, 2017
709ac3e
all trip are displayed on the page automatically
tvojnar Nov 28, 2017
f62a846
added click event to show all the trips:
tvojnar Nov 28, 2017
6fd4dcc
Merge pull request #1 from tvojnar/get-trips
tvojnar Nov 28, 2017
91598b9
added data-id to each tr so I can access the id to get the trip detai…
tvojnar Nov 29, 2017
6cab10e
can access new attributes for model after fetch for trip detauls
tvojnar Nov 29, 2017
4310db0
trying to figure out how to access all the attributes at once
tvojnar Nov 29, 2017
d8084d3
trip details are prepended to the correct spot when a trip is clicked on
tvojnar Nov 29, 2017
a9a9692
empty out the trip-details article before adding another trips details
tvojnar Nov 29, 2017
48c1bcc
now I can hide the trip details
tvojnar Nov 29, 2017
538d3ba
changed the click event for getting the trip details to be applied to…
tvojnar Nov 29, 2017
42310c5
changed functionality to only make the fetch api call for the model i…
tvojnar Nov 29, 2017
313d2bc
Merge pull request #2 from tvojnar/trip-details
tvojnar Nov 29, 2017
f3c818a
basic post set up
tvojnar Nov 30, 2017
a29cb93
actually posting now
tvojnar Nov 30, 2017
1e69e5c
form is removed if trip is saved
tvojnar Nov 30, 2017
2e24203
added handleValidationFailures function
tvojnar Nov 30, 2017
7747b9a
added validation check via an if statement in addTripHandler
tvojnar Nov 30, 2017
864bba9
added validations to the Trip model
tvojnar Nov 30, 2017
ff3e163
added url to the model so now I can make a bad most request without t…
tvojnar Nov 30, 2017
fc66b9f
moved where the form is placed down one lace
tvojnar Nov 30, 2017
5036473
adding functionality to hide and show the add a trip button
tvojnar Nov 30, 2017
15d1dc8
added a cancel button for the add-trip frm
tvojnar Nov 30, 2017
28ef304
Merge pull request #3 from tvojnar/add-a-trip
tvojnar Nov 30, 2017
d21e399
pushing so I can checkout a differnt branch
tvojnar Nov 30, 2017
9c274df
added a form to reserve the trip
tvojnar Nov 30, 2017
0abfef0
added click event for reserving a trip, but right now it just sends a…
tvojnar Nov 30, 2017
05df3d3
attempted to make custom url for Reservation and wrote reserveTrip me…
tvojnar Nov 30, 2017
6c3b0e3
added some comments to help me tomorrow
tvojnar Nov 30, 2017
9cac868
you can reserve a trip now
tvojnar Nov 30, 2017
ae5ff97
switched to using a template method to display the status messages
tvojnar Nov 30, 2017
4384c76
added book css for status messages to style.css
tvojnar Nov 30, 2017
bb94dfd
can remove status messages by clicking the x
tvojnar Nov 30, 2017
66e5871
added extra attribute to reportStatus to direct where to put the stat…
tvojnar Nov 30, 2017
12b698d
undid addition of if else statement to reportStatus
tvojnar Nov 30, 2017
f58b1e8
success status for reserving trip is now put below the h4 for the res…
tvojnar Nov 30, 2017
188906b
error messages from the server for the reserve trip are now added bel…
tvojnar Dec 1, 2017
484fecd
client side validations work for the reservation now, and the error m…
tvojnar Dec 1, 2017
05bd4fa
done with adding trip functionality for now
tvojnar Dec 1, 2017
367a803
Merge pull request #4 from tvojnar/book-trip
tvojnar Dec 1, 2017
2aacfeb
fixed Trip so client side validations are now returned to be displaye…
tvojnar Dec 1, 2017
414ced7
Merge pull request #5 from tvojnar/add-error-messages
tvojnar Dec 1, 2017
c2d71b9
added url to Trip model, but I didn't need it anymore because adding …
tvojnar Dec 1, 2017
c891fef
table is sorted when a th is clicked on
tvojnar Dec 1, 2017
12b8c9b
added css to change th when you sort by th
tvojnar Dec 1, 2017
32448b5
add form to filter trips
tvojnar Dec 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 129 additions & 5 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,138 @@
</head>
<body>
<header>

<h1>BackTREK</h1>
<button id="add-trip" class="button">Add a trip</button>
</header>
<main>
<div class="row">


<div id="filter container" class="large-3 column">
<form id="trip-filter-form">
<select name="category">
<option style="display:none;" selected>Filter trips by</option>
<option value="name">Trip Name</option>
<option value="continent">Continent</option>
<option value="category">Category</option>
<option value="continent">Duration</option>
<option value="cost">Cost</option>
</select>

<input type="text"/>

<input type="submit" class="button" />

</form>
</div>
</div>
<section id="status-messages">
<button class="clear float-right">
<img src="http://www.pvhc.net/img223/xeiwtpbbgpmyhtcnjvwt.png" alt="Clear">
</button>
<ul>
</ul>
</section>
<section id="place-for-form"></section>

<section id="start-background">
<button id="get-trips" class="button">Explore our trips!</button>
</section>

<section id="main-page" class="row">
<table id="trip-table">
<thead>
<th class="sort name">Name</th>
<th class="sort continent">Continent</th>
<th class="sort category">Category</th>
<th class="sort weeks">Weeks</th>
<th class="sort cost">Cost</th>
</thead>
<tbody id="trip-list">
</tbody>
</tbody>
</table>
<article id="trip-details">
</article>
</section>

</main>
<footer>

</footer>
<script src="app.bundle.js" type="text/javascript"></script>


<script type="text/template" id="display-trips">
<tr class="trip">
<td><%- name %></td>
<td><%- continent %></td>
<td><%- category %></td>
<td><%- weeks %></td>
<td><%- cost %></td>
</tr>
</script>

<script type="text/template" id="trip-details-template">
<button id="hide-details" class="button">Hide trip details</button>
<h3><%- name %></h3>
<ul>
<li>Continent: <%- continent %></li>
<li>Category: <%- category %></li>
<li>Weeks: <%- weeks %></li>
<li>Cost: <%- cost %></li>
</ul>
<p> <%- about %> </p>

<h4 id="form-title">Book this trip!</h4>
<ul id="form-status">
</ul>
<form id="reservation-form">
<input type="hidden" id="trip_id" name="trip_id" value="<%- id %>">

<label for="name">Name</label>
<input type="text" name="name"></input>

<label for="age">Age</label>
<input type="text" name="age"></input>

<label for="email">Email</label>
<input type="text" name="email"></input>

<input type="submit" value="Book trip!" class="button"></input>
</form>
</script>

<script type="text/template" id="trip-form-template">
<form id="add-trip-form">
<label for="name">Name</label>
<input type="text" name="name"></input>

<label for="continent">Continent</label>
<input type="text" name="continent"></input>

<label for="category">Category</label>
<input type="text" name="category"></input>

<label for="weeks">Number of weeks</label>
<input type="text" name="weeks"></input>

<label for="cost">Cost</label>
<input type="text" name="cost"></input>

<label for="about">Description</label>
<input type="text" name="about"></input>

<input type="submit" value="Add trip!" class="button submit-trip"></input>
<button id="cancel" class="button">Cancel</button>
</form>
</script>

</main>
<footer>
<script type="text/template" id="status-message-template">
<li class="<%- status %>">
<%- message %>
</li>
</script>

</footer>
<script src="app.bundle.js" type="text/javascript"></script>
</body>
</html>
Loading