Skip to content
Permalink
Browse files

merged with upstream master

  • Loading branch information...
whitef0x0 committed Jun 27, 2016
2 parents cfd0f29 + ac3ccdf commit 04951a31d5201974e8276ca4326319b833b9c984
Showing with 1,462 additions and 2,683 deletions.
  1. +425 −310 .idea/workspace.xml
  2. +1 −5 README.md
  3. +3 −2 bower.json
  4. +18 −2 config/forms.client.config.js
  5. +37 −0 config/i18n/english.js
  6. +35 −0 config/i18n/french.js
  7. +35 −0 config/i18n/german.js
  8. +35 −0 config/i18n/italian.js
  9. +35 −0 config/i18n/spanish.js
  10. +26 −0 controllers/submit-form.client.controller.js
  11. +31 −10 css/form.css
  12. +0 −33 demo/boot.js
  13. +0 −1,215 demo/dist/form.js
  14. +0 −542 demo/dist/template.js
  15. +0 −1 demo/index.html
  16. +3 −5 directives/field-icon.client.directive.js
  17. +24 −22 directives/field.client.directive.js
  18. +62 −7 directives/on-enter-key.client.directive.js
  19. +2 −2 directives/on-finish-render.client.directive.js
  20. +232 −169 directives/submit-form.client.directive.js
  21. +4 −10 gruntfile.js
  22. +0 −17 index.js
  23. +3 −19 package.json
  24. +13 −11 services/current-form.client.service.js
  25. +27 −36 services/forms.client.service.js
  26. +0 −10 services/myform.client.service.js
  27. +36 −27 services/time-counter.client.service.js
  28. +4 −3 views/directiveViews/entryPage/startPage.html
  29. +24 −12 views/directiveViews/field/date.html
  30. +23 −14 views/directiveViews/field/dropdown.html
  31. +18 −9 views/directiveViews/field/file.html
  32. +44 −26 views/directiveViews/field/legal.html
  33. +32 −13 views/directiveViews/field/radio.html
  34. +26 −14 views/directiveViews/field/rating.html
  35. +10 −4 views/directiveViews/field/statement.html
  36. +44 −29 views/directiveViews/field/textarea.html
  37. +41 −26 views/directiveViews/field/textfield.html
  38. +33 −27 views/directiveViews/field/yes_no.html
  39. +76 −51 views/directiveViews/form/submit-form.client.view.html

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -3,10 +3,6 @@ Tellform Angular Form UI Module

##About
This module gives you the standalone front-end of tellform. It handles form rendering and form ui. For you to use this module you must have an API endpoint, such as (Formkeep)[https://formkeep.com].
This is a readonly split of the tellform project.

This repository contain the form ui as a standalone component.

To see it in action clone this repos, run `npm install` and open the file `demo/index.html`.

##Disclaimer
This is a largely work in progress, use it at your own risk.
@@ -1,6 +1,7 @@
{
"name": "angular-tellform",
"description": "Frontend UI for Tellform",
"version": "1.0.0",
"main": [
"dist/bundle.js",
"dist/form.css"
@@ -10,6 +11,7 @@
"Samuel Laulhau <sam@lalop.co> (https://samuellaulhau.fr)"
],
"license": "MIT",
<<<<<<< HEAD
"keywords": [
"forms",
"tellform",
@@ -65,5 +67,4 @@
"angular": "^1.5.6"
},
"private": false
}

}
@@ -1,7 +1,8 @@
'use strict';

