Skip to content

Commit

Permalink
Change layout to fluid
Browse files Browse the repository at this point in the history
  • Loading branch information
mbogoevici authored and pmuir committed May 28, 2012
1 parent e5bf63a commit 724323f
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 118 deletions.
48 changes: 28 additions & 20 deletions src/main/webapp/desktop-index.html
Expand Up @@ -24,9 +24,16 @@
});
</script>

<!-- 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]-->


</head>
<body>


<div id="container">
<div id="menu">
<div class="navbar">
Expand All @@ -43,14 +50,13 @@
</div>
</div>
</div>
<div id="content" class="container">

<div id="content" class="container-fluid">
</div>
</div>


<footer>
<img src="resources/gfx/logo.png" alt="HTML5"/>
<footer style="">
<div style="text-align: center;"><img src="resources/gfx/logo.png" alt="HTML5"/></div>
</footer>


Expand Down Expand Up @@ -107,7 +113,7 @@

TicketMonster.EventMenuView = Backbone.View.extend({
events:{
"click a": "update"
"click a":"update"
},
tagName:'div',
render:function () {
Expand All @@ -127,14 +133,14 @@
$("a[rel='popover']").popover({trigger:'hover'})
return this
},
update: function() {
update:function () {
$("a[rel='popover']").popover('hide')
}
});

TicketMonster.VenueMenuView = Backbone.View.extend({
events:{
"click a": "update"
"click a":"update"
},
tagName:'div',
render:function () {
Expand All @@ -153,7 +159,7 @@
$(".collapse").collapse()
return this
},
update: function() {
update:function () {
$("a[rel='popover']").popover('hide')
}
});
Expand Down Expand Up @@ -521,12 +527,13 @@
return item.id == self.model.performanceId
});
applyTemplate($(self.el), $("#create-booking"), { show:selectedShow,
performance: self.currentPerformance});
performance:self.currentPerformance});
self.selectorView = new TicketMonster.SectionSelectorView({model:selectedShow, el:$("#sectionSelectorPlaceholder")}).render();
self.ticketCategoriesView = new TicketMonster.TicketCategoriesView({model:{}, el:$("#ticketCategoriesViewPlaceholder") });
self.ticketSummaryView = new TicketMonster.TicketSummaryView({model:self.model, el:$("#ticketSummaryView")});
self.show = selectedShow;
self.ticketCategoriesView.render();
self.ticketSummaryView.render();
$("#sectionSelector").change();
});
},
Expand All @@ -546,7 +553,7 @@
save:function (event) {
var bookingRequest = {ticketRequests:[]};
var self = this;
bookingRequest.ticketRequests = _.map(this.model.bookingRequest.tickets, function(ticket) {
bookingRequest.ticketRequests = _.map(this.model.bookingRequest.tickets, function (ticket) {
return {priceCategory:ticket.priceCategory.id, quantity:ticket.quantity}
});
bookingRequest.email = $("input[name='email']").val();
Expand All @@ -559,7 +566,7 @@
success:function (booking) {
this.model = {}
$.getJSON('rest/shows/performance/' + booking.performance.id, function (retrievedPerformance) {
applyTemplate($(self.el), $("#booking-confirmation"), {booking:booking, performance: retrievedPerformance })
applyTemplate($(self.el), $("#booking-confirmation"), {booking:booking, performance:retrievedPerformance })
});
}}).error(function (error) {
if (error.status == 400 || error.status == 409) {
Expand All @@ -583,20 +590,20 @@
});

// make sure that tickets are sorted by section and ticket category
this.model.bookingRequest.tickets.sort(function(t1, t2) {
if (t1.priceCategory.section.id != t2.priceCategory.section.id ) {
this.model.bookingRequest.tickets.sort(function (t1, t2) {
if (t1.priceCategory.section.id != t2.priceCategory.section.id) {
return t1.priceCategory.section.id - t2.priceCategory.section.id;
}
else {
return t1.priceCategory.ticketCategory.id - t2.priceCategory.ticketCategory.id
}
});

var totals = _.reduce( this.model.bookingRequest.tickets, function(totals, ticketRequest) {
return {
tickets: totals.tickets + ticketRequest.quantity,
price: totals.price + ticketRequest.quantity * ticketRequest.priceCategory.price
};
var totals = _.reduce(this.model.bookingRequest.tickets, function (totals, ticketRequest) {
return {
tickets:totals.tickets + ticketRequest.quantity,
price:totals.price + ticketRequest.quantity * ticketRequest.priceCategory.price
};
}, {tickets:0, price:0.0});

this.model.bookingRequest.totals = totals;
Expand Down Expand Up @@ -644,9 +651,10 @@
events:function () {
var events = new TicketMonster.Events;
var eventsView = new TicketMonster.EventsCategoriesView({model:events, el:$("#content")})
events.bind("reset", function () {
events.bind("reset",
function () {
eventsView.render()
}).fetch()
}).fetch()
},
venues:function () {
var venues = new TicketMonster.Venues;
Expand Down

0 comments on commit 724323f

Please sign in to comment.