mirror of
https://github.com/atlanticbiomedical/website.git
synced 2025-07-01 18:07:27 -04:00
Added pages support
This commit is contained in:
@ -22,11 +22,19 @@ angular.module('biomed-frontend', [
|
||||
templateUrl: 'app/layout.html'
|
||||
})
|
||||
.state('site.list', {
|
||||
url: '/',
|
||||
url: '/?page',
|
||||
templateUrl: 'app/list.html',
|
||||
controller: function($scope, $timeout, $sce, $location, $anchorScroll, Posts) {
|
||||
controller: function($scope, $timeout, $sce, $location, $anchorScroll, $stateParams, Posts) {
|
||||
$scope.posts = [];
|
||||
|
||||
var page = $stateParams.page;
|
||||
if (!page) {
|
||||
page = 'front';
|
||||
}
|
||||
|
||||
|
||||
console.log($stateParams);
|
||||
|
||||
var deferred = false;
|
||||
var more = true;
|
||||
var filter = undefined;
|
||||
@ -34,6 +42,7 @@ angular.module('biomed-frontend', [
|
||||
var loadNextPage = function() {
|
||||
if (more && (!deferred || deferred.$resolved)) {
|
||||
var query = {
|
||||
'pages': page,
|
||||
'status': 'posted',
|
||||
'sort': '-postedOn',
|
||||
'limit': 10,
|
||||
|
@ -4,7 +4,7 @@
|
||||
<ul class="title-area">
|
||||
<!-- Title Area -->
|
||||
<li class="name">
|
||||
<a href="/"><h1 class="logo"></h1></a>
|
||||
<a ui-sref="site.list({page:'front'})"><h1 class="logo"></h1></a>
|
||||
</li>
|
||||
<li class="toggle-topbar menu-icon">
|
||||
<a href="#">
|
||||
@ -25,7 +25,7 @@
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
<a href="http://v1.atlanticbiomedical.com/sales.php">Sales</a>
|
||||
<a ui-sref="site.list({page: 'sales'})">Sales</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
|
@ -25,7 +25,8 @@ var Post = new Schema({
|
||||
{ type: String }
|
||||
],
|
||||
status: { type: String },
|
||||
tags: [{ type: String }]
|
||||
tags: [{ type: String }],
|
||||
pages: [{ type: String }]
|
||||
});
|
||||
var PostModel = mongoose.model('Post', Post);
|
||||
|
||||
|
Reference in New Issue
Block a user