Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for retrieving branding themes
- Loading branch information
Jordan Walsh
committed
Mar 15, 2017
1 parent
16c5b96
commit a1e6368
Showing
9 changed files
with
134 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var _ = require('lodash'), | ||
Entity = require('./entity'), | ||
logger = require('../logger') | ||
|
||
var BrandingThemeSchema = new Entity.SchemaObject({ | ||
BrandingThemeID: { type: String }, | ||
Name: { type: String }, | ||
SortOrder: { type: String }, | ||
CreatedDateUTC: { type: String } | ||
}); | ||
|
||
var BrandingTheme = Entity.extend(BrandingThemeSchema, { | ||
constructor: function(application, data, options) { | ||
logger.debug('BrandingTheme::constructor'); | ||
this.Entity.apply(this, arguments); | ||
}, | ||
initialize: function(data, options) {} | ||
}); | ||
|
||
|
||
module.exports = BrandingTheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var _ = require('lodash'), | ||
logger = require('../logger'), | ||
EntityHelper = require('./entity_helper'), | ||
BrandingTheme = require('../entities/brandingtheme'), | ||
util = require('util') | ||
|
||
var BrandingThemes = EntityHelper.extend({ | ||
constructor: function(application, options) { | ||
EntityHelper.call(this, application, Object.assign({ entityName: 'BrandingTheme', entityPlural: 'BrandingThemes' }, options)); | ||
}, | ||
getBrandingThemes: function(options, callback) { | ||
var self = this; | ||
var clonedOptions = _.clone(options || {}); | ||
clonedOptions.entityConstructor = function(data) { return new BrandingTheme(data) }; | ||
return this.getEntities(clonedOptions) | ||
}, | ||
getBrandingTheme: function(id) { | ||
return this.getBrandingThemes({ id: id }) | ||
.then(function(brandingThemes) { | ||
return _.first(brandingThemes); | ||
}) | ||
}, | ||
}) | ||
|
||
module.exports = BrandingThemes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h3>Branding Themes</h3> | ||
<table class="table table-bordered table-striped table-collapsed"> | ||
<thead> | ||
<tr> | ||
<td>ID</td> | ||
<td>Name</td> | ||
<td>SortOrder</td> | ||
<td>CreatedDateUTC</td> | ||
</tr> | ||
</thead> | ||
{{#each brandingthemes}} | ||
<tr> | ||
<td>{{ this.BrandingThemeID }}</td> | ||
<td>{{ this.Name }}</td> | ||
<td>{{ this.SortOrder }}</td> | ||
<td>{{ this.CreatedDateUTC }}</td> | ||
</tr> | ||
{{/each}} | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters