Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
Binary file added GOTHIC.TTF
Binary file not shown.
Binary file added back.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 59 additions & 24 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,85 @@
<body ng-app="directoryApp">
<div class="container">
<div class="row">
<h1>UF Directory App</h1>
<img src="logo.png" width="300px" height="120px">
</div>
<div class="row" ng-controller="ListingsController">
<div class="col-md-6">
<div class="input-group" id="searchBar">
<!--

Implement a way to filter through listings using the search bar

-->
<!----------------------------------------------------------------------
Implement a way to filter through listings using the search bar -->
<span class="input-group-addon" id="sizing-addon1"><span class="glyphicon glyphicon-search"></span></span>
<input type="text" class="form-control" placeholder="Search">
<input type="text" class="form-control" ng-model="searchMe" placeholder="Search">
<!--------------------------------------------------------------------->
</div>
<div class="tableWrapper">
<table class="table table-striped table-hover">
<table class="table table-striped table-hover table-dark">
<tr>
<th>Code</th>
<th width="15%">Code</th>
<th>Building Name</th>
<th></th>
</tr>
<!--

<!------------------------------------------------------------------------------------
Fill in the rest of the table:
* populate the rows with the code and name of each listing
* include a way to remove individual listings

-->
* include a way to remove individual listings -->
<tr ng-repeat="listings in listings | filter : searchMe | orderBy : 'code'" ng-click="showDetails($index)">
<div class="row" ng-controller="ListingsController">
<td>{{ listings.code }}</td>
<td>{{ listings.name }}</td>
<td><button type="button" ng-click="deleteListing($index)">Delete</button></td>
</div>
</tr>
<!----------------------------------------------------------------------------------->
</table>
</div>
<!--

Write an HTML form that adds new listings to the directory

-->
<!----------------------------------------------------------------------------------------
Write an HTML form that adds new listings to the directory -->
<br>
<div class="formSector">
<form>
<h3>Add To Directory</h3>
<table>
<tr>
<td><b>Code:</b>&emsp;
<input type="text" name="code" size="19" ng-model="code_in">
</td>
<td><b>&emsp;Name:</b>&emsp;
<input type="text" name="name" size="20" ng-model="name_in">
</td>
</tr>
<tr>
<td colspan="3"><br><b>Coordinates:</b>
&emsp;lat&emsp;<input type="text" name="latitude" size="10" ng-model="latitude_in">
&emsp;&emsp;long&emsp;<input type="text" name="longitude" size="10" ng-model="longitude_in"></td>
</tr>
<tr>
<td colspan="3"><br><b>Address:&emsp;</b>
<input type="text" name="address" size="50" ng-model="address_in">
</td>
</tr>
<tr>
<td colspan="3" align="center"><br><button type="submit" ng-click="addListing()">Add</button></td>
</tr>
</table>
</form>
</div>
<br><br>
<!-------------------------------------------------------------------------------------->
</div>
<div class="col-md-6">
<div class="jumbotron">
<h2>Detailed Information</h2>
<!--

<!--------------------------------------------------------------------------------------
Include a way to display detailed information about an individual listing:
* consider how to use ng-click within the the table to implement this feature

-->
* consider how to use ng-click within the the table to implement this feature -->
<b>&emsp;Code:</b> {{ detailedInfo.code }}<br>
<br><b>&emsp;Name:</b> {{ detailedInfo.name }}<br>
<br><b>&emsp;Coordinates:</b>
<br><b>&emsp;&emsp;&emsp;latitude</b>&emsp;&emsp;{{ detailedInfo.coordinates.latitude }}
<br><b>&emsp;&emsp;&emsp;longitude</b>&ensp;&nbsp;{{ detailedInfo.coordinates.longitude }}<br>
<br><b>&emsp;Address:</b> {{ detailedInfo.address}}<br><br>
<!------------------------------------------------------------------------------------->
</div>
</div>
</div>
Expand Down
28 changes: 25 additions & 3 deletions listingController.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,30 @@ angular.module('listings').controller('ListingsController', ['$scope', 'Listings
Implement these functions in the controller to make your application function
as described in the assignment spec.
*/
$scope.addListing = function() {};
$scope.deleteListing = function(index) {};
$scope.showDetails = function(index) {};
$scope.addListing = function() {
var submit = {
"code": $scope.code_in.toUpperCase(),
"name": $scope.name_in,
"coordinates": {
"latitude": $scope.latitude_in,
"longitude": $scope.longitude_in
},
"address": $scope.address_in
};
$scope.listings.push(submit);
$scope.code_in = '';
$scope.name_in = '';
$scope.latitude_in = '';
$scope.longitude_in = '';
$scope.address_in = '';
};

$scope.deleteListing = function(index) {
$scope.listings.splice(index, 1);
};

$scope.showDetails = function(index) {
$scope.detailedInfo = $scope.listings[index];
};
}
]);
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,48 @@
margin: 15px 10px;
}

@font-face {
font-family: CenturyGothic;
src: url(GOTHIC.ttf);
}

.tableWrapper {
max-height: 400px;
overflow: auto;
color: black;
font-family: CenturyGothic;
border: 3px solid black;
background-color: white;
}

th {
font-family: CenturyGothic;
font-size: 16px;
}

body {
background-image: url("back.jpg");
background-size: 120%;
background-position: center;
color: black;
font-family: CenturyGothic;
}

h1, h2 {
color: black
}

.jumbotron {
font-family: CenturyGothic;
}

.formSector {
background-color: white;
border-radius: 5px;
padding: 15px;
font-family: CenturyGothic;
}

.jumbotron {
padding: 5px;
}