Merge branch '2.20' into fixSlowAnalyticsBug

This commit is contained in:
David Baldwynn 2017-11-13 14:51:53 -08:00
commit 28fe150149
23 changed files with 377 additions and 5861 deletions

5
.gitignore vendored
View File

@ -1,14 +1,10 @@
dist dist
.vagrant .vagrant
npm-debug.* npm-debug.*
docs/Oscar_Credentials.md
scripts/test_oscarhost.js scripts/test_oscarhost.js
scripts/oscarhost/private/
coverage/ coverage/
e2e_coverage/ e2e_coverage/
uploads/
app/e2e_tests/screeshots/* app/e2e_tests/screeshots/*
tmp
# iOS / Apple # iOS / Apple
# =========== # ===========
@ -25,6 +21,7 @@ Oscar_Credentials.*
npm-debug.log npm-debug.log
node_modules/ node_modules/
public/lib/ public/lib/
public/dist/
app/tests/coverage/ app/tests/coverage/
.bower-*/ .bower-*/
.idea/ .idea/

View File

@ -4,7 +4,7 @@ TellForm 2.1.0
[![Build Status](https://travis-ci.org/tellform/tellform.svg?branch=master)](https://travis-ci.org/tellform/tellform) [![Build Status](https://travis-ci.org/tellform/tellform.svg?branch=master)](https://travis-ci.org/tellform/tellform)
![Project Status](https://img.shields.io/badge/status-2.1.0-green.svg) ![Project Status](https://img.shields.io/badge/status-2.1.0-green.svg)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&utm_medium=referral&utm_content=tellform/tellform&utm_campaign=Badge_Grade) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&utm_medium=referral&utm_content=tellform/tellform&utm_campaign=Badge_Grade)
[![Gitter](https://badges.gitter.im/tellform/tellform.svg)](https://gitter.im/tellform/tellform?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Gitter](https://badges.gitter.im/tellform/Lobby.svg)](https://gitter.im/tellform/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
> An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires. > An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires.
@ -119,14 +119,7 @@ Your application should run on port 3000 or the port you specified in your .env
To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/). To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/).
Then run these commands Then see this page [here](https://tellform.com/install_docker) for commands on how to deploy your own local TellForm instance.
```
$ docker run -p 27017:27017 -d --name some-mongo mongo
$ docker run -p 127.0.0.1:6379:6379 -d --name some-redis redis
$ docker run --rm -p 3000:3000 --link some-redis:redis-db --link some-mongo:db -e "SUBDOMAINS_DISABLED=TRUE" -e "DISABLE_CLUSTER_MODE=TRUE" -e "MAILER_EMAIL_ID=<YourEmailAPI_ID>" -e "MAILER_FROM=<noreply@yourdomain.com>" -e "MAILER_SERVICE_PROVIDER=<YourEmailAPIProvider>" -e "MAILER_PASSWORD=<YourAPIKey>" -e "BASE_URL=localhost" -p 80:80 tellform/development
```
## Testing Your Application ## Testing Your Application
You can run the full test suite included with TellForm with the test task: You can run the full test suite included with TellForm with the test task:
@ -201,7 +194,7 @@ TellForm's configuration is done with environment variables. To set an option fo
## Where to get help ## Where to get help
[Gitter Chat](https://gitter.im/tellform/tellform) [Gitter Chat](https://gitter.im/tellform/Lobby)
[Official Twitter](https://twitter.com/tellform_real) [Official Twitter](https://twitter.com/tellform_real)

View File

@ -49,6 +49,10 @@ function BaseFieldSchema(){
Schema.apply(this, arguments); Schema.apply(this, arguments);
this.add({ this.add({
newOptionSchema: {
type: Boolean,
default: false
},
globalId: { globalId: {
type: String, type: String,
}, },
@ -72,6 +76,7 @@ function BaseFieldSchema(){
ratingOptions: RatingFieldSchema, ratingOptions: RatingFieldSchema,
fieldOptions: [FieldOptionSchema], fieldOptions: [FieldOptionSchema],
required: { required: {
type: Boolean, type: Boolean,
default: true default: true
@ -168,7 +173,6 @@ FormFieldSchema.pre('save', function(next) {
if(this.fieldType === 'dropdown' && this.isSubmission){ if(this.fieldType === 'dropdown' && this.isSubmission){
this.fieldValue = this.fieldValue.option_value; this.fieldValue = this.fieldValue.option_value;
} }
return next(); return next();
}); });

View File

@ -10,6 +10,7 @@ var mongoose = require('mongoose'),
timeStampPlugin = require('../libs/timestamp.server.plugin'), timeStampPlugin = require('../libs/timestamp.server.plugin'),
path = require('path'), path = require('path'),
querystring = require('querystring'); querystring = require('querystring');
constants = require('../libs/constants');
/** /**
* User Schema * User Schema

View File

@ -51,7 +51,7 @@ html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
block content block content
script window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;ga('create','{{google_analytics_id}}','auto');ga('send','pageview') script window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;ga('create','#{google_analytics_id}','auto');ga('send','pageview')
script(src='https://www.google-analytics.com/analytics.js', async='', defer='') script(src='https://www.google-analytics.com/analytics.js', async='', defer='')

View File

@ -28,9 +28,8 @@ module.exports = {
domain: process.env.BASE_URL || '.tellform.com' domain: process.env.BASE_URL || '.tellform.com'
}, },
assets: { assets: {
bower_js: 'public/dist/vendor.min.js', css: ['public/dist/application.min.css'],
css: 'public/dist/application.min.css', js: ['public/dist/application.min.js', 'public/dist/populate_template_cache.js'],
js: 'public/dist/application.min.js', form_js: ['public/dist/form-application.min.js', 'public/dist/form_populate_template_cache.js', 'public/dist/form-vendor.min.js']
form_js: 'public/dist/form-application.min.js'
} }
}; };

View File

@ -123,7 +123,7 @@ module.exports = function(grunt) {
compress: true compress: true
}, },
files: { files: {
'public/dist/vendor.min.js': bowerArray 'public/dist/form-vendor.min.js': bowerArray
} }
} }
}, },

View File

@ -22,6 +22,7 @@
"start": "grunt", "start": "grunt",
"test": "grunt test", "test": "grunt test",
"postinstall": "bower install --config.interactive=false", "postinstall": "bower install --config.interactive=false",
"travis": "grunt test:travis",
"init": "node scripts/setup.js" "init": "node scripts/setup.js"
}, },
"dependencies": { "dependencies": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,14 +20,9 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
state: fromState, state: fromState,
params: fromParams params: fromParams
} }
<<<<<<< HEAD
var statesToIgnore = ['home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success'];
=======
var statesToIgnore = ['', 'home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success']; var statesToIgnore = ['', 'home', 'signin', 'resendVerifyEmail', 'verify', 'signup', 'signup-success', 'forgot', 'reset-invalid', 'reset', 'reset-success'];
>>>>>>> 2.20
//Redirect to listForms if user is authenticated //Redirect to listForms if user is authenticated
if(statesToIgnore.indexOf(toState.name) > 0){ if(statesToIgnore.indexOf(toState.name) > 0){
if(Auth.isAuthenticated()){ if(Auth.isAuthenticated()){

View File

@ -49,6 +49,7 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
LOGIC_JUMP: 'Logic Jump', LOGIC_JUMP: 'Logic Jump',
SHOW_BUTTONS: 'Additional Buttons', SHOW_BUTTONS: 'Additional Buttons',
SAVE_START_PAGE: 'Save', SAVE_START_PAGE: 'Save',
ADD_OPTIONS_PLACEHOLDER: 'Add one choice per line. Minumum of one choice is required',
//Admin Form View //Admin Form View
ARE_YOU_SURE: 'Are you ABSOLUTELY sure?', ARE_YOU_SURE: 'Are you ABSOLUTELY sure?',

View File

@ -49,6 +49,7 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
LOGIC_JUMP: 'Saut logique', LOGIC_JUMP: 'Saut logique',
SHOW_BUTTONS: 'Boutons supplémentaires', SHOW_BUTTONS: 'Boutons supplémentaires',
SAVE_START_PAGE: "Enregistrer", SAVE_START_PAGE: "Enregistrer",
ADD_OPTIONS_PLACEHOLDER: "Ajouter un choix par ligne. Un minimum d'un choix est requis",
// Affichage du formulaire d'administration // Affichage du formulaire d'administration
ARE_YOU_SURE: 'Es-tu ABSOLUMENT sûr?', ARE_YOU_SURE: 'Es-tu ABSOLUMENT sûr?',

View File

@ -49,6 +49,7 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
LOGIC_JUMP: 'Logischer Sprung', LOGIC_JUMP: 'Logischer Sprung',
SHOW_BUTTONS: 'Zusätzliche Schaltflächen', SHOW_BUTTONS: 'Zusätzliche Schaltflächen',
SAVE_START_PAGE: 'Speichern', SAVE_START_PAGE: 'Speichern',
ADD_OPTIONS_PLACEHOLDER: 'Fügen Sie eine Auswahl pro Zeile hinzu. Mindestens eine Wahl ist erforderlich.',
// Admin-Formularansicht // Admin-Formularansicht
ARE_YOU_SURE: "Bist du ABSOLUT sicher?", ARE_YOU_SURE: "Bist du ABSOLUT sicher?",

View File

@ -49,6 +49,7 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
LOGIC_JUMP: 'Jump Logic', LOGIC_JUMP: 'Jump Logic',
SHOW_BUTTONS: 'Pulsanti aggiuntivi', SHOW_BUTTONS: 'Pulsanti aggiuntivi',
SAVE_START_PAGE: 'Salva', SAVE_START_PAGE: 'Salva',
ADD_OPTIONS_PLACEHOLDER: "Aggiungi una scelta per riga. È necessario un minimo di una scelta.",
// Visualizzazione modulo di amministrazione // Visualizzazione modulo di amministrazione
ARE_YOU_SURE: 'Sei ASSOLUTAMENTE sicuro?', ARE_YOU_SURE: 'Sei ASSOLUTAMENTE sicuro?',

View File

@ -49,6 +49,7 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
LOGIC_JUMP: 'Salto lógico', LOGIC_JUMP: 'Salto lógico',
SHOW_BUTTONS: 'Botones adicionales', SHOW_BUTTONS: 'Botones adicionales',
SAVE_START_PAGE: 'Grabar', SAVE_START_PAGE: 'Grabar',
ADD_OPTIONS_PLACEHOLDER: 'Agregue una opción por línea. Se requiere un mínimo de una opción',
//Admin Form View //Admin Form View
ARE_YOU_SURE: '¿Estás absolutamente seguro?', ARE_YOU_SURE: '¿Estás absolutamente seguro?',

View File

@ -36,22 +36,60 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
animation: true, animation: true,
templateUrl: 'editFieldModal.html', templateUrl: 'editFieldModal.html',
windowClass: 'edit-modal-window', windowClass: 'edit-modal-window',
scope: $scope,
controller: function($uibModalInstance, $scope) { controller: function($uibModalInstance, $scope) {
$scope.field = curr_field; var fieldOptionsToString = function(){
$scope.showLogicJump = false; if(!$scope.field.fieldOptions){
return '';
}
return $scope.field.fieldOptions.map(function(fieldOption){
return fieldOption.option_value;
}).join('\n');
}
$scope.field = curr_field;
$scope.isEdit = isEdit; $scope.isEdit = isEdit;
$scope.options = {
isEdit: isEdit,
fieldOptionsString: fieldOptionsToString()
}
var stringToFieldOptions = function(fieldOptionsString){
var values = fieldOptionsString.split('\n');
var fieldOptions = [];
for(var i=0; i < values.length; i++){
fieldOptions.push({
option_value: values[i]
});
}
return fieldOptions;
}
$scope.$watch('options.fieldOptionsString', function(newVal, oldVal){
if(newVal !== oldVal){
$scope.field.fieldOptions = stringToFieldOptions(newVal);
}
});
// decides whether field options block will be shown (true for dropdown and radio fields) // decides whether field options block will be shown (true for dropdown and radio fields)
$scope.showAddOptions = function (field){ $scope.showListOptions = function () {
if($scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'checkbox' || $scope.field.fieldType === 'radio'){ if($scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'radio'){
return true; return true;
} else {
return false;
} }
return false;
}; };
$scope.validShapes = [ // decides whether field options block will be shown (true for rating fields)
$scope.showRatingOptions = function (){
if($scope.field.fieldType === 'rating'){
return true;
}
return false;
};
$scope.validShapes = [
'Heart', 'Heart',
'Star', 'Star',
'thumbs-up', 'thumbs-up',
@ -67,42 +105,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
'Trash' 'Trash'
]; ];
// add new option to the field //Name to Font-Awesome Conversion Map
$scope.addOption = function(){
if($scope.field.fieldType === 'checkbox' || $scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'radio'){
if(!$scope.field.fieldOptions){
$scope.field.fieldOptions = [];
}
var lastOptionID = $scope.field.fieldOptions.length+1;
// new option's id
var newOption = {
'option_id' : Math.floor(100000*Math.random()),
'option_title' : 'Option '+lastOptionID,
'option_value' : 'Option ' +lastOptionID
};
// put new option into fieldOptions array
$scope.field.fieldOptions.push(newOption);
}
};
// delete particular option
$scope.deleteOption = function (option){
if($scope.field.fieldType === 'checkbox' || $scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'radio'){
for(var i = 0; i < $scope.field.fieldOptions.length; i++){
if($scope.field.fieldOptions[i].option_id === option.option_id){
$scope.field.fieldOptions.splice(i, 1);
break;
}
}
}
};
//Populate Name to Font-awesomeName Conversion Map
$scope.select2FA = { $scope.select2FA = {
'Heart': 'Heart', 'Heart': 'Heart',
'Star': 'Star', 'Star': 'Star',
@ -119,17 +122,12 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
'Trash': 'Trash Can' 'Trash': 'Trash Can'
}; };
// decides whether field options block will be shown (true for dropdown and radio fields) if($scope.field.fieldType === 'dropdown' || $scope.field.fieldType === 'radio'){
$scope.showRatingOptions = function (){
if($scope.field.fieldType === 'rating'){ }
return true;
} else {
return false;
}
};
$scope.saveField = function(){ $scope.saveField = function(){
if($scope.isEdit){ if($scope.options.isEdit){
$scope.myform.form_fields[field_index] = $scope.field; $scope.myform.form_fields[field_index] = $scope.field;
} else { } else {
$scope.myform.form_fields.push(curr_field); $scope.myform.form_fields.push(curr_field);
@ -293,7 +291,7 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
required: true, required: true,
disabled: false, disabled: false,
deletePreserved: false, deletePreserved: false,
logicJump: {} logicJump: {},
}; };
if(fieldType === 'rating'){ if(fieldType === 'rating'){
@ -304,36 +302,15 @@ angular.module('forms').directive('editFormDirective', ['$rootScope', 'FormField
newField.fieldValue = 0; newField.fieldValue = 0;
} }
if($scope.showAddOptions(newField)){ if(fieldType === 'dropdown' || fieldType === 'radio'){
newField.fieldOptions = []; newField.fieldOptions = [{
newField.fieldOptions.push({ option_value: 'Option1'
'option_id' : Math.floor(100000*Math.random()), //Generate pseudo-random option id }];
'option_title' : 'Option 0',
'option_value' : 'Option 0'
});
} }
$scope.openEditModal(newField, false, $scope.myform.form_fields.length); $scope.openEditModal(newField, false, $scope.myform.form_fields.length);
}; };
// decides whether field options block will be shown (true for dropdown and radio fields)
$scope.showAddOptions = function (field){
if(field.fieldType === 'dropdown' || field.fieldType === 'checkbox' || field.fieldType === 'radio'){
return true;
} else {
return false;
}
};
// decides whether field options block will be shown (true for dropdown and radio fields)
$scope.showRatingOptions = function (field){
if(field.fieldType === 'rating'){
return true;
} else {
return false;
}
};
// Delete particular field on button click // Delete particular field on button click
$scope.deleteField = function (field_index) { $scope.deleteField = function (field_index) {
$scope.myform.form_fields.splice(field_index, 1); $scope.myform.form_fields.splice(field_index, 1);

View File

@ -1,18 +1,11 @@
'use strict'; 'use strict';
//TODO: DAVID: URGENT: Make this a $resource that fetches valid field types from server //TODO: DAVID: URGENT: Make this a $resource that fetches valid field types from server
<<<<<<< HEAD
angular.module('forms').service('FormFields', [ '$rootScope', '$translate', '$window',
function($rootScope, $translate, $window) {
console.log($window.user);
$translate.use($window.user.language);
=======
angular.module('forms').service('FormFields', [ '$rootScope', '$translate', 'Auth', angular.module('forms').service('FormFields', [ '$rootScope', '$translate', 'Auth',
function($rootScope, $translate, Auth) { function($rootScope, $translate, Auth) {
var language = Auth.ensureHasCurrentUser().language; var language = Auth.ensureHasCurrentUser().language;
$translate.use(language); $translate.use(language);
>>>>>>> 2.20
this.types = [ this.types = [
{ {

View File

@ -1,296 +1,5 @@
<form class="row" name="editForm" > <form class="row" name="editForm" >
<!-- Edit EndPage Modal Dialog Template -->
<script type="text/ng-template" id="editEndPageModal.html" class="edit-endpage-modal">
<div class="modal-body">
<div class="row">
<div class="edit-panel col-md-6 col-xs-12 col-sm-12">
<div class="row modal-header">
<h2 class="modal-title hidden-md hidden-lg">{{ 'EDIT_END_PAGE' | translate }}</h2>
<h3 class="modal-title hidden-xs hidden-sm">{{ 'EDIT_END_PAGE' | translate }}</h3>
</div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'TITLE' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.endPage.title" required>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'PARAGRAPH' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<textarea class="form-control" type="text"
ng-model="myform.endPage.paragraph"></textarea>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'BTN_TEXT' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.endPage.buttonText" required>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<div class="col-md-4 col-xs-12 field-input">{{ 'SHOW_BUTTONS' | translate }}</div>
<div class="col-md-8 col-xs-12 field-input">
<label class="switch-light switch-holo" onclick="">
<input type="checkbox" ng-model="showButtons">
<span>
<span> {{ 'OFF' | translate }}</span>
<span> {{ 'ON' | translate }}</span>
<a></a>
</span>
</label>
</div>
</div>
<div class="row options buttons" ng-if="showButtons">
<div class="col-md-3 col-xs-12">{{ 'BUTTONS' | translate }}:</div>
<div class="col-md-9 col-xs-12">
<div ng-repeat="button in myform.endPage.buttons track by button._id" class="row" style="padding-bottom:1em;">
<div class="col-xs-5">
<span>{{ 'BUTTON_TEXT' | translate }}</span>
<input type="text"
name="{{button.text}}_buttonText_startPage"
ng-model="button.text"
value="{{button.text}}"
placeholder="{{ 'BUTTON_TEXT' | translate }}">
</div>
<div class="col-xs-5">
<span>{{ 'BUTTON_LINK' | translate }}</span>
<input type="text"
name="{{button.url}}_url_startPage"
ng-model="button.url"
value="{{button.url}}"
placeholder="http://aeouaou.com/aoeuoa">
</div>
<div class="col-xs-2">
<a class="btn btn-danger btn-mini right" type="button" ng-click="deleteButton(button)">
<i class="fa fa-trash-o"></i>
</a>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<button class="btn btn-primary btn-small col-md-offset-6 col-md-6 col-sm-4 col-sm-offset-8 col-xs-4 col-xs-offset-8" type="button" ng-click="addButton()">
<i class="icon-plus icon-white"></i> {{ 'ADD_BUTTON' | translate }}
</button>
</div>
</div>
</div>
<div class="modal-footer row">
<button type="submit" ng-click="saveEndPage()" class="btn btn-signup btn-rounded">
{{ 'SAVE_START_PAGE' | translate }}
</button>
<button ng-click="cancel()" class="btn btn-secondary btn-rounded">
{{ 'CANCEL' | translate }}
</button>
</div>
</div>
<div class="preview-field-panel col-md-6 hidden-sm hidden-xs">
<form class="public-form">
<div class="row">
<div class="col-xs-12 text-center" style="overflow-wrap: break-word;">
<h1 style="font-weight: 400; font-size: 25px;">
{{myform.endPage.title}}
</h1>
</div>
<div class="col-xs-10 col-xs-offset-1 text-center" style="overflow-wrap: break-word;">
<p style="color: grey; font-weight: 100; font-size: 16px;">
{{myform.endPage.paragraph}}
</p>
</div>
</div>
<div class="row form-actions text-center" style="padding: 5px 25px 5px 25px;">
<button ng-click="reloadForm()" class="btn" type="button"
ng-style="{'background-color':myform.design.colors.buttonColor, 'color':myform.design.colors.buttonTextColor}">
<span style="font-size: 1.6em;">
{{myform.endPage.buttonText}}
</span>
</button>
</div>
<div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em;">
<p ng-repeat="button in myform.endPage.buttons" class="text-center" style="display:inline;">
<button class="btn" style="background-color:rgb(156, 226, 235)" type="button" ng-style="{'background-color':button.bgColor, 'color':button.color}">
<a href="{{button.url}}"
style="font-size: 1.6em; text-decoration: none;"
ng-style="{'color':button.color}">
{{button.text}}
</a>
</button>
</p>
</div>
</form>
</div>
</div>
</div>
</script>
<!-- Edit StartPage Modal Dialog Template -->
<script type="text/ng-template" id="editStartPageModal.html" class="edit-startpage-modal">
<div class="modal-body">
<div class="row">
<div class="edit-panel col-md-6 col-xs-12 col-sm-12">
<div class="row modal-header">
<h2 class="modal-title hidden-md hidden-lg">{{ 'EDIT_START_PAGE' | translate }}</h2>
<h3 class="modal-title hidden-xs hidden-sm">{{ 'EDIT_START_PAGE' | translate }}</h3>
</div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'INTRO_TITLE' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.startPage.introTitle"
name="introTitleStartPage" required>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'INTRO_PARAGRAPH' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<textarea class="form-control" type="text"
ng-model="myform.startPage.introParagraph"
name="introParagraphStartPage"></textarea>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'INTRO_BTN' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.startPage.introButtonText"
name="introButtonText" required>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<div class="col-md-4 col-xs-12 field-input">{{ 'SHOW_BUTTONS' | translate }}</div>
<div class="col-md-8 col-xs-12 field-input">
<label class="switch-light switch-holo" onclick="">
<input type="checkbox" ng-model="showButtons">
<span>
<span> {{ 'OFF' | translate }}</span>
<span> {{ 'ON' | translate }}</span>
<a></a>
</span>
</label>
</div>
</div>
<div class="row options buttons" ng-if="showButtons">
<div class="col-md-3 col-xs-12">{{ 'BUTTONS' | translate }}:</div>
<div class="col-md-9 col-xs-12">
<div ng-repeat="button in myform.startPage.buttons track by button._id" class="row" style="padding-bottom:1em;">
<div class="col-xs-5">
<span>{{ 'BUTTON_TEXT' | translate }}</span>
<input type="text"
name="{{button.text}}_buttonText_startPage"
ng-model="button.text"
value="{{button.text}}"
placeholder="{{ 'BUTTON_TEXT' | translate }}">
</div>
<div class="col-xs-5">
<span>{{ 'BUTTON_LINK' | translate }}</span>
<input type="text"
name="{{button.url}}_url_startPage"
ng-model="button.url"
value="{{button.url}}"
placeholder="http://aeouaou.com/aoeuoa">
</div>
<div class="col-xs-2">
<a class="btn btn-danger btn-mini right" type="button" ng-click="deleteButton(button)">
<i class="fa fa-trash-o"></i>
</a>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<button class="btn btn-primary btn-small col-md-offset-6 col-md-6 col-sm-4 col-sm-offset-8 col-xs-4 col-xs-offset-8" type="button" ng-click="addButton()">
<i class="icon-plus icon-white"></i> {{ 'ADD_BUTTON' | translate }}
</button>
</div>
</div>
</div>
<div class="modal-footer row">
<button type="submit" ng-click="saveStartPage()" class="btn btn-signup btn-rounded">
{{ 'SAVE_START_PAGE' | translate }}
</button>
<button ng-click="cancel()" class="btn btn-secondary btn-rounded">
{{ 'CANCEL' | translate }}
</button>
</div>
</div>
<div class="preview-field-panel col-md-6 hidden-sm hidden-xs">
<form class="public-form">
<div class="field row">
<div class="col-xs-12 text-center" style="overflow-wrap: break-word;">
<h1>{{myform.startPage.introTitle}}</h1>
</div>
<div class="col-xs-10 col-xs-offset-1 text-left" style="overflow-wrap: break-word;">
<p style="color:#ddd;">{{myform.startPage.introParagraph}}</p>
</div>
</div>
<div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em;">
<p ng-repeat="button in myform.startPage.buttons" class="text-center" style="display:inline;">
<button class="btn btn-info" type="button" ng-style="{'background-color':button.bgColor, 'color':button.color}">
<a href="{{button.url}}" style="font-size: 1.6em; text-decoration: none; color: inherit;" >
{{button.text}}
</a>
</button>
</p>
</div>
<div class="row form-actions">
<button class="btn btn-info btn btn-info col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3" type="button">
<span style="color:white; font-size: 1.6em; text-decoration: none;">
{{myform.startPage.introButtonText}}
</span>
</button>
</div>
</form>
</div>
</div>
</div>
</script>
<!-- Edit Field Modal Dialog Template --> <!-- Edit Field Modal Dialog Template -->
<script type="text/ng-template" id="editFieldModal.html" class="edit-field-modal"> <script type="text/ng-template" id="editFieldModal.html" class="edit-field-modal">
<div class="modal-body"> <div class="modal-body">
@ -308,33 +17,22 @@
<div class="row"><br></div> <div class="row"><br></div>
<div class="row description" ng-hide="showRatingOptions()"> <div class="row description question" ng-hide="showRatingOptions(field)">
<div class="col-md-12 bold">{{ 'QUESTION_DESCRIPTION' | translate }}</div> <div class="col-md-12 bold">{{ 'QUESTION_DESCRIPTION' | translate }}</div>
<div class="col-md-12"> <div class="col-md-12">
<textarea type="text" class="form-control" ng-model="field.description" name="description{{field._id}}"value="{{field.description}}"></textarea> <textarea type="text" class="form-control" ng-model="field.description" name="description{{field._id}}"value="{{field.description}}"></textarea>
</div> </div>
</div> </div>
<div class="row" ng-show="showAddOptions()"><br></div> <div class="row" ng-if="showListOptions()"><br></div>
<div class="row options" ng-if="showAddOptions()"> <div class="row options question" ng-if="showListOptions()">
<div class="col-md-4 col-xs-12">{{ 'OPTIONS' | translate }}</div> <div class="col-md-4 col-xs-12">{{ 'OPTIONS' | translate }}</div>
<div class="col-md-8 col-xs-12"> <div class="col-md-8 col-xs-12">
<div ng-repeat="option in field.fieldOptions track by option.option_id" class="row"> <textarea type="text" class="form-control" ng-model="options.fieldOptionsString" ng-value="fieldOptionsString" name="options{{field._id}}" placeholder="{{ 'ADD_OPTIONS_PLACEHOLDER' | translate }}" required="true"></textarea>
<input type="text" name="{{option.option_value}}{{field._id}}" ng-model="option.option_value" class="col-xs-5">
<a class="btn btn-danger btn-mini right" type="button" ng-click="deleteOption(option)" class="col-xs-3">
<i class="fa fa-trash-o"></i>
</a>
</div>
<div class="row">
<button class="btn btn-primary btn-small col-md-offset-0 col-md-6 col-sm-4 col-sm-offset-4 col-xs-6 col-xs-offset-6" type="button" ng-click="addOption()">
<i class="icon-plus icon-white"></i> {{ 'ADD_OPTION' | translate }}
</button>
</div>
</div> </div>
</div> </div>
<div class="row" ng-show="showRatingOptions()"><br></div> <div class="row" ng-if="showRatingOptions()"><br></div>
<div class="row" ng-if="showRatingOptions()"> <div class="row" ng-if="showRatingOptions()">
<div class="col-md-9 col-sm-9">{{ 'NUM_OF_STEPS' | translate }}</div> <div class="col-md-9 col-sm-9">{{ 'NUM_OF_STEPS' | translate }}</div>
<div class="col-md-3 col-sm-3"> <div class="col-md-3 col-sm-3">
@ -342,17 +40,17 @@
min="1" max="10" min="1" max="10"
ng-model="field.ratingOptions.steps" ng-model="field.ratingOptions.steps"
name="ratingOptions_steps{{field._id}}" name="ratingOptions_steps{{field._id}}"
ng-value="{{field.ratingOptions.steps}}" ng-value="field.ratingOptions.steps"
required> required>
</div> </div>
<br> <br>
<div class="col-md-5 col-sm-9">{{ 'SHAPE' | translate }}:</div> <div class="col-md-5 col-sm-9">{{ 'SHAPE' | translate }}:</div>
<div class="col-md-7 col-sm-3"> <div class="col-md-7 col-sm-3">
<select style="width:100%" ng-model="field.ratingOptions.shape" <select style="width:100%" ng-model="field.ratingOptions.shape"
value="{{field.ratingOptions.steps}}" ng-value="field.ratingOptions.steps"
name="ratingOptions_shape{{field._id}}" required> name="ratingOptions_shape{{field._id}}" required>
<option ng-repeat="shapeType in validShapes" <option ng-repeat="shapeType in validShapes"
value="{{shapeType}}"> ng-value="shapeType">
{{select2FA[shapeType]}} {{select2FA[shapeType]}}
</option> </option>
</select> </select>
@ -489,6 +187,298 @@
</div> </div>
</script> </script>
<!-- Edit EndPage Modal Dialog Template -->
<script type="text/ng-template" id="editEndPageModal.html" class="edit-endpage-modal">
<div class="modal-body">
<div class="row">
<div class="edit-panel col-md-6 col-xs-12 col-sm-12">
<div class="row modal-header">
<h2 class="modal-title hidden-md hidden-lg">{{ 'EDIT_END_PAGE' | translate }}</h2>
<h3 class="modal-title hidden-xs hidden-sm">{{ 'EDIT_END_PAGE' | translate }}</h3>
</div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'TITLE' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.endPage.title" required>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'PARAGRAPH' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<textarea class="form-control" type="text"
ng-model="myform.endPage.paragraph"></textarea>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'BTN_TEXT' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.endPage.buttonText" required>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<div class="col-md-4 col-xs-12 field-input">{{ 'SHOW_BUTTONS' | translate }}</div>
<div class="col-md-8 col-xs-12 field-input">
<label class="switch-light switch-holo" onclick="">
<input type="checkbox" ng-model="showButtons">
<span>
<span> {{ 'OFF' | translate }}</span>
<span> {{ 'ON' | translate }}</span>
<a></a>
</span>
</label>
</div>
</div>
<div class="row options buttons" ng-if="showButtons">
<div class="col-md-3 col-xs-12">{{ 'BUTTONS' | translate }}:</div>
<div class="col-md-9 col-xs-12">
<div ng-repeat="button in myform.endPage.buttons track by button._id" class="row" style="padding-bottom:1em;">
<div class="col-xs-5">
<span>{{ 'BUTTON_TEXT' | translate }}</span>
<input type="text"
name="{{button.text}}_buttonText_startPage"
ng-model="button.text"
value="{{button.text}}"
placeholder="{{ 'BUTTON_TEXT' | translate }}">
</div>
<div class="col-xs-5">
<span>{{ 'BUTTON_LINK' | translate }}</span>
<input type="text"
name="{{button.url}}_url_startPage"
ng-model="button.url"
value="{{button.url}}"
placeholder="http://aeouaou.com/aoeuoa">
</div>
<div class="col-xs-2">
<a class="btn btn-danger btn-mini right" type="button" ng-click="deleteButton(button)">
<i class="fa fa-trash-o"></i>
</a>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<button class="btn btn-primary btn-small col-md-offset-6 col-md-6 col-sm-4 col-sm-offset-8 col-xs-4 col-xs-offset-8" type="button" ng-click="addButton()">
<i class="icon-plus icon-white"></i> {{ 'ADD_BUTTON' | translate }}
</button>
</div>
</div>
</div>
<div class="modal-footer row">
<button type="submit" ng-click="saveEndPage()" class="btn btn-signup btn-rounded">
{{ 'SAVE_START_PAGE' | translate }}
</button>
<button ng-click="cancel()" class="btn btn-secondary btn-rounded">
{{ 'CANCEL' | translate }}
</button>
</div>
</div>
<div class="preview-field-panel col-md-6 hidden-sm hidden-xs">
<form class="public-form">
<div class="row">
<div class="col-xs-12 text-center" style="overflow-wrap: break-word;">
<h1 style="font-weight: 400; font-size: 25px;">
{{myform.endPage.title}}
</h1>
</div>
<div class="col-xs-10 col-xs-offset-1 text-center" style="overflow-wrap: break-word;">
<p style="color: grey; font-weight: 100; font-size: 16px;">
{{myform.endPage.paragraph}}
</p>
</div>
</div>
<div class="row form-actions text-center" style="padding: 5px 25px 5px 25px;">
<button ng-click="reloadForm()" class="btn" type="button"
ng-style="{'background-color':myform.design.colors.buttonColor, 'color':myform.design.colors.buttonTextColor}">
<span style="font-size: 1.6em;">
{{myform.endPage.buttonText}}
</span>
</button>
</div>
<div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em;">
<p ng-repeat="button in myform.endPage.buttons" class="text-center" style="display:inline;">
<button class="btn" style="background-color:rgb(156, 226, 235)" type="button" ng-style="{'background-color':button.bgColor, 'color':button.color}">
<a href="{{button.url}}"
style="font-size: 1.6em; text-decoration: none;"
ng-style="{'color':button.color}">
{{button.text}}
</a>
</button>
</p>
</div>
</form>
</div>
</div>
</div>
</script>
<!-- Edit StartPage Modal Dialog Template -->
<script type="text/ng-template" id="editStartPageModal.html" class="edit-startpage-modal">
<div class="modal-body">
<div class="row">
<div class="edit-panel col-md-6 col-xs-12 col-sm-12">
<div class="row modal-header">
<h2 class="modal-title hidden-md hidden-lg">{{ 'EDIT_START_PAGE' | translate }}</h2>
<h3 class="modal-title hidden-xs hidden-sm">{{ 'EDIT_START_PAGE' | translate }}</h3>
</div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'INTRO_TITLE' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.startPage.introTitle"
name="introTitleStartPage" required>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'INTRO_PARAGRAPH' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<textarea class="form-control" type="text"
ng-model="myform.startPage.introParagraph"
name="introParagraphStartPage"></textarea>
</div>
</div>
<div class="row"><br></div>
<div class="row question">
<div class="col-md-4 col-sm-12">{{ 'INTRO_BTN' | translate }}:</div>
<div class="col-md-8 col-sm-12">
<input class="form-control" type="text"
ng-model="myform.startPage.introButtonText"
name="introButtonText" required>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<div class="col-md-4 col-xs-12 field-input">{{ 'SHOW_BUTTONS' | translate }}</div>
<div class="col-md-8 col-xs-12 field-input">
<label class="switch-light switch-holo" onclick="">
<input type="checkbox" ng-model="showButtons">
<span>
<span> {{ 'OFF' | translate }}</span>
<span> {{ 'ON' | translate }}</span>
<a></a>
</span>
</label>
</div>
</div>
<div class="row options buttons" ng-if="showButtons">
<div class="col-md-3 col-xs-12">{{ 'BUTTONS' | translate }}:</div>
<div class="col-md-9 col-xs-12">
<div ng-repeat="button in myform.startPage.buttons track by button._id" class="row" style="padding-bottom:1em;">
<div class="col-xs-5">
<span>{{ 'BUTTON_TEXT' | translate }}</span>
<input type="text"
name="{{button.text}}_buttonText_startPage"
ng-model="button.text"
value="{{button.text}}"
placeholder="{{ 'BUTTON_TEXT' | translate }}">
</div>
<div class="col-xs-5">
<span>{{ 'BUTTON_LINK' | translate }}</span>
<input type="text"
name="{{button.url}}_url_startPage"
ng-model="button.url"
value="{{button.url}}"
placeholder="http://aeouaou.com/aoeuoa">
</div>
<div class="col-xs-2">
<a class="btn btn-danger btn-mini right" type="button" ng-click="deleteButton(button)">
<i class="fa fa-trash-o"></i>
</a>
</div>
</div>
<div class="row"><br></div>
<div class="row">
<button class="btn btn-primary btn-small col-md-offset-6 col-md-6 col-sm-4 col-sm-offset-8 col-xs-4 col-xs-offset-8" type="button" ng-click="addButton()">
<i class="icon-plus icon-white"></i> {{ 'ADD_BUTTON' | translate }}
</button>
</div>
</div>
</div>
<div class="modal-footer row">
<button type="submit" ng-click="saveStartPage()" class="btn btn-signup btn-rounded">
{{ 'SAVE_START_PAGE' | translate }}
</button>
<button ng-click="cancel()" class="btn btn-secondary btn-rounded">
{{ 'CANCEL' | translate }}
</button>
</div>
</div>
<div class="preview-field-panel col-md-6 hidden-sm hidden-xs">
<form class="public-form">
<div class="field row">
<div class="col-xs-12 text-center" style="overflow-wrap: break-word;">
<h1>{{myform.startPage.introTitle}}</h1>
</div>
<div class="col-xs-10 col-xs-offset-1 text-left" style="overflow-wrap: break-word;">
<p style="color:#ddd;">{{myform.startPage.introParagraph}}</p>
</div>
</div>
<div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em;">
<p ng-repeat="button in myform.startPage.buttons" class="text-center" style="display:inline;">
<button class="btn btn-info" type="button" ng-style="{'background-color':button.bgColor, 'color':button.color}">
<a href="{{button.url}}" style="font-size: 1.6em; text-decoration: none; color: inherit;" >
{{button.text}}
</a>
</button>
</p>
</div>
<div class="row form-actions">
<button class="btn btn-info btn btn-info col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3" type="button">
<span style="color:white; font-size: 1.6em; text-decoration: none;">
{{myform.startPage.introButtonText}}
</span>
</button>
</div>
</form>
</div>
</div>
</div>
</script>
<!-- Add Fields Element --> <!-- Add Fields Element -->
<div class="col-xs-2 col-sm-4 add-field"> <div class="col-xs-2 col-sm-4 add-field">

View File

@ -3,10 +3,6 @@
// Use Application configuration module to register a new module // Use Application configuration module to register a new module
ApplicationConfiguration.registerModule('forms', [ ApplicationConfiguration.registerModule('forms', [
'ngFileUpload', 'ui.date', 'ui.sortable', 'ngFileUpload', 'ui.date', 'ui.sortable',
<<<<<<< HEAD
'angular-input-stars', 'users', 'ngclipboard', 'textAngular', 'angular-input-stars', 'users', 'ngclipboard', 'textAngular',
'frapontillo.bootstrap-switch' 'frapontillo.bootstrap-switch'
=======
'angular-input-stars', 'users', 'ngclipboard'
>>>>>>> 2.20
]);//, 'colorpicker.module' @TODO reactivate this module ]);//, 'colorpicker.module' @TODO reactivate this module