Skip to content

Commit

Permalink
Merge pull request #138 from OpenDataSTL/develop
Browse files Browse the repository at this point in the history
Merge develop to master for 1.1.0 release
  • Loading branch information
abobwhite authored Jun 14, 2017
2 parents cb6b916 + b7c5063 commit c6fdeaf
Show file tree
Hide file tree
Showing 31 changed files with 265 additions and 223 deletions.
3 changes: 2 additions & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"directory": "bower_components"
"directory": "bower_components",
"strict-ssl": false
}
2 changes: 1 addition & 1 deletion app/data/questionAnswers.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ticket-faq":[
{"q":"I know I got a ticket but I can't find it in YourSTLCourts.",
"a":"Currently the municipalities listed below have opted to participate in YourSTLCourts. If you can't locate your ticket information, it may be that the court where you received your ticket is not participating in YourSTLCourts. We encourage you to call City Hall and/or court to ask that they participate in YourSTLCours. You can find contact information for any court in St. Louis County by clicking <a href=\"\\\">here</a>.",
"a":"Currently the municipalities listed below have opted to participate in YourSTLCourts. If you can't locate your ticket information, it may be that the court where you received your ticket is not participating in YourSTLCourts. We encourage you to call City Hall and/or court to ask that they participate in YourSTLCourts. You can find contact information for any court in St. Louis County by clicking <a href=\"\\\">here</a>.",
"keywords":[],
"fill-in":"supportedMunicipalities"},
{"q":"I know I need to appear in court soon. I lost my ticket but remember where I was pulled over. How can I find my court date and location?",
Expand Down
5 changes: 4 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<title>Your STL Courts</title>
<base href="/">
<meta name="description" content="">
<meta name="fragment" content="!">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale = 1.0">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="shortcut icon" href="images/favicon.ico">
Expand Down Expand Up @@ -91,14 +93,14 @@
<script src="bower_components/angular-touch/angular-touch.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
<script src="bower_components/angularjs-toaster/toaster.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/angular-ui-select/dist/select.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/leaflet/dist/leaflet-src.js"></script>
<script src="bower_components/angular-simple-logger/dist/angular-simple-logger.js"></script>
<script src="bower_components/angular-moment/angular-moment.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/Autolinker.js/dist/Autolinker.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<!-- endbower -->
<!-- endbuild -->

Expand Down Expand Up @@ -155,6 +157,7 @@
<script src="scripts/directives/scrollable.dir.js"></script>
<script src="scripts/directives/navBarMenuCloseable.dir.js"></script>
<script src="scripts/directives/loading.dir.js"></script>
<script src="scripts/directives/stlCourtsFocus.dir.js"></script>

<script src="scripts/components/stlCourtsHeader.comp.js"></script>
<script src="scripts/components/stlCourtsFooter.comp.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ angular.module('yourStlCourts').config(function ($stateProvider, $urlRouterProvi
}
})
.state('citations', {
url: '/citations/{citationId}',
url: '/tickets/{citationId}/info',
templateUrl: 'views/citations.html',
controller: 'CitationsCtrl as ctrl',
resolve: {
Expand All @@ -146,7 +146,7 @@ angular.module('yourStlCourts').config(function ($stateProvider, $urlRouterProvi
}
})
.state('noCitationsFound',{
url: '/citations/error/notFound',
url: '/tickets/error/notFound',
templateUrl: 'views/citationsNotFound.html',
controller: 'NoCitationsFoundCtrl as ctrl',
resolve: {
Expand Down
30 changes: 30 additions & 0 deletions app/scripts/controllers/citationInfo.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,39 @@

angular.module('yourStlCourts').controller('CitationInfoCtrl', function (faqData,$state, $window, citations,municipalities,courts,Courts,Session,moment,$anchorScroll) {
var ctrl = this;
var PLACEHOLDER_DL_NUM = "NO_DL_NUM";

ctrl.faqData = faqData;
ctrl.selectedCitation = null;
ctrl.paymentUrl = "";
ctrl.citationCourtLocations = {};
ctrl.groupedCitations = {};

ctrl.groupCitationsByDL = function(){
var dlNum = "";
var dlState = "";
var groupedCitations = {};

citations.forEach(function(citation){
dlNum = citation.drivers_license_number;
dlState = citation.drivers_license_state;
if (dlNum === ""){
//in the event the defendant does not have a DL Num assign one so the object has a key
dlNum = PLACEHOLDER_DL_NUM;
}
if (!groupedCitations[dlNum+dlState]){
groupedCitations[dlNum+dlState] = [];
}
groupedCitations[dlNum+dlState].push(citation);
});

return groupedCitations;
};

ctrl.issueMultiplePeopleWarning = function(){

return (_.size(ctrl.groupedCitations) > 1);
};

ctrl.selectCitation = function(citation,idToScrollTo){
ctrl.selectedCitation = citation;
Expand Down Expand Up @@ -44,6 +73,7 @@ angular.module('yourStlCourts').controller('CitationInfoCtrl', function (faqData
$state.go('home');
} else {
ctrl.citations = citations;
ctrl.groupedCitations = ctrl.groupCitationsByDL();
for(var citationCount = 0; citationCount < citations.length; citationCount++){
var courtId = citations[citationCount].court_id;
var foundCourt = _.find(courts, {id: courtId});
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/locationPickerMap.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ angular.module('yourStlCourts').controller('LocationPickerMapCtrl', function ($s
function getMunicipalityFromMapName(muniMapName){
function getName(nameString){
if (nameString.toLowerCase() == "unincorporated"){
nameString = "St. Louis County - Unincorporated";
nameString = "St. Louis County Municipal";
}

return nameString.replace("&", "and");
Expand Down
1 change: 1 addition & 0 deletions app/scripts/controllers/ticketFinder.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ angular.module('yourStlCourts').controller('TicketFinderCtrl', function (TicketF
ctrl.getDOB = function(){
if(ctrl.ticketForm.$valid) {
var modalInstance = $uibModal.open({
animation:false, //allows focus cursor to stay in input box on edge & IE browsers
templateUrl: 'views/dobPicker.html',
controller: 'dobPickerCtrl as ctrl',
size: 'sm'
Expand Down
15 changes: 13 additions & 2 deletions app/scripts/directives/stlCourtsDatepicker.dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ angular.module('yourStlCourts').directive('stlCourtsDatepicker', function($timeo
dateObject:'=?', //returns javascript Date
dateField:'=?', //returns date String formatted to "MM/dd/yyyy"
dateValid:'=?',
dateOver18:'=?'
dateOver18:'=?',
okButtonId:'@'
},
templateUrl: 'views/stlCourtsDatepicker.html',
controller: 'StlCourtsDatepicker as ctrl',
link: function($scope,element,attrs){
var scope = $scope;
var keys = {
backspace:8,
delete:46,
Expand Down Expand Up @@ -56,9 +58,14 @@ angular.module('yourStlCourts').directive('stlCourtsDatepicker', function($timeo
updateDateString();
if (numberOfExistingDigits === Number(maxLength)){
//tab to the next field
if ($(event.target).next("span") !== $()){
if ($(event.target).next("span").length !== 0){
clearInputElement($(event.target).next().next());
$(event.target).next().next().focus();
}else{
if (scope.okButtonId) {
//last date field is filled in go to OK button
$("#" + scope.okButtonId).focus();
}
}
}
}else{
Expand Down Expand Up @@ -152,6 +159,10 @@ angular.module('yourStlCourts').directive('stlCourtsDatepicker', function($timeo
uibDatePickerDateJustChangedDateString = true;
$scope.ctrl.dateString = formatDateObjToDateFormat();
loadDateStringToElement();
if (scope.okButtonId) {
//user just selected a date from the datePicker and it filled in the whole date
$("#" + scope.okButtonId).focus();
}
}else{
initialDTSet = false;
}
Expand Down
14 changes: 14 additions & 0 deletions app/scripts/directives/stlCourtsFocus.dir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

angular.module('yourStlCourts').directive('stlCourtsFocus', function ($timeout) {
return {
restrict: 'A',

link: function ($scope, element, attr) {
var scope = $scope;
$timeout(function(){
$(element).get(0).focus();
});
}
};
});
5 changes: 5 additions & 0 deletions app/scripts/services/Session.svc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ angular.module('yourStlCourts').factory('Session', function () {

function setLatestCitations(citations){
latestCitations = citations;
clearLastSelectedCitation();
}

function getLastSelectedCitation(){
Expand All @@ -19,6 +20,10 @@ angular.module('yourStlCourts').factory('Session', function () {
lastSelectedCitation = citation;
}

function clearLastSelectedCitation(){
lastSelectedCitation = null;
}

var svc = {
getLatestCitations: getLatestCitations,
setLatestCitations: setLatestCitations,
Expand Down
6 changes: 3 additions & 3 deletions app/styles/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}
@media screen and (min-width:901px){
.navbar-nav{
font-size: .9em;
font-size: .8em;
}

.navbar-nav{
Expand All @@ -88,7 +88,7 @@

@media screen and (min-width:1025px){
.navbar-nav{
font-size: 1.1em;
font-size: 1em;
}
}

Expand All @@ -113,7 +113,7 @@
.navbar-nav{
float:none !important;
display:inline-block;
font-size: .9em;
font-size: .7em;
}
.navbar{
margin-bottom:5px !important;
Expand Down
2 changes: 1 addition & 1 deletion app/styles/loading.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
.loadingContent {
width: 100px;
height: 100px;
position: absolute;
position: fixed;
left: 50%;
top: 50%;
margin: -50px 0 0 -50px;
Expand Down
17 changes: 15 additions & 2 deletions app/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ footer {
line-height: $footer-height;
}

@media screen and (max-width:767px){
footer {
text-align: center;
background-color: #333;
position: absolute;
left: 0;
bottom: 0;
height: auto;
width: 100%;
overflow:hidden;
}
}

p.address1{
padding-top:0px;
padding-bottom:0px;
Expand Down Expand Up @@ -219,14 +232,14 @@ $homepageTileHeight : 75px;
color:inherit;
}

.close{
.homepageTileClose.close{
position:absolute;
top:5px;
right:5px;
color:$white !important;
opacity: 1.0;
}
.close:hover{
.homepageTileClose.close:hover{
color:$white !important;
}

Expand Down
80 changes: 36 additions & 44 deletions app/views/citationInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,42 @@ <h1>Ticket Results</h1>
</div>
<div class="sub-page-container">
<div class="ticket-results-container container-fluid topMargin alignContainerToPage">
<div class="well well-sm warning-red-text" ng-if="ctrl.issueMultiplePeopleWarning()">Ticket results may be shown for multiple people.</div>
<div class="row alignRowToPage">
<div class="col-sm-12 alignColumnsToPageToPage">
<table class="table table-condensed table-bordered table-hover" ng-if="ctrl.citations.length > 1">
<thead>
<th class="hide-when-small-screen"></th>
<th>Ticket #</th>
<th>Name</th>
<th>Court Date</th>
<th>Court Location</th>
<th>Violations</th>
</thead>
<tbody>
<tr class="selectableRow" ng-repeat="citation in ctrl.citations" ng-class="{'selectedRow' : ctrl.citationSelected(citation)}" ng-click="ctrl.selectCitation(citation,'selectedCitationInfo')">
<td class="hide-when-small-screen center-block"><button class="btn btn-scheme-primary-invert" type="button" ng-click="ctrl.selectCitation(citation)">view</button></td>
<td class="hide-border-when-small"><div class="inline-div"><span class="label-for-small-screen table-item-label">Ticket #</span>{{citation.citation_number}}</div><span class="small-screen-view-button"><button class="btn btn-scheme-primary-invert" type="button" ng-click="ctrl.selectCitation(citation)">view this ticket</button></span></span></td>
<td class="hide-border-when-small"><span class="label-for-small-screen table-item-label">Name</span>{{citation.first_name}} {{citation.last_name}}</td>
<td class="hide-border-when-small"><span class="label-for-small-screen table-item-label">Court Date</span>{{ctrl.formatDate(citation.court_dateTime)}}</td>
<td class="hide-border-when-small"><span class="label-for-small-screen table-item-label ">Court Location</span>{{ctrl.citationCourtLocations[citation.court_id]}}</td>
<td class="hide-border-when-small">
<span class="label-for-small-screen table-item-label">Violations</span>
<span ng-repeat="violation in citation.violations" ng-if="ctrl.hasViolations(citation)">
{{violation.violation_description}}<span ng-if="$index < citation.violations.length - 1">, </span>
</span>
<span class="noViolations" ng-if="!ctrl.hasViolations(citation)">
Violation data unavailable. Please contact your court.
</span>
</td>
</tr>
</tbody>
</table>
<div ng-repeat="citationGrouping in ctrl.groupedCitations">
<h3 class="no-indent">
{{citationGrouping[0].first_name + " " + citationGrouping[0].last_name}}
</h3>
<table class="table table-condensed table-bordered table-hover" ng-if="ctrl.citations.length > 1">
<thead>
<th class="hide-when-small-screen"></th>
<th>Ticket #</th>
<th>Name</th>
<th>Court Date</th>
<th>Court Location</th>
<th>Violations</th>
</thead>
<tbody>
<tr class="selectableRow" ng-repeat="citation in citationGrouping" ng-class="{'selectedRow' : ctrl.citationSelected(citation)}" ng-click="ctrl.selectCitation(citation,'selectedCitationInfo')">
<td class="hide-when-small-screen center-block"><button class="btn btn-scheme-primary-invert" type="button" ng-click="ctrl.selectCitation(citation)">view</button></td>
<td class="hide-border-when-small"><div class="inline-div"><span class="label-for-small-screen table-item-label">Ticket #</span>{{citation.citation_number}}</div><span class="small-screen-view-button"><button class="btn btn-scheme-primary-invert" type="button" ng-click="ctrl.selectCitation(citation)">view this ticket</button></span></div></td>
<td class="hide-border-when-small"><span class="label-for-small-screen table-item-label">Name</span>{{citation.first_name}} {{citation.last_name}}</td>
<td class="hide-border-when-small"><span class="label-for-small-screen table-item-label">Court Date</span>{{ctrl.formatDate(citation.court_dateTime)}}</td>
<td class="hide-border-when-small"><span class="label-for-small-screen table-item-label ">Court Location</span>{{ctrl.citationCourtLocations[citation.court_id]}}</td>
<td class="hide-border-when-small">
<span class="label-for-small-screen table-item-label">Violations</span>
<span ng-repeat="violation in citation.violations" ng-if="ctrl.hasViolations(citation)">
{{violation.violation_description}}<span ng-if="$index < citation.violations.length - 1">, </span>
</span>
<span class="noViolations" ng-if="!ctrl.hasViolations(citation)">
Violation data unavailable. Please contact your court.
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Expand All @@ -47,7 +53,7 @@ <h2 class="no-indent">
<p class="address">{{ctrl.selectedCitation.defendant_address}}</p>
<p class="address">{{ctrl.selectedCitation.defendant_city}}, {{ctrl.selectedCitation.defendant_state}}</p>
</div>
<p class="zeroAboveBelow">Driver's License #: {{ctrl.selectedCitation.drivers_license_number}}</p>
<p class="zeroAboveBelow">Driver's License #: {{ctrl.selectedCitation.drivers_license_number}} - {{ctrl.selectedCitation.drivers_license_state}}</p>
<br>
</div>
<div class="col-sm-6 alignColumnsToPage">
Expand All @@ -65,24 +71,10 @@ <h2 class="no-indent">Ticket Info</h2>
<span class="italic" ng-if="ctrl.isMissingFineInfo(ctrl.selectedCitation)">
Fine Info Unavailable
</span>
<span id="fine-warning" class="citation-info-warning-note" ng-if="!ctrl.isMissingFineInfo(ctrl.selectedCitation)">
Note: this is the amount of your fine only. Your total will also include court fees.
</span>
<span id="mandatory-appearance-note" class="citation-info-warning-note warning-red-text" ng-if="!ctrl.showPaymentButton()">
Note: you must appear in court and speak with the judge to pay this citation.
</span>
</dd>
<!-- This section will be implemented at a later date
<dt>Total Court Fee</dt>
<dd>
<span ng-if="!ctrl.isMissingFeeInfo(ctrl.selectedCitation)">
${{ctrl.getFeeTotal(ctrl.selectedCitation)}}
</span>
<span class="italic" ng-if="ctrl.isMissingFeeInfo(ctrl.selectedCitation)">
Fee Info Unavailable
</span>
</dd>
-->
</dl>
</div>
</div>
Expand Down Expand Up @@ -117,7 +109,7 @@ <h2 class="no-indent">Court Information</h2>
<dt>Court Time</dt>
<dd>{{ctrl.formatTime(ctrl.selectedCitation.court_dateTime)}}</dd>
<dt>Court Name</dt>
<dd>{{ctrl.selectedCitation.court.name}} Court</dd>
<dd>{{ctrl.selectedCitation.court.name}}</dd>
<dt>Court Phone Number</dt>
<dd>{{ctrl.selectedCitation.court.phone}}<span ng-if="ctrl.selectedCitation.court.extension"> x{{ctrl.selectedCitation.court.extension}}</span></dd>
<dt>Court Location</dt>
Expand Down
Loading

0 comments on commit c6fdeaf

Please sign in to comment.