// Configuring the Forms drop-down menus
angular.module('angular-tellform').filter('formValidity', function(){
angular.module('angular-tellform')
.filter('formValidity', function(){
return function(formObj){
if(formObj && formObj.form_fields && formObj.visible_form_fields){

@@ -29,4 +30,19 @@ angular.module('angular-tellform').filter('formValidity', function(){
return {
go: function() {}
};
}]).constant('FORM_URL', '/form/:formId');
}]).constant('FORM_URL', '/form/:formId')
.value('supportedFields', [
'textfield',
'textarea',
'date',
'dropdown',
'hidden',
'password',
'radio',
'legal',
'statement',
'rating',
'yes_no',
'number',
'natural'
]);
@@ -0,0 +1,37 @@
'use strict';

angular.module('angular-tellform').config(['$translateProvider', function ($translateProvider) {

$translateProvider.translations('english', {
FORM_SUCCESS: 'Form entry successfully submitted!',
REVIEW: 'Review',
BACK_TO_FORM: 'Go back to Form',
EDIT_FORM: 'Edit this TellForm',
CREATE_FORM: 'Create this TellForm',
ADVANCEMENT: '{{done}} out of {{total}} answered',
CONTINUE_FORM: 'Continue to Form',
REQUIRED: 'required',
COMPLETING_NEEDED: '{{answers_not_completed}} answer(s) need completing',
OPTIONAL: 'optional',
ERROR_EMAIL_INVALID: 'Please enter a valid email address',
ERROR_NOT_A_NUMBER: 'Please enter valid numbers only',
ERROR_URL_INVALID: 'Please a valid url',
OK: 'OK',
ENTER: 'press ENTER',
YES: 'Yes',
NO: 'No',
NEWLINE: 'press SHIFT+ENTER to create a newline',
CONTINUE: 'Continue',
LEGAL_ACCEPT: 'I accept',
LEGAL_NO_ACCEPT: 'I don’t accept',
DELETE: 'Delete',
CANCEL: 'Cancel',
SUBMIT: 'Submit',
UPLOAD_FILE: 'Upload your File'
});

$translateProvider.preferredLanguage('english')
.fallbackLanguage('english')
.useSanitizeValueStrategy('escape');

}]);
@@ -0,0 +1,35 @@
'use strict';

angular.module('angular-tellform').config(['$translateProvider', function ($translateProvider) {

$translateProvider.translations('french', {
FORM_SUCCESS: 'Votre formulaire a été enregistré!',
REVIEW: 'Incomplet',
BACK_TO_FORM: 'Retourner au formulaire',
EDIT_FORM: 'Éditer le Tellform',
CREATE_FORM: 'Créer un TellForm',
ADVANCEMENT: '{{done}} complétés sur {{total}}',
CONTINUE_FORM: 'Aller au formulaire',
REQUIRED: 'obligatoire',
COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)',
OPTIONAL: 'facultatif',
ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide',
ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres',
ERROR_URL_INVALID: 'Merci de rentrer une url valide',
OK: 'OK',
ENTER: 'presser ENTRÉE',
YES: 'Oui',
NO: 'Non',
NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne',
CONTINUE: 'Continuer',
LEGAL_ACCEPT: 'J’accepte',
LEGAL_NO_ACCEPT: 'Je n’accepte pas',
DELETE: 'Supprimer',
CANCEL: 'Réinitialiser',
SUBMIT: 'Enregistrer',
UPLOAD_FILE: 'Envoyer un fichier',
Y: 'O',
N: 'N'
});

}]);
@@ -0,0 +1,35 @@
'use strict';

angular.module('angular-tellform').config(['$translateProvider', function ($translateProvider) {

$translateProvider.translations('german', {
FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.',
REVIEW: 'Unvollständig',
BACK_TO_FORM: 'Zurück zum Formular',
EDIT_FORM: 'Bearbeiten Sie diese TellForm',
CREATE_FORM: 'Erstellen Sie eine TellForm',
ADVANCEMENT: '{{done}} von {{total}} beantwortet',
CONTINUE_FORM: 'Zum Formular',
REQUIRED: 'verpflichtend',
COMPLETING_NEEDED: 'Es fehlen/fehtl noch {{answers_not_completed}} Antwort(en)',
OPTIONAL: 'fakultativ',
ERROR_EMAIL_INVALID: 'Bitte gültige Mailadresse eingeben',
ERROR_NOT_A_NUMBER: 'Bitte nur Zahlen eingeben',
ERROR_URL_INVALID: 'Bitte eine gültige URL eingeben',
OK: 'Okay',
ENTER: 'Eingabetaste drücken',
YES: 'Ja',
NO: 'Nein',
NEWLINE: 'Für eine neue Zeile SHIFT+ENTER drücken',
CONTINUE: 'Weiter',
LEGAL_ACCEPT: 'Ich akzeptiere',
LEGAL_NO_ACCEPT: 'Ich akzeptiere nicht',
DELETE: 'Entfernen',
CANCEL: 'Canceln',
SUBMIT: 'Speichern',
UPLOAD_FILE: 'Datei versenden',
Y: 'J',
N: 'N'
});

}]);
@@ -0,0 +1,35 @@
'use strict';

angular.module('angular-tellform').config(['$translateProvider', function ($translateProvider) {

$translateProvider.translations('italian', {
FORM_SUCCESS: 'Il formulario è stato inviato con successo!',
REVIEW: 'Incompleto',
BACK_TO_FORM: 'Ritorna al formulario',
EDIT_FORM: 'Modifica questo Tellform',
CREATE_FORM: 'Creare un TellForm',
ADVANCEMENT: '{{done}} su {{total}} completate',
CONTINUE_FORM: 'Vai al formulario',
REQUIRED: 'obbligatorio',
COMPLETING_NEEDED: '{{answers_not_completed}} risposta/e deve/ono essere completata/e',
OPTIONAL: 'opzionale',
ERROR_EMAIL_INVALID: 'Si prega di inserire un indirizzo email valido',
ERROR_NOT_A_NUMBER: 'Si prega di inserire solo numeri',
ERROR_URL_INVALID: 'Grazie per inserire un URL valido',
OK: 'OK',
ENTER: 'premere INVIO',
YES: '',
NO: 'No',
NEWLINE: 'premere SHIFT+INVIO per creare una nuova linea',
CONTINUE: 'Continua',
LEGAL_ACCEPT: 'Accetto',
LEGAL_NO_ACCEPT: 'Non accetto',
DELETE: 'Cancella',
CANCEL: 'Reset',
SUBMIT: 'Registra',
UPLOAD_FILE: 'Invia un file',
Y: 'S',
N: 'N'
});

}]);
@@ -0,0 +1,35 @@
'use strict';

angular.module('angular-tellform').config(['$translateProvider', function ($translateProvider) {

$translateProvider.translations('spanish', {
FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!',
REVIEW: 'Revisar',
BACK_TO_FORM: 'Regresar al formulario',
EDIT_FORM: 'Crear un TellForm',
CREATE_FORM: 'Editar este TellForm',
ADVANCEMENT: '{{done}} de {{total}} contestadas',
CONTINUE_FORM: 'Continuar al formulario',
REQUIRED: 'Información requerida',
COMPLETING_NEEDED: '{{answers_not_completed}} respuesta(s) necesita(n) ser completada(s)',
OPTIONAL: 'Opcional',
ERROR_EMAIL_INVALID: 'Favor de proporcionar un correo electrónico válido',
ERROR_NOT_A_NUMBER: 'Por favor, introduzca sólo números válidos',
ERROR_URL_INVALID: 'Favor de proporcionar un url válido',
OK: 'OK',
ENTER: 'pulse INTRO',
YES: 'Si',
NO: 'No',
NEWLINE: 'presione SHIFT+INTRO para crear una nueva línea',
CONTINUE: 'Continuar',
LEGAL_ACCEPT: 'Acepto',
LEGAL_NO_ACCEPT: 'No acepto',
DELETE: 'Eliminar',
CANCEL: 'Cancelar',
SUBMIT: 'Registrar',
UPLOAD_FILE: 'Cargar el archivo',
Y: 'S',
N: 'N'
});

}]);
@@ -0,0 +1,26 @@
'use strict';

// SubmitForm controller
angular.module('angular-tellform').controller('SubmitFormController', [
'$scope', '$rootScope', '$state', '$translate', 'myForm', 'Auth',
function($scope, $rootScope, $state, $translate, myForm, Auth) {
$scope.authentication = Auth;
$scope.myform = myForm;

$translate.use(myForm.language);

if(!$scope.myform.isLive){
// Show navbar if form is not public AND user IS loggedin
if($scope.authentication.isAuthenticated()){
$scope.hideNav = $rootScope.hideNav = false;
}
// Redirect if form is not public user IS NOT loggedin
else {
$scope.hideNav = $rootScope.hideNav = true;
$state.go('access_denied');
}
}else{
$scope.hideNav = $rootScope.hideNav = true;
}
}
]);
@@ -32,6 +32,7 @@

.public-form input, .public-form textarea {
background-color: rgba(0,0,0,0);
background-color: #000000;
border: 2px dashed #ddd!important;
}

@@ -40,9 +41,21 @@
outline: none;
}

