Skip to content

Commit

Permalink
Merge pull request #113 from alanzfu/feature-feed-view-controller-ser…
Browse files Browse the repository at this point in the history
…vice

Feed View/Controllers, Bio/Edit View/Controllers
  • Loading branch information
urbantumbleweed committed Jan 11, 2016
2 parents bf75fff + e36d733 commit df2e748
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 41 deletions.
13 changes: 7 additions & 6 deletions client/app/client-profile/bio/bio.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<div class="color-block">
</div>
<div class="bio-container">
<img class='clientImage bio-image' src='https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/3/005/03e/23d/1878a7c.jpg'></img>
<img class='clientImage bio-image' src='{{bio.data.currentClient.client_image}}'></img>
<div class="bio-profile-main-info">
<h4 class="bio-name"> {{ bio.data.currentClient.client_name }} </h4>
<!-- change the a here -->
<a href="mailto:[email protected]" class="bio-email">[email protected]</a>
<a href="mailto:{{bio.data.currentClient.client_email}}" class="bio-email">{{bio.data.currentClient.client_email}}</a>
</div>
<ul class="bio-profile-details">
<li class="bio-list-item"> Location: {{bio.data.currentClient.zipcode}} </li>
<li class="bio-list-item"> Birthday: {{bio.data.currentClient.birthday}} </li>
<li class="bio-list-item"> Company: {{bio.data.currentClient.company}}

<li class="bio-list-item"> Company: {{bio.data.currentClient.client_company}} </li>
<li class="bio-list-item"> Title: {{bio.data.currentClient.client_title}} </li>
<li class="bio-list-item"> Location: {{bio.data.currentClient.client_zipcode}} </li>
<li class="bio-list-item"> Birthday: {{bio.data.currentClient.client_birthday}} </li>
<!--Add list items here as more things populate -->
</ul>

</div>
<div class="edit-bio">
<a ui-sref="new-client">Edit</a>
Expand Down
27 changes: 23 additions & 4 deletions client/app/client-profile/feed/feed.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
<div class='box style'>
<div class='client-container row' ng-repeat='feedEntry in dashboard.data.feed'>

<div class='article-container'>
<div class='client-container row ng-hide=true'>
<div class="col-sm-12">
<h4 class="feed-headline">Upcoming:<h4>
<h5>{{feed.fakeFeedData.message}}<h5>
</div>
</div>
<div class='client-container row'>
<div class='col-sm-12'>
<h4 class="feed-headline">Weather in {{feed.fakeFeedData.weather.name}}:</h4>
<img src="{{feed.fakeFeedData.weather.weather[0].iconUrl}}"></img>{{feed.fakeFeedData.weather.main.convertedTemp}} F, {{feed.fakeFeedData.weather.weather[0].description}}
</div>
</div>
<div class='client-container row'>
<div class="col-sm-12">
<h4 class="feed-headline">Company News:<h4>
<div class="row">
<div ng-repeat="article in feed.fakeFeedData.news" class="col-sm-12 article">
<a href="{{article.Url}}" target="_blank" "class="article-headline">{{article.Title}}</a>
<p class="article-description">{{article.Description}}</p>
</div>
</div>
</div>
</div>


</div>

