Skip to content
Browse files

Implementing the 3 pane ticket view with unified ticket view

* cleaning up overall layout
* basic three column layout on trip tickets
* starting to fill in dynamic trip ticket data
* filter form cleanup
* Styling action list links on trip ticket index view
* Setting up content frame styling for trip tickets and open capacity partials
* moving some classes into mixins to be resusable, so we can scope them better
* Setting up initial unified Trip Ticket display
* Setting up custom scrollbars from JCF library
* Finalizing trip ticket index view
* Adding AJAX functionality to initial trip ticket list state
* Adding DateTime picker to Trip Time filder fields
  • Loading branch information...
1 parent 067b1a2 commit e4016fe84051860dd525603bdfa7f3e47e13e7f0 @chrisbloom7 chrisbloom7 committed
Showing with 6,177 additions and 3,292 deletions.
  1. BIN app/assets/images/img01.png
  2. BIN app/assets/images/img02.jpg
  3. +455 −454 app/assets/javascripts/application.js
  4. +16 −4 app/assets/stylesheets/_forms.css.scss
  5. +8 −103 app/assets/stylesheets/application.css.scss
  6. +86 −91 app/assets/stylesheets/layout.css.scss
  7. +531 −0 app/assets/stylesheets/trip_tickets.css.scss
  8. +101 −0 app/assets/stylesheets/utilities.css.scss
  9. +1 −4 app/controllers/home_controller.rb
  10. +3 −2 app/controllers/trip_tickets_controller.rb
  11. +8 −2 app/helpers/application_helper.rb
  12. +35 −0 app/helpers/trip_tickets_helper.rb
  13. +6 −2 app/models/location.rb
  14. +20 −2 app/models/trip_ticket.rb
  15. +10 −10 app/views/admin/index.html.erb
  16. +17 −15 app/views/devise/confirmations/new.html.erb
  17. +22 −20 app/views/devise/passwords/edit.html.erb
  18. +17 −15 app/views/devise/passwords/new.html.erb
  19. +34 −32 app/views/devise/registrations/edit.html.erb
  20. +25 −23 app/views/devise/registrations/new.html.erb
  21. +26 −24 app/views/devise/sessions/new.html.erb
  22. +17 −15 app/views/devise/unlocks/new.html.erb
  23. +2 −2 app/views/home/dashboard.html.erb
  24. +23 −23 app/views/layouts/application.html.erb
  25. +20 −20 app/views/locations/_address_form.html.erb
  26. +6 −4 app/views/open_capacities/index.html.erb
  27. +8 −6 app/views/provider_relationships/edit.html.erb
  28. +8 −6 app/views/provider_relationships/new.html.erb
  29. +23 −21 app/views/provider_relationships/show.html.erb
  30. +8 −6 app/views/providers/edit.html.erb
  31. +35 −34 app/views/providers/index.html.erb
  32. +45 −43 app/views/providers/keys.html.erb
  33. +8 −6 app/views/providers/new.html.erb
  34. +78 −76 app/views/providers/show.html.erb
  35. +6 −4 app/views/reports/index.html.erb
  36. +8 −6 app/views/services/edit.html.erb
  37. +8 −6 app/views/services/new.html.erb
  38. +11 −9 app/views/trip_claims/edit.html.erb
  39. +46 −44 app/views/trip_claims/index.html.erb
  40. +8 −6 app/views/trip_claims/new.html.erb
  41. +11 −9 app/views/trip_claims/show.html.erb
  42. +11 −9 app/views/trip_ticket_comments/edit.html.erb
  43. +33 −31 app/views/trip_ticket_comments/index.html.erb
  44. +8 −6 app/views/trip_ticket_comments/new.html.erb
  45. +22 −20 app/views/trip_ticket_comments/show.html.erb
  46. +120 −0 app/views/trip_tickets/_sidebar_filter_form.html.erb
  47. +1 −1 app/views/trip_tickets/_trip_claims.html.erb
  48. +138 −0 app/views/trip_tickets/_unified_trip_ticket_view.html.erb
  49. +11 −9 app/views/trip_tickets/edit.html.erb
  50. +116 −123 app/views/trip_tickets/index.html.erb
  51. +8 −6 app/views/trip_tickets/new.html.erb
  52. +40 −40 app/views/trip_tickets/show.html.erb
  53. +3 −0 app/views/trip_tickets/show.js.erb
  54. +6 −4 app/views/users/account.html.erb
  55. +12 −10 app/views/users/edit.html.erb
  56. +6 −4 app/views/users/index.html.erb
  57. +8 −6 app/views/users/new.html.erb
  58. +23 −21 app/views/users/show.html.erb
  59. +13 −0 db/migrate/20130330044733_set_default_trip_ticket_appointment_time.rb
  60. +8 −9 db/schema.rb
  61. +7 −12 lib/trip_tickets_filter.rb
  62. +1 −0 spec/requests/api/v1/trip_tickets_requests_spec.rb
  63. +3 −2 test/factories/trip_tickets.rb
  64. +29 −14 test/integration/trip_tickets_test.rb
  65. +1,789 −1,785 vendor/assets/javascripts/jcf.js
  66. +1,919 −0 vendor/assets/javascripts/jquery-ui-timepicker-addon.js
  67. +6 −4 vendor/assets/stylesheets/bootstrap.css
  68. +26 −27 vendor/assets/stylesheets/jcf.css
  69. +10 −0 vendor/assets/stylesheets/jquery-ui-timepicker-addon.css
