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