47 changes: 44 additions & 3 deletions client/app/client-profile/feed/feedController.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
angular.module('client-recon.client-profile.feed', [])
.controller('FeedController', function ($scope, AppState, $state) {
var feed = this;
feed.data = AppState.state;
.controller('FeedController', function ($scope, AppState, $state, ClientsApi) {
this.fakeFeedData = {
'weather':{
"coord":{"lon":-122.42,"lat":37.77},
"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],
"base":"cmc stations",
"main":{"temp":285.15,"pressure":1023,"humidity":81,"temp_min":284.15,"temp_max":286.15},
"wind":{"speed":2.6,"deg":80},"clouds":{"all":75},"dt":1452470622,
"sys":{"type":1,"id":478,"message":0.0092,"country":"US","sunrise":1452525898,"sunset":1452561019},
"id":5391959,
"name":"San Francisco",
"cod":200
},
'news': [
{
"__metadata":{
"uri":"https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/News?Query='Adobe'&NewsSortBy='Date'&NewsCategory='rt_Business'&$skip=3&$top=1",
"type":"NewsResult"
},
"ID":"a2f61661-9242-43e3-b86f-d4d97f110260",
"Title":"Adobe Systems Incorporated (ADBE) Stake Reduced by Capital Investment Services of America",
"Url":"http://www.tickerreport.com/banking-finance/1202773/adobe-systems-incorporated-adbe-stake-reduced-by-capital-investment-services-of-america/",
"Source":"Ticker Report",
"Description":"Capital Investment Services of America lowered its position in Adobe Systems Incorporated (NASDAQ:ADBE) by 0.7% during the fourth quarter, according to its most recent 13F filing with the SEC. The institutional investor owned 175,415 shares of the software ...",
"Date":"2016-01-09T18:31:48Z"
},
{"__metadata":{"uri":"https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/News?Query='Adobe'&NewsSortBy='Date'&NewsCategory='rt_Business'&$skip=4&$top=1","type":"NewsResult"},"ID":"f15bcaaf-9267-4e8b-bd37-b9c729b63f04","Title":"Adobe preparing fixes for the Windows and OS X versions of Acrobat and Reader","Url":"http://betanews.com/2016/01/08/adobe-preparing-fixes-for-the-windows-and-os-x-versions-of-acrobat-and-reader/","Source":"Beta News","Description":"If you're an advanced user utilizing Adobe products then you likely know the inherent perils of some of the company's platforms. Adobe has gone as far as to instigate its own version of Patch Tuesday, and that will be rolling around in just a few days.","Date":"2016-01-08T20:34:40Z"},
{"__metadata":{"uri":"https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/News?Query='Adobe'&NewsSortBy='Date'&NewsCategory='rt_Business'&$skip=5&$top=1","type":"NewsResult"},"ID":"d12fd518-5d5c-42fc-98b3-9f47bb2a7874","Title":"Web Standards Evolution Drives Hybrid Apps: IDC Study","Url":"http://www.eweek.com/developer/web-standards-evolution-drives-hybrid-apps-idc-study.html","Source":"eWeek","Description":"Indeed, Hilwa points out that HTML5 is finally taking off as browser vendors support the standard more completely and as the industry, particularly advertisers, accelerates its shift from Adobe's Flash technology. \"These moves will open pathways for more ...","Date":"2016-01-10T16:43:14Z"},
{"__metadata":{"uri":"https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/News?Query='Adobe'&NewsSortBy='Date'&NewsCategory='rt_Business'&$skip=6&$top=1","type":"NewsResult"},"ID":"92e4e5cd-ab75-4360-a0ce-59a1dcdcdfb8","Title":"Spirit Air’s Ousted CEO Walks Away With $1 Million and Free Flights for Life","Url":"http://skift.com/2016/01/09/spirit-airs-ousted-ceo-walks-away-with-1-million-and-free-flights-for-life/","Source":"Skift","Description":"Video: Adobe’s Head of Industry Strategy on Creating the Next Golden Age of Travel Sponsored This content is created collaboratively with one of our sponsors. Michael Klein, Adobe’s Head of Industry Strategy, Travel & Retail spoke about the need to ...","Date":"2016-01-09T04:19:58Z"},
{"__metadata":{"uri":"https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/News?Query='Adobe'&NewsSortBy='Date'&NewsCategory='rt_Business'&$skip=7&$top=1","type":"NewsResult"},"ID":"ffb31841-abe9-4012-8ad5-332a1f11a819","Title":"Adobe Flash has begun to die","Url":"http://www.businessinsider.com/adobe-flash-has-begun-to-die-2015-12","Source":"The Business Insider","Description":"Deaths are rarely to be celebrated, but there is one passing that certainly won’t be widely mourned: that of Adobe’s Flash. 2015 was the year the bug ridden security flaw finally went into terminal decline. Once the darling of the new interactive web ...","Date":"2015-12-29T05:37:26Z"}
],
'message': 'His birthday is in 9 days.'
};

this.fakeFeedData.weather.main.temp = (this.fakeFeedData.weather.main.temp - 273) * 1.8 + 32;
this.fakeFeedData.weather.main.convertedTemp = this.fakeFeedData.weather.main.temp.toString().split('.')[0];
this.fakeFeedData.weather.weather[0].iconUrl = 'http://openweathermap.org/img/w/' + this.fakeFeedData.weather.weather[0].icon + '.png';
/*
ClientsApi.getFeed(1,this.data.currentClient.client_id)
.then(function(feed){
this.feed = feed;
});
*/
});

11 changes: 7 additions & 4 deletions client/app/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
<div class='client-wrapper container box-style'>
<div class='client-container row' ng-repeat="client in dashboard.data.clients" ng-click="dashboard.storeClient($index)">
<div class="col-sm-2">
<img class='clientImage' src='https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/3/005/03e/23d/1878a7c.jpg'></img>
<img class='clientImage' src='{{client.client_image}}'></img>
</div>
<div class="col-sm-10 client-text-summary clientInfo">
<h4 class='clientName'>{{client.client_name}}</h4>
<a href="mailto:[email protected]" class='clientEmail'>[email protected]</a>
<div class='clientTitle'>Sr. Associate Director of Solutioning</div>
<div class='clientCompany'>Yahoo! Talent Solutions</div>
<a href="mailto:[email protected]" class='clientEmail'>{{client.client_email}}</a>
<div class='clientTitle'>{{client.client_title}}</div>
<div class='clientCompany'>{{client.client_company}}</div>
</div>
</div>
<div class="add-new row client-container" ng-click="dashboard.addNew()">
+
</div>
</div>

8 changes: 7 additions & 1 deletion client/app/dashboard/dashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ angular.module('client-recon.dashboard', [])
var initializeClients = function () {
ClientsApi.getAll(1)
.then(function (clients) {
console.log(clients);
clients.map(function(client){
client.client_birthday = client.client_birthday.slice(0,10);
});
dashboard.data.clients = clients;
})
.catch(function (error) {
Expand All @@ -24,5 +26,9 @@ angular.module('client-recon.dashboard', [])
$state.go('client-profile.bio');
}

dashboard.addNew = function(index) {
$state.go('new-client');
}

initializeClients();
});
14 changes: 13 additions & 1 deletion client/app/edit-client/edit-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ <h4>Company</h4>
<input class="client-input" type='text' placeholder="Company" ng-model='editClientCtrl.newData.client_company'>
</div>
</div>
<div class='row client-company-input'>
<div class="col-sm-12">
<h4>Title</h4>
<input class="client-input" type='text' placeholder="Title" ng-model='editClientCtrl.newData.client_title'>
</div>
</div>
<div class='row client-zipcode-input'>
<div class="col-sm-12">
<h4>Zipcode</h4>
Expand All @@ -29,7 +35,13 @@ <h4>Zipcode</h4>
<div class='row client-birthday-input'>
<div class="col-sm-12">
<h4>Birthday</h4>
<input class="client-input" type='date' ng-model='editClientCtrl.newData.client_birthday'>
<input class="client-input" type='text' ng-model='editClientCtrl.newData.client_birthday'>
</div>
</div>
<div class='row client-image-input'>
<div class="col-sm-12">
<h4>Image Url</h4>
<input class="client-input" placeholder="http://website.com/image.png" type='text' ng-model='editClientCtrl.data.client_image'>
</div>
</div>
<div class='row client-form-submit'>
Expand Down
2 changes: 1 addition & 1 deletion client/app/edit-client/editClientController.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
angular.module('client-recon.edit-client', [])
.controller('EditClientController', function ($scope, $timeout, ClientsApi, AppState) {
.controller('EditClientController', function ($scope, $timeout, ClientsApi, AppState, $state) {
// TEMPLATE FOR DATA
this.data = AppState.state;
var successfulPost = this.success;
Expand Down
23 changes: 18 additions & 5 deletions client/app/new-client/new-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,51 @@
<div class='row client-name-input'>
<div class="col-sm-12">
<h4>Name</h4>
<input class="client-input" type='text' placeholder="e.g. John Smith" ng-model='newClientCtrl.data.name'>
<input class="client-input" type='text' placeholder="e.g. John Smith" ng-model='newClientCtrl.data.client_name'>
</div>
</div>
<div class='row client-email-input'>
<div class="col-sm-12">
<h4>Email</h4>
<input class="client-input" type='text' placeholder="[email protected]" ng-model='newClientCtrl.data.email'>
<input class="client-input" type='text' placeholder="[email protected]" ng-model='newClientCtrl.data.client_email'>
</div>
</div>
<div class='row client-company-input'>
<div class="col-sm-12">
<h4>Company</h4>
<input class="client-input" type='text' placeholder="Company" ng-model='newClientCtrl.data.company'>
<input class="client-input" type='text' placeholder="Company" ng-model='newClientCtrl.data.client_company'>
</div>
</div>
<div class='row client-company-input'>
<div class="col-sm-12">
<h4>Title</h4>
<input class="client-input" type='text' placeholder="Title" ng-model='newClientCtrl.data.client_title'>
</div>
</div>
<div class='row client-zipcode-input'>
<div class="col-sm-12">
<h4>Zipcode</h4>
<input class="client-input" type='text' placeholder="e.g. 94105"ng-model='newClientCtrl.data.zipcode'>
<input class="client-input" type='text' placeholder="e.g. 94105" ng-model='newClientCtrl.data.client_zipcode'>
</div>
</div>
<div class='row client-birthday-input'>
<div class="col-sm-12">
<h4>Birthday</h4>
<input class="client-input" type='date' ng-model='newClientCtrl.data.birthday'>
<input class="client-input" type='date' ng-model='newClientCtrl.data.client_birthday'>
</div>
</div>
<div class='row client-image-input'>
<div class="col-sm-12">
<h4>Image Url</h4>
<input class="client-input" placeholder="http://website.com/image.png" type='text' ng-model='newClientCtrl.data.client_image'>
</div>
</div>
<div class='row client-form-submit'>
<div class="col-sm-12">
<input class="client-input" type='submit' ng-show='newClientForm.$valid' ng-click='newClientCtrl.postClient()'>
</div>
</div>

</form>
<div class='successfulPostNotification' ng-show='newClientCtrl.succesfulPost'>
New Client Successfully Added!
Expand Down
6 changes: 4 additions & 2 deletions client/app/new-client/newClientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


angular.module('client-recon.new-client', [])
.controller('NewClientController', function ($scope, $timeout, ClientsApi, AppState) {
.controller('NewClientController', function ($scope, $timeout, ClientsApi, AppState, $state) {
// TEMPLATE FOR DATA
this.data = {
name:'',
Expand All @@ -18,8 +18,9 @@ angular.module('client-recon.new-client', [])

this.postClient = function () {
//DETECT USER ID FROM APP STATE
ClientsApi.addOne( 1,newClient).then(function(res){
ClientsApi.addOne(1,newClient).then(function(res){
// CALLED AFTER SUCCESSFUL POST
console.log(res);
successfulPost = true;
newClient.name = '';
newClient.email = '';
Expand All @@ -30,6 +31,7 @@ angular.module('client-recon.new-client', [])
// NOTIFICATION ONLY SHOW FOR A FEW SECONDS AND DISAPPEAR
$timeout(function(){
successfulPost = false;
$state.go('dashboard');
}, 2000);

})
Expand Down
4 changes: 2 additions & 2 deletions client/app/services/clientApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ angular.module('client-recon.services', [])

var editOne = function(user_id, editedClient){
//currently user is hard coded
return $http.put('/api/users/' + 1 + '/clients/' + editedClient.client_id, editedClient)
return $http.put('/api/users/' + user_id + '/clients/' + editedClient.client_id, editedClient)
.then(function(res){
return res.data;
});
}

var getFeed = function(user_id, client_id) {
//currently user is hard coded
return $http.get('/api/users/' + 1 + '/clients/' + user_id + '/feed')
return $http.get('/api/users/' + user_id + '/clients/' + user_id + '/feed')
.then(function(res){
return res.data;
});
Expand Down
12 changes: 4 additions & 8 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,24 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Client Recon</title>
<title>Frend.li</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,300,600,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Courgette:400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="styles/style.css">
</head>
<body>
<header>
<nav>
<div class="nav-bar row">
<div class="col-sm-4">
<div class="col-sm-12">
<ul class="nav-links-list">
<li class="nav-link"><a ui-sref="dashboard">Dashboard</a></li>
<li class="nav-link"><a ui-sref="new-client">New Client</a></li>
<!--<li class="nav-link"><a ui-sref="new-client">Add Client</a></li>-->
<li class="nav-link"><a ui-sref="dashboard">Frend.li</a></li>
</ul>
</div>
<div class="col-sm-4">
<!-- Logo? -->
</div>
<div class="col-sm-4 nav-link authentication">
<a href="#" ui-sref="authenticate">Log Out</a>
</div>
<div>
</nav>
</header>
Expand Down
33 changes: 29 additions & 4 deletions client/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ a:hover{
nav{
background-color: rgba(0,0,0,0.5);
font-weight: 300;
background-color: #293565;
letter-spacing: 0.4px;
-webkit-box-shadow: 0px 2px 7px 0px rgba(0,0,0,0.5);
-moz-box-shadow: 0px 2px 7px 0px rgba(0,0,0,0.5);
Expand All @@ -23,6 +22,7 @@ nav{
.nav-bar{
margin: 0px auto;
width: 1200px;
text-align: center;
}

.nav-bar ul{
Expand All @@ -36,12 +36,13 @@ nav{
}

.nav-link{
font-size: 1.3em;
padding: 10px 15px;
font-family: 'Courgette', 'Lato', sans-serif;
font-size: 1.8em;
padding: 0px 15px;
display: inline;
}

.nav-link:select{
link:active, link:visited{
text-decoration: none;
}

Expand All @@ -60,6 +61,13 @@ nav{
z-index: -1;
}

.add-new{
text-align: center;
padding: 10px 0px;
font-size: 1.5em;
font-weight:400;
}

.authentication{
text-align: right;
}
Expand Down Expand Up @@ -226,6 +234,23 @@ nav{


/* --------- CLIENT PROFILE.BIO VIEW --------- */
.article-container div:hover {
cursor: default;
background-color: white;
}


.article{
padding: 10px 20px;

}
.article-headline{
font-size: 0.9em;
margin-bottom: 5px;
}

.article-description{
font-size: 0.8em;
}


0 comments on commit df2e748

Please sign in to comment.