Skip to content

Commit

Permalink
Merge pull request pencilblue#929 from pencilblue/0.5.0
Browse files Browse the repository at this point in the history
0.5.0
  • Loading branch information
brianhyder committed Jan 23, 2016
2 parents 9a1e399 + 597742c commit 78b228a
Show file tree
Hide file tree
Showing 308 changed files with 14,638 additions and 4,692 deletions.
7 changes: 7 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
languages:
JavaScript: true
exclude_paths:
- "public/lib/**"
- "public/bower_components/**"
- "public/localization/**"
- "sample.config.js"
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public/media/
public/docs/
public/bower_components/
log/
coverage/
out
plugins/*
!plugins/pencilblue
Expand All @@ -19,7 +20,10 @@ plugins/*
!plugins/wp_import/**
**/node_modules
**/node_modules/**
config.js
config.json
**/.DS_Store
**/dump.rdb

config.js

npm-debug.log
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: node_js
node_js:
- "0.10"
- "0.11"
- "0.12"
- "iojs-1.4.2"
- "4.1"
- "iojs-3.3.1"
after_script:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- rm -rf ./coverage
- rm -rf ./coverage
sudo: false
74 changes: 74 additions & 0 deletions controllers/admin/base_admin_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
Copyright (C) 2015 PencilBlue, LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

module.exports = function BaseAdminControllerModule(pb) {
"use strict";

var util = pb.util;
var BaseController = pb.BaseController;

/**
* This class serves as a base class for all the controllers used in the admin control panel
* @class BaseAdminController
* @constructor
* @extends BaseController
*/
function BaseAdminController() {}
util.inherits(BaseAdminController, BaseController);

/**
* Initializes the admin controller with site-related info
* @override
* @method init
* @param {Object} props
* @param {Function} cb
*/
BaseAdminController.prototype.init = function (props, cb) {
var self = this;
BaseController.prototype.init.call(self, props, function () {
self.extendedInit(cb);
});
};

/**
* Initializes the admin controller with instance variables
* @override
* @method extendedInit
* @param {Function} cb
*/
BaseAdminController.prototype.extendedInit = function(cb) {
this.siteQueryService = new pb.SiteQueryService({site: this.site, onlyThisSite: true});
this.settings = pb.SettingServiceFactory.getServiceBySite(this.site, true);
cb();
};

/**
* Centralized place to obtain the pills to be displayed on top of the admin controller
*
* @param navKey
* @param localizationService
* @param activePill
* @param data
* @return {Object} pill objects for admin console with site pill at the beginning
*/
BaseAdminController.prototype.getAdminPills = function (navKey, localizationService, activePill, data) {
var pills = pb.AdminSubnavService.get(navKey, localizationService, activePill, data);
return pb.AdminSubnavService.addSiteToPills(pills, this.siteName);
};

return BaseAdminController;
};
2 changes: 1 addition & 1 deletion controllers/api/base_api_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module.exports = function(pb) {
* @param {String} rawOrder
* @return {Object} Contains the order statement and an array of failures
*/
BaseApiController.prototype.processOrder = function(rawOrder) {console.log(rawOrder);
BaseApiController.prototype.processOrder = function(rawOrder) {
var order = null;
var failures = [];

Expand Down
Loading

0 comments on commit 78b228a

Please sign in to comment.