Skip to content

Commit

Permalink
Merge pull request Family-Thief#149 from SteelBurgher/searchCleanup
Browse files Browse the repository at this point in the history
Search cleanup
  • Loading branch information
SteelBurgher committed May 11, 2015
2 parents c986f15 + ce37a52 commit c42da64
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 87 deletions.
9 changes: 2 additions & 7 deletions client/app/allHelpRequest/allHelpRequest.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ angular.module('familyThiefApp')
$scope.user = Auth.getCurrentUser();

$scope.resultList = [];
$scope.searchResults = [];
$scope.searchString;

//search for a project containing the query strings
Expand All @@ -17,7 +16,7 @@ angular.module('familyThiefApp')
params: {search: $scope.searchString}
}).success(function(data, status) {
console.log(data);
$scope.searchResults = data;
$scope.resultList = data;
});
};

Expand All @@ -26,7 +25,6 @@ angular.module('familyThiefApp')
url: "api/allHelpRequests",
method: "GET",
}).success(function(data, status) {
console.log(data);
$scope.resultList = data;
});
};
Expand All @@ -41,8 +39,5 @@ angular.module('familyThiefApp')

});

//$scope.upvote = function() {
//$http({
//url: "api/helpRequest/votes",
//method: POST,


20 changes: 20 additions & 0 deletions client/app/allHelpRequest/allHelpRequest.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.search-list-item {
padding: 5px 5px;
margin-bottom: 10px;
height: 100px;
overflow: hidden;
border: 3px solid #47a447;
border-radius: 10px;
width: 70%;
margin: 20px auto;
}

.search-list-item:hover {
cursor: pointer;
background-color: #448BCA;
}

a.search-item {
color: black;
display: block;
}
51 changes: 19 additions & 32 deletions client/app/allHelpRequest/allHelpRequest.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,31 @@

<div class="container">
<div class="row">
<h2 class="page-header">Help Requests from Other Writers</h2>
<h2 class="page-header">Find Writing to Contribute To</h2>
</div>
<div class="row">
<div class="col-lg-6 col-lg-offset-3 text-center">
<a class="btn btn-success btn-md" ng-click="getRecentlySubmitted()">See Recent Help Requests</a>
<h2>or</h2>
<form name="searchForm" ng-submit="search()" novalidate>
<input type="text" class="form-control" ng-model="searchString" id="string" name="string" required>
<input type="submit" class="btn btn-primary" ng-disabled="searchForm.$invalid">
<input type="submit" class="btn btn-primary" value="search" ng-disabled="searchForm.$invalid">
</form>
</div>
</div>
<!--div class="row">
<a ng-click="loadHelpRequest(result.id)">
<div class="col-md-4">
{{result.title}}
</div>
<div class="col-md-4">
{{result.summary}}
</div>
<div class="col-md-2">
{{result.origDate}}
</div>
</a>
</div-->
<div class="row">
<div class="col-lg-6">
<h4 class="page-header">Title</h4>
<ul ng-repeat="result in resultList | limitTo: 25">
<a ng-click="loadHelpRequest(result.id)">{{result.title}}</a>
</ul>
</div>
<div class="col-lg-3">
<h4 class="page-header">Votes</h3>
<ul ng-repeat="result in resultList | limitTo: 25">
<li>{{result.summary}}</li>
</div>
<div class="col-lg-3">
<button type="button" class="btn btn-primary btn-md" ng-show="result.title" ng-click="">upvote</button>
</button>
<a class="search-item" ng-repeat="result in resultList | limitTo: 25 | orderBy: '-origDate'" ng-click='loadHelpRequest(result.id)'>
<div class="search-list-item">
<div class="row">
<div class="col-lg-4">
<p>{{result.title}}</p>
</div>
<div class="col-lg-6">
<p>{{result.summary}}</p>
</div>
<div class="col-lg-2">
<p>{{result.origDate | date:'yyyy-MM-dd'}}</p>
</div>
</div>
</div>
</div>
</div>
</a>
</divb>
3 changes: 2 additions & 1 deletion client/app/dashboard/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
border-radius: 10px;
}

.dash-list-item a {
a.list-item {
color: black;
display: block;
}

.dash-helpRequest .title {
Expand Down
71 changes: 24 additions & 47 deletions client/app/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,60 +20,37 @@ <h4 ng-show="user.votes > 0">You have {{user.votes}} likes for your writing!</h4
<div class="row">
<div class="col-lg-6">
<h3 class="page-header">Your Outstanding Help Requests <a class= "btn btn-primary btn-lg" href="/submission">Add New</a></h3>
<div class="dash-helpRequest dash-list-item" ng-repeat="request in user.helpRequests | orderBy: '-createdAt'">
<div class="row">
<a ng-click="loadHelpRequest(request.id)">
<div class="col-md-4 title">
{{request.title}}
<a class="list-item" ng-repeat="request in user.helpRequests | orderBy: '-createdAt'" ng-click="loadHelpRequest(request.id)">
<div class="dash-helpRequest dash-list-item">
<div class="row">
<div class="col-md-4 title">
{{request.title}}
</div>
<div class="col-md-4 summary">
{{request.summary}}
</div>
<div class="col-md-4 date">
{{request.createdAt | date:'yyyy-MM-dd'}}
</div>
</div>
<div class="col-md-4 summary">
{{request.summary}}
</div>
<div class="col-md-4 date">
{{request.createdAt | date:'yyyy-MM-dd'}}
</div>
</a>
</div>
</div>
</a>
</div>
<div class="col-lg-6">
<h3 class="page-header">Your contributions <a class= "btn btn-primary btn-lg" href="/allHelpRequest">Contribute</a></h3>
<div class="dash-contribution dash-list-item" ng-repeat="contribution in user.contributions | orderBy: '-origDate'">
<div class="row">
<a ng-click="loadContribution(contribution.id)">
<div class="col-md-8 title">
{{contribution.textSnippet}}
<a class="list-item" ng-repeat="contribution in user.contributions | orderBy: '-origDate'" ng-click='loadContribution(contribution.id)'>
<div class="dash-contribution dash-list-item">
<div class="row">
<div class="col-md-8 title">
{{contribution.textSnippet}}
</div>
<div class="col-md-4 date">
{{contribution.origDate | date:'yyyy-MM-dd'}}
</div>
</div>
<div class="col-md-4 date">
{{contribution.origDate | date:'yyyy-MM-dd'}}
</div>
</a>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="row search">
<div class="col-lg-6 col-lg-offset-3 text-center">
<form name="searchForm" ng-submit="search()" novalidate>
<label for="string"><h4 class="page-header">Search for a Project to Contribute to</h4></label>
<input type="text" class="form-control" ng-model="searchString" id="string" name="string" required>
<input type="submit" class="btn btn-primary" ng-disabled="searchForm.$invalid">
</form>
</div>
</div>
<div class="searchResult" ng-repeat="result in searchResults">
<div class="row">
<a ng-click="loadHelpRequest(result.id)">
<div class="col-md-4">
{{result.title}}
</div>
<div class="col-md-4">
{{result.summary}}
</div>
<div class="col-md-2">
{{result.origDate}}
</div>
</a>
</div>
</div>

0 comments on commit c42da64

Please sign in to comment.