View
BIN app/assets/images/img01.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN app/assets/images/img02.jpg 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
909 app/assets/javascripts/application.js
@@ -13,488 +13,489 @@
//= require jquery
//= require jquery_ujs
//= require jquery-ui-1.10.0
+//= require jquery-ui-timepicker-addon
//= require jcf
//= require_tree .
// page init
jQuery(function(){
- // jcf.customForms.replaceAll();
+ jcf.customForms.replaceAll();
initOpenClose();
- // initInputs();
- // initDatePicker();
+ // initInputs();
+ // initDatePicker();
});
// open-close init
function initOpenClose() {
- jQuery('.details-box').openClose({
- activeClass: 'active',
- opener: '.opener',
- slider: '.slide',
- animSpeed: 400,
- effect: 'slide'
- });
- jQuery('.form-holder').openClose({
- activeClass: 'active',
- opener: '.opener',
- slider: '.slide',
- animSpeed: 400,
- effect: 'slide'
- });
+ jQuery('.details-box').openClose({
+ activeClass: 'active',
+ opener: '.opener',
+ slider: '.slide',
+ animSpeed: 400,
+ effect: 'slide'
+ });
+ jQuery('.form-holder').openClose({
+ activeClass: 'active',
+ opener: '.opener',
+ slider: '.slide',
+ animSpeed: 400,
+ effect: 'slide'
+ });
}
// // clear inputs on focus
// function initInputs() {
-// PlaceholderInput.replaceByOptions({
-// // filter options
-// clearInputs: true,
-// clearTextareas: true,
-// clearPasswords: true,
-// skipClass: 'default',
-//
-// // input options
-// wrapWithElement: false,
-// showUntilTyping: false,
-// getParentByClass: false,
-// placeholderAttr: 'value'
-// });
+// PlaceholderInput.replaceByOptions({
+// // filter options
+// clearInputs: true,
+// clearTextareas: true,
+// clearPasswords: true,
+// skipClass: 'default',
+//
+// // input options
+// wrapWithElement: false,
+// showUntilTyping: false,
+// getParentByClass: false,
+// placeholderAttr: 'value'
+// });
// }
//
// //init datepicker
// function initDatePicker() {
-// jQuery('.reports-list li').each(function() {
-// var row = jQuery(this),
-// from = row.find('.from'),
-// to = row.find('.to');
-//
-// from.datepicker({
-// changeMonth: false,
-// showOn: "both",
-// numberOfMonths: 1,
-// onClose: function( selectedDate ) {
-// to.datepicker( "option", "minDate", selectedDate );
-// }
-// });
-// to.datepicker({
-// changeMonth: false,
-// showOn: "both",
-// numberOfMonths: 1,
-// onClose: function( selectedDate ) {
-// from.datepicker( "option", "maxDate", selectedDate );
-// }
-// });
-// });
+// jQuery('.reports-list li').each(function() {
+// var row = jQuery(this),
+// from = row.find('.from'),
+// to = row.find('.to');
+//
+// from.datepicker({
+// changeMonth: false,
+// showOn: "both",
+// numberOfMonths: 1,
+// onClose: function( selectedDate ) {
+// to.datepicker( "option", "minDate", selectedDate );
+// }
+// });
+// to.datepicker({
+// changeMonth: false,
+// showOn: "both",
+// numberOfMonths: 1,
+// onClose: function( selectedDate ) {
+// from.datepicker( "option", "maxDate", selectedDate );
+// }
+// });
+// });
// }
/*
* jQuery Open/Close plugin
*/
(function($) {
- function OpenClose(options) {
- this.options = $.extend({
- addClassBeforeAnimation: true,
- activeClass:'active',
- opener:'.opener',
- slider:'.slide',
- animSpeed: 400,
- effect:'fade',
- event:'click'
- }, options);
- this.init();
- }
- OpenClose.prototype = {
- init: function() {
- if(this.options.holder) {
- this.findElements();
- this.attachEvents();
- this.makeCallback('onInit');
- }
- },
- findElements: function() {
- this.holder = $(this.options.holder);
- this.opener = this.holder.find(this.options.opener);
- this.slider = this.holder.find(this.options.slider);
-
- if (!this.holder.hasClass(this.options.activeClass)) {
- this.slider.addClass(slideHiddenClass);
- }
- },
- attachEvents: function() {
- // add handler
- var self = this;
- this.eventHandler = function(e) {
- e.preventDefault();
- if (self.slider.hasClass(slideHiddenClass)) {
- self.showSlide();
- } else {
- self.hideSlide();
- }
- };
- self.opener.bind(self.options.event, this.eventHandler);
+ function OpenClose(options) {
+ this.options = $.extend({
+ addClassBeforeAnimation: true,
+ activeClass:'active',
+ opener:'.opener',
+ slider:'.slide',
+ animSpeed: 400,
+ effect:'fade',
+ event:'click'
+ }, options);
+ this.init();
+ }
+ OpenClose.prototype = {
+ init: function() {
+ if(this.options.holder) {
+ this.findElements();
+ this.attachEvents();
+ this.makeCallback('onInit');
+ }
+ },
+ findElements: function() {
+ this.holder = $(this.options.holder);
+ this.opener = this.holder.find(this.options.opener);
+ this.slider = this.holder.find(this.options.slider);
+
+ if (!this.holder.hasClass(this.options.activeClass)) {
+ this.slider.addClass(slideHiddenClass);
+ }
+ },
+ attachEvents: function() {
+ // add handler
+ var self = this;
+ this.eventHandler = function(e) {
+ e.preventDefault();
+ if (self.slider.hasClass(slideHiddenClass)) {
+ self.showSlide();
+ } else {
+ self.hideSlide();
+ }
+ };
+ self.opener.bind(self.options.event, this.eventHandler);
- // hove mode handler
- if(self.options.event === 'over') {
- self.opener.bind('mouseenter', function() {
- self.holder.removeClass(self.options.activeClass);
- self.opener.trigger(self.options.event);
- });
- self.holder.bind('mouseleave', function() {
- self.holder.addClass(self.options.activeClass);
- self.opener.trigger(self.options.event);
- });
- }
- },
- showSlide: function() {
- var self = this;
- if (self.options.addClassBeforeAnimation) {
- self.holder.addClass(self.options.activeClass);
- }
- self.slider.removeClass(slideHiddenClass);
+ // hove mode handler
+ if(self.options.event === 'over') {
+ self.opener.bind('mouseenter', function() {
+ self.holder.removeClass(self.options.activeClass);
+ self.opener.trigger(self.options.event);
+ });
+ self.holder.bind('mouseleave', function() {
+ self.holder.addClass(self.options.activeClass);
+ self.opener.trigger(self.options.event);
+ });
+ }
+ },
+ showSlide: function() {
+ var self = this;
+ if (self.options.addClassBeforeAnimation) {
+ self.holder.addClass(self.options.activeClass);
+ }
+ self.slider.removeClass(slideHiddenClass);
- self.makeCallback('animStart', true);
- toggleEffects[self.options.effect].show({
- box: self.slider,
- speed: self.options.animSpeed,
- complete: function() {
- if (!self.options.addClassBeforeAnimation) {
- self.holder.addClass(self.options.activeClass);
- }
- self.makeCallback('animEnd', true);
- }
- });
- },
- hideSlide: function() {
- var self = this;
- if (self.options.addClassBeforeAnimation) {
- self.holder.removeClass(self.options.activeClass);
- }
-
- self.makeCallback('animStart', false);
- toggleEffects[self.options.effect].hide({
- box: self.slider,
- speed: self.options.animSpeed,
- complete: function() {
- if (!self.options.addClassBeforeAnimation) {
- self.holder.removeClass(self.options.activeClass);
- }
- self.slider.addClass(slideHiddenClass);
- self.makeCallback('animEnd', false);
- }
- });
- },
- destroy: function() {
- this.slider.removeClass(slideHiddenClass);
- this.opener.unbind(this.options.event, this.eventHandler);
- this.holder.removeClass(this.options.activeClass).removeData('OpenClose');
- },
- makeCallback: function(name) {
- if(typeof this.options[name] === 'function') {
- var args = Array.prototype.slice.call(arguments);
- args.shift();
- this.options[name].apply(this, args);
- }
- }
- };
-
- // add stylesheet for slide on DOMReady
- var slideHiddenClass = 'js-slide-hidden';
- $(function() {
- var tabStyleSheet = $('<style type="text/css">')[0];
- var tabStyleRule = '.' + slideHiddenClass;
- tabStyleRule += '{position:absolute !important;left:-9999px !important;top:-9999px !important;display:block !important}';
- if (tabStyleSheet.styleSheet) {
- tabStyleSheet.styleSheet.cssText = tabStyleRule;
- } else {
- tabStyleSheet.appendChild(document.createTextNode(tabStyleRule));
- }
- $('head').append(tabStyleSheet);
- });
-
- // animation effects
- var toggleEffects = {
- slide: {
- show: function(o) {
- o.box.stop(true).hide().slideDown(o.speed, o.complete);
- },
- hide: function(o) {
- o.box.stop(true).slideUp(o.speed, o.complete);
- }
- },
- fade: {
- show: function(o) {
- o.box.stop(true).hide().fadeIn(o.speed, o.complete);
- },
- hide: function(o) {
- o.box.stop(true).fadeOut(o.speed, o.complete);
- }
- },
- none: {
- show: function(o) {
- o.box.hide().show(0, o.complete);
- },
- hide: function(o) {
- o.box.hide(0, o.complete);
- }
- }
- };
-
- // jQuery plugin interface
- $.fn.openClose = function(opt) {
- return this.each(function() {
- jQuery(this).data('OpenClose', new OpenClose($.extend(opt, {holder: this})));
- });
- };
+ self.makeCallback('animStart', true);
+ toggleEffects[self.options.effect].show({
+ box: self.slider,
+ speed: self.options.animSpeed,
+ complete: function() {
+ if (!self.options.addClassBeforeAnimation) {
+ self.holder.addClass(self.options.activeClass);
+ }
+ self.makeCallback('animEnd', true);
+ }
+ });
+ },
+ hideSlide: function() {
+ var self = this;
+ if (self.options.addClassBeforeAnimation) {
+ self.holder.removeClass(self.options.activeClass);
+ }
+
+ self.makeCallback('animStart', false);
+ toggleEffects[self.options.effect].hide({
+ box: self.slider,
+ speed: self.options.animSpeed,
+ complete: function() {
+ if (!self.options.addClassBeforeAnimation) {
+ self.holder.removeClass(self.options.activeClass);
+ }
+ self.slider.addClass(slideHiddenClass);
+ self.makeCallback('animEnd', false);
+ }
+ });
+ },
+ destroy: function() {
+ this.slider.removeClass(slideHiddenClass);
+ this.opener.unbind(this.options.event, this.eventHandler);
+ this.holder.removeClass(this.options.activeClass).removeData('OpenClose');
+ },
+ makeCallback: function(name) {
+ if(typeof this.options[name] === 'function') {
+ var args = Array.prototype.slice.call(arguments);
+ args.shift();
+ this.options[name].apply(this, args);
+ }
+ }
+ };
+
+ // add stylesheet for slide on DOMReady
+ var slideHiddenClass = 'js-slide-hidden';
+ $(function() {
+ var tabStyleSheet = $('<style type="text/css">')[0];
+ var tabStyleRule = '.' + slideHiddenClass;
+ tabStyleRule += '{position:absolute !important;left:-9999px !important;top:-9999px !important;display:block !important}';
+ if (tabStyleSheet.styleSheet) {
+ tabStyleSheet.styleSheet.cssText = tabStyleRule;
+ } else {
+ tabStyleSheet.appendChild(document.createTextNode(tabStyleRule));
+ }
+ $('head').append(tabStyleSheet);
+ });
+
+ // animation effects
+ var toggleEffects = {
+ slide: {
+ show: function(o) {
+ o.box.stop(true).hide().slideDown(o.speed, o.complete);
+ },
+ hide: function(o) {
+ o.box.stop(true).slideUp(o.speed, o.complete);
+ }
+ },
+ fade: {
+ show: function(o) {
+ o.box.stop(true).hide().fadeIn(o.speed, o.complete);
+ },
+ hide: function(o) {
+ o.box.stop(true).fadeOut(o.speed, o.complete);
+ }
+ },
+ none: {
+ show: function(o) {
+ o.box.hide().show(0, o.complete);
+ },
+ hide: function(o) {
+ o.box.hide(0, o.complete);
+ }
+ }
+ };
+
+ // jQuery plugin interface
+ $.fn.openClose = function(opt) {
+ return this.each(function() {
+ jQuery(this).data('OpenClose', new OpenClose($.extend(opt, {holder: this})));
+ });
+ };
}(jQuery));
// // placeholder class
// (function(){
-// var placeholderCollection = [];
-// PlaceholderInput = function() {
-// this.options = {
-// element:null,
-// showUntilTyping:false,
-// wrapWithElement:false,
-// getParentByClass:false,
-// showPasswordBullets:false,
-// placeholderAttr:'value',
-// inputFocusClass:'focus',
-// inputActiveClass:'text-active',
-// parentFocusClass:'parent-focus',
-// parentActiveClass:'parent-active',
-// labelFocusClass:'label-focus',
-// labelActiveClass:'label-active',
-// fakeElementClass:'input-placeholder-text'
-// };
-// placeholderCollection.push(this);
-// this.init.apply(this,arguments);
-// };
-// PlaceholderInput.refreshAllInputs = function(except) {
-// for(var i = 0; i < placeholderCollection.length; i++) {
-// if(except !== placeholderCollection[i]) {
-// placeholderCollection[i].refreshState();
-// }
-// }
-// };
-// PlaceholderInput.replaceByOptions = function(opt) {
-// var inputs = [].concat(
-// convertToArray(document.getElementsByTagName('input')),
-// convertToArray(document.getElementsByTagName('textarea'))
-// );
-// for(var i = 0; i < inputs.length; i++) {
-// if(inputs[i].className.indexOf(opt.skipClass) < 0) {
-// var inputType = getInputType(inputs[i]);
-// var placeholderValue = inputs[i].getAttribute('placeholder');
-// if(opt.focusOnly || (opt.clearInputs && (inputType === 'text' || inputType === 'email' || placeholderValue)) ||
-// (opt.clearTextareas && inputType === 'textarea') ||
-// (opt.clearPasswords && inputType === 'password')
-// ) {
-// new PlaceholderInput({
-// element:inputs[i],
-// focusOnly: opt.focusOnly,
-// wrapWithElement:opt.wrapWithElement,
-// showUntilTyping:opt.showUntilTyping,
-// getParentByClass:opt.getParentByClass,
-// showPasswordBullets:opt.showPasswordBullets,
-// placeholderAttr: placeholderValue ? 'placeholder' : opt.placeholderAttr
-// });
-// }
-// }
-// }
-// };
-// PlaceholderInput.prototype = {
-// init: function(opt) {
-// this.setOptions(opt);
-// if(this.element && this.element.PlaceholderInst) {
-// this.element.PlaceholderInst.refreshClasses();
-// } else {
-// this.element.PlaceholderInst = this;
-// if(this.elementType !== 'radio' || this.elementType !== 'checkbox' || this.elementType !== 'file') {
-// this.initElements();
-// this.attachEvents();
-// this.refreshClasses();
-// }
-// }
-// },
-// setOptions: function(opt) {
-// for(var p in opt) {
-// if(opt.hasOwnProperty(p)) {
-// this.options[p] = opt[p];
-// }
-// }
-// if(this.options.element) {
-// this.element = this.options.element;
-// this.elementType = getInputType(this.element);
-// if(this.options.focusOnly) {
-// this.wrapWithElement = false;
-// } else {
-// if(this.elementType === 'password' && this.options.showPasswordBullets) {
-// this.wrapWithElement = false;
-// } else {
-// this.wrapWithElement = this.elementType === 'password' || this.options.showUntilTyping ? true : this.options.wrapWithElement;
-// }
-// }
-// this.setPlaceholderValue(this.options.placeholderAttr);
-// }
-// },
-// setPlaceholderValue: function(attr) {
-// this.origValue = (attr === 'value' ? this.element.defaultValue : (this.element.getAttribute(attr) || ''));
-// if(this.options.placeholderAttr !== 'value') {
-// this.element.removeAttribute(this.options.placeholderAttr);
-// }
-// },
-// initElements: function() {
-// // create fake element if needed
-// if(this.wrapWithElement) {
-// this.fakeElement = document.createElement('span');
-// this.fakeElement.className = this.options.fakeElementClass;
-// this.fakeElement.innerHTML += this.origValue;
-// this.fakeElement.style.color = getStyle(this.element, 'color');
-// this.fakeElement.style.position = 'absolute';
-// this.element.parentNode.insertBefore(this.fakeElement, this.element);
-//
-// if(this.element.value === this.origValue || !this.element.value) {
-// this.element.value = '';
-// this.togglePlaceholderText(true);
-// } else {
-// this.togglePlaceholderText(false);
-// }
-// } else if(!this.element.value && this.origValue.length) {
-// this.element.value = this.origValue;
-// }
-// // get input label
-// if(this.element.id) {
-// this.labels = document.getElementsByTagName('label');
-// for(var i = 0; i < this.labels.length; i++) {
-// if(this.labels[i].htmlFor === this.element.id) {
-// this.labelFor = this.labels[i];
-// break;
-// }
-// }
-// }
-// // get parent node (or parentNode by className)
-// this.elementParent = this.element.parentNode;
-// if(typeof this.options.getParentByClass === 'string') {
-// var el = this.element;
-// while(el.parentNode) {
-// if(hasClass(el.parentNode, this.options.getParentByClass)) {
-// this.elementParent = el.parentNode;
-// break;
-// } else {
-// el = el.parentNode;
-// }
-// }
-// }
-// },
-// attachEvents: function() {
-// this.element.onfocus = bindScope(this.focusHandler, this);
-// this.element.onblur = bindScope(this.blurHandler, this);
-// if(this.options.showUntilTyping) {
-// this.element.onkeydown = bindScope(this.typingHandler, this);
-// this.element.onpaste = bindScope(this.typingHandler, this);
-// }
-// if(this.wrapWithElement) this.fakeElement.onclick = bindScope(this.focusSetter, this);
-// },
-// togglePlaceholderText: function(state) {
-// if(!this.element.readOnly && !this.options.focusOnly) {
-// if(this.wrapWithElement) {
-// this.fakeElement.style.display = state ? '' : 'none';
-// } else {
-// this.element.value = state ? this.origValue : '';
-// }
-// }
-// },
-// focusSetter: function() {
-// this.element.focus();
-// },
-// focusHandler: function() {
-// clearInterval(this.checkerInterval);
-// this.checkerInterval = setInterval(bindScope(this.intervalHandler,this), 1);
-// this.focused = true;
-// if(!this.element.value.length || this.element.value === this.origValue) {
-// if(!this.options.showUntilTyping) {
-// this.togglePlaceholderText(false);
-// }
-// }
-// this.refreshClasses();
-// },
-// blurHandler: function() {
-// clearInterval(this.checkerInterval);
-// this.focused = false;
-// if(!this.element.value.length || this.element.value === this.origValue) {
-// this.togglePlaceholderText(true);
-// }
-// this.refreshClasses();
-// PlaceholderInput.refreshAllInputs(this);
-// },
-// typingHandler: function() {
-// setTimeout(bindScope(function(){
-// if(this.element.value.length) {
-// this.togglePlaceholderText(false);
-// this.refreshClasses();
-// }
-// },this), 10);
-// },
-// intervalHandler: function() {
-// if(typeof this.tmpValue === 'undefined') {
-// this.tmpValue = this.element.value;
-// }
-// if(this.tmpValue != this.element.value) {
-// PlaceholderInput.refreshAllInputs(this);
-// }
-// },
-// refreshState: function() {
-// if(this.wrapWithElement) {
-// if(this.element.value.length && this.element.value !== this.origValue) {
-// this.togglePlaceholderText(false);
-// } else if(!this.element.value.length) {
-// this.togglePlaceholderText(true);
-// }
-// }
-// this.refreshClasses();
-// },
-// refreshClasses: function() {
-// this.textActive = this.focused || (this.element.value.length && this.element.value !== this.origValue);
-// this.setStateClass(this.element, this.options.inputFocusClass,this.focused);
-// this.setStateClass(this.elementParent, this.options.parentFocusClass,this.focused);
-// this.setStateClass(this.labelFor, this.options.labelFocusClass,this.focused);
-// this.setStateClass(this.element, this.options.inputActiveClass, this.textActive);
-// this.setStateClass(this.elementParent, this.options.parentActiveClass, this.textActive);
-// this.setStateClass(this.labelFor, this.options.labelActiveClass, this.textActive);
-// },
-// setStateClass: function(el,cls,state) {
-// if(!el) return; else if(state) addClass(el,cls); else removeClass(el,cls);
-// }
-// };
-//
-// // utility functions
-// function convertToArray(collection) {
-// var arr = [];
-// for (var i = 0, ref = arr.length = collection.length; i < ref; i++) {
-// arr[i] = collection[i];
-// }
-// return arr;
-// }
-// function getInputType(input) {
-// return (input.type ? input.type : input.tagName).toLowerCase();
-// }
-// function hasClass(el,cls) {
-// return el.className ? el.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')) : false;
-// }
-// function addClass(el,cls) {
-// if (!hasClass(el,cls)) el.className += " "+cls;
-// }
-// function removeClass(el,cls) {
-// if (hasClass(el,cls)) {el.className=el.className.replace(new RegExp('(\\s|^)'+cls+'(\\s|$)'),' ');}
-// }
-// function bindScope(f, scope) {
-// return function() {return f.apply(scope, arguments);};
-// }
-// function getStyle(el, prop) {
-// if (document.defaultView && document.defaultView.getComputedStyle) {
-// return document.defaultView.getComputedStyle(el, null)[prop];
-// } else if (el.currentStyle) {
-// return el.currentStyle[prop];
-// } else {
-// return el.style[prop];
-// }
-// }
+// var placeholderCollection = [];
+// PlaceholderInput = function() {
+// this.options = {
+// element:null,
+// showUntilTyping:false,
+// wrapWithElement:false,
+// getParentByClass:false,
+// showPasswordBullets:false,
+// placeholderAttr:'value',
+// inputFocusClass:'focus',
+// inputActiveClass:'text-active',
+// parentFocusClass:'parent-focus',
+// parentActiveClass:'parent-active',
+// labelFocusClass:'label-focus',
+// labelActiveClass:'label-active',
+// fakeElementClass:'input-placeholder-text'
+// };
+// placeholderCollection.push(this);
+// this.init.apply(this,arguments);
+// };
+// PlaceholderInput.refreshAllInputs = function(except) {
+// for(var i = 0; i < placeholderCollection.length; i++) {
+// if(except !== placeholderCollection[i]) {
+// placeholderCollection[i].refreshState();
+// }
+// }
+// };
+// PlaceholderInput.replaceByOptions = function(opt) {
+// var inputs = [].concat(
+// convertToArray(document.getElementsByTagName('input')),
+// convertToArray(document.getElementsByTagName('textarea'))
+// );
+// for(var i = 0; i < inputs.length; i++) {
+// if(inputs[i].className.indexOf(opt.skipClass) < 0) {
+// var inputType = getInputType(inputs[i]);
+// var placeholderValue = inputs[i].getAttribute('placeholder');
+// if(opt.focusOnly || (opt.clearInputs && (inputType === 'text' || inputType === 'email' || placeholderValue)) ||
+// (opt.clearTextareas && inputType === 'textarea') ||
+// (opt.clearPasswords && inputType === 'password')
+// ) {
+// new PlaceholderInput({
+// element:inputs[i],
+// focusOnly: opt.focusOnly,
+// wrapWithElement:opt.wrapWithElement,
+// showUntilTyping:opt.showUntilTyping,
+// getParentByClass:opt.getParentByClass,
+// showPasswordBullets:opt.showPasswordBullets,
+// placeholderAttr: placeholderValue ? 'placeholder' : opt.placeholderAttr
+// });
+// }
+// }
+// }
+// };
+// PlaceholderInput.prototype = {
+// init: function(opt) {
+// this.setOptions(opt);
+// if(this.element && this.element.PlaceholderInst) {
+// this.element.PlaceholderInst.refreshClasses();
+// } else {
+// this.element.PlaceholderInst = this;
+// if(this.elementType !== 'radio' || this.elementType !== 'checkbox' || this.elementType !== 'file') {
+// this.initElements();
+// this.attachEvents();
+// this.refreshClasses();
+// }
+// }
+// },
+// setOptions: function(opt) {
+// for(var p in opt) {
+// if(opt.hasOwnProperty(p)) {
+// this.options[p] = opt[p];
+// }
+// }
+// if(this.options.element) {
+// this.element = this.options.element;
+// this.elementType = getInputType(this.element);
+// if(this.options.focusOnly) {
+// this.wrapWithElement = false;
+// } else {
+// if(this.elementType === 'password' && this.options.showPasswordBullets) {
+// this.wrapWithElement = false;
+// } else {
+// this.wrapWithElement = this.elementType === 'password' || this.options.showUntilTyping ? true : this.options.wrapWithElement;
+// }
+// }
+// this.setPlaceholderValue(this.options.placeholderAttr);
+// }
+// },
+// setPlaceholderValue: function(attr) {
+// this.origValue = (attr === 'value' ? this.element.defaultValue : (this.element.getAttribute(attr) || ''));
+// if(this.options.placeholderAttr !== 'value') {
+// this.element.removeAttribute(this.options.placeholderAttr);
+// }
+// },
+// initElements: function() {
+// // create fake element if needed
+// if(this.wrapWithElement) {
+// this.fakeElement = document.createElement('span');
+// this.fakeElement.className = this.options.fakeElementClass;
+// this.fakeElement.innerHTML += this.origValue;
+// this.fakeElement.style.color = getStyle(this.element, 'color');
+// this.fakeElement.style.position = 'absolute';
+// this.element.parentNode.insertBefore(this.fakeElement, this.element);
+//
+// if(this.element.value === this.origValue || !this.element.value) {
+// this.element.value = '';
+// this.togglePlaceholderText(true);
+// } else {
+// this.togglePlaceholderText(false);
+// }
+// } else if(!this.element.value && this.origValue.length) {
+// this.element.value = this.origValue;
+// }
+// // get input label
+// if(this.element.id) {
+// this.labels = document.getElementsByTagName('label');
+// for(var i = 0; i < this.labels.length; i++) {
+// if(this.labels[i].htmlFor === this.element.id) {
+// this.labelFor = this.labels[i];
+// break;
+// }
+// }
+// }
+// // get parent node (or parentNode by className)
+// this.elementParent = this.element.parentNode;
+// if(typeof this.options.getParentByClass === 'string') {
+// var el = this.element;
+// while(el.parentNode) {
+// if(hasClass(el.parentNode, this.options.getParentByClass)) {
+// this.elementParent = el.parentNode;
+// break;
+// } else {
+// el = el.parentNode;
+// }
+// }
+// }
+// },
+// attachEvents: function() {
+// this.element.onfocus = bindScope(this.focusHandler, this);
+// this.element.onblur = bindScope(this.blurHandler, this);
+// if(this.options.showUntilTyping) {
+// this.element.onkeydown = bindScope(this.typingHandler, this);
+// this.element.onpaste = bindScope(this.typingHandler, this);
+// }
+// if(this.wrapWithElement) this.fakeElement.onclick = bindScope(this.focusSetter, this);
+// },
+// togglePlaceholderText: function(state) {
+// if(!this.element.readOnly && !this.options.focusOnly) {
+// if(this.wrapWithElement) {
+// this.fakeElement.style.display = state ? '' : 'none';
+// } else {
+// this.element.value = state ? this.origValue : '';
+// }
+// }
+// },
+// focusSetter: function() {
+// this.element.focus();
+// },
+// focusHandler: function() {
+// clearInterval(this.checkerInterval);
+// this.checkerInterval = setInterval(bindScope(this.intervalHandler,this), 1);
+// this.focused = true;
+// if(!this.element.value.length || this.element.value === this.origValue) {
+// if(!this.options.showUntilTyping) {
+// this.togglePlaceholderText(false);
+// }
+// }
+// this.refreshClasses();
+// },
+// blurHandler: function() {
+// clearInterval(this.checkerInterval);
+// this.focused = false;
+// if(!this.element.value.length || this.element.value === this.origValue) {
+// this.togglePlaceholderText(true);
+// }
+// this.refreshClasses();
+// PlaceholderInput.refreshAllInputs(this);
+// },
+// typingHandler: function() {
+// setTimeout(bindScope(function(){
+// if(this.element.value.length) {
+// this.togglePlaceholderText(false);
+// this.refreshClasses();
+// }
+// },this), 10);
+// },
+// intervalHandler: function() {
+// if(typeof this.tmpValue === 'undefined') {
+// this.tmpValue = this.element.value;
+// }
+// if(this.tmpValue != this.element.value) {
+// PlaceholderInput.refreshAllInputs(this);
+// }
+// },
+// refreshState: function() {
+// if(this.wrapWithElement) {
+// if(this.element.value.length && this.element.value !== this.origValue) {
+// this.togglePlaceholderText(false);
+// } else if(!this.element.value.length) {
+// this.togglePlaceholderText(true);
+// }
+// }
+// this.refreshClasses();
+// },
+// refreshClasses: function() {
+// this.textActive = this.focused || (this.element.value.length && this.element.value !== this.origValue);
+// this.setStateClass(this.element, this.options.inputFocusClass,this.focused);
+// this.setStateClass(this.elementParent, this.options.parentFocusClass,this.focused);
+// this.setStateClass(this.labelFor, this.options.labelFocusClass,this.focused);
+// this.setStateClass(this.element, this.options.inputActiveClass, this.textActive);
+// this.setStateClass(this.elementParent, this.options.parentActiveClass, this.textActive);
+// this.setStateClass(this.labelFor, this.options.labelActiveClass, this.textActive);
+// },
+// setStateClass: function(el,cls,state) {
+// if(!el) return; else if(state) addClass(el,cls); else removeClass(el,cls);
+// }
+// };
+//
+// // utility functions
+// function convertToArray(collection) {
+// var arr = [];
+// for (var i = 0, ref = arr.length = collection.length; i < ref; i++) {
+// arr[i] = collection[i];
+// }
+// return arr;
+// }
+// function getInputType(input) {
+// return (input.type ? input.type : input.tagName).toLowerCase();
+// }
+// function hasClass(el,cls) {
+// return el.className ? el.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')) : false;
+// }
+// function addClass(el,cls) {
+// if (!hasClass(el,cls)) el.className += " "+cls;
+// }
+// function removeClass(el,cls) {
+// if (hasClass(el,cls)) {el.className=el.className.replace(new RegExp('(\\s|^)'+cls+'(\\s|$)'),' ');}
+// }
+// function bindScope(f, scope) {
+// return function() {return f.apply(scope, arguments);};
+// }
+// function getStyle(el, prop) {
+// if (document.defaultView && document.defaultView.getComputedStyle) {
+// return document.defaultView.getComputedStyle(el, null)[prop];
+// } else if (el.currentStyle) {
+// return el.currentStyle[prop];
+// } else {
+// return el.style[prop];
+// }
+// }
// }());
View
20 app/assets/stylesheets/_forms.css.scss
@@ -1,6 +1,7 @@
@import 'utilities';
-$form_label–width: 225px;
+$form_label_width: 225px;
+$form_label_padding_right: 10px;
.field_with_errors {
background-color: #c00;
@@ -40,6 +41,17 @@ $form_label–width: 225px;
border: 2px solid red;
}
+.ui-datepicker-trigger {
+ background:url(image-path("sprite1.png")) no-repeat 0 -710px;
+ height:16px;
+ margin:0 0 3px 0;
+ overflow:hidden;
+ text-indent:-9999px;
+ width:16px;
+ border:none;
+ cursor:pointer;
+}
+
form {
input[type=button],
input[type=color],
@@ -108,8 +120,8 @@ fieldset {
label {
float:left;
- padding:4px 10px 0 0;
- width:$form_label–width;
+ padding:4px $form_label_padding_right 0 0;
+ width:$form_label_width;
}
&.field-with-checkbox {
@@ -129,7 +141,7 @@ fieldset {
/* text-align:right; */
&.field-align {
- margin-left:$form_label–width;
+ margin-left:$form_label_width + $form_label_padding_right;
}
input[type=button].button,input[type=submit].button,a.button span {
View
111 app/assets/stylesheets/application.css.scss
@@ -12,6 +12,7 @@
*= require_self
*= require_tree .
*= require jquery-ui-1.10.0.custom
+ *= require jquery-ui-timepicker-addon
*= require jcf
*/
@@ -38,20 +39,25 @@ body {
a {
color:#444;
- /* text-decoration:none; */
+ text-decoration:none;
&:active {
background-color:transparent;
}
&:hover,&:focus {
- /* text-decoration:underline; */
+ text-decoration:underline;
}
}
.image-holder img,.map-holder img {
vertical-align:top;
}
+
+ .padded {
+ padding-left:10px;
+ padding-right:10px;
+ }
}
/* refactor out into specific stylesheets as needed */
@@ -104,108 +110,7 @@ body {
width:409px;
}
-.tickets-list {
- float:left;
- height:670px;
- line-height:14px;
- list-style:none;
- margin:0;
- padding:0;
- width:398px;
-}
-
-.tickets-list li {
- background:#e7eae7;
- margin:0 0 4px;
- min-height:70px;
- overflow:hidden;
- padding:6px 16px 4px 8px;
- position:relative;
- vertical-align:top;
-}
-
-.tickets-list .check {
- background:#f1f4f1;
-}
-
-.tickets-list .column {
- float:left;
- margin:0 0 0 41px;
- width:153px;
-}
-
-.tickets-list .column:first-child {
- margin:0;
- width:180px;
-}
-
-.tickets-list .title {
- display:block;
- font:14px/16px "Helvetica Neue", Helvetica, Arial, sans-serif;
- margin:0 0 8px;
-}
-
-.tickets-list .title .count {
- padding:0 0 0 3px;
-}
-
-.tickets-list .date {
- display:block;
- font-style:normal;
- margin:0 0 10px;
-}
-
-.tickets-list .date span {
- background:url(image-path("separator02.gif")) no-repeat 0 3px;
- margin:0 0 0 6px;
- padding:0 5px 0 6px;
-}
-
-.tickets-list .icons-list,.add-info .icons-list {
- font-size:0;
- line-height:0;
- list-style:none;
- margin:0;
- padding:0;
-}
-
-.icons-list li {
- background:none;
- display:inline;
- margin:0 10px 0 0;
- padding:0;
- vertical-align:middle;
-}
-.tickets-list .checked {
- background:url(image-path("sprite1.png")) no-repeat 0 -625px;
- bottom:8px;
- display:none;
- height:15px;
- position:absolute;
- right:6px;
- width:16px;
-}
-
-.tickets-list .check .checked {
- display:block;
-}
-
-.tickets-list p {
- margin:0 0 8px;
-}
-
-.tickets-list .green {
- background-image:url(image-path("arrow02.png"));
- background-position:100% 0;
- background-repeat:no-repeat;
-}
-
-.tickets-list .green2 {
- background-image:url(image-path("arrow03.png"));
- background-position:100% 0;
- background-repeat:no-repeat;
-}
*/
/*
View
177 app/assets/stylesheets/layout.css.scss
@@ -1,6 +1,6 @@
@import 'utilities';
-#main-header {
+#header {
background:#ccc;
border-bottom:2px solid #707070;
@@ -62,10 +62,6 @@
position:relative;
width:1066px;
- a {
- text-decoration:none;
- }
-
.logo {
bottom:-30px;
font-size:20px;
@@ -137,122 +133,121 @@
}
#main {
+ @include clearfix;
margin:0 auto;
overflow:hidden;
width:1280px;
-}
-#content {
- float:right;
- width:1035px;
+ #content {
+ float:right;
+ min-height:100px;
+ width:1062px;
- heading {
- margin:0 0 12px;
- position:relative;
-
- img {
- margin:0 0 0 8px;
- vertical-align:middle;
+ &.alt-content {
+ background:#ededed;
}
+
+ heading {
+ margin:0 0 12px;
+
+ /*
+ position:relative;
+
+ img {
+ margin:0 0 0 8px;
+ vertical-align:middle;
+ }
- &.alt-heading {
- margin-bottom:26px;
+ &.alt-heading {
+ margin-bottom:26px;
+ }
+ */
}
- }
- section {
- border-top:2px solid #707070;
- margin-top:12px;
- padding-top:12px;
+ section {
+ border-top:2px solid #707070;
+ margin-top:12px;
+ padding-top:12px;
- &:first-child {
- border-top:0 none;
- margin-top:0;
- padding-top:0;
- }
- }
-
- nav {
- margin:6px 0;
- padding:6px 0;
- }
-
- .alt-content {
- background:#ededed;
- }
-
- .scrollable-area-wrapper {
- .vscrollbar {
- width:10px;
+ &:first-child {
+ border-top:0 none;
+ margin-top:0;
+ padding-top:0;
+ }
}
- .vscroll-line {
- background:#ccc;
- width:10px;
- }
+ .scrollable-area-wrapper {
+ .vscrollbar {
+ width:10px;
+ }
- .vscroll-slider {
- background:#f7f7f7;
- border:1px solid #ccc;
- width:8px;
- }
+ .vscroll-line {
+ background:#ccc;
+ width:10px;
+ }
- .vscroll-up,.vscroll-down {
- display:none;
+ .vscroll-slider {
+ background:#f7f7f7;
+ border:1px solid #ccc;
+ width:8px;
+ }
+
+ .vscroll-up,.vscroll-down {
+ display:none;
+ }
}
- }
- .content-holder {
- background:#fff;
- float:right;
- width:655px;
- }
+ /*
+ .content-holder {
+ background:#fff;
+ float:right;
+ width:655px;
+ }
- .content-frame {
- height:643px;
- padding:8px 33px 20px 24px;
+ .content-frame {
+ height:643px;
+ padding:8px 33px 20px 24px;
+ }
+ */
}
-}
-#sidebar {
- float:left;
- padding:46px 0 0 10px;
- width:200px;
-
- .side-nav {
- font-size:14px;
- line-height:16px;
- list-style:none;
- margin:0 -9px 0 -10px;
- padding:9px 0 0;
- width:219px;
+ #sidebar {
+ min-height:100px;
+ padding-top:46px;
+ width:218px;
- li {
- overflow:hidden;
- padding:0 0 3px;
- vertical-align:top;
+ .side-nav {
+ list-style:none;
+ margin:0;
+ padding:0;
+
+ li {
+ font-size:14px;
+ line-height:16px;
+ overflow:hidden;
+ padding:0;
+ vertical-align:top;
- a {
- color:#303030;
- display:block;
- padding:11px 12px 12px;
- }
+ a {
+ color:#303030;
+ display:block;
+ padding:12px 10px;
+ }
- &.active a,a:hover {
- background:url(image-path("bg-side-nav.png")) repeat-x;
- text-decoration:none;
+ &.active a,a:hover {
+ background:url(image-path("bg-side-nav.png")) repeat-x;
+ }
}
}
}
}
footer {
+ @include clearfix;
background:#ccc;
border-top:2px solid #707070;
- height: auto !important;
- height: 100%;
- margin-top:10px;
- min-height: 100%;
+ height: 100px;
+ margin-top:20px;
padding:10px;
text-align:center;
}
View
531 app/assets/stylesheets/trip_tickets.css.scss
@@ -1,4 +1,535 @@
+@import 'utilities';
+
body[data-controller="trip_tickets"] {
+ #trip_ticket_filters {
+ input.form-input {
+ width:184px;
+ }
+
+ select.form-input {
+ width:198px;
+ }
+
+ #trip_ticket_filters_trip_time_start,
+ #trip_ticket_filters_trip_time_end {
+ width:157px;
+ margin-right:10px;
+ margin-bottom:3px;
+ }
+ }
+
+ &[data-action="index"] {
+ #content {
+ &>header {
+ display:none;
+ }
+
+ .actions-list-holder {
+ background:#ededed;
+ overflow:hidden;
+ padding:9px 33px 4px;
+
+ .actions-list {
+ float:right;
+ font-weight:600;
+ list-style:none;
+ margin:0;
+ padding:0;
+
+ li {
+ float:left;
+
+ a {
+ background:url(image-path("sprite1.png")) no-repeat 0 -520px;
+ color:#666;
+ display:block;
+
+ span {
+ background:url(image-path("separator03.gif")) no-repeat 0 1px;
+ display:block;
+ padding:7px 12px 11px 9px;
+ }
+ }
+
+ &:first-child a {
+ background-position:0 -470px;
+ }
+
+ &.last a {
+ background-position:100% -570px;
+ }
+
+ &:first-child a span {
+ background:none;
+ }
+ }
+ }
+ }
+
+ .tickets-holder {
+ float:left;
+ margin:0 -3px 0 0;
+ padding:0;
+ width:409px;
+
+ .tickets-list {
+ float:left;
+ height:670px;
+ line-height:14px;
+ list-style:none;
+ margin:0;
+ min-height:670px;
+ padding:0;
+ width:398px;
+
+ li {
+ background:#e7eae7;
+ margin:0 0 4px;
+ min-height:70px;
+ overflow:hidden;
+ padding:6px 16px 4px 8px;
+ position:relative;
+ vertical-align:top;
+ }
+
+ @include icons-list;
+
+ .check {
+ background:#f1f4f1;
+ }
+
+ .active {
+ background:#fff;
+ }
+
+ .description{
+ overflow:hidden;
+ padding:0 0 8px;
+ }
+
+ .column {
+ float:left;
+ margin:0 0 0 41px;
+ width:153px;
+
+ &:first-child {
+ margin:0;
+ width:180px;
+ }
+ }
+
+ .title {
+ display:block;
+ font:14px/16px "Helvetica Neue", Helvetica, Arial, sans-serif;
+ margin:0 0 8px;
+
+ .count {
+ padding:0 0 0 3px;
+ }
+
+ img {
+ margin:0 0 0 11px;
+ vertical-align:middle;
+ }
+ }
+
+ address {
+ font-style:normal;
+ }
+
+ .date {
+ display:block;
+ font-style:normal;
+ margin:0 0 10px;
+
+ span {
+ background:url(image-path("separator02.gif")) no-repeat 0 3px;
+ margin:0 0 0 6px;
+ padding:0 5px 0 6px;
+ }
+
+ img {
+ vertical-align:middle;
+ }
+ }
+
+ .checked {
+ background:url(image-path("sprite1.png")) no-repeat 0 -625px;
+ bottom:8px;
+ display:none;
+ height:15px;
+ position:absolute;
+ right:6px;
+ width:16px;
+ }
+
+ .check .checked {
+ display:block;
+ }
+
+ p {
+ margin:0 0 8px;
+ }
+
+ .green {
+ background-image:url(image-path("arrow02.png"));
+ background-position:100% 0;
+ background-repeat:no-repeat;
+ }
+
+ .green2 {
+ background-image:url(image-path("arrow03.png"));
+ background-position:100% 0;
+ background-repeat:no-repeat;
+ }
+ }
+ }
+
+ .content-holder {
+ background:#fff;
+ float:right;
+ width:655px;
+
+ .content-frame {
+ height:643px;
+ min-height:643px;
+ padding:8px 33px 20px 24px;
+
+ .heading {
+ margin:0 0 12px;
+ position:relative;
+
+ &.alt-heading {
+ margin-bottom:26px;
+ }
+
+ h2 {
+ font-size:16px;
+ font-weight:700;
+ line-height:18px;
+ margin:0;
+ }
+
+ /* Open Capacity */
+ .btn-request {
+ background:url(image-path("sprite1.png")) no-repeat 100% -282px;
+ color:#fff;
+ font-size:13px;
+ font-weight:700;
+ line-height:15px;
+ padding:0 6px 0 0;
+ position:absolute;
+ right:1px;
+ top:6px;
+
+ span {
+ background:url(image-path("sprite1.png")) no-repeat 0 -250px;
+ float:left;
+ padding:5px 11px 9px 19px;
+ }
+ }
+
+ /* Trip Ticket */
+ img {
+ margin:0 0 0 8px;
+ vertical-align:middle;
+ }
+ }
+
+ /* Trip Ticket */
+ .twocolumns {
+ overflow:hidden;
+
+ .add-info {
+ float:left;
+ padding:0 0 0 2px;
+ width:275px;
+
+ h3 {
+ font-size:14px;
+ font-weight:400;
+ line-height:16px;
+ margin:0 0 7px -2px;
+ }
+
+ .description {
+ float:none;
+ margin:0 0 -7px;
+ overflow:hidden;
+ padding:0;
+ width:auto;
+
+ .column {
+ float:left;
+ margin:-2px 0 0 10px;
+ width:121px;
+
+ &:first-child {
+ margin:0;
+ }
+
+ p {
+ line-height:17px;
+ margin:0;
+
+ img {
+ display:inline-block;
+ margin:-4px 0 0 3px;
+ vertical-align:middle;
+ }
+ }
+ }
+ }
+
+ @include icons-list;
+
+ .icons-list {
+ padding:0 0 12px;
+ }
+
+ .image-holder {
+ margin:0 0 14px;
+ }
+
+ .dates-list {
+ line-height:14px;
+ list-style:none;
+ margin:0;
+ padding:0 0 18px;
+
+ li {
+ overflow:hidden;
+ vertical-align:top;
+
+ &.active em {
+ font-weight:700;
+ }
+
+ span {
+ background:url(image-path("separator02.gif")) no-repeat 0 3px;
+ padding:0 7px 0 3px;
+
+ &:first-child {
+ background:none;
+ padding-left:0;
+ }
+ }
+
+ .note {
+ background-position:0 1px;
+ font-size:9px;
+
+ strong {
+ font-weight:700;
+ }
+ }
+ }
+ }
+
+ address {
+ font-style:normal;
+ margin:0 0 4px;
+ }
+
+ .gps-data {
+ display:block;
+ padding:2px 0 16px;
+ }
+
+ p {
+ margin:0 0 15px;
+ }
+ }
+
+ .description {
+ float:right;
+ padding:16px 0 0;
+ width:285px;
+
+ @include form-holder;
+
+ p {
+ margin:0 0 18px;
+ }
+
+ .details-box {
+ padding:0 0 17px;
+
+ .opener {
+ background:url(image-path("sprite1.png")) no-repeat 2px 4px;
+ font-size:14px;
+ line-height:16px;
+ padding:0 0 0 18px;
+ }
+
+ &.active .opener {
+ background-position:-1px -86px;
+ }
+
+ .slide {
+ padding:20px 10px 16px 0;
+
+ dl {
+ line-height:15px;
+ margin:0;
+ overflow:hidden;
+
+ dt,dd {
+ display:inline-block;
+ margin:0 0 13px;
+ vertical-align:top;
+ }
+
+ dt {
+ padding:0 10px 0 0;
+ width:97px;
+ }
+
+ dd {
+ width:154px;
+ }
+ }
+ }
+
+ p {
+ margin:0 0 18px;
+ }
+ }
+ }
+ }
+
+ /* Open Capacity */
+ .seats-info {
+ margin:0 0 9px;
+ @include clearfix;
+
+ .column {
+ float:left;
+ margin:0 10px 0 0;
+ width:138px;
+ }
+
+ p {
+ margin:0 0 10px;
+ }
+
+ dl {
+ margin:-5px 0 0;
+ }
+
+ dl {
+ dt,dd {
+ display:inline-block;
+ margin:0 0 8px;
+ vertical-align:bottom;
+ }
+
+ dt {
+ text-align:right;
+ width:20px;
+ }
+
+ dd {
+ padding:0 0 1px 7px;
+ width:105px;
+ }
+ }
+ }
+
+ /* Open Capacity */
+ .map-holder {
+ margin:0 0 54px;
+
+ .frame {
+ margin:0 0 14px;
+ }
+
+ .description {
+ line-height:17px;
+ overflow:hidden;
+
+ p {
+ margin:0;
+ overflow:hidden;
+ }
+
+ .event-section {
+ float:left;
+ padding:4px 10px 0 0;
+ width:141px;
+
+ address {
+ font-style:normal;
+ }
+
+ .date {
+ display:block;
+ font-style:normal;
+ font-weight:700;
+
+ span {
+ background:url(image-path("separator04.gif")) no-repeat 0 4px;
+ margin:0 0 0 2px;
+ padding:0 0 0 7px;
+ }
+ }
+ }
+ }
+ }
+
+ /* Open Capacity */
+ .activities-section {
+ @include clearfix;
+
+ @include form-holder;
+
+ .events-list {
+ float:left;
+ list-style:none;
+ margin:0;
+ padding:3px 0 0;
+
+ li {
+ overflow:hidden;
+ padding:0 0 6px;
+ vertical-align:top;
+ }
+
+ strong {
+ background:url(image-path("separator05.gif")) no-repeat 100% 4px;
+ font-weight:700;
+ margin:0 3px 0 0;
+ padding:0 7px 0 0;
+ }
+ }
+
+ .activity-list {
+ list-style:none;
+ margin:0 0 0 -4px;
+ padding:0;
+
+ li {
+ overflow:hidden;
+ padding:0 0 4px;
+ vertical-align:top;
+ }
+
+ span {
+ background:url(image-path("separator02.gif")) no-repeat 100% 2px;
+ display:inline-block;
+ margin:0 3px 0 0;
+ padding:0 7px 0 0;
+ text-align:right;
+ vertical-align:top;
+ width:55px;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
/*
.tickets-list.small-list li {
background:#f8f8f8;
View
101 app/assets/stylesheets/utilities.css.scss
@@ -17,3 +17,104 @@
*zoom:1;
}
}
+
+@mixin form-holder {
+ .form-holder {
+ float:right;
+ width:296px;
+
+ .heading {
+ margin:0 1px 10px 0;
+ @include clearfix;
+
+ h2 {
+ float:left;
+ font-size:14px;
+ line-height:16px;
+ }
+ }
+
+ .opener {
+ background:url(image-path("bg-opener.png")) no-repeat;
+ float:right;
+ margin:-2px 0 0;
+ padding:1px 0 3px 22px;
+ }
+
+ &.active .opener {
+ background-position:-1px -86px;
+ }
+
+ .form-comment {
+ padding:1px 0 11px;
+
+ textarea {
+ background:none;
+ border:1px solid #ccc;
+ margin:0 0 7px;
+ max-height:56px;
+ min-height:56px;
+ max-width:292px;
+ min-width:292px;
+ overflow:auto;
+ padding:0;
+ }
+
+ .buttons-holder {
+ overflow:hidden;
+ padding:0 1px 0 0;
+ text-align:right;
+
+ .btn-cancel {
+ background:url(image-path("sprite1.png")) no-repeat 100% -379px;
+ display:inline-block;
+ color:#fff;
+ font:14px/16px "Helvetica Neue", Helvetica, Arial, sans-serif;
+ padding:0 6px 0 0;
+ vertical-align:top;
+
+ span {
+ background:url(image-path("sprite1.png")) no-repeat 0 -350px;
+ float:left;
+ padding:4px 4px 6px 9px;
+ }
+ }
+ }
+
+ input[type=submit] {
+ background:url(image-path("sprite1.png")) no-repeat 0 -309px;
+ border:0;
+ color:#fff;
+ height:26px;
+ line-height:26px;
+ margin:0 0 0 7px;
+ padding:0 0 2px;
+ width:63px;
+ }
+ }
+ }
+}
+
+@mixin icons-list {
+ .icons-list {
+ font-size:0;
+ line-height:0;
+ list-style:none;
+ margin:0;
+ padding:0;
+
+ @include clearfix;
+
+ li {
+ background:none;
+ display:inline;
+ margin:0 10px 0 0;
+ padding:0;
+ vertical-align:middle;
+
+ img {
+ vertical-align:middle;
+ }
+ }
+ }
+}
View
5 app/controllers/home_controller.rb
@@ -1,6 +1,3 @@
class HomeController < ApplicationController
-
- def dashboard
- end
-
+ def dashboard; end
end
View
5 app/controllers/trip_tickets_controller.rb
@@ -29,6 +29,7 @@ def show
respond_to do |format|
format.html # show.html.erb
format.json { render json: @trip_ticket }
+ format.js
end
end
@@ -102,8 +103,8 @@ def compact_array_params
end
def massage_trip_ticket_trip_time_filter_values_for_form
- params[:trip_ticket_filters][:trip_time][:start] = parse_trip_ticket_trip_time(params[:trip_ticket_filters][:trip_time][:start], nil)
- params[:trip_ticket_filters][:trip_time][:end] = parse_trip_ticket_trip_time(params[:trip_ticket_filters][:trip_time][:end], nil)
+ params[:trip_ticket_filters][:trip_time][:start] = parse_trip_ticket_trip_time(params[:trip_ticket_filters][:trip_time][:start], nil).try(:strftime, "%Y-%m-%d %I:%M %P")
+ params[:trip_ticket_filters][:trip_time][:end] = parse_trip_ticket_trip_time(params[:trip_ticket_filters][:trip_time][:end], nil).try(:strftime, "%Y-%m-%d %I:%M %P")
end
def providers_for_lists
View
10 app/helpers/application_helper.rb
@@ -1,7 +1,13 @@
module ApplicationHelper
- def address_and_city(location)
+ def formatted_address_and_city(location)
unless location.blank?
- simple_format location.address_and_city
+ raw location.address_and_city('<br/>')
+ end
+ end
+
+ def formatted_address_city_and_zip(location)
+ unless location.blank?
+ raw location.address_city_and_zip('<br/>')
end
end
View
35 app/helpers/trip_tickets_helper.rb
@@ -2,4 +2,39 @@ module TripTicketsHelper
def providers_from_white_black_list(provider_ids)
raw Provider.where(:id => provider_ids).all.collect{|p| link_to p.name, provider_path(p)}.join(', ')
end
+
+ def customer_age(dob)
+ now = Time.now.utc.to_date
+ now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
+ end
+
+ def formatted_customer_identifiers(identifier_array)
+ unless identifier_array.blank?
+ simple_format identifier_array.reject(&:blank?).map(&:strip).join("\n")
+ end
+ end
+
+ def load_time_warning(customer_boarding_time)
+ if customer_boarding_time > 3
+ raw %Q(<img src="/assets/icon02.png" width="13" height="13" alt="" />)
+ end
+ end
+
+ def unload_time_warning(customer_deboarding_time)
+ if customer_deboarding_time > 3
+ raw %Q(<img src="/assets/icon02.png" width="13" height="13" alt="" />)
+ end
+ end
+
+ def load_unload_time_warning(customer_boarding_time, customer_deboarding_time)
+ if customer_boarding_time > 3 || customer_deboarding_time > 3
+ raw %Q(<img src="/assets/icon02.png" width="13" height="13" alt="" />)
+ end
+ end
+
+ def formatted_allowed_time_variance(allowed_time_variance)
+ if allowed_time_variance > 0
+ " +/- #{allowed_time_variance}"
+ end
+ end
end
View
8 app/models/location.rb
@@ -2,7 +2,11 @@ class Location < ActiveRecord::Base
attr_accessible :address_1, :address_2, :city, :position, :state, :zip
validates_presence_of :address_1, :city, :state, :zip
- def address_and_city
- [address_1, address_2, city].compact.map(&:strip).join("\n")
+ def address_and_city(separator = "\n")
+ [address_1, address_2, city].reject(&:blank?).map(&:strip).join(separator)
+ end
+
+ def address_city_and_zip(separator = "\n")
+ [address_1, address_2, [city, zip].reject(&:blank?).map(&:strip).join(' ')].reject(&:blank?).map(&:strip).join(separator)
end
end
View
22 app/models/trip_ticket.rb
@@ -66,7 +66,8 @@ class TripTicket < ActiveRecord::Base
validates_presence_of :customer_dob, :customer_first_name, :customer_last_name,
:customer_primary_phone, :customer_seats_required, :origin_customer_id,
- :origin_provider_id, :requested_drop_off_time, :requested_pickup_time
+ :origin_provider_id, :requested_drop_off_time, :requested_pickup_time,
+ :appointment_time
validates :customer_information_withheld, :inclusion => { :in => [true, false] }
validates :scheduling_priority, :inclusion => { :in => SCHEDULING_PRIORITY.keys }
@@ -120,7 +121,24 @@ def can_create_new_result?
end
def customer_full_name
- [customer_first_name, customer_middle_name, customer_last_name].reject(&:blank?).join(" ")
+ [customer_first_name, customer_middle_name, customer_last_name].reject(&:blank?).map(&:strip).join(" ")
+ end
+
+ def seats_required
+ "+ #{[num_attendants, customer_seats_required, num_guests].reject(&:blank?).sum}"
+ end
+
+ def ethnicity_and_race
+ vals = [customer_race, customer_ethnicity].reject(&:blank?)
+
+ case vals.size