.public-form input.no-border, .public-form textarea.no-border {
border: none!important;
/*.public-form input.no-border.ng-invalid, .public-form textarea.no-border {
border-color: none;
}*/
.public-form input.ng-valid, .public-form textarea.ng-valid {
border-color: #20FF20!important;
border-style: solid!important;
border-width: 3px!important;
}

.public-form input.ng-invalid.ng-dirty, .public-form textarea.ng-invalid.ng-dirty {
border-color: #FA787E!important;
border-style: solid!important;
border-width: 3px!important;
}

section.content p.breakwords {
word-break: break-all;
}
@@ -142,6 +155,10 @@ form .accordion-edit {
z-index: 99!important;
}

form .row.field .field-number {
margin-right: 0.5em;
}

/* Styles for form submission view (/forms/:formID) */
form .row.field {
padding: 1em 0 0 0;
@@ -220,22 +237,18 @@ form .row.field {
form .row.field.dropdown > .field-input input:focus {
border: none;
}

form .row.field.dropdown > .field-input .ui-select-match {
border: 0 grey solid;
border-width: 0 0 2px 0;
border-radius: 5px;
}

form .dropdown > .field-input .ui-select-choices-row-inner {
border-radius: 3px;
margin: 5px;
padding: 10px;
background-color: #000000;
background-color: rgba(0,0,0,0.05);
}

form .dropdown > .field-input .ui-select-choices-row-inner.active, form .dropdown > .field-input .ui-select-choices-row-inner.active:focus {
background-color: rgba(0,0,0,0.1);
background-color: #000000;
background-color: rgba(0,0,0,0.1);
}
.config-form {
max-width: 100%;
@@ -298,6 +311,7 @@ div.config-form .row.field {

.admin-form .panel-heading {
background-color: #f1f1f1;
position: relative!important;
}
.admin-form .panel-heading:hover {
background-color: #fff;
@@ -314,7 +328,14 @@ div.config-form .row.field {
width: 80%;
}


/*Override Select2 UI*/
.ui-select-choices.ui-select-dropdown {
top:2.5em!important;
}
.ui-select-toggle {
box-shadow:none!important;
border:none!important;
}

.current-fields .tool-panel > .panel-default:hover {
border-color: #9d9d9d;
Oops, something went wrong.

0 comments on commit 04951a3

Please sign in to comment.
You can’t perform that action at this time.