make it work

This commit is contained in:
Sam 2016-05-05 22:12:40 +03:00
parent 45939f32ce
commit 3315f8133c
18 changed files with 2997 additions and 1615 deletions

View file

@ -41,7 +41,7 @@
<link rel="stylesheet" href="/lib/angular-input-stars/angular-input-stars.css">
<link rel="stylesheet" href="/lib/jquery-ui/themes/flick/jquery-ui.css"/>
<link rel="stylesheet" href="/modules/core/css/github-fork-ribbon.css"/>
<!--[if lt IE 9]>
<link rel="stylesheet" href="gh-fork-ribbon.ie.css">
<![endif]-->
@ -70,7 +70,7 @@
<section class="content">
{% block content %}{% endblock %}
</section>
<script src="lib/file-saver.js/FileSaver.js" type="text/javascript"></script>
<!--Embedding The User Object-->
<script type="text/javascript">
@ -88,7 +88,7 @@
{% endfor %}
<!-- end Bower JS dependencies-->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js"></script>
<!--Application JavaScript Files-->
{% for jsFile in jsFiles %}
<script type="text/javascript" src="{{jsFile}}"></script>
@ -114,7 +114,7 @@
<p><a href="http://browsehappy.com" class="btn btn-primary btn-lg" role="button">Yes, upgrade my browser!</a></p>
</section>
<![endif] -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@ -124,7 +124,7 @@
ga('create', '{{google_analytics_id}}', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

View file

@ -33,7 +33,8 @@
"angular-busy": "^4.1.3",
"angular-input-stars": "https://github.com/whitef0x0/angular-input-stars.git#master",
"raven-js": "^3.0.4",
"tableExport.jquery.plugin": "^1.5.1"
"tableExport.jquery.plugin": "^1.5.1",
"angular-translate": "~2.11.0"
},
"resolutions": {
"angular-bootstrap": "^0.14.0",

View file

@ -4,7 +4,7 @@
* Module dependencies.
*/
var _ = require('lodash'),
glob = require('glob'),
gruntFile = require('grunt').file,
bowerFiles = require('main-bower-files'),
path = require('path'),
fs = require('fs');
@ -40,36 +40,15 @@ if( fs.existsSync('./config/env/api_keys.js') ){
* Get files by glob patterns
*/
module.exports.getGlobbedFiles = function(globPatterns, removeRoot) {
// For context switching
var _this = this;
// URL paths regex
var urlRegex = new RegExp('^(?:[a-z]+:)?\/\/', 'i');
// The output array
var output = [];
// If glob pattern is array so we use each pattern in a recursive way, otherwise we use glob
if (_.isArray(globPatterns)) {
globPatterns.forEach(function(globPattern) {
output = _.union(output, _this.getGlobbedFiles(globPattern, removeRoot));
var files = gruntFile.expand(globPatterns);
if (removeRoot) {
files = files.map(function(file) {
return file.replace(removeRoot, '');
});
} else if (_.isString(globPatterns)) {
if (urlRegex.test(globPatterns)) {
output.push(globPatterns);
} else {
var files = glob.sync(globPatterns);
if (removeRoot) {
files = files.map(function(file) {
return file.replace(removeRoot, '');
});
}
output = _.union(output, files);
}
}
return output;
return files;
};
module.exports.removeRootDir = function(files, root) {

31
config/env/all.js vendored
View file

@ -69,27 +69,42 @@ module.exports = {
},
assets: {
css: [
'public/modules/**/css/*.css'
'public/modules/**/css/*.css',
'!public/modules/**/demo/**/*.css',
'!public/modules/**/dist/**/*.css',
'!public/modules/**/node_modules/**/*.css'
],
js: [
'public/dist/populate_template_cache.js',
'public/config.js',
'public/application.js',
'public/config.js',
'public/application.js',
'public/*.js',
'public/modules/*/*.js',
'public/modules/*/*[!tests]*/*.js'
'public/modules/*/*/*.js',
'public/modules/**/*.js',
'!public/modules/**/gruntfile.js',
'!public/modules/**/demo/**/*.js',
'!public/modules/**/dist/**/*.js',
'!public/modules/**/node_modules/**/*.js',
'!public/modules/**/tests/**/*.js'
],
views: [
'public/modules/*/views/*.html',
'public/modules/*/views/*/*.html',
'public/modules/*/views/*/*/*.html',
'public/modules/**/*.html',
'!public/modules/**/demo/**/*.html',
'!public/modules/**/dist/**/*.html',
'!public/modules/**/node_modules/**/*.html',
'!public/modules/**/tests/**/*.html'
],
unit_tests: [
'public/lib/angular-mocks/angular-mocks.js',
'public/modules/*/tests/unit/*.js',
'public/modules/*/tests/unit/**/*.js',
'!public/modules/**/demo/**/*.js',
'!public/modules/**/node_modules/**/*.js'
],
e2e_tests: [
'public/modules/*/tests/e2e/**.js',
'!public/modules/**/demo/**/*.js',
'!public/modules/**/node_modules/**/*.js'
]
}
};

View file

@ -3,7 +3,7 @@
module.exports = {
baseUrl: process.env.BASE_URL || 'tellform.com',
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || 'localhost') + '/mean',
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://' + (process.env.DB_1_PORT_27017_TCP_ADDR || '192.168.99.100:27017') + '/mean',
options: {
user: '',
pass: process.env.MONGOLAB_PASS || ''

View file

@ -3,6 +3,10 @@ version: '2'
services:
db:
image: mongo:3.2
ports:
- "27017:27017"
volumes:
- mongo-data-wt:/data/db
web:
build: .
volumes:

View file

@ -7,16 +7,20 @@ module.exports = function(grunt) {
// Unified Watch Object
var watchFiles = {
serverViews: ['app/views/**/*.*'],
serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', '!app/tests/'],
clientViews: ['public/modules/**/views/**/*.html'],
clientJS: ['public/js/*.js', 'public/modules/**/*.js', '!public/modules/**/gruntfile.js', '!public/modules/**/demo/**/*.js', '!public/modules/**/dist/**/*.js', '!public/modules/**/lib/**/*.js'],
clientCSS: ['public/modules/**/*.css'],
clientViews: ['public/modules/**/views/**/*.html', '!public/modules/**/demo/**/*.html', '!public/modules/**/dist/**/*.html', '!public/modules/**/node_modules/**/*.html'],
clientJS: ['public/js/*.js', 'public/modules/**/*.js', '!public/modules/**/gruntfile.js', '!public/modules/**/demo/**/*.js', '!public/modules/**/dist/**/*.js', '!public/modules/**/node_modules/**/*.js'],
clientCSS: ['public/modules/**/*.css', '!public/modules/**/demo/**/*.css', '!public/modules/**/dist/**/*.css', '!public/modules/**/node_modules/**/*.css'],
serverTests: ['app/tests/**/*.js'],
clientTests: ['public/modules/**/tests/*.js'],
allTests: ['public/modules/**/tests/*.js', 'app/tests/**/*.js'],
clientTests: ['public/modules/**/tests/*.js', '!public/modules/**/demo/**/*.js', '!public/modules/**/dist/**/*.js', '!public/modules/**/node_modules/**/*.js']
};
watchFiles.allTests = watchFiles.serverTests.concat(watchFiles.clientTests);
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@ -234,7 +238,7 @@ module.exports = function(grunt) {
},
html2js: {
options: {
base: 'NodeForm',
base: 'public',
watch: true,
module: 'NodeForm.templates',
singleModule: true,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -3,7 +3,7 @@
angular.module('forms').directive('configureFormDirective', ['$rootScope', '$http', 'Upload', 'CurrentForm',
function ($rootScope, $http, Upload, CurrentForm) {
return {
templateUrl: 'modules/forms/views/directiveViews/form/configure-form.client.view.html',
templateUrl: 'modules/forms/admin/views/directiveViews/form/configure-form.client.view.html',
restrict: 'E',
scope: {
myform:'=',

View file

@ -3,7 +3,7 @@
angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormFields',
function ($rootScope, FormFields) {
return {
templateUrl: 'modules/forms/views/directiveViews/form/edit-form.client.view.html',
templateUrl: 'modules/forms/admin/views/directiveViews/form/edit-form.client.view.html',
restrict: 'E',
scope: {
myform:'='

View file

@ -3,7 +3,7 @@
angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope', '$http',
function ($rootScope, $http) {
return {
templateUrl: 'modules/forms/views/directiveViews/form/edit-submissions-form.client.view.html',
templateUrl: 'modules/forms/admin/views/directiveViews/form/edit-submissions-form.client.view.html',
restrict: 'E',
scope: {
myform:'=',

View file

@ -1,4 +1,4 @@
<div class="container" cg-busy="{promise:updatePromise,templateUrl:'modules/forms/views/directiveViews/cgBusy/update-form-message-TypeB.html',message:'Updating form...', backdrop:false, wrapperClass:'.busy-updating-wrapper'}"></div>
<div class="container" cg-busy="{promise:updatePromise,templateUrl:'modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html',message:'Updating form...', backdrop:false, wrapperClass:'.busy-updating-wrapper'}"></div>
<section class="container admin-form">
@ -33,7 +33,7 @@
<h2 class="hidden-md hidden-lg" data-ng-bind="myform.title" style="margin-bottom: 0px;"></h2>
</div>
<div class="col-xs-1 col-sm-2">
<small class="pull-right">
<small class="pull-right">
<button class="btn btn-danger" ng-click="openDeleteModal()">
<i class="fa fa-trash-o"></i>
<span class="hidden-xs">Delete</span>
@ -42,13 +42,13 @@
</small>
</div>
<div class="col-xs-1 col-sm-2">
<small class="pull-right">
<a class="btn btn-default view-form-btn" href="/#!/forms/{{myform._id}}" ng-if="myform.form_fields.length">
<small class="pull-right">
<a class="btn btn-default view-form-btn" href="/#!/forms/{{myform._id}}">
<span class="hidden-xs hidden-sm">
View
<span ng-show="myform.isLive">
Live
</span>
</span>
<span ng-hide="myform.isLive">Preview</span> Form
</span>
<span class="hidden-xs hidden-md hidden-lg">

View file

@ -11,6 +11,7 @@
"dependencies": {
"bootstrap": "~3",
"angular": "~1.4.7",
"angular-translate": "~2.11.0",
"angular-resource": "~1.4.7",
"angular-bootstrap": "~1.3.2",
"angular-ui-utils": "~3.0.0",

View file

@ -1,12 +1,14 @@
angular.module('forms', [
'duScroll', 'ngResource', 'NodeForm.templates', 'pascalprecht.translate',
'angular-input-stars'
'angular-input-stars',
'ui.select'
]);
angular.module('NodeForm', [
'ui.select', 'cgBusy', 'ngSanitize', 'vButton', 'ngResource',
'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'forms'
'ui.router', 'ui.bootstrap', 'ui.utils', 'ngRaven', 'forms',
'ui.select'
]);
angular.module('forms').factory('Auth', [

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
// Setting up route
angular.module('forms').config(['$stateProvider',
function($stateProvider) {
// Forms state routing
$stateProvider.
@ -26,7 +26,7 @@ angular.module('forms').config(['$stateProvider',
controllerAs: 'ctrl'
}).state('viewForm', {
url: '/forms/:formId/admin',
templateUrl: 'modules/forms/views/admin-form.client.view.html',
templateUrl: 'modules/forms/admin/views/admin-form.client.view.html',
data: {
permissions: [ 'editForm' ]
},
@ -39,16 +39,16 @@ angular.module('forms').config(['$stateProvider',
controller: 'AdminFormController'
}).state('viewForm.configure', {
url: '/configure',
templateUrl: 'modules/forms/views/adminTabs/configure.html'
templateUrl: 'modules/forms/admin/views/adminTabs/configure.html'
}).state('viewForm.design', {
url: '/design',
templateUrl: 'modules/forms/views/adminTabs/design.html'
templateUrl: 'modules/forms/admin/views/adminTabs/design.html'
}).state('viewForm.analyze', {
url: '/analyze',
templateUrl: 'modules/forms/views/adminTabs/analyze.html',
templateUrl: 'modules/forms/admin/views/adminTabs/analyze.html',
}).state('viewForm.create', {
url: '/create',
templateUrl: 'modules/forms/views/adminTabs/create.html'
templateUrl: 'modules/forms/admin/views/adminTabs/create.html'
});
}
]);

View file

@ -1,4 +1,7 @@
'use strict';
// Use Application configuration module to register a new module
ApplicationConfiguration.registerModule('forms', ['ngFileUpload', 'ui.router.tabs', 'ui.date', 'ui.sortable', 'angular-input-stars', 'users']);//, 'colorpicker.module' @TODO reactivate this module
ApplicationConfiguration.registerModule('forms', [
'ngFileUpload', 'ui.router.tabs', 'ui.date', 'ui.sortable',
'angular-input-stars', 'users', 'pascalprecht.translate'
]);//, 'colorpicker.module' @TODO reactivate this module