API service provider for DayWon CRM system.
##Sections
| def index(): | |
| motech_payload = get_stuff_from_motech() | |
| self.__format_payload(motech_payload, 'index') | |
| def __format_payload(self, payload, type): | |
| """ | |
| Call relevant restructuring methods for Motech response payload. | |
| :payload: JSON payload. | |
| :type: a string representing the type of request |
| def index(): | |
| motech_payload = get_payload_from_motech() | |
| payload = FormattedResponse(motech_payload, 'index') | |
| class FormattedResponse: | |
| def __init__(self, payload, type): | |
| if type == 'index': | |
| # perform index-related processing | |
| $.fn.utmMirror = function () { | |
| if (window.location.search) { | |
| var sep = this.attr('href').includes('?') ? '&' : '?'; | |
| this.attr('href', this.attr('href') + sep + window.location.search.substring(1)); | |
| } | |
| } |
| angular-breadcrumbs.min.js | |
| angular-cookies.min.js | |
| angular-resource.min.js | |
| angular-route.min.js | |
| angular-touch.min.js | |
| angular-ui-router.min.js | |
| angular-will-paginate.js | |
| angular.min.js | |
| angulartics-ga.min.js | |
| angulartics.min.js |
| source 'http://rubygems.org' | |
| # API Core | |
| ruby '2.0.0' | |
| gem 'rails', '~> 4.0.1' | |
| gem 'rails-api', '~> 0.1.0' | |
| gem 'rabl', '~> 0.9.1' | |
| gem 'json', '~> 1.8.1' | |
| gem 'oj', '~> 2.7.3' | |
| gem 'soft_deletion', '~> 0.5.6' |
| { | |
| "color_scheme": "Packages/User/base16-ocean.dark (SL) (Flake8Lint).tmTheme", | |
| "file_exclude_patterns": | |
| [ | |
| "*.pyc", | |
| "*.pyo", | |
| "*.exe", | |
| "*.dll", | |
| "*.obj", | |
| "*.o", |
| // MAIN | |
| export default class Main extends React.Component { | |
| render() { | |
| return ( | |
| <Router createReducer={reducerCreate}> | |
| <Scene key='root'> | |
| <Scene | |
| key='drawer' | |
| component={NavDrawer}> | |
| <Scene key="main" tabs={true}> |
| { | |
| "person": { | |
| "name": "foo", | |
| "score": 0.50 | |
| } | |
| } |
| 'use strict'; | |
| exports.handler = (event, context, callback) => { | |
| // Extract request from the CloudFront event that is sent to Lambda@Edge | |
| var request = event.Records[0].cf.request; | |
| // Match any '/' that occurs at the end of a URI. | |
| // Replace it with /index.html. | |
| if (request.uri.match(/^((?!\.(css|js|html|xml|txt|ico|jpg|png|gif|json|pdf)$).)*$/)) { | |
| request.uri = request.uri.replace(/\/$/, '/index.html'); |