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
from ..api import agency_api, jsonresp | |
# This is the server-side counterpart of the Actions.js file | |
from flask import session, request | |
from model import Session, Quote, AgencyPdf, AgencyTemplate, EmailMessage, EmailTemplate | |
from task_queue.async import pdf, email | |
import arrow | |
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
<form ng-submit="login()" novalidate name="loginForm"> | |
<div class="form-group" ng-class="{'has-error':loginForm.email.$invalid}"> | |
<input type="email" id="email" name="email" ng-model="email" class="form-control" placeholder="Email Address" required /> | |
</div> | |
<div class="form-group" ng-class="{'has-error':loginForm.password.$invalid}"> | |
<input type="password" id="password" name="password" ng-model="password" class="form-control" placeholder="Password" required /> | |
</div> | |
<div class="text-center form-group"> | |
<button class="btn btn-primary" type="submit" ng-disabled="loginForm.$invalid" ng-disabled="$loading">Login</button> | |
<button class="btn" type="reset" ng-disabled="!loginForm.$dirty || $loading">Reset</button> |
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
.factory('ItemSvc', ['$http', function ($http) { | |
this.$cache = {}; | |
this.get = function (id) { | |
this.$cache[id] = {}; | |
$http.get('/api/item/' + id).success(function (data) { | |
var cached = this.$cache[id]; | |
for (var k in data) { |
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
(function () { | |
'use strict'; | |
function ClientService($http) { | |
var self = this; | |
this.$cache = []; | |
this.$idx = 0; | |
this.get = function (id, readOnly) { | |
var ret = {}; |
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
(function () { | |
'use strict'; | |
function Model($http, config) { | |
this.$config = config; | |
this.$http = $http; | |
} | |
Model.prototype.$formatUrl = function (url, data) { | |
var ret = url; |
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
(function() { | |
'use strict'; | |
angular.module('MyApp') | |
.service('Client', ['Model', 'config', function (Model, config) { | |
var model = new Model($http, { | |
updateUrl: config.apiCall('api/client/:id'), | |
createUrl: config.apiCall('api/clients'), | |
getUrl: config.apiCall('api/client/:id'), | |
allUrl: config.apiCall('api/clients') |
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
(function(){ | |
'use strict'; | |
function ClientSelector(Client) { | |
var directive = {}; | |
directive.restrict = 'E'; | |
directive.replace = true; | |
directive.scope = { | |
model: '=ngModel', |
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
(function() { | |
'use strict'; | |
function ClientService(Model, config) { | |
var model = Model.config({ | |
updateUrl: config.apiCall('agency/client/:id'), | |
createUrl: config.apiCall('agency/clients'), | |
getUrl: config.apiCall('agency/client/:id'), | |
allUrl: config.apiCall('agency/clients') | |
}); |
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
(function(){ | |
'use strict'; | |
function ImageUpload(Media, config, $upload) { | |
var ret = {}; | |
ret.restrict = 'E'; | |
ret.replace = true; | |
ret.scope = { | |
model: '=ngModel', |
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
var gulp = require('gulp'), | |
plugins = require('gulp-load-plugins')({lazy:false}), | |
less = require('gulp-less'), | |
path = require('path'), | |
historyApiFallback = require('connect-history-api-fallback'), | |
inject = require('gulp-inject'), | |
jshint = require('gulp-jshint'), | |
concat = require('gulp-concat'), | |
uglify = require('gulp-uglify'), | |
minifyCSS = require('gulp-minify-css'), |