Compare commits

...

121 commits

Author SHA1 Message Date
Leopere d5c94ce67f
Update README.md 2019-08-22 01:06:07 -04:00
Leopere 6e32ace806
Commented out new sponsor links. 2019-08-22 01:00:01 -04:00
Leopere a6d61ebf35
More tidying up leaving some details for future netizens. 2019-08-22 00:55:03 -04:00
Leopere 98385954dc
Deprecation notice for the time being.
Unfortunately due to many blockers that arose due to time constraints of involved parties a fork ended up being the best possible solution.  Credit will be given to the original codebase and repository.
2019-07-11 18:20:56 -04:00
Leopere 4900d13a47
Fixed Discord Server URL
The old TellForm server was replaced with the OMF server.
2019-07-11 18:13:37 -04:00
Leopere 210c7544e7
Merge pull request #344 from wodka/simplify-docker
improve docker images, fix jsep and initial build
2019-07-03 16:43:59 -04:00
wodka a9e04b4894 add missing bower install 2019-07-03 22:13:28 +02:00
wodka d07063f636 fixes for admin creation 2019-07-03 09:47:52 +02:00
wodka 643954896b fix user creation 2019-07-01 16:13:21 +02:00
wodka 77cabf15e5 attach socket.io to current server if ports are equal 2019-07-01 11:49:27 +02:00
wodka b3bf791d3c improve docker images, fix jsep and initial build 2019-07-01 10:03:29 +02:00
Leopere c3153ed514
Merge pull request #338 from tellform/Leopere-discordmove-1
Going to update the chat to something I can manage.
2019-06-07 19:47:24 -04:00
Leopere e29742f83a
Going to update the chat to something I can manage.
I have no access to manage Gitter and it seems a slight refocus might not be terrible.
2019-06-07 19:36:57 -04:00
Arielle Baldwynn a24f90ce91 added example env 2019-04-29 19:28:21 -07:00
Arielle Baldwynn 4eae4de2ce added countable web productions as sponsor 2019-04-29 19:16:36 -07:00
Arielle Baldwynn 39c656c41e fixed nginx dockerfile 2019-04-29 19:09:25 -07:00
Arielle Baldwynn 15a6324a90 got npm install to work 2019-04-29 16:02:27 -07:00
Arielle Baldwynn 17b428b304 Merge branch 'master' of github.com:tellform/tellform into stable2.1 2019-04-29 14:15:52 -07:00
Arielle Baldwynn 81e66f0025
Update README.md 2019-02-19 10:27:56 -08:00
Arielle Baldwynn b1917c9fdd
Merge pull request #330 from mattiasaxell/master
fix Swedish translations
2019-02-02 13:01:51 -08:00
Mattias 6453716c99 fix translations 2019-01-31 10:15:21 +01:00
Arielle Baldwynn 639ba9fdb8
Merge pull request #328 from bokub/patch-2
Remove dead link from README
2019-01-09 16:31:30 -08:00
Boris K 1a9e847741
Remove dead link from README 2019-01-09 21:05:00 +01:00
Arielle Baldwynn 995e6aa41c
Merge pull request #316 from LoneRifle/patch-2
deleteSubmissions - remove spurious condition
2018-10-23 22:42:44 -07:00
Arielle Baldwynn d7f0cc8127
Merge pull request #317 from spkjess/master
update markdown
2018-10-23 22:42:27 -07:00
Jess Sze e8afc9e7e6 add registry 2018-10-20 17:17:29 +08:00
Jess Sze ad35ae9215 update markdown 2018-10-20 17:03:24 +08:00
LoneRifle 5bc0d623a5
deleteSubmissions - remove spurious condition
`FormSubmission.remove` should not use `admin` as a condition:
 - the field is not present in the schema or in any created submissions
 - the user is unlikely to be the admin of a submission 

Remove this field to facilitate deletes

Fixes #315
2018-10-20 16:33:12 +08:00
David Baldwynn 13d9bd9ece fixed bugs with authentication 2018-09-11 14:09:17 -07:00
David Baldwynn 19c85f9845 fixed css aligment for form multi choice questions 2018-09-11 16:46:59 -04:00
Arielle Baldwynn 188705b640
Merge pull request #301 from pshah123/master
Fix Issues from PR #299
2018-08-31 13:27:24 -07:00
David Baldwynn 386b6be968 got stable release to work 2018-08-31 15:56:49 -04:00
David Baldwynn d9ef557edd u 2018-08-31 15:26:13 -04:00
David Baldwynn 52a1ab2bff got form running and fixed swedish translations 2018-08-31 15:25:43 -04:00
David Baldwynn 80beec8ad2
Merge pull request #305 from drew23c/drew
stored the logos in docs/ folder and added the logos for tellform sponsors...
2018-07-09 12:34:35 -07:00
Andrew Caldwell 3b0dee9ea3 stored the logos in docs/ folder and added the logos for tellform backers in readme.md 2018-07-06 13:47:44 -04:00
Priansh Shah 01ac456f62 fix merge 2018-04-24 23:15:52 +03:00
Priansh Shah 9715088e86 Revert "fix styling on form"
This reverts commit 9a9c1ae02e.
2018-04-24 23:05:46 +03:00
Priansh Shah 0f2cf42ceb revert changelog 2018-04-24 23:05:40 +03:00
Priansh Shah 65fd117b04 revert changelog 2018-04-24 23:05:05 +03:00
Priansh Shah 985c3c1aae revert custom Earlybird changes to form 2018-04-24 23:04:16 +03:00
Priansh Shah 808439cf47 Revert "Merge branch 'master' into server"
This reverts commit 83ca05e64b, reversing
changes made to 78082f7152.
2018-04-24 23:03:36 +03:00
Priansh Shah eaab2ff339 Revert "disable signups"
This reverts commit ca875ed01d.
2018-04-24 23:03:15 +03:00
Priansh Shah f99049d155 Revert "fix jsep import, add fillin for HTTPS server, remove debug flag"
This reverts commit 78082f7152.
2018-04-24 23:01:58 +03:00
David Baldwynn 8c4e519fbe
Merge pull request #299 from earlybird/master
Add JSEP CDN
2018-04-24 09:26:39 -07:00
Priansh Shah 9a9c1ae02e fix styling on form 2018-04-10 00:35:12 +00:00
Priansh Shah 2835280ff3 fix mobile responsiveness 2018-04-09 21:41:37 +00:00
Priansh Shah 7afc7eef87 update changelog 2018-04-09 21:36:17 +00:00
Priansh Shah 45f8fe7a02 fix form styling 2018-04-09 21:34:26 +00:00
Priansh Shah 623cb865c2 fix readme 2018-04-09 20:35:09 +00:00
Priansh Shah d6e48544a4 Merge branch 'master' of https://github.com/earlybird/tellform 2018-04-09 20:31:10 +00:00
Priansh Shah ca875ed01d disable signups 2018-04-09 20:30:44 +00:00
Priansh Shah 33b0fc02c4
Merge pull request #1 from earlybird/server
fix jsep import, add fillin for HTTPS server, remove debug flag
2018-04-09 16:25:04 -04:00
Priansh Shah 83ca05e64b
Merge branch 'master' into server 2018-04-09 16:24:29 -04:00
Priansh Shah 78082f7152 fix jsep import, add fillin for HTTPS server, remove debug flag 2018-04-09 20:22:41 +00:00
Priansh Shah e2ff321ec8
add JSEP cdn 2018-04-09 05:47:04 -04:00
David Baldwynn 38b3618f8b
Merge pull request #291 from mattiasaxell/patch-4
Create swedish.js translation
2018-03-05 12:39:55 -08:00
David Baldwynn f5dc78b6d7
Merge pull request #292 from mattiasaxell/patch-5
Create swedish.js - Swedish translation
2018-03-03 16:18:06 -08:00
David Baldwynn f384f5fee4
Merge pull request #293 from mattiasaxell/patch-6
Create swedish.js first translation
2018-03-03 16:17:57 -08:00
David Baldwynn 3421c92eab
Merge pull request #290 from mattiasaxell/patch-2
Adding Swedish translation to config
2018-03-03 16:17:42 -08:00
David Baldwynn f47a8d41ae
Merge pull request #294 from mattiasaxell/patch-7
Create swedish.js - first Swedish translation
2018-03-03 16:17:29 -08:00
Mattias Axell 53fa777ce0
Create swedish.js first Swedish translation 2018-02-28 18:12:54 +01:00
Mattias Axell e725aa1ea3
Create swedish.js first translation 2018-02-28 17:22:21 +01:00
Mattias Axell c63e905c25
Create swedish.js - Swedish translation 2018-02-28 16:31:35 +01:00
Mattias Axell ee2c59805e
Create swedish.js translation 2018-02-28 16:28:34 +01:00
Mattias Axell a0092baf31
Update typo in Swedish translation 2018-02-28 15:55:06 +01:00
Mattias Axell b6f5c5f897
First translation to Swedish
Proposing first translation of TellForm into Swedish.
2018-02-28 15:52:24 +01:00
David Baldwynn 66765278d2
Merge pull request #285 from MaximePawlakFr/fixFrenchTranslations
Fix french translations in modules, form_modules and locales.
2018-02-14 19:07:22 -08:00
Maxime 1ace06555c Fix french translations in modules, form_modules and locales. 2018-02-14 17:28:19 +01:00
David Baldwynn 4086219189
Merge pull request #283 from theasp/master
Fix MAILER_STMP_SECURE
2018-01-29 16:13:30 -08:00
Andrew Phillips 7357756625 Fix MAILER_STMP_SECURE
This should resolve https://github.com/tellform/tellform/issues/281,
matching the description in the Configuration section of `README.md`.
This also corrects the case of `TRUE` in an example.
2018-01-25 13:31:04 -04:00
David Baldwynn ff24843e3a Merge branch 'master' of github.com:tellform/tellform 2017-11-21 13:36:34 -08:00
David Baldwynn 4447785a56 removed secure grunt task 2017-11-21 13:36:14 -08:00
David Baldwynn 341ce5a88f
Merge pull request #265 from felixcheruiyot/master
Fix wrong vendor.min.js file reference URL
2017-11-20 20:33:33 -08:00
FELIX CHERUIYOT ed662281cd
Merge pull request #1 from felixcheruiyot/felixcheruiyot-patch-1
Fix missing vendor file reference
2017-11-17 07:44:07 +03:00
FELIX CHERUIYOT 13c3263667
Fix missing vendor file reference
vendor.min.js not found
2017-11-17 07:43:21 +03:00
David Baldwynn 084a8005fd fixed form vendor files 2017-11-11 19:56:41 -08:00
David Baldwynn 24cffeee37 fixed problem with production assets 2017-11-08 11:31:46 -08:00
David Baldwynn d132133d67 Merge branch 'master' of github.com:tellform/tellform 2017-11-06 17:55:46 -05:00
David Baldwynn 1539846121 fixed google analytics 2017-11-06 17:55:43 -05:00
David Baldwynn ed815f68e5
Update README.md 2017-11-06 14:35:29 -08:00
David Baldwynn 552f4d8396
Update gitter.im links 2017-11-06 14:29:43 -08:00
David Baldwynn 7c3834dcae Merge branch 'master' of github.com:tellform/tellform 2017-11-06 14:12:37 -08:00
David Baldwynn 5b847b33ec moved grunt to dev dependencies 2017-11-06 14:10:27 -08:00
David Baldwynn 86f74ce85f
Merge pull request #257 from tellform/fixSetupScript
Fixed Setup Script
2017-11-06 13:58:20 -08:00
David Baldwynn 147effe028
Added buildpack for Heroku Deploy Button 2017-11-06 13:57:13 -08:00
David Baldwynn b29d5bad36 fixed admin setup script 2017-11-06 13:44:29 -08:00
David Baldwynn 53658da890 Merge branch 'master' of github.com:tellform/tellform 2017-11-05 16:28:29 -08:00
David Baldwynn 3dc51d9d2c fixed bug in core.routes.js 2017-11-05 19:23:01 -05:00
David Baldwynn f8ac5454d7 Merge branch 'master' of github.com:tellform/tellform 2017-11-05 16:14:15 -08:00
David Baldwynn 4c76e37aba
Merge pull request #253 from tellform/fixGruntfile
Fixed Gruntfile
2017-11-05 16:11:47 -08:00
David Baldwynn be6fc12949 fixed ngAnnotate grunt task 2017-11-05 16:05:58 -08:00
David Baldwynn e2d000e6a0 fixed gruntfile build for form-application.js 2017-11-05 15:56:03 -08:00
David Baldwynn 0f3b59a1ce Merge branch 'master' of github.com:tellform/tellform 2017-11-05 15:51:47 -08:00
David Baldwynn 492783ec49 built correct dist files 2017-11-05 15:50:55 -08:00
David Baldwynn 381df20d3c
Merge pull request #252 from tellform/hotfixes
Hotfixes - Signin Redirection, FormField Service language, Gruntfile Concat
2017-11-05 15:41:42 -08:00
David Baldwynn f7d4394049 removed unused npm deps 2017-11-05 15:28:58 -08:00
David Baldwynn 7451311403 removed empty authentication controller test 2017-11-02 11:37:33 -07:00
David Baldwynn 5c58db879c got server tests to pass 2017-11-02 11:14:25 -07:00
David Baldwynn 076f56bf59 fix language detection bug for FormFields service 2017-11-02 10:41:36 -07:00
David Baldwynn 6927f9d5ac fixed signin redirect bug 2017-11-02 10:37:29 -07:00
David Baldwynn 65a8b2d7cc fixed gruntfile bug 2017-10-29 11:43:20 -04:00
David Baldwynn d304b80913 fixed submission ordering 2017-10-28 05:13:56 -04:00
David Baldwynn a3d203fee3 Merge branch 'master' of github.com:tellform/tellform 2017-10-28 01:51:18 -07:00
David Baldwynn dc3bb54774 fixed submissions bug 2017-10-28 04:30:23 -04:00
David Baldwynn 3b9f01f92a fixed form_fields translation bug 2017-10-28 00:45:04 -07:00
David Baldwynn a829e08d73 fixed errors for password reset, user signup and user signin 2017-10-27 23:54:55 -07:00
David Baldwynn 34b2cba461 added client side validation for email, username and password inputs 2017-10-27 23:23:50 -07:00
David Baldwynn 82d60c5a42 add error for unactivated account login/forgot password 2017-10-27 20:59:47 -07:00
David Baldwynn c45d248c3c internationalized transactional emails 2017-10-27 20:46:00 -07:00
David Baldwynn 4f7d646edd got email pug templates to work 2017-10-27 19:30:05 -07:00
David Baldwynn b0f03d1f0a got i18n transaltions for all serverside views 2017-10-27 17:23:24 -07:00
David Baldwynn 25ce55b4c7 moved to pug from swig and fixed public form when subdomains are disabled 2017-10-27 16:00:04 -07:00
David Baldwynn 62a34f9ab6 fixed all translations on frontend 2017-10-27 12:52:39 -07:00
David Baldwynn e6685154dd added german and italian translateions for user and core views 2017-10-27 12:13:47 -07:00
David Baldwynn fe692d2a7d Removed codeclimate badge 2017-10-26 11:06:10 -07:00
David Baldwynn 8a8f1e9b2e Update README.md 2017-10-26 11:04:50 -07:00
David Baldwynn b3213d5a8a Merge pull request #242 from alexgleason/alexgleason
whitef0x0/tellform --> tellform/tellform
2017-10-26 11:04:17 -07:00
David Baldwynn 6899a5d48f Removed npm run version 2017-10-26 11:00:05 -07:00
David Baldwynn e4ef81af35 fixed verification email signup bug 2017-10-26 11:36:15 -04:00
Alex Gleason e110820fcb whitef0x0/tellform --> tellform/tellform 2017-10-17 13:12:27 -04:00
147 changed files with 17520 additions and 47816 deletions

View file

@ -1,4 +1,5 @@
{ {
"directory": "public/lib", "directory": "public/lib",
"analytics": false "analytics": false,
"registry": "https://registry.bower.io"
} }

124
.env.example Normal file
View file

@ -0,0 +1,124 @@
# TellForm Configuration File
###################################
# Common configuration variables
###################################
# Set this to the path where Mailu data and configuration is stored
# Mac users: Change to a Docker accessible folder
ROOT=/opt/tellform_data
# Set to what environment you will be running TellForm in (production or development)
NODE_ENV=development
# Set to a randomly generated 16 bytes string
SECRET_KEY=ChangeMeChangeMe
# URI of Mongo database that TellForm will connect to
#DO NOT CHANGE
MONGODB_URI=mongodb://mongo/tellform
# URL Redis server that TellForm will connect to
#DO NOT CHANGE
REDIS_URL=redis://redis:6379
# Port that the TellForm Node app will listen on
PORT=5000
# Domain that TellForm's admin panel will be hosted at
BASE_URL=tellform.dev
# Port that SocketIO server (for analytics) will listen on
SOCKET_PORT=20523
#Choose what kind of TLS you want.
#Can be either 'cert' (supply your certificates in ./cert/), 'notls' (no https at all) or 'letsencrypt' that autoconfigures your instance with letsencrypt
TLS_FLAVOR=notls
###################################
# Optional features
###################################
# Set this to enable coveralls.io support
COVERALLS_REPO_TOKEN=
# Disable signups for your TellForm instance
SIGNUP_DISABLED=FALSE
# Disable per-user custom subdomains
SUBDOMAINS_DISABLED=FALSE
# Url that subdomains will be hosted at (has to have domain name as ADMIN_URL)
# Only used when SUBDOMAINS_DISABLED=FALSE
SUBDOMAIN_URL=*.tellform.dev
# Enable running TellForm in pm2's 'cluster' mode
ENABLE_CLUSTER_MODE=FALSE
###################################
# Mail settings
# IMPORTANT: These settings need to be set
# to be set in order for your instance to work
###################################
# Set this to set the username credential of your SMTP service
MAILER_EMAIL_ID=
# Set this to set the password credential of your SMTP service
MAILER_PASSWORD=
# Set this to set the email address that all email should be sent from for signup/verification emails
MAILER_FROM=
# Set this to any services from https://nodemailer.com/smtp/well-known/ to use a 'well-known' email provider
MAILER_SERVICE_PROVIDER=
# Set these if you are not using a 'MAILER_SERVICE_PROVIDER' and want to specify your SMTP server's address and port
MAILER_SMTP_HOST=
MAILER_SMTP_PORT=
# Set this if you are using a custom SMTP server that supports SSL
MAILER_SMTP_SECURE
###################################
# Automatic Admin Creation Settings
###################################
# Set this to "TRUE" if you wish to automatically create an admin user on startup
CREATE_ADMIN=FALSE
# Set this to set the email used by your default admin account
ADMIN_EMAIL=admin@admin.com
# Set this to set the username of your default admin acconut
ADMIN_USERNAME=root
# Set this to set the password of your default admin account
ADMIN_PASSWORD=root
###################################
# Advanced settings
###################################
# Set this to server your websockets server on a seperate URL
SOCKETS_URL=
# Set this to change the port that TellForm will listen on
PORT=5000
# Set this to your Google Analytics ID to enable tracking with GA
GOOGLE_ANALYTICS_ID=
# Set this to your Sentry.io DSN code to enable front-end JS error tracking with Sentry.io
RAVEN_DSN
# Set this to set the 'name' meta property in the HTML <head>
APP_NAME=
# Set this to set the 'keywords' meta property in the HTML <head>
APP_KEYWORDS=
# Set this to set the 'description' meta property in the HTML head
APP_DESC=

6
.gitignore vendored
View file

@ -1,14 +1,11 @@
data/
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 +22,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,33 +4,16 @@
# Run: # Run:
# docker run -it tellform-prod # docker run -it tellform-prod
FROM phusion/baseimage:0.9.19 FROM node:10-alpine
MAINTAINER David Baldwynn <team@tellform.com> MAINTAINER Arielle Baldwynn <team@tellform.com>
# Install Utilities # Install some needed packages
RUN apt-get update -q \ RUN apk add --no-cache \
&& apt-get install -yqq \
curl \
ant \
git \ git \
gcc \ && rm -rf /tmp/*
make \
build-essential \
libkrb5-dev \
python \
sudo \
apt-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN sudo apt-get install -yq nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install NPM Global Libraries # Install NPM Global Libraries
RUN npm install --quiet -g grunt bower pm2 && npm cache clean RUN npm install --quiet -g grunt bower pm2 && npm cache clean --force
WORKDIR /opt/tellform WORKDIR /opt/tellform
RUN mkdir -p /opt/tellform/public/lib RUN mkdir -p /opt/tellform/public/lib
@ -47,6 +30,39 @@ COPY ./gruntfile.js /opt/tellform/gruntfile.js
COPY ./server.js /opt/tellform/server.js COPY ./server.js /opt/tellform/server.js
COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js
# Set default ENV
ENV NODE_ENV=development
ENV SECRET_KEY=ChangeMeChangeMe
#ENV MONGODB_URI=mongodb://mongo/tellform
#ENV REDIS_URL=redis://redis:6379
ENV PORT=5000
ENV BASE_URL=localhost
ENV SOCKET_PORT=20523
ENV SIGNUP_DISABLED=FALSE
ENV SUBDOMAINS_DISABLED=FALSE
ENV ENABLE_CLUSTER_MODE=FALSE
ENV MAILER_EMAIL_ID=tellform@localhost
ENV MAILER_PASSWORD=
ENV MAILER_FROM=tellform@localhost
ENV MAILER_SERVICE_PROVIDER=
ENV MAILER_SMTP_HOST=
ENV MAILER_SMTP_PORT=
ENV MAILER_SMTP_SECURE=
ENV CREATE_ADMIN=FALSE
ENV ADMIN_EMAIL=admin@tellform.com
ENV ADMIN_USERNAME=root
ENV ADMIN_PASSWORD=root
ENV APP_NAME=Tellform
ENV APP_KEYWORDS=
ENV APP_DESC=
# optional ENV settings
ENV COVERALLS_REPO_TOKEN=
ENV GOOGLE_ANALYTICS_ID=
ENV RAVEN_DSN=
# Copies the local package.json file to the container # Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild # and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only # and install node_modules/ everytime we build the docker, but only
@ -54,6 +70,8 @@ COPY ./scripts/create_admin.js /opt/tellform/scripts/create_admin.js
# Add npm package.json # Add npm package.json
COPY ./package.json /opt/tellform/package.json COPY ./package.json /opt/tellform/package.json
RUN npm install --only=production --quiet RUN npm install --only=production --quiet
RUN bower install --allow-root
RUN grunt build
# Run TellForm server # Run TellForm server
CMD ["node", "server.js"] CMD ["node", "server.js"]

View file

@ -10,56 +10,7 @@ TellForm Installation Instructions
## Local deployment with Docker ## Local deployment with Docker
### Prerequisites Refer to [docker_files](https://github.com/tellform/docker_files).
Make you sure have the following packages and versions on your machine:
```
"node": ">=6.11.2"
"npm": ">=3.3.6"
"bower": ">=1.8.0"
"grunt-cli": ">=1.2.0"
"grunt": ">=0.4.5"
"docker": ">=17.06.0-ce"
"docker-compose": ">=1.14.0"
```
### Install dependencies
```
$ npm install
```
### Prepare .env file:
Create `.env` file at project root folder. Fill in `MAILER_SERVICE_PROVIDER`, `MAILER_EMAIL_ID`, `MAILER_PASSWORD` and `MAILER_FROM`.
```
APP_NAME=TellForm
BASE_URL=localhost:3000
PORT=3000
DB_PORT_27017_TCP_ADDR=tellform-mongo
REDIS_DB_PORT_6379_TCP_ADDR=tellform-redis
MAILER_SERVICE_PROVIDER=<TO-FILL-IN>
MAILER_EMAIL_ID=<TO-FILL-IN>
MAILER_PASSWORD=<TO-FILL-IN>
MAILER_FROM=<TO-FILL-IN>
SIGNUP_DISABLED=false
SUBDOMAINS_DISABLED=true
DISABLE_CLUSTER_MODE=true
```
### Build docker image
```
$ docker-compose build
```
### Run docker containers with docker-compose
Create and start mongo & redis docker container:
```
$ docker-compose up
```
Your application should run on port 3000 or the port you specified in your .env file, so in your browser just go to [http://localhost:3000](http://localhost:3000)
## AWS AMI Deployment ## AWS AMI Deployment

129
README.md
View file

@ -1,18 +1,34 @@
TellForm 2.1.0 TellForm 2.1.0
======== ========
DEPRECATION WARNING UNTIL FURTHER NOTICE.
There are many oudated and vulnerable dependencies within this project and I recommend that you use this code repository for internal testing and development only.
There were too many impassable hurdles to really continue forward at the pace that I was hoping with TellForm @leopere~ If you want to follow my progress on an alternative in the mean time check out https://OhMyForm.com or our Discord server. We managed to get the base Docker image fixed before forking the code so you can give this a try however not much has changed at the moment.
<!--
[![Code Shelter](https://www.codeshelter.co/static/badges/badge-flat.svg)](https://www.codeshelter.co/)
[![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)
[![Code Climate](https://codeclimate.com/github/whitef0x0/tellform/badges/gpa.svg)](https://codeclimate.com/github/whitef0x0/tellform) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=tellform/tellform&amp;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&amp;utm_medium=referral&amp;utm_content=whitef0x0/tellform&amp;utm_campaign=Badge_Grade) -->
[![Gitter](https://badges.gitter.im/whitef0x0/tellform.svg)](https://gitter.im/whitef0x0/tellform?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. To Join the fork's community please follow this Discord button here.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/whitef0x0/tellform/tree/master) ![Discord](https://img.shields.io/discord/595773457862492190.svg?label=Discord%20Chat)
## Readme and Issues
The README.md is still effectively in tact however it's all been commented out so that it's no longer visible on the main github repository page. You may visit it by navigating through the repositories files themselves.
No new or old issues will be tended to so the Issues Board has been closed. We don't recommend using this repositories codebase as its no longer maintained and is only intended for reference code. If you wish to use the fork which should remain backwards compatible feel free to explore [https://ohmyform.com](https://ohmyform.com/) or its GitHub repository at [https://github.com/ohmyform/ohmyform/](https://github.com/ohmyform/ohmyform/) where the code base is started from TellForm we are planning on keeping it reverse compatible however the code is Sublicensed AGPL and is going to have a stable release prepared for the public hopefully but September 12th 2019. It should be a drop in replacement for TellForm which should expand on the vision of TellForm but hopefully bring it all up to date.
<!--
> An *opensource alternative to TypeForm* that can create [stunning mobile-ready forms](https://tellform.com/examples) , surveys and questionnaires.-->
<!--
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/tellform/tellform/tree/master)
-->
<!--
## Table of Contents ## Table of Contents
- [Features](#features) - [Features](#features)
- [How to Contribute](#how-to-contribute) - [How to Contribute](#how-to-contribute)
- [Quickstart](#quickstart) - [Quickstart](#quickstart)
@ -24,11 +40,8 @@ TellForm 2.1.0
- [Backers](#backers) - [Backers](#backers)
- [Contributors](#contributors) - [Contributors](#contributors)
- [Mentions on the Web](#mentions-on-the-web) - [Mentions on the Web](#mentions-on-the-web)
## Features ## Features
### Currently following features are implemented: ### Currently following features are implemented:
- Multi-Language Support - Multi-Language Support
- 11 possible question types - 11 possible question types
- Editable start and end pages - Editable start and end pages
@ -38,7 +51,6 @@ TellForm 2.1.0
- Embeddable Forms - Embeddable Forms
- Forms as a Service API - Forms as a Service API
- Deployable with Heroku and DockerHub - Deployable with Heroku and DockerHub
### On the Roadmap for v3.0.0 ### On the Roadmap for v3.0.0
- Implement encryption for all form data - Implement encryption for all form data
- Add Typeform API integration - Add Typeform API integration
@ -47,37 +59,27 @@ TellForm 2.1.0
- Add Stripe/Payment Form field - Add Stripe/Payment Form field
- Add Custom Background and Dropdown Field Images - Add Custom Background and Dropdown Field Images
- Add File Upload Form Field - Add File Upload Form Field
## How to Contribute ## How to Contribute
Please checkout our CONTRIBUTING.md on ways to contribute to TellForm. Please checkout our CONTRIBUTING.md on ways to contribute to TellForm.
All contributors are eligible to get a free [TellForm Sticker](https://www.stickermule.com/marketplace/15987-tellform-round-sticker). All you have to do is submit a PR, get it accepted, email your address to team [at] tellform.com and we'll send you a sticker that you can proudly put on your laptop. All contributors are eligible to get a free [TellForm Sticker](https://www.stickermule.com/marketplace/15987-tellform-round-sticker). All you have to do is submit a PR, get it accepted, email your address to team [at] tellform.com and we'll send you a sticker that you can proudly put on your laptop.
## Quickstart ## Quickstart
Before you start, make sure you have Before you start, make sure you have
1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379 1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379
2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all) 2. [MongoDB](https://www.mongodb.com/) installed and running at 127.0.0.1:27017 (OR specify the host and port in config/env/all)
Also make sure to install [DNS Masq](http://www.thekelleys.org.uk/dnsmasq/doc.html) or equivalent if running it locally on your computer (look at dns_masq_setup_osx for instructions on OSX) Also make sure to install [DNS Masq](http://www.thekelleys.org.uk/dnsmasq/doc.html) or equivalent if running it locally on your computer (look at dns_masq_setup_osx for instructions on OSX)
Install dependencies first. Install dependencies first.
```bash ```bash
$ npm install $ npm install
$ bower install $ bower install
``` ```
Setup environment. Setup environment.
```bash ```bash
$ grunt build $ grunt build
``` ```
Create your user account Create your user account
```bash ```bash
$ node ./scripts/setup.js $ node ./scripts/setup.js
``` ```
OR create your .env file OR create your .env file
``` ```
GOOGLE_ANALYTICS_ID=yourGAID GOOGLE_ANALYTICS_ID=yourGAID
@ -85,92 +87,67 @@ PRERENDER_TOKEN=yourPrerender.ioToken
COVERALLS_REPO_TOKEN=yourCoveralls.ioToken COVERALLS_REPO_TOKEN=yourCoveralls.ioToken
BASE_URL=localhost BASE_URL=localhost
DSN_KEY=yourPrivateRavenKey DSN_KEY=yourPrivateRavenKey
# Mail config # Mail config
MAILER_EMAIL_ID=user@domain.com MAILER_EMAIL_ID=user@domain.com
MAILER_PASSWORD=some-pass MAILER_PASSWORD=some-pass
MAILER_FROM=user@domain.com MAILER_FROM=user@domain.com
# Use this for one of Nodemailer's pre-configured service providers # Use this for one of Nodemailer's pre-configured service providers
MAILER_SERVICE_PROVIDER=SendGrid MAILER_SERVICE_PROVIDER=SendGrid
# Use these for a custom service provider # Use these for a custom service provider
# Note: MAILER_SMTP_HOST will override MAILER_SERVICE_PROVIDER # Note: MAILER_SMTP_HOST will override MAILER_SERVICE_PROVIDER
MAILER_SMTP_HOST=smtp.domain.com MAILER_SMTP_HOST=smtp.domain.com
MAILER_SMTP_PORT=465 MAILER_SMTP_PORT=465
MAILER_SMTP_SECURE=true MAILER_SMTP_SECURE=TRUE
``` ```
Side note: ___Currently we are using Raven and Sentry [https://www.getsentry.com](https://www.getsentry.com) for error logging. To use it you must provide a valid private DSN key in your .env file and a public DSN key in app/views/layout.index.html___ Side note: ___Currently we are using Raven and Sentry [https://www.getsentry.com](https://www.getsentry.com) for error logging. To use it you must provide a valid private DSN key in your .env file and a public DSN key in app/views/layout.index.html___
#### To run the development version: #### To run the development version:
Set ```NODE_ENV=development``` in .env file Set ```NODE_ENV=development``` in .env file
```$ grunt``` ```$ grunt```
#### To run the production version: #### To run the production version:
Set ```NODE_ENV=production``` in .env file Set ```NODE_ENV=production``` in .env file
```$ grunt``` ```$ grunt```
Your application should run on port 3000 or the port you specified in your .env file, so in your browser just go to [http://localhost:3000](http://localhost:3000) Your application should run on port 3000 or the port you specified in your .env file, so in your browser just go to [http://localhost:3000](http://localhost:3000)
## Deploying with Docker ## Deploying with Docker
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 follow these steps:
Then run these commands ### Step 1: Clone the repo
`$ git clone https://github.com/tellform/docker_files.git`
``` ### Step 2: Setup TellForm Configuration
$ docker run -p 27017:27017 -d --name some-mongo mongo Create your .env file by copying the .env.dist file included in the repo and changing it to suit your deployment.
$ docker run -p 127.0.0.1:6379:6379 -d --name some-redis redis Important: You need to fill out all of the ENV variables in the "Mail Settings" section or your TellForm instance won't work.
$ 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 If you want to have https, make sure to change 'TLS_FLAVOR'
``` ### Step 3: Start your TellForm instance
`docker-compose up -d`
TellForm should now be accessible on http://localhost
## 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:
``` ```
$ grunt test $ grunt test
``` ```
This will run both the server-side tests (located in the app/tests/ directory) and the client-side tests (located in the public/modules/*/tests/). This will run both the server-side tests (located in the app/tests/ directory) and the client-side tests (located in the public/modules/*/tests/).
To execute only the server tests, run the test:server task: To execute only the server tests, run the test:server task:
``` ```
$ grunt test:server $ grunt test:server
``` ```
And to run only the client tests, run the test:client task: And to run only the client tests, run the test:client task:
``` ```
$ grunt test:client $ grunt test:client
``` ```
Currently the live example uses heroku github deployments. The Docker file is out of date and does not work. If someone wishes to get it working feel free to submit a pull request. Currently the live example uses heroku github deployments. The Docker file is out of date and does not work. If someone wishes to get it working feel free to submit a pull request.
To calculate your total test coverage with Istanbul, run the coverage task To calculate your total test coverage with Istanbul, run the coverage task
```bash ```bash
$ grunt coverage $ grunt coverage
``` ```
To calculate your server-side test coverage with Istanbul, run the coverage task To calculate your server-side test coverage with Istanbul, run the coverage task
```bash ```bash
$ grunt coverage:server $ grunt coverage:server
``` ```
To calculate your client-side test coverage with Istanbul, run the coverage task To calculate your client-side test coverage with Istanbul, run the coverage task
```bash ```bash
$ grunt coverage:client $ grunt coverage:client
``` ```
## Configuration ## Configuration
TellForm's configuration is done with environment variables. To set an option for TellForm, open/create your .env file and set add `ENV_VAR=somevalue` to set the ENV_VAR variable to the value `somevalue`. TellForm's configuration is done with environment variables. To set an option for TellForm, open/create your .env file and set add `ENV_VAR=somevalue` to set the ENV_VAR variable to the value `somevalue`.
| Property | Valid Values | Default Value | Description | Required? | | Property | Valid Values | Default Value | Description | Required? |
|-------------------------|--------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------| |-------------------------|--------------------------------------------------------|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| NODE_ENV | "development", "production", "test" or "secure" | development | Set which version of the app you want to run (either secure/SSL, dev, prod or test) | No | | NODE_ENV | "development", "production", "test" or "secure" | development | Set which version of the app you want to run (either secure/SSL, dev, prod or test) | No |
@ -199,42 +176,24 @@ TellForm's configuration is done with environment variables. To set an option fo
| APP_KEYWORDS | A comma-seperated list of phrases/words | typeform, pdfs, forms, opensource, formbuilder, google forms, nodejs | Sets the value of the <meta> description attribute. | No | | APP_KEYWORDS | A comma-seperated list of phrases/words | typeform, pdfs, forms, opensource, formbuilder, google forms, nodejs | Sets the value of the <meta> description attribute. | No |
| RAVEN_DSN | A valid Sentry.io DSN | N/A | Set this to your Sentry.io Public DSN to enable remote logging | No | | RAVEN_DSN | A valid Sentry.io DSN | N/A | Set this to your Sentry.io Public DSN to enable remote logging | No |
| GOOGLE_ANALYTICS_ID | A valid Google Analytics ID | N/A | Set this to your GA id to enable GA tracking on your TellForm instance | No | | GOOGLE_ANALYTICS_ID | A valid Google Analytics ID | N/A | Set this to your GA id to enable GA tracking on your TellForm instance | No |
## Where to get help ## Where to get help
[Gitter Chat](https://gitter.im/tellform/Lobby)
[Gitter Chat](https://gitter.im/whitef0x0/tellform)
[Official Twitter](https://twitter.com/tellform_real) [Official Twitter](https://twitter.com/tellform_real)
-->
## Sponsors ## Sponsors
Further Sponsorships are no longer accepted.
<!--
Does your company use TellForm? Help keep the project bug-free and feature rich by [sponsoring the project](https://opencollective.com/tellform#sponsor). Does your company use TellForm? Help keep the project bug-free and feature rich by [sponsoring the project](https://opencollective.com/tellform#sponsor).
<a href="https://countable.ca" style="padding: 30px 0">
<a href="https://m.do.co/c/a86fd8843e09" style="padding: 30px 0"> <img src="https://countable.ca/logo.cb446ab0.svg" height="30px">
<img src="/docs/readme_logos/do_logo.png" height="30px"> </a> -->
</a>
<a href="https://getsentry.com/" style="padding: 30px 0">
<img src="/docs/readme_logos/sentry_logo.png" height="30px">
</a>
<a href="https://statuspage.io/" style="padding: 30px 0">
<img src="/docs/readme_logos/statuspage_logo.png" height="30px">
</a>
<br><br>
<a href="https://www.stickermule.com/unlock?ref_id=0939360701" style="padding: 30px 0">
<img src="/docs/readme_logos/stickermule_logo.png" height="30px">
</a>
<a href="https://sparkpost.com/" style="padding: 30px 0">
<img src="/docs/readme_logos/sparkpost_logo.png" height="30px">
</a>
<a href="https://therooststand.com/" style="padding: 30px 0">
<img src="/docs/readme_logos/roost_logo.png" height="30px">
</a>
## Backers ## Backers
Love our work and community? [Become a backer](https://opencollective.com/tellform). Love our work and community? <!--[Become a backer](https://opencollective.com/tellform).-->
<a href="https://opencollective.com/elliot" target="_blank"> <a href="https://opencollective.com/elliot" target="_blank">
<img src="https://opencollective.com/proxy/images/?src=https%3A%2F%2Fd1ts43dypk8bqh.cloudfront.net%2Fv1%2Favatars%2F6fd61b2c-62b6-438a-9168-bab7ef1489b8" height= "64"> <img src="https://opencollective.com/proxy/images/?src=https%3A%2F%2Fd1ts43dypk8bqh.cloudfront.net%2Fv1%2Favatars%2F6fd61b2c-62b6-438a-9168-bab7ef1489b8" height= "64">
@ -247,14 +206,12 @@ Love our work and community? [Become a backer](https://opencollective.com/tellfo
## Contributors ## Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars2.githubusercontent.com/u/1160417?v=3" width="100px;"/><br /><sub>David Baldwynn</sub>](http://baldwynn.me)<br />[💻](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Code") [🔧](#tool-whitef0x0 "Tools") [🚇](#infra-whitef0x0 "Infrastructure (Hosting, Build-Tools, etc)") [📖](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Documentation") [💡](#example-whitef0x0 "Examples") [🎨](#design-whitef0x0 "Design") [🔍](#fundingFinding-whitef0x0 "Funding Finding") [👀](#review-whitef0x0 "Reviewed Pull Requests") [⚠️](https://github.com/tellform/TellForm/commits?author=whitef0x0 "Tests") | [<img src="https://avatars2.githubusercontent.com/u/313117?v=3" width="100px;"/><br /><sub>Samuel Laulhau</sub>](https://samuellaulhau.fr)<br />[💻](https://github.com/tellform/TellForm/commits?author=lalop "Code") [🌍](#translation-lalop "Translation") | [<img src="https://avatars0.githubusercontent.com/u/313507?v=3" width="100px;"/><br /><sub>Arun Pattnaik</sub>](http://arun.co)<br />[🎨](#design-arunpattnaik "Design") | [<img src="https://avatars0.githubusercontent.com/u/5405744?v=3" width="100px;"/><br /><sub>Thiên Toán</sub>](https://toanalien.com)<br />[🐛](https://github.com/tellform/TellForm/issues?q=author%3Atoanalien "Bug reports") [💻](https://github.com/tellform/TellForm/commits?author=toanalien "Code") [📖](https://github.com/tellform/TellForm/commits?author=toanalien "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/8615608?v=3" width="100px;"/><br /><sub>Adrian Portabales</sub>](https://github.com/AdrianP-)<br />[🐛](https://github.com/tellform/TellForm/issues?q=author%3AAdrianP- "Bug reports") [💻](https://github.com/tellform/TellForm/commits?author=AdrianP- "Code") | [<img src="https://avatars3.githubusercontent.com/u/8433587?v=3" width="100px;"/><br /><sub>Peter Thaleikis</sub>](https://github.com/spekulatius)<br />[📖](https://github.com/tellform/TellForm/commits?author=spekulatius "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/1247388?v=3" width="100px;"/><br /><sub>Mickaël Andrieu</sub>](http://www.mickael-andrieu.com)<br />[📖](https://github.com/tellform/TellForm/commits?author=mickaelandrieu "Documentation") | | [<img src="https://avatars2.githubusercontent.com/u/1160417?v=3" width="100px;"/><br /><sub>David Baldwynn</sub>](http://baldwynn.me)<br />[💻](https://github.com/tellform/tellform/commits?author=whitef0x0 "Code") [🔧](#tool-whitef0x0 "Tools") [🚇](#infra-whitef0x0 "Infrastructure (Hosting, Build-Tools, etc)") [📖](https://github.com/tellform/tellform/commits?author=whitef0x0 "Documentation") [💡](#example-whitef0x0 "Examples") [🎨](#design-whitef0x0 "Design") [🔍](#fundingFinding-whitef0x0 "Funding Finding") [👀](#review-whitef0x0 "Reviewed Pull Requests") [⚠️](https://github.com/tellform/tellform/commits?author=whitef0x0 "Tests") | [<img src="https://avatars2.githubusercontent.com/u/313117?v=3" width="100px;"/><br /><sub>Samuel Laulhau</sub>](https://samuellaulhau.fr)<br />[💻](https://github.com/tellform/tellform/commits?author=lalop "Code") [🌍](#translation-lalop "Translation") | [<img src="https://avatars0.githubusercontent.com/u/313507?v=3" width="100px;"/><br /><sub>Arun Pattnaik</sub>](http://arun.co)<br />[🎨](#design-arunpattnaik "Design") | [<img src="https://avatars0.githubusercontent.com/u/5405744?v=3" width="100px;"/><br /><sub>Thiên Toán</sub>](https://toanalien.com)<br />[🐛](https://github.com/tellform/tellform/issues?q=author%3Atoanalien "Bug reports") [💻](https://github.com/tellform/tellform/commits?author=toanalien "Code") [📖](https://github.com/tellform/tellform/commits?author=toanalien "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/8615608?v=3" width="100px;"/><br /><sub>Adrian Portabales</sub>](https://github.com/AdrianP-)<br />[🐛](https://github.com/tellform/tellform/issues?q=author%3AAdrianP- "Bug reports") [💻](https://github.com/tellform/tellform/commits?author=AdrianP- "Code") | [<img src="https://avatars3.githubusercontent.com/u/8433587?v=3" width="100px;"/><br /><sub>Peter Thaleikis</sub>](https://github.com/spekulatius)<br />[📖](https://github.com/tellform/tellform/commits?author=spekulatius "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/1247388?v=3" width="100px;"/><br /><sub>Mickaël Andrieu</sub>](http://www.mickael-andrieu.com)<br />[📖](https://github.com/tellform/tellform/commits?author=mickaelandrieu "Documentation") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars1.githubusercontent.com/u/1522464?v=3" width="100px;"/><br /><sub>Ahmad Luqman</sub>](https://github.com/ahmad-luqman)<br />[📖](https://github.com/tellform/TellForm/commits?author=ahmad-luqman "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/3691490?v=3" width="100px;"/><br /><sub>Peter Dave Hello</sub>](https://www.peterdavehello.org/)<br />[📖](https://github.com/tellform/TellForm/commits?author=PeterDaveHello "Documentation") | | [<img src="https://avatars1.githubusercontent.com/u/1522464?v=3" width="100px;"/><br /><sub>Ahmad Luqman</sub>](https://github.com/ahmad-luqman)<br />[📖](https://github.com/tellform/tellform/commits?author=ahmad-luqman "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/3691490?v=3" width="100px;"/><br /><sub>Peter Dave Hello</sub>](https://www.peterdavehello.org/)<br />[📖](https://github.com/tellform/tellform/commits?author=PeterDaveHello "Documentation") |
<!-- ALL-CONTRIBUTORS-LIST:END --> <!-- ALL-CONTRIBUTORS-LIST:END -->
## Mentions on the Web ## Mentions on the Web
[Mister Ad](http://start.mister-ad.biz/newsticker/open-source-alternative-zu-typeform-tellform-in-der-kurzvorstellung/)
[t3n.de](http://t3n.de/news/open-source-alternative-typeform-tellform-707295/) [t3n.de](http://t3n.de/news/open-source-alternative-typeform-tellform-707295/)
[BootCSS Expo](http://expo.bootcss.com/) [BootCSS Expo](http://expo.bootcss.com/)

View file

@ -28,5 +28,10 @@
"description": "Which mail service/API you will be using (i.e. SparkPost, Mandrill, etc)", "description": "Which mail service/API you will be using (i.e. SparkPost, Mandrill, etc)",
"value": "SendGrid" "value": "SendGrid"
} }
},
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs#v111"
} }
]
} }

View file

@ -19,7 +19,7 @@ exports.deleteSubmissions = function(req, res) {
var submission_id_list = req.body.deleted_submissions, var submission_id_list = req.body.deleted_submissions,
form = req.form; form = req.form;
FormSubmission.remove({ form: req.form, admin: req.user, _id: {$in: submission_id_list} }, function(err){ FormSubmission.remove({ form: req.form, _id: {$in: submission_id_list} }, function(err){
if(err){ if(err){
res.status(400).send({ res.status(400).send({
@ -79,7 +79,7 @@ exports.createSubmission = function(req, res) {
exports.listSubmissions = function(req, res) { exports.listSubmissions = function(req, res) {
var _form = req.form; var _form = req.form;
FormSubmission.find({ form: _form._id }).sort('-created').lean().exec(function(err, _submissions) { FormSubmission.find({ form: _form._id }).sort('created').lean().exec(function(err, _submissions) {
if (err) { if (err) {
console.error(err); console.error(err);
res.status(500).send({ res.status(500).send({
@ -88,17 +88,15 @@ exports.listSubmissions = function(req, res) {
} }
res.json(_submissions); res.json(_submissions);
}); });
}; };
/** /**
* Create a new form * Create a new form
*/ */
exports.create = function(req, res) { exports.create = function(req, res) {
debugger;
if(!req.body.form){ if(!req.body.form){
return res.status(401).send({ return res.status(400).send({
message: 'Invalid Input' message: 'Invalid Input'
}); });
} }
@ -125,15 +123,7 @@ exports.read = function(req, res) {
if(!req.user || (req.form.admin.id !== req.user.id) ){ if(!req.user || (req.form.admin.id !== req.user.id) ){
readForRender(req, res); readForRender(req, res);
} else { } else {
FormSubmission.find({ form: req.form._id }).exec(function(err, _submissions) {
if (err) {
res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
}
var newForm = req.form.toJSON(); var newForm = req.form.toJSON();
newForm.submissions = _submissions;
if (req.userId) { if (req.userId) {
if(req.form.admin._id+'' === req.userId+''){ if(req.form.admin._id+'' === req.userId+''){
@ -144,7 +134,6 @@ exports.read = function(req, res) {
}); });
} }
return res.json(newForm); return res.json(newForm);
});
} }
}; };
@ -256,7 +245,7 @@ exports.list = function(req, res) {
Form.find(searchObj) Form.find(searchObj)
.sort('-created') .sort('-created')
.select('title language submissions admin isLive') .select('title language admin submissions isLive')
.populate('admin.username', 'admin._id') .populate('admin.username', 'admin._id')
.lean() .lean()
.exec(function(err, forms) { .exec(function(err, forms) {
@ -288,7 +277,6 @@ exports.formByID = function(req, res, next, id) {
} }
Form.findById(id) Form.findById(id)
.populate('admin') .populate('admin')
.populate('submissions')
.exec(function(err, form) { .exec(function(err, form) {
if (err) { if (err) {
return next(err); return next(err);

View file

@ -9,16 +9,10 @@ var errorHandler = require('../errors.server.controller'),
config = require('../../../config/config'), config = require('../../../config/config'),
User = mongoose.model('User'), User = mongoose.model('User'),
tokgen = require('../../libs/tokenGenerator'), tokgen = require('../../libs/tokenGenerator'),
fs = require('fs'); fs = require('fs'),
i18n = require('i18n'),
require.extensions['.html'] = function (module, filename) { async = require('async'),
module.exports = fs.readFileSync(filename, 'utf8'); pug = require('pug');
};
var welcomeEmail = require("../../views/welcome.email.view.html");
var verificationEmail = require("../../views/verification.email.view.html");
var nev = require('email-verification')(mongoose); var nev = require('email-verification')(mongoose);
@ -26,6 +20,15 @@ var nev = require('email-verification')(mongoose);
var config_nev = function () { var config_nev = function () {
nev.configure({ nev.configure({
verifyMailOptions: {
from: config.mailer.from
},
confirmMailOptions: {
from: config.mailer.from
},
persistentUserModel: User, persistentUserModel: User,
tempUserCollection: config.tempUserCollection, tempUserCollection: config.tempUserCollection,
emailAndUsernameUnique: true, emailAndUsernameUnique: true,
@ -33,19 +36,7 @@ var config_nev = function () {
verificationURL: config.baseUrl+'/#!/verify/${URL}', verificationURL: config.baseUrl+'/#!/verify/${URL}',
transportOptions: config.mailer.options, transportOptions: config.mailer.options,
verifyMailOptions: {
from: config.mailer.from,
subject: '✔ Activate your new TellForm account!',
html: welcomeEmail,
text: 'Please verify your account by clicking the following link, or by copying and pasting it into your browser: ${URL}'
},
confirmMailOptions: {
from: config.mailer.from,
subject: '✔ Welcome to {{app.title}}!',
html: verificationEmail,
text: 'Your account has been successfully verified.'
},
verifySendMailCallback: function(err, info) { verifySendMailCallback: function(err, info) {
if (err) { if (err) {
throw err; throw err;
@ -63,13 +54,22 @@ var config_nev = function () {
throw err; throw err;
} }
}); });
}; };
config_nev(); config_nev();
exports.validateVerificationToken = function(req, res){ exports.validateVerificationToken = function(req, res){
nev.confirmTempUser(req.params.token, function(err, user) {
const fn = pug.compileFile(__dirname + "/../../views/welcome.email.view.pug");
var renderedHtml = fn(res.locals);
var emailTemplate = {
subject: i18n.__('WELCOME_EMAIL_SUBJECT', config.app.title),
html: renderedHtml,
text: i18n.__('WELCOME_EMAIL_TEXT')
};
nev.confirmTempUser(req.params.token, emailTemplate, function(err, user) {
if(err) { if(err) {
return res.status(500).send( {message: err } ); return res.status(500).send( {message: err } );
} else if (user){ } else if (user){
@ -83,7 +83,16 @@ exports.validateVerificationToken = function(req, res){
}; };
exports.resendVerificationEmail = function(req, res, next){ exports.resendVerificationEmail = function(req, res, next){
nev.resendVerificationEmail(req.body.email, function(err, userFound) { const fn = pug.compileFile(__dirname + "/../../views/verification.email.view.pug");
var renderedHtml = fn(res.locals);
var emailTemplate = {
subject: i18n.__('VERIFICATION_EMAIL_SUBJECT'),
html: renderedHtml,
text: i18n.__('VERIFICATION_EMAIL_TEXT')
};
nev.resendVerificationEmail(req.body.email, emailTemplate, function(err, userFound) {
if(err) { if(err) {
return res.status(500).send( {message: errorHandler.getErrorMessage(err) } ); return res.status(500).send( {message: errorHandler.getErrorMessage(err) } );
} }
@ -107,23 +116,35 @@ exports.signup = function(req, res) {
// Init Variables // Init Variables
var user = new User(req.body); var user = new User(req.body);
// Set language to visitor's language
user.language = req.cookies['userLang'];
// Add missing user fields // Add missing user fields
user.provider = 'local'; user.provider = 'local';
// Then save the temporary user // Then save the temporary user
nev.createTempUser(user, function (err, existingPersistentUser, newTempUser) { nev.createTempUser(user, function (err, existingPersistentUser, newTempUser) {
if (err) { if (err) {
console.log(err);
return res.status(400).send({ return res.status(400).send({
message: errorHandler.getErrorMessage(err) message: errorHandler.getErrorMessage(err)
}); });
} }
// new user created // new user created
if (newTempUser) { if (newTempUser) {
var URL = newTempUser[nev.options.URLFieldName]; const fn = pug.compileFile(__dirname + "/../../views/verification.email.view.pug");
nev.sendVerificationEmail(user.email, URL, function (sendEmailErr, info) { var renderedHtml = fn(res.locals);
if (sendEmailErr) {
var URL = newTempUser[nev.options.URLFieldName];
var emailTemplate = {
subject: i18n.__('VERIFICATION_EMAIL_SUBJECT'),
html: renderedHtml,
text: i18n.__('VERIFICATION_EMAIL_TEXT')
};
nev.sendVerificationEmail(user.email, URL, emailTemplate, function (sendEmailErr, info) {
if (sendEmailErr) {
return res.status(400).send({ return res.status(400).send({
message: errorHandler.getErrorMessage(err) message: errorHandler.getErrorMessage(err)
}); });
@ -131,7 +152,7 @@ exports.signup = function(req, res) {
return res.status(200).send('An email has been sent to you. Please check it to verify your account.'); return res.status(200).send('An email has been sent to you. Please check it to verify your account.');
}); });
} else { } else {
return res.status(400).send({message: 'Error: User already exists!'}); return res.status(400).send({message: 'User with username/email already exists!'});
} }
}); });
}; };
@ -140,6 +161,7 @@ exports.signup = function(req, res) {
* Signin after passport authentication * Signin after passport authentication
*/ */
exports.signin = function(req, res, next) { exports.signin = function(req, res, next) {
passport.authenticate('local', function(err, user, info) { passport.authenticate('local', function(err, user, info) {
if (err || !user) { if (err || !user) {
res.status(400).send(info); res.status(400).send(info);
@ -155,6 +177,8 @@ exports.signin = function(req, res, next) {
message: errorHandler.getErrorMessage(loginErr) message: errorHandler.getErrorMessage(loginErr)
}); });
} }
res.cookie('langCookie', user.language, { maxAge: 90000, httpOnly: true });
return res.json(user); return res.json(user);
}); });
} }
@ -165,138 +189,11 @@ exports.signin = function(req, res, next) {
* Signout * Signout
*/ */
exports.signout = function(req, res) { exports.signout = function(req, res) {
if(req.cookies.hasOwnProperty('userLang')){
res.clearCookie('userLang');
}
req.logout(); req.logout();
return res.status(200).send('You have successfully logged out.'); return res.status(200).send('You have successfully logged out.');
};
/**
* OAuth callback
*/
exports.oauthCallback = function(strategy) {
return function(req, res, next) {
passport.authenticate(strategy, function(err, user, redirectURL) {
if (err || !user) {
return res.redirect('/#!/signin');
}
req.login(user, function(err) {
if (err) {
return res.redirect('/#!/signin');
}
return res.redirect(redirectURL || '/');
});
})(req, res, next);
};
};
/**
* Helper function to save or update a OAuth user profile
*/
exports.saveOAuthUserProfile = function(req, providerUserProfile, done) {
if (!req.user) {
// Define a search query fields
var searchMainProviderIdentifierField = 'providerData.' + providerUserProfile.providerIdentifierField;
var searchAdditionalProviderIdentifierField = 'additionalProvidersData.' + providerUserProfile.provider + '.' + providerUserProfile.providerIdentifierField;
// Define main provider search query
var mainProviderSearchQuery = {};
mainProviderSearchQuery.provider = providerUserProfile.provider;
mainProviderSearchQuery[searchMainProviderIdentifierField] = providerUserProfile.providerData[providerUserProfile.providerIdentifierField];
// Define additional provider search query
var additionalProviderSearchQuery = {};
additionalProviderSearchQuery[searchAdditionalProviderIdentifierField] = providerUserProfile.providerData[providerUserProfile.providerIdentifierField];
// Define a search query to find existing user with current provider profile
var searchQuery = {
$or: [mainProviderSearchQuery, additionalProviderSearchQuery]
};
User.findOne(searchQuery, function(err, user) {
if (err) {
return done(err);
} else {
if (!user) {
var possibleUsername = providerUserProfile.username || ((providerUserProfile.email) ? providerUserProfile.email.split('@')[0] : '');
User.findUniqueUsername(possibleUsername, null, function(availableUsername) {
var newUser = new User({
firstName: providerUserProfile.firstName,
lastName: providerUserProfile.lastName,
username: availableUsername,
displayName: providerUserProfile.displayName,
email: providerUserProfile.email,
provider: providerUserProfile.provider,
providerData: providerUserProfile.providerData
});
// And save the user
newUser.save(function(userSaveErr) {
return done(userSaveErr, user);
});
});
}
return done(err, user);
}
});
} else {
// User is already logged in, join the provider data to the existing user
var user = req.user;
// Check if user exists, is not signed in using this provider, and doesn't have that provider data already configured
if (user.provider !== providerUserProfile.provider && (!user.additionalProvidersData || !user.additionalProvidersData[providerUserProfile.provider])) {
// Add the provider data to the additional provider data field
if (!user.additionalProvidersData) {
user.additionalProvidersData = {};
}
user.additionalProvidersData[providerUserProfile.provider] = providerUserProfile.providerData;
// Then tell mongoose that we've updated the additionalProvidersData field
user.markModified('additionalProvidersData');
// And save the user
user.save(function(err) {
return done(err, user, '/#!/settings/accounts');
});
} else {
return done(new Error('User is already connected using this provider'), user);
}
}
};
/**
* Remove OAuth provider
*/
exports.removeOAuthProvider = function(req, res, next) {
var user = req.user;
var provider = req.param('provider');
if (user && provider) {
// Delete the additional provider
if (user.additionalProvidersData[provider]) {
delete user.additionalProvidersData[provider];
// Then tell mongoose that we've updated the additionalProvidersData field
user.markModified('additionalProvidersData');
}
user.save(function(err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
req.login(user, function(err) {
if (err) {
res.status(400).send(err);
} else {
res.json(user);
}
});
}
});
}
}; };
/* Generate API Key for User */ /* Generate API Key for User */

View file

@ -11,7 +11,8 @@ var _ = require('lodash'),
config = require('../../../config/config'), config = require('../../../config/config'),
nodemailer = require('nodemailer'), nodemailer = require('nodemailer'),
async = require('async'), async = require('async'),
crypto = require('crypto'); crypto = require('crypto'),
pug = require('pug');
var smtpTransport = nodemailer.createTransport(config.mailer.options); var smtpTransport = nodemailer.createTransport(config.mailer.options);
@ -32,10 +33,23 @@ exports.forgot = function(req, res) {
if (req.body.username) { if (req.body.username) {
User.findOne({ User.findOne({
$or: [ $or: [
{'username': req.body.username}, {'username': req.body.username.toLowerCase()},
{'email': req.body.username} {'email': req.body.username}
] ]
}, '-salt -password', function(err, user) { }, '-salt -password', function(err, user) {
if(err){
return res.status(500).send({
message: err.message
});
}
if (!user) {
var tempUserModel = mongoose.model(config.tempUserCollection);
tempUserModel.findOne({
$or: [
{'username': req.body.username.toLowerCase()},
{'email': req.body.username}
]
}).lean().exec(function(err, user) {
if(err){ if(err){
return res.status(500).send({ return res.status(500).send({
message: err.message message: err.message
@ -45,9 +59,11 @@ exports.forgot = function(req, res) {
return res.status(400).send({ return res.status(400).send({
message: 'No account with that username or email has been found' message: 'No account with that username or email has been found'
}); });
} else if (user.provider !== 'local') { }
return res.status(400).send({ return res.status(400).send({
message: 'It seems like you signed up using your ' + user.provider + ' account' message: 'The account associated with this email has not been activated yet'
});
}); });
} else { } else {
user.resetPasswordToken = token; user.resetPasswordToken = token;
@ -65,13 +81,12 @@ exports.forgot = function(req, res) {
} }
}, },
function(token, user, done) { function(token, user, done) {
res.render('templates/reset-password-email', { const fn = pug.compileFile(__dirname + "/../../views/templates/reset-password-email.server.view.pug");
name: user.displayName || 'TellForm User', res.locals['url'] = 'http://' + req.headers.host + '/auth/reset/' + token;
appName: config.app.title,
url: 'http://' + req.headers.host + '/auth/reset/' + token console.log(res.locals);
}, function(err, emailHTML) { var renderedHtml = fn(res.locals);
done(err, emailHTML, user); done(null, renderedHtml, user);
});
}, },
// If valid email, send reset email using service // If valid email, send reset email using service
function(emailHTML, user, done) { function(emailHTML, user, done) {
@ -138,10 +153,21 @@ exports.validateResetToken = function(req, res) {
* Reset password POST from email token * Reset password POST from email token
*/ */
exports.reset = function(req, res, next) { exports.reset = function(req, res, next) {
if(req.body.newPassword.length < 4){
return res.status(400).send({
message: 'Password must be at least 4 characters long'
});
}
if(req.body.newPassword !== req.body.verifyPassword){
return res.status(400).send({
message: 'Passwords do not match'
});
}
// Init Variables // Init Variables
var passwordDetails = req.body; var passwordDetails = req.body;
async.waterfall([ async.waterfall([
function(done) { function(done) {
User.findOne({ User.findOne({
resetPasswordToken: req.params.token, resetPasswordToken: req.params.token,
@ -150,32 +176,25 @@ exports.reset = function(req, res, next) {
} }
}, function(err, user) { }, function(err, user) {
if (!err && user) { if (!err && user) {
if (passwordDetails.newPassword === passwordDetails.verifyPassword) {
user.password = passwordDetails.newPassword; user.password = passwordDetails.newPassword;
user.resetPasswordToken = null; user.resetPasswordToken = null;
user.resetPasswordExpires = null; user.resetPasswordExpires = null;
user.save(function(err) { user.save(function(err, savedUser) {
if (err) { if (err) {
done(err, null); done(err, null);
} }
done(null, user); done(null, savedUser);
}); });
} else {
done('Passwords do not match', null);
}
} else { } else {
done('Password reset token is invalid or has expired.', null); done('Password reset token is invalid or has expired.', null);
} }
}); });
}, },
function(user, done) { function(user, done) {
res.render('templates/reset-password-confirm-email', { const fn = pug.compileFile(__dirname + "/../../views/templates/reset-password-confirm-email.server.view.pug");
name: user.displayName, var renderedHtml = fn(res.locals);
appName: config.app.title done(null, renderedHtml, user);
}, function(err, emailHTML) {
done(err, emailHTML, user);
});
}, },
// If valid email, send reset email using service // If valid email, send reset email using service
function(emailHTML, user, done) { function(emailHTML, user, done) {

View file

@ -71,7 +71,6 @@ var VisitorDataSchema = new Schema({
userAgent: { userAgent: {
type: String type: String
} }
}); });
var formSchemaOptions = { var formSchemaOptions = {
@ -219,7 +218,7 @@ FormSchema.virtual('analytics.fields').get(function () {
var visitors = this.analytics.visitors; var visitors = this.analytics.visitors;
var that = this; var that = this;
if(this.form_fields.length === 0) { if(!this.form_fields || this.form_fields.length === 0) {
return null; return null;
} }

View file

@ -9,19 +9,7 @@ var mongoose = require('mongoose'),
config = require('../../config/config'), config = require('../../config/config'),
timeStampPlugin = require('../libs/timestamp.server.plugin'), timeStampPlugin = require('../libs/timestamp.server.plugin'),
path = require('path'), path = require('path'),
querystring = require('querystring'), querystring = require('querystring');
nodemailer = require('nodemailer');
var smtpTransport = nodemailer.createTransport(config.mailer.options);
// verify connection configuration on startup
smtpTransport.verify(function(error, success) {
if (error) {
console.log('Your mail configuration is incorrect', error);
} else {
console.log('Mail server is ready to take our messages');
}
});
/** /**
* A Validation function for local strategy properties * A Validation function for local strategy properties
@ -37,18 +25,11 @@ var validateLocalStrategyProperty = function(property) {
return ((this.provider !== 'local' && !this.updated) || propHasLength); return ((this.provider !== 'local' && !this.updated) || propHasLength);
}; };
/**
* A Validation function for local strategy password
*/
var validateLocalStrategyPassword = function(password) {
return (this.provider !== 'local' || (password && password.length > 6));
};
/** /**
* A Validation function for username * A Validation function for username
*/ */
var validateUsername = function(username) { var validateUsername = function(username) {
return (username.match(/^[a-zA-Z0-9]+$/) !== null); return (username.match(/^[a-zA-Z0-9.-_]+$/) !== null);
}; };
@ -69,23 +50,17 @@ var UserSchema = new Schema({
email: { email: {
type: String, type: String,
trim: true, trim: true,
lowercase: true,
unique: 'Account already exists with this email', unique: 'Account already exists with this email',
required: 'Please enter your email', match: [/.+\@.+\..+/, 'Please fill a valid email address'],
validate: { required: [true, 'Email is required']
validator: validateLocalStrategyProperty,
message: 'Please fill in your email'
},
match: [/.+\@.+\..+/, 'Please fill a valid email address']
}, },
username: { username: {
type: String, type: String,
unique: true, unique: true,
required: true,
lowercase: true, lowercase: true,
validate: { match: [/^[a-zA-Z0-9\-]+$/, 'Username can only contain alphanumeric characters and \'-\''],
validator: validateUsername, required: [true, 'Username is required']
message: 'Please use a valid username'
}
}, },
passwordHash: { passwordHash: {
type: String, type: String,
@ -96,7 +71,6 @@ var UserSchema = new Schema({
}, },
provider: { provider: {
type: String, type: String,
required: 'Provider is required',
default: 'local' default: 'local'
}, },
providerData: {}, providerData: {},
@ -112,7 +86,6 @@ var UserSchema = new Schema({
type: String, type: String,
enum: ['en', 'fr', 'es', 'it', 'de'], enum: ['en', 'fr', 'es', 'it', 'de'],
default: 'en', default: 'en',
required: 'User must have a language'
}, },
lastModified: { lastModified: {
type: Date type: Date

View file

@ -25,6 +25,9 @@ module.exports = function(app) {
} else { } else {
app.route('/forms/:formIdFast([a-zA-Z0-9]+)/render') app.route('/forms/:formIdFast([a-zA-Z0-9]+)/render')
.get(forms.readForRender); .get(forms.readForRender);
app.route('/view/')
.get(core.form);
} }
app.route('/forms/:formIdFast([a-zA-Z0-9]+)') app.route('/forms/:formIdFast([a-zA-Z0-9]+)')

View file

@ -14,7 +14,6 @@ module.exports = function(app) {
// Setting up the users profile api // Setting up the users profile api
app.route('/users/me').get(auth.isAuthenticatedOrApiKey, users.getUser); app.route('/users/me').get(auth.isAuthenticatedOrApiKey, users.getUser);
app.route('/users').put(auth.isAuthenticatedOrApiKey, users.update); app.route('/users').put(auth.isAuthenticatedOrApiKey, users.update);
app.route('/users/accounts').delete(users.requiresLogin, users.removeOAuthProvider);
// Setting up the users account verification api // Setting up the users account verification api
app.route('/auth/verify/:token').get(users.validateVerificationToken); app.route('/auth/verify/:token').get(users.validateVerificationToken);

View file

@ -9,7 +9,8 @@ var should = require('should'),
User = mongoose.model('User'), User = mongoose.model('User'),
Form = mongoose.model('Form'), Form = mongoose.model('Form'),
Field = mongoose.model('Field'), Field = mongoose.model('Field'),
FormSubmission = mongoose.model('FormSubmission'); FormSubmission = mongoose.model('FormSubmission'),
async = require('async');
/** /**
* Globals * Globals
@ -68,7 +69,7 @@ describe('Form Routes Unit tests', function() {
.send({form: myForm}) .send({form: myForm})
.expect(401) .expect(401)
.end(function(FormSaveErr, FormSaveRes) { .end(function(FormSaveErr, FormSaveRes) {
console.log(FormSaveRes.text);
// Call the assertion callback // Call the assertion callback
done(FormSaveErr); done(FormSaveErr);
}); });
@ -83,7 +84,7 @@ describe('Form Routes Unit tests', function() {
}); });
}); });
it(' > should be able to read/get a Form if not signed in', function(done) { it(' > should be able to read/get a live Form if not signed in', function(done) {
// Create new Form model instance // Create new Form model instance
var FormObj = new Form(myForm); var FormObj = new Form(myForm);
@ -105,6 +106,23 @@ describe('Form Routes Unit tests', function() {
}); });
}); });
it(' > should be able to read/get a non-live Form if not signed in', function(done) {
// Create new Form model instance
var FormObj = new Form(myForm);
FormObj.isLive = false;
// Save the Form
FormObj.save(function(err, form) {
if(err) return done(err);
userSession.get('/subdomain/' + credentials.username + '/forms/' + form._id + '/render')
.expect(401, {message: 'Form is Not Public'})
.end(function(err, res) {
done(err);
});
});
});
it(' > should not be able to delete an Form if not signed in', function(done) { it(' > should not be able to delete an Form if not signed in', function(done) {
// Set Form user // Set Form user
myForm.admin = user; myForm.admin = user;
@ -146,6 +164,16 @@ describe('Form Routes Unit tests', function() {
}); });
}); });
it(' > should not be able to create a Form if body is empty', function(done) {
loginSession.post('/forms')
.send({form: null})
.expect(400, {"message":"Invalid Input"})
.end(function(FormSaveErr, FormSaveRes) {
// Call the assertion callback
done(FormSaveErr);
});
});
it(' > should not be able to save a Form if no title is provided', function(done) { it(' > should not be able to save a Form if no title is provided', function(done) {
// Set Form with a invalid title field // Set Form with a invalid title field
myForm.title = ''; myForm.title = '';
@ -165,10 +193,22 @@ describe('Form Routes Unit tests', function() {
done(); done();
}); });
}); });
it(' > should be able to update a Form if signed in', function(done) { it(' > should be able to create a Form if form_fields are undefined', function(done) {
myForm.analytics = null;
myForm.form_fields = null;
loginSession.post('/forms')
.send({form: myForm})
.expect(200)
.end(function(FormSaveErr, FormSaveRes) {
// Call the assertion callback
done(FormSaveErr);
});
});
it(' > should be able to update a Form if signed in and Form is valid', function(done) {
// Save a new Form // Save a new Form
loginSession.post('/forms') loginSession.post('/forms')
@ -182,7 +222,7 @@ describe('Form Routes Unit tests', function() {
} }
// Update Form title // Update Form title
myForm.title = 'WHY YOU GOTTA BE SO MEAN?'; myForm.title = 'WHY YOU GOTTA BE SO FORMULAIC?';
// Update an existing Form // Update an existing Form
loginSession.put('/forms/' + FormSaveRes.body._id) loginSession.put('/forms/' + FormSaveRes.body._id)
@ -197,13 +237,12 @@ describe('Form Routes Unit tests', function() {
// Set assertions // Set assertions
(FormUpdateRes.body._id).should.equal(FormSaveRes.body._id); (FormUpdateRes.body._id).should.equal(FormSaveRes.body._id);
(FormUpdateRes.body.title).should.match('WHY YOU GOTTA BE SO MEAN?'); (FormUpdateRes.body.title).should.match(myForm.title);
// Call the assertion callback // Call the assertion callback
done(); done();
}); });
}); });
}); });
it(' > should be able to delete a Form if signed in', function(done) { it(' > should be able to delete a Form if signed in', function(done) {
@ -238,10 +277,9 @@ describe('Form Routes Unit tests', function() {
done(); done();
}); });
}); });
}); });
it('should be able to save new form while logged in', function(done){ it(' > should be able to save new form while logged in', function(done){
// Save a new Form // Save a new Form
authenticatedSession.post('/forms') authenticatedSession.post('/forms')
.send({form: myForm}) .send({form: myForm})
@ -271,12 +309,70 @@ describe('Form Routes Unit tests', function() {
}); });
}); });
it(' > should be able to get list of users\' forms sorted by date created while logged in', function(done) {
var myForm1 = {
title: 'First Form',
language: 'en',
admin: user.id,
form_fields: [
new Field({'fieldType':'textfield', 'title':'First Name', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'nascar', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'hockey', 'fieldValue': ''})
],
isLive: true
};
var myForm2 = {
title: 'Second Form',
language: 'en',
admin: user.id,
form_fields: [
new Field({'fieldType':'textfield', 'title':'Last Name', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'formula one', 'fieldValue': ''}),
new Field({'fieldType':'checkbox', 'title':'football', 'fieldValue': ''})
],
isLive: true
};
var FormObj1 = new Form(myForm1);
var FormObj2 = new Form(myForm2);
async.waterfall([
function(callback) {
FormObj1.save(function(err){
callback(err);
});
},
function(callback) {
FormObj2.save(function(err){
callback(err);
});
},
function(callback) {
loginSession.get('/forms')
.expect(200)
.end(function(err, res) {
res.body.length.should.equal(2);
res.body[0].title.should.equal('Second Form');
res.body[1].title.should.equal('First Form');
// Call the assertion callback
callback(err);
});
}
], function (err) {
done(err);
});
});
afterEach('should be able to signout user', function(done){ afterEach('should be able to signout user', function(done){
authenticatedSession.get('/auth/signout') authenticatedSession.get('/auth/signout')
.expect(200) .expect(200)
.end(function(signoutErr, signoutRes) { .end(function(signoutErr, signoutRes) {
// Handle signout error // Handle signout error
if (signoutErr) return done(signoutErr); if (signoutErr) {
return done(signoutErr);
}
authenticatedSession.destroy(); authenticatedSession.destroy();
done(); done();
}); });

View file

@ -199,6 +199,7 @@ describe('FormSubmission Model Unit Tests:', function() {
it('should preserve deleted form_fields that have submissions without any problems', function(done) { it('should preserve deleted form_fields that have submissions without any problems', function(done) {
var fieldPropertiesToOmit = ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId', 'isSubmission', 'validFieldTypes', 'title'];
var old_fields = myForm.toObject().form_fields; var old_fields = myForm.toObject().form_fields;
var new_form_fields = _.clone(myForm.toObject().form_fields); var new_form_fields = _.clone(myForm.toObject().form_fields);
new_form_fields.splice(0, 1); new_form_fields.splice(0, 1);
@ -210,8 +211,8 @@ describe('FormSubmission Model Unit Tests:', function() {
should.not.exist(err); should.not.exist(err);
should.exist(_form.form_fields); should.exist(_form.form_fields);
var actual_fields = _.deepOmit(_form.toObject().form_fields, ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId']); var actual_fields = _.deepOmit(_form.toObject().form_fields, fieldPropertiesToOmit);
old_fields = _.deepOmit(old_fields, ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId']); old_fields = _.deepOmit(old_fields, fieldPropertiesToOmit);
should.deepEqual(actual_fields, old_fields, 'old form_fields not equal to newly saved form_fields'); should.deepEqual(actual_fields, old_fields, 'old form_fields not equal to newly saved form_fields');
done(); done();

View file

@ -1,8 +0,0 @@
{% extends 'layout.server.view.html' %}
{% block content %}
<h1>Page Not Found</h1>
<pre>
{{url}} is not a valid path.
</pre>
{% endblock %}

View file

@ -0,0 +1,8 @@
extends layout.server.view.pug
block content
section.public-form.auth.sigin-view.valign-wrapper
div.row.valign
h3.col-md-12.text-center=__('404_HEADER')
div.col-md-4.col-md-offset-4
div.col-md-12.text-center(style="padding-bottom: 50px;")=__('404_BODY', url)

View file

@ -1,8 +0,0 @@
{% extends 'layout.server.view.html' %}
{% block content %}
<h1>Server Error</h1>
<pre>
{{error}}
</pre>
{% endblock %}

View file

@ -0,0 +1,12 @@
extends layout.server.view.pug
block content
section.public-form.auth.sigin-view.valign-wrapper
div.row.valign
h3.col-md-12.text-center=__('500_HEADER')
div.col-md-4.col-md-offset-4
if process.env.NODE_ENV == 'development' || process.env.NODE_ENV == 'test'
div.col-md-12.text-center(style="padding-bottom: 50px;")
| #{error}
else
div.col-md-12.text-center(style="padding-bottom: 50px;")=__('500_BODY')

View file

@ -1,139 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}} Form</title>
<!-- General META -->
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<!-- Facebook META -->
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="/img/brand/logo.png">
<meta property="og:type" content="website">
<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="/img/brand/logo.png">
<style>
.loader {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url('/static/dist/page-loader.gif') 50% 35% no-repeat rgb(249,249,249);
background-size: 50px 50px;
}
</style>
<!-- Fav Icon -->
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body ng-cloak>
<div class="loader"></div>
<section class="content">
<section ui-view></section>
</section>
<!--Embedding The User Object signupDisabled, socketPort and socketUrl Boolean -->
<script type="text/javascript">
var user = {{ user | json | safe }};
var signupDisabled = {{signupDisabled | safe}};
var socketPort = false;
{% if socketPort %}
socketPort = {{socketPort | safe }};
{% endif %}
var socketUrl = "{{socketUrl | safe}}";
var subdomainsDisabled = {{subdomainsDisabled | safe}};
</script>
<script src="/static/lib/jquery/dist/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="/static/lib/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/static/lib/bootstrap/dist/css/bootstrap.min.css">
<!--Bower CSS dependencies-->
{% for bowerCssFile in bowerCssFiles %}
<link rel="stylesheet" href="{{bowerCssFile}}">
{% endfor %}
<link rel="stylesheet" href="/static/lib/angular-input-stars/angular-input-stars.css">
<link rel="stylesheet" href="/static/lib/jquery-ui/themes/flick/jquery-ui.min.css"/>
<!-- end Bower CSS dependencies-->
<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}
<!-- end Application CSS Files-->
<!--Socket.io Client Dependency-->
<script src="/static/lib/socket.io-client/dist/socket.io.min.js"></script>
<script src="/static/lib/jquery-ui/jquery-ui.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="/static/dist/vendor.min.js"></script>
<script src="/static/lib/angular-ui-date/src/date.js" type="text/javascript"></script>
<!--Application JavaScript Files-->
{% for jsFile in formJSFiles %}
<script type="text/javascript" src="{{jsFile}}"></script>
{% endfor %}
<!-- end Application Javascript dependencies-->
{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script async type="text/javascript" src="http://{{request.hostname}}:35729/livereload.js"></script>
{% endif %}
<script>
Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
</script>
{% if google_analytics_id %}
<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),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{google_analytics_id}}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");
</script>
</body>
</html>

View file

@ -0,0 +1,109 @@
doctype html
html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
head
title=title
// General META
meta(charset='utf-8')
meta(http-equiv='Content-type', content='text/html;charset=UTF-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1')
meta(name='viewport', content='width=device-width,initial-scale=1,maximum-scale=1')
meta(name='apple-mobile-web-app-capable', content='yes')
meta(name='apple-mobile-web-app-status-bar-style', content='black')
// Semantic META
meta(name='keywords', content='keywords')
meta(name='description', content='description')
// Facebook META
meta(property='og:site_name', content=title)
meta(property='og:title', content=title)
meta(property='og:description', content='description')
meta(property='og:url', content='url')
meta(property='og:image', content='/img/brand/logo.png')
meta(property='og:type', content='website')
// Twitter META
meta(name='twitter:title', content=title)
meta(name='twitter:description', content='description')
meta(name='twitter:url', content='url')
meta(name='twitter:image', content='/img/brand/logo.png')
style.
.loader {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
z-index: 9999;
background: url('/static/dist/page-loader.gif') 50% 35% no-repeat rgb(249,249,249);
background-size: 50px 50px;
}
// Fav Icon
link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon')
body(ng-cloak='')
.loader
section.content
section(ui-view='')
//Embedding The User Object signupDisabled, socketPort and socketUrl Boolean
script(type='text/javascript').
var signupDisabled = !{signupDisabled};
var socketPort = false;
var socketUrl = false;
var subdomainsDisabled = !{subdomainsDisabled};
//Embedding socketPort
if socketPort
script(type='text/javascript').
socketPort = !{socketPort}
//Embedding socketUrl
if socketUrl
script(type='text/javascript').
socketUrl = "!{socketUrl}"
//JSEP
script(src='https://cdn.jsdelivr.net/npm/jsep@0.3.4/build/jsep.min.js', type='text/javascript')
script(src='/static/lib/jquery/dist/jquery.min.js', type='text/javascript')
link(rel='stylesheet', href='/static/lib/font-awesome/css/font-awesome.min.css')
link(rel='stylesheet', href='/static/lib/bootstrap/dist/css/bootstrap.min.css')
//Bower CSS dependencies
each bowerCssFile in bowerCssFiles
link(rel='stylesheet', href=bowerCssFile)
link(rel='stylesheet', href='/static/lib/angular-input-stars/angular-input-stars.css')
link(rel='stylesheet', href='/static/lib/jquery-ui/themes/flick/jquery-ui.min.css')
// end Bower CSS dependencies
//Application CSS Files
each cssFile in cssFiles
link(rel='stylesheet', href=cssFile)
// end Application CSS Files
//Socket.io Client Dependency
script(src='/static/lib/socket.io-client/dist/socket.io.min.js')
script(src='/static/lib/jquery-ui/jquery-ui.js', type='text/javascript')
//Minified Bower Dependencies
script(src='/static/lib/angular/angular.min.js')
script(src='/static/dist/form-vendor.min.js')
script(src='/static/lib/angular-ui-date/src/date.js', type='text/javascript')
//Application JavaScript Files
each jsFile in formJSFiles
script(type='text/javascript', src=jsFile)
// end Application Javascript dependencies
if process.env.NODE_ENV === 'development'
//Livereload script rendered
script(async='', type='text/javascript', src='http://#{request.hostname}:35729/livereload.js')
script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
if google_analytics_id
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='')
script(type="text/javascript").
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");

View file

@ -1,4 +0,0 @@
{% extends 'layout.server.view.html' %}
{% block content %}
<section class="content" ui-view></section>
{% endblock %}

View file

@ -0,0 +1,55 @@
extends layout.server.view.pug
block content
section.content(ui-view='', ng-cloak='')
script(src='/static/lib/file-saver.js/FileSaver.js', type='text/javascript')
//Embedding The User Object
script(type='text/javascript').
var user = null;
//Embedding The signupDisabled Boolean
script(type='text/javascript').
var signupDisabled = !{signupDisabled};
var socketPort = false;
var socketUrl = false;
var subdomainsDisabled = !{subdomainsDisabled};
var locale = "en";
//Embedding locale
if locale
script(type='text/javascript').
locale = "!{locale}";
//Embedding socketPort
if socketPort
script(type='text/javascript').
socketPort = !{socketPort}
//Embedding socketUrl
if socketUrl
script(type='text/javascript').
socketUrl = "!{socketUrl}"
//Socket.io Client Dependency
script(src='https://cdn.socket.io/socket.io-1.4.5.js')
//Bower JS dependencies
each bowerJSFile in bowerJSFiles
script(type='text/javascript', src=bowerJSFile)
// end Bower JS dependencies
script(type='text/javascript', src='https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js')
//Application JavaScript Files
each jsFile in jsFiles
script(type='text/javascript', src=jsFile)
// end Application Javascript dependencies
if process.env.NODE_ENV === 'development'
script(type='text/javascript', src='http://#{request.hostname}:35729/livereload.js')
script(src='https://cdn.ravenjs.com/2.3.0/angular/raven.min.js')
script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();

View file

@ -1,135 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}}</title>
<!-- General META -->
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<!-- Facebook META -->
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="/img/brand/logo.png">
<meta property="og:type" content="website">
<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="/img/brand/logo.png">
<!-- Fav Icon -->
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900'>
<!--Bower CSS dependencies-->
{% for bowerCssFile in bowerCssFiles %}
<link rel="stylesheet" href="{{bowerCssFile}}">
{% endfor %}
<link rel="stylesheet" href="/static/lib/angular-input-stars/angular-input-stars.css">
<link rel="stylesheet" href="/static/lib/jquery-ui/themes/flick/jquery-ui.css"/>
<link rel="stylesheet" href="/static/modules/core/css/github-fork-ribbon.css"/>
<!-- end Bower CSS dependencies-->
<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}
<!-- end Application CSS Files-->
<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body ng-cloak>
{% block content %}{% endblock %}
<script src="/static/lib/file-saver.js/FileSaver.js" type="text/javascript"></script>
<!--Embedding The User Object-->
<script type="text/javascript">
var user = {{ user | json | safe }};
</script>
<!--Embedding The signupDisabled Boolean-->
<script type="text/javascript">
var signupDisabled = {{signupDisabled | safe}};
var socketPort = false;
{% if socketPort %}
socketPort = {{socketPort | safe}};
{% endif %}
var socketUrl = "{{socketUrl | safe}}" || false;
var subdomainsDisabled = {{subdomainsDisabled | safe}};
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!--Socket.io Client Dependency-->
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<!--Bower JS dependencies-->
{% for bowerJSFile in bowerJSFiles %}
<script type="text/javascript" src="{{bowerJSFile}}"></script>
{% 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>
{% endfor %}
<!-- end Application Javascript dependencies-->
{% if process.env.NODE_ENV === 'development' %}
<!--Livereload script rendered -->
<script type="text/javascript" src="http://{{request.hostname}}:35729/livereload.js"></script>
{% endif %}
<script src="https://cdn.ravenjs.com/2.3.0/angular/raven.min.js"></script>
<script>
Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
</script>
<!-- [if lt IE 9]>
<section class="browsehappy jumbotron hide">
<h1>Hello there!</h1>
<p>You are using an old browser which we unfortunately do not support.</p>
<p>Please <a href="http://browsehappy.com/">click here</a> to update your browser before using the website.</p>
<p><a href="http://browsehappy.com" class="btn btn-primary btn-lg" role="button">Yes, upgrade my browser!</a></p>
</section>
<![endif] -->
<script>
window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
ga('create','{{google_analytics_id}}','auto');ga('send','pageview')
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");
</script>
</body>
</html>

View file

@ -0,0 +1,61 @@
doctype html
html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
head
title=title
// General META
meta(charset='utf-8')
meta(http-equiv='Content-type', content='text/html;charset=UTF-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1')
meta(name='viewport', content='width=device-width,initial-scale=1,maximum-scale=1')
meta(name='apple-mobile-web-app-capable', content='yes')
meta(name='apple-mobile-web-app-status-bar-style', content='black')
// Semantic META
meta(name='keywords', content=keywords)
meta(name='description', content=description)
// Facebook META
meta(property='og:site_name', content=title)
meta(property='og:title', content=title)
meta(property='og:description', content=description)
meta(property='og:url', content=url)
meta(property='og:image', content='/img/brand/logo.png')
meta(property='og:type', content='website')
// Twitter META
meta(name='twitter:title', content=title)
meta(name='twitter:description', content=description)
meta(name='twitter:url', content=url)
meta(name='twitter:image', content='/img/brand/logo.png')
// Fav Icon
link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon')
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css')
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', integrity='sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u', crossorigin='anonymous')
link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900')
//Bower CSS dependencies
each bowerCssFile in bowerCssFiles
link(rel='stylesheet', href=bowerCssFile)
link(rel='stylesheet', href='/static/lib/angular-input-stars/angular-input-stars.css')
link(rel='stylesheet', href='/static/lib/jquery-ui/themes/flick/jquery-ui.css')
link(rel='stylesheet', href='/static/modules/core/css/github-fork-ribbon.css')
// end Bower CSS dependencies
//Application CSS Files
each cssFile in cssFiles
link(rel='stylesheet', href=cssFile)
// end Application CSS Files
body
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(src='https://www.google-analytics.com/analytics.js', async='', defer='')
script(type="text/javascript").
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");

View file

@ -1,94 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{title}}</title>
<!-- General META -->
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Semantic META -->
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<!-- Facebook META -->
<meta property="og:site_name" content="{{title}}">
<meta property="og:title" content="{{title}}">
<meta property="og:description" content="{{description}}">
<meta property="og:url" content="{{url}}">
<meta property="og:image" content="/img/brand/logo.png">
<meta property="og:type" content="website">
<!-- Twitter META -->
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:url" content="{{url}}">
<meta name="twitter:image" content="/img/brand/logo.png">
<!-- Fav Icon -->
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900'>
<!--Bower CSS dependencies-->
<!-- end Bower CSS dependencies-->
<!--Application CSS Files-->
{% for cssFile in cssFiles %}
<link rel="stylesheet" href="{{cssFile}}">
{% endfor %}
<!-- end Application CSS Files-->
<!-- HTML5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<redoc spec-url='/static/swagger.json'></redoc>
<script src="https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js"> </script>
<!--Bower JS dependencies-->
{% for bowerJSFile in bowerJSFiles %}
<script type="text/javascript" src="{{bowerJSFile}}"></script>
{% 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>
{% if process.env.NODE_ENV === 'development' %}
<script src="https://cdn.ravenjs.com/2.3.0/angular/raven.min.js"></script>
<script>
Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
</script>
<!-- [if lt IE 9]>
<section class="browsehappy jumbotron hide">
<h1>Hello there!</h1>
<p>You are using an old browser which we unfortunately do not support.</p>
<p>Please <a href="http://browsehappy.com/">click here</a> to update your browser before using the website.</p>
<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),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{google_analytics_id}}', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

View file

@ -0,0 +1,62 @@
doctype html
html(lang='en', xmlns='http://www.w3.org/1999/xhtml')
head
title #{title}
// General META
meta(charset='utf-8')
meta(http-equiv='Content-type', content='text/html;charset=UTF-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge,chrome=1')
meta(name='viewport', content='width=device-width,initial-scale=1,maximum-scale=1')
meta(name='apple-mobile-web-app-capable', content='yes')
meta(name='apple-mobile-web-app-status-bar-style', content='black')
// Semantic META
meta(name='keywords', content='#{keywords}')
meta(name='description', content='#{description}')
// Facebook META
meta(property='og:site_name', content='#{title}')
meta(property='og:title', content='#{title}')
meta(property='og:description', content='#{description}')
meta(property='og:url', content='{{url}}')
meta(property='og:image', content='/img/brand/logo.png')
meta(property='og:type', content='website')
// Twitter META
meta(name='twitter:title', content='#{title}')
meta(name='twitter:description', content='#{description}')
meta(name='twitter:url', content='{{url}}')
meta(name='twitter:image', content='/img/brand/logo.png')
// Fav Icon
link(href='/static/modules/core/img/brand/favicon.ico', rel='shortcut icon', type='image/x-icon')
link(rel='stylesheet', href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900')
//Application CSS Files
each cssFile in cssFiles
link(rel='stylesheet', href='#{cssFile}')
// end Application CSS Files
body
redoc(spec-url='/static/swagger.json')
script(src='https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js')
//Bower JS dependencies
each bowerJSFile in bowerJSFiles
script(type='text/javascript', src='#{bowerJSFile}')
// end Bower JS dependencies
script(type='text/javascript', src='https://cdnjs.cloudflare.com/ajax/libs/angular-strap/2.3.8/angular-strap.min.js')
if process.env.NODE_ENV === 'development'
script(src='https://cdn.ravenjs.com/2.3.0/angular/raven.min.js')
script Raven.config('https://825fefd6b4ed4a4da199c1b832ca845c@sentry.tellform.com/2').install();
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(type="text/javascript").
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("2213510609");

View file

@ -30,7 +30,7 @@
<p>Hello there!</p> <p>Hello there!</p>
<p>This is a courtesy message to confirm that your password was just changed.</p> <p>This is a courtesy message to confirm that your password was just changed.</p>
<p>Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at&nbsp;<a href="mailto:team@tellform.com">team@tellform.com</a>.</p> <p>Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at&nbsp;<a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
<p> - The {{appName}} team</p> <p> - The #{appName} team</p>
</td> </td>
<td width="36"></td> <td width="36"></td>
</tr> </tr>

View file

@ -0,0 +1,41 @@
doctype html
html
head
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1')
p=__("VERIFICATION_EMAIL_PARAGRAPH_2")
a(href='mailto:team@tellform.com') team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -0,0 +1,44 @@
doctype html
html
head
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1')
p
a(href=url)=__('RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT')
p=__('RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2')
p=__('VERIFICATION_EMAIL_PARAGRAPH_2')
a(href='mailto:team@tellform.com') team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -1,64 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<head>
@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=latin,latin-ext);
<style>
a {
color: #007ee6;
text-decoration: none;
}
</style>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<body style="padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%;" marginheight="0" marginwidth="0">
<center>
<table cellpadding="8" cellspacing="0" style="*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff;" border="0">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" style="border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px;" border="0" align="center">
<tr>
<td colspan="3" height="6"></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="line-height: 25px;" border="0" align="center">
<tr>
<td colspan="3" height="30"></td>
</tr>
<tr>
<td width="36"></td>
<td width="454" align="left" style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px;" valign="top">
<p>Hello there!</p>
<p>Welcome to TellForm! Here is a special link to activate your new account:</p>
<p><a href="${URL}">Activate my account</a></p>
<p>Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at&nbsp;<a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
<p> - The TellForm team</p>
</td>
<td width="36"></td>
</tr>
<tr>
<td colspan="3" height="36"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td style="padding: 0; border-collapse: collapse;">
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none;">
<td width="400" align="left"></td>
<td width="128" align="right">© TellForm 2017</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</head>

View file

@ -0,0 +1,49 @@
html
head
style.
a {
color: #007ee6;
text-decoration: none;
}
meta(content='text/html; charset=utf-8', http-equiv='Content-Type')
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('VERIFICATION_EMAIL_PARAGRAPH_1')
p
a(href='http://${URL}')=__('VERIFICATION_EMAIL_LINK_TEXT')
p=__('VERIFICATION_EMAIL_PARAGRAPH_2')
a(href='mailto:team@tellform.com')
| team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -1,64 +0,0 @@
<!DOCTYPE html>
<html>
<head>@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=latin,latin-ext);
<style>
a {
color: #007ee6;
text-decoration: none;
}
</style>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body style="padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%;" marginheight="0" marginwidth="0">
<center>
<table cellpadding="8" cellspacing="0" style="*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff;" border="0">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" style="border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px;" border="0" align="center">
<tr>
<td colspan="3" height="6"></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="line-height: 25px;" border="0" align="center">
<tr>
<td colspan="3" height="30"></td>
</tr>
<tr>
<td width="36"></td>
<td width="454" align="left" style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px;" valign="top">
<p>Hello there!</p>
<p>We would like to welcome you as our newest member!</p>
<p>Thanks so much for using TellForm! If you have any questions, or suggestions, please feel free to email us here at&nbsp;<a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
<p> - The TellForm team</p>
</td>
<td width="36"></td>
</tr>
<tr>
<td colspan="3" height="36"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr>
<td height="10"></td>
</tr>
<tr>
<td style="padding: 0; border-collapse: collapse;">
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none;">
<td width="400" align="left"></td>
<td width="128" align="right">© TellForm 2017</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</body>
</html>

View file

@ -0,0 +1,48 @@
html
head
style.
a {
color: #007ee6;
text-decoration: none;
}
meta(content='text/html; charset=utf-8', http-equiv='Content-Type')
body(style='padding: 0; width: 100% !important; -webkit-text-size-adjust: 100%; margin: 0; -ms-text-size-adjust: 100%', marginheight='0', marginwidth='0')
center
table(cellpadding='8', cellspacing='0', style='*width: 540px; padding: 0; width: 100% !important; background: #ffffff; margin: 0; background-color: #ffffff', border='0')
tbody
tr
td(valign='top')
table(cellpadding='0', cellspacing='0', style='border-radius: 6px; -webkit-border-radius: 6px; border: 1px #c0c0c0 solid; -moz-border-radius: 6px', border='0', align='center')
tbody
tr
td(colspan='3', height='6')
tr
td
table(cellpadding='0', cellspacing='0', style='line-height: 25px', border='0', align='center')
tbody
tr
td(colspan='3', height='30')
tr
td(width='36')
td(width='454', align='left', style="color: #444444; border-collapse: collapse; font-size: 11pt; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; max-width: 454px", valign='top')
p=__('EMAIL_GREETING')
p=__('WELCOME_EMAIL_PARAGRAPH_1')
p=__('WELCOME_EMAIL_PARAGRAPH_2')
a(href='mailto:team@tellform.com')
| team@tellform.com
p=__('EMAIL_SIGNATURE')
td(width='36')
tr
td(colspan='3', height='36')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr
td(height='10')
tr
td(style='padding: 0; border-collapse: collapse')
table(cellpadding='0', cellspacing='0', align='center', border='0')
tbody
tr(style="color: #c0c0c0; font-size: 11px; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; -webkit-text-size-adjust: none")
td(width='400', align='left')
td(width='128', align='right') © TellForm 2017

View file

@ -2,7 +2,7 @@
"name": "tellform", "name": "tellform",
"description": "Opensource alternative to TypeForm", "description": "Opensource alternative to TypeForm",
"version": "2.0.0", "version": "2.0.0",
"homepage": "https://github.com/whitef0x0/tellform", "homepage": "https://github.com/tellform/tellform",
"authors": [ "authors": [
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)" "David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"
], ],
@ -37,7 +37,7 @@
"angular-translate": "~2.11.0", "angular-translate": "~2.11.0",
"ng-translate": "*", "ng-translate": "*",
"deep-diff": "^0.3.4", "deep-diff": "^0.3.4",
"jsep": "^0.3.1", "jsep": "0.3.1",
"ngclipboard": "^1.1.1", "ngclipboard": "^1.1.1",
"mobile-detect": "^1.3.3", "mobile-detect": "^1.3.3",
"socket.io-client": "^1.7.2", "socket.io-client": "^1.7.2",

4
config/env/all.js vendored
View file

@ -28,7 +28,7 @@ module.exports = {
socketPort: process.env.SOCKET_PORT || 20523, socketPort: process.env.SOCKET_PORT || 20523,
socketPortExternallyVisible: (process.env.SOCKET_PORT_EXTERN_VISIBLE === 'TRUE'), socketPortExternallyVisible: (process.env.SOCKET_PORT_EXTERN_VISIBLE === 'TRUE'),
templateEngine: 'swig', templateEngine: 'pug',
signupDisabled: (process.env.SIGNUP_DISABLED === 'TRUE'), signupDisabled: (process.env.SIGNUP_DISABLED === 'TRUE'),
enableClusterMode: (process.env.ENABLE_CLUSTER_MODE === 'TRUE'), enableClusterMode: (process.env.ENABLE_CLUSTER_MODE === 'TRUE'),
@ -40,7 +40,7 @@ module.exports = {
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '', host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 465, port: process.env.MAILER_SMTP_PORT || 465,
secure: process.env.MAILER_SMTP_SECURE || true, secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: { auth: {
user: process.env.MAILER_EMAIL_ID || '', user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || '' pass: process.env.MAILER_PASSWORD || ''

View file

@ -21,7 +21,7 @@ module.exports = {
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '', host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 465, port: process.env.MAILER_SMTP_PORT || 465,
secure: process.env.MAILER_SMTP_SECURE || true, secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: { auth: {
user: process.env.MAILER_EMAIL_ID || '', user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || '' pass: process.env.MAILER_PASSWORD || ''

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

@ -44,7 +44,7 @@ module.exports = {
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '', host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 587, port: process.env.MAILER_SMTP_PORT || 587,
secure: process.env.MAILER_SMTP_SECURE || true, secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: { auth: {
user: process.env.MAILER_EMAIL_ID || '', user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || '' pass: process.env.MAILER_PASSWORD || ''

2
config/env/test.js vendored
View file

@ -30,7 +30,7 @@ module.exports = {
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
host: process.env.MAILER_SMTP_HOST || '', host: process.env.MAILER_SMTP_HOST || '',
port: process.env.MAILER_SMTP_PORT || 587, port: process.env.MAILER_SMTP_PORT || 587,
secure: process.env.MAILER_SMTP_SECURE || true, secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
auth: { auth: {
user: process.env.MAILER_EMAIL_ID || '', user: process.env.MAILER_EMAIL_ID || '',
pass: process.env.MAILER_PASSWORD || '' pass: process.env.MAILER_PASSWORD || ''

View file

@ -20,7 +20,8 @@ var fs = require('fs'),
config = require('./config'), config = require('./config'),
consolidate = require('consolidate'), consolidate = require('consolidate'),
path = require('path'), path = require('path'),
client = new raven.Client(config.DSN); client = new raven.Client(config.DSN),
i18n = require('i18n');
var mongoose = require('mongoose'); var mongoose = require('mongoose');
@ -35,6 +36,18 @@ var configureSocketIO = function (app, db) {
return server; return server;
}; };
var supportedLanguages = ['en', 'de', 'fr', 'it', 'es'];
function containsAnySupportedLanguages(preferredLanguages){
for (var i = 0; i < preferredLanguages.length; i++) {
var currIndex = supportedLanguages.indexOf(preferredLanguages[i]);
if (currIndex > -1) {
return supportedLanguages[currIndex];
}
}
return null;
}
module.exports = function(db) { module.exports = function(db) {
// Initialize express app // Initialize express app
var app = express(); var app = express();
@ -135,8 +148,6 @@ module.exports = function(db) {
// reassign url // reassign url
req.url = subdomainPath; req.url = subdomainPath;
req.userId = user._id;
// Q.E.D. // Q.E.D.
return next(); return next();
}); });
@ -175,19 +186,37 @@ module.exports = function(db) {
level: 9 level: 9
})); }));
//Setup i18n
i18n.configure({
locales: supportedLanguages,
directory: __dirname + '/locales',
defaultLocale: 'en',
cookie: 'userLang'
});
// Set swig as the template engine app.use(i18n.init);
app.engine('server.view.html', consolidate[config.templateEngine]);
app.use(function(req, res, next) {
// express helper for natively supported engines
res.locals.__ = res.__ = function() {
return i18n.__.apply(req, arguments);
};
next();
});
// Set template engine as defined in the config files
app.engine('server.view.pug', consolidate.pug);
// Set views path and view engine // Set views path and view engine
app.set('view engine', 'server.view.html'); app.set('view engine', 'server.view.pug');
app.set('views', './app/views'); app.set('views', './app/views');
// Enable logger (morgan) // Enable logger (morgan)
app.use(morgan(logger.getLogFormat(), logger.getMorganOptions())); app.use(morgan(logger.getLogFormat(), logger.getMorganOptions()));
// Environment dependent middleware // Environment dependent middleware
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
// Disable views cache // Disable views cache
app.set('view cache', false); app.set('view cache', false);
} else if (process.env.NODE_ENV === 'production') { } else if (process.env.NODE_ENV === 'production') {
@ -200,6 +229,7 @@ module.exports = function(db) {
extended: true, extended: true,
limit: '100mb' limit: '100mb'
})); }));
app.use(bodyParser.json({ limit: '100mb' })); app.use(bodyParser.json({ limit: '100mb' }));
app.use(methodOverride()); app.use(methodOverride());
@ -220,7 +250,6 @@ module.exports = function(db) {
app.use(cookieParser()); app.use(cookieParser());
// Express MongoDB session storage // Express MongoDB session storage
app.use(session({ app.use(session({
saveUninitialized: true, saveUninitialized: true,
resave: true, resave: true,
@ -237,18 +266,40 @@ module.exports = function(db) {
app.use(passport.initialize()); app.use(passport.initialize());
app.use(passport.session()); app.use(passport.session());
//Visitor Language Detection
app.use(function(req, res, next) {
var acceptLanguage = req.headers['accept-language'];
var languages, supportedLanguage;
if(acceptLanguage){
languages = acceptLanguage.match(/[a-z]{2}(?!-)/g) || [];
supportedLanguage = containsAnySupportedLanguages(languages);
}
if(!req.user && supportedLanguage !== null){
var currLanguage = res.cookie('userLang');
if(currLanguage && currLanguage !== supportedLanguage || !currLanguage){
res.clearCookie('userLang');
res.cookie('userLang', supportedLanguage, { maxAge: 90000, httpOnly: true });
}
} else if(req.user && (!req.cookies.hasOwnProperty('userLang') || req.cookies['userLang'] !== req.user.language) ){
res.cookie('userLang', req.user.language, { maxAge: 90000, httpOnly: true });
}
next();
});
// Globbing routing files // Globbing routing files
config.getGlobbedFiles('./app/routes/**/*.js').forEach(function(routePath) { config.getGlobbedFiles('./app/routes/**/*.js').forEach(function(routePath) {
require(path.resolve(routePath))(app); require(path.resolve(routePath))(app);
}); });
// Add headers for Sentry // Add headers for Sentry
app.use(function (req, res, next) { app.use(function (req, res, next) {
// Website you wish to allow to connect // Website you wish to allow to connect
res.setHeader('Access-Control-Allow-Origin', 'https://sentry.polydaic.com'); res.setHeader('Access-Control-Allow-Origin', 'https://sentry.io');
// Request methods you wish to allow // Request methods you wish to allow
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
@ -280,16 +331,11 @@ module.exports = function(db) {
// Log it // Log it
client.captureError(err); client.captureError(err);
if(process.env.NODE_ENV === 'production'){
res.status(500).render('500', {
error: 'Internal Server Error'
});
} else {
// Error page // Error page
res.status(500).render('500', { res.status(500).render('500', {
__: i18n.__,
error: err.stack error: err.stack
}); });
}
}); });
// Assume 404 since no middleware responded // Assume 404 since no middleware responded
@ -297,7 +343,8 @@ module.exports = function(db) {
client.captureError(new Error('Page Not Found')); client.captureError(new Error('Page Not Found'));
res.status(404).render('404', { res.status(404).render('404', {
url: req.originalUrl, url: req.originalUrl,
error: 'Not Found' error: 'Not Found',
__: i18n.__
}); });
}); });

21
config/locales/de.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Seite nicht gefunden",
"500_HEADER": "500 - Interner Serverfehler",
"404_BODY": "%s ist kein gültiger Pfad.",
"500_BODY": "Ein unerwarteter Fehler scheint aufgetreten zu sein, warum nicht versuchen, Ihre Seite zu aktualisieren oder Sie können uns kontaktieren, wenn das Problem weiterhin besteht.",
"EMAIL_GREETING": "Hallo da!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Willkommen bei TellForm! Hier ist ein spezieller Link um deinen neuen Account zu aktivieren:",
"VERIFICATION_EMAIL_LINK_TEXT": "Mein Konto aktivieren",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Vielen Dank für die Nutzung unserer Dienste! Wenn Sie Fragen oder Anregungen haben, senden Sie uns bitte eine E-Mail an",
"VERIFICATION_EMAIL_SUBJECT": "Aktiviere dein neues TellForm-Konto!",
"VERIFICATION_EMAIL_TEXT": "Bitte bestätigen Sie Ihren Account, indem Sie auf den folgenden Link klicken oder ihn in Ihren Browser kopieren und einfügen: $ {URL}",
"EMAIL_SIGNATURE": "- Das TellForm-Team",
"WELCOME_EMAIL_PARAGRAPH_1": "Wir möchten Sie als unser neustes Mitglied begrüßen!",
"WELCOME_EMAIL_PARAGRAPH_2": "Wir wünschen Ihnen viel Spaß mit TellForm! Wenn Sie Probleme haben, senden Sie uns bitte eine E-Mail an",
"WELCOME_EMAIL_SUBJECT": "Willkommen bei %s!",
"WELCOME_EMAIL_TEXT": "Ihr Konto wurde erfolgreich verifiziert.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Dies ist eine Höflichkeitsnachricht, um zu bestätigen, dass Ihr Passwort gerade geändert wurde.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Hier ist ein spezieller Link, mit dem Sie Ihr Passwort zurücksetzen können: Bitte beachten Sie, dass es innerhalb einer Stunde zu Ihrem Schutz abläuft:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Passwort zurücksetzen",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Falls Sie dies nicht gewünscht haben, ignorieren Sie bitte diese E-Mail und Ihr Passwort bleibt unverändert."
}

22
config/locales/en.json Normal file
View file

@ -0,0 +1,22 @@
{
"500_HEADER": "500 - Internal Server Error",
"404_HEADER": "404 - Page not found",
"404_BODY": "%s is not a valid path",
"500_BODY": "An unexpected error seems to have occured. Why not try refreshing your page? Or you can contact us if the problem persists.",
"EMAIL_GREETING": "Hello there!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Welcome to TellForm! Here is a special link to activate your new account:",
"VERIFICATION_EMAIL_LINK_TEXT": "Activate my account",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Thanks so much for using our services! If you have any questions, or suggestions, please feel free to email us here at",
"VERIFICATION_EMAIL_SUBJECT": "Activate your new TellForm account!",
"VERIFICATION_EMAIL_TEXT": "Please verify your account by clicking the following link, or by copying and pasting it into your browser: ${URL}",
"EMAIL_SIGNATURE": "- The TellForm team",
"WELCOME_EMAIL_PARAGRAPH_1": "We would like to welcome you as our newest member!",
"WELCOME_EMAIL_PARAGRAPH_2": "We hope you enjoy using TellForm! If you have any trouble please feel free to email us here at",
"WELCOME_EMAIL_SUBJECT": "Welcome to %s!",
"WELCOME_EMAIL_TEXT": "Your account has been successfully verified.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "This is a courtesy message to confirm that your password was just changed.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Here is a special link that will allow you to reset your password. Please note it will expire in one hour for your protection:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Reset Your Password",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "If you did not request this, please ignore this email and your password will remain unchanged.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1": "RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1"
}

21
config/locales/es.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Página no encontrada",
"500_HEADER": "500 - Error interno del servidor",
"404_BODY": "%s no es una ruta válida",
"500_BODY": "Parece que se produjo un error inesperado. ¿Por qué no intenta actualizar su página? O puede contactarnos si el problema persiste",
"EMAIL_GREETING": "¡Hola!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Bienvenido a TellForm. Aquí hay un enlace especial para activar su nueva cuenta:",
"VERIFICATION_EMAIL_LINK_TEXT": "Activar mi cuenta",
"VERIFICATION_EMAIL_PARAGRAPH_2": "¡Muchas gracias por utilizar nuestros servicios! Si tiene alguna pregunta o sugerencia, no dude en enviarnos un correo electrónico aquí",
"VERIFICATION_EMAIL_SUBJECT": "¡Active su nueva cuenta TellForm!",
"VERIFICATION_EMAIL_TEXT": "Verifique su cuenta haciendo clic en el siguiente enlace, o copiándolo y pegándolo en su navegador: $ {URL}",
"EMAIL_SIGNATURE": "- El equipo de TellForm",
"WELCOME_EMAIL_PARAGRAPH_1": "¡Nos gustaría darle la bienvenida como nuestro miembro más nuevo!",
"WELCOME_EMAIL_PARAGRAPH_2": "Esperamos que disfrute utilizando TellForm. Si tiene algún problema, no dude en enviarnos un correo electrónico aquí",
"WELCOME_EMAIL_SUBJECT": "¡Bienvenido a %s!",
"WELCOME_EMAIL_TEXT": "Su cuenta ha sido verificada con éxito",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Este es un mensaje de cortesía para confirmar que su contraseña acaba de cambiarse",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Aquí hay un enlace especial que le permitirá restablecer su contraseña. Tenga en cuenta que caducará en una hora para su protección:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Restablecer su contraseña",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Si no lo solicitó, ignore este correo electrónico y su contraseña no cambiará".
}

21
config/locales/fr.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Page non trouvée",
"500_HEADER": "500 - Erreur interne du serveur",
"404_BODY": "%s n'est pas un chemin valide.",
"500_BODY": "Une erreur inattendue semble s'être produite, pourquoi ne pas essayer d'actualiser votre page ? Ou vous pouvez nous contacter si le problème persiste.",
"EMAIL_GREETING": "Bonjour !",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Bienvenue sur TellForm ! Voici un lien spécial pour activer votre nouveau compte : ",
"VERIFICATION_EMAIL_LINK_TEXT": "Activer mon compte",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Merci infiniment d'utiliser nos services ! Si vous avez des questions ou des suggestions, n'hésitez pas à nous envoyer un courriel ici",
"VERIFICATION_EMAIL_SUBJECT": "Activer votre nouveau compte TellForm !",
"VERIFICATION_EMAIL_TEXT": "Merci de vérifier votre compte en cliquant sur le lien suivant, ou en le copiant dans votre navigateur web : ${URL}",
"EMAIL_SIGNATURE": "- L'équipe TellForm",
"WELCOME_EMAIL_PARAGRAPH_1": "Nous aimerions vous accueillir en tant que nouveau membre !",
"WELCOME_EMAIL_PARAGRAPH_2": "Nous espérons que vous apprécierez l'utilisation de TellForm ! Si vous avez des problèmes, n'hésitez pas à nous envoyer un e-mail ici",
"WELCOME_EMAIL_SUBJECT": "Bienvenue dans %s!",
"WELCOME_EMAIL_TEXT": "Votre compte a été vérifié avec succès.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Ceci est un message de courtoisie pour confirmer que votre mot de passe a été modifié.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Voici un lien spécial qui vous permettra de réinitialiser votre mot de passe. Veuillez noter qu'il expirera dans une heure pour votre protection :",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Réinitialiser votre mot de passe",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Si vous ne l'avez pas demandé, veuillez ignorer cet e-mail et votre mot de passe restera inchangé."
}

21
config/locales/it.json Normal file
View file

@ -0,0 +1,21 @@
{
"404_HEADER": "404 - Pagina non trovata",
"500_HEADER": "500 - Errore Server Interno",
"404_BODY": "%s non è un percorso valido",
"500_BODY": "Si è verificato un errore imprevisto: perché non provare a rinfrescare la tua pagina oppure puoi contattarci se il problema persiste",
"EMAIL_GREETING": "Ciao!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Benvenuti a TellForm! Ecco un collegamento speciale per attivare il tuo nuovo account:",
"VERIFICATION_EMAIL_LINK_TEXT": "Attiva il mio account",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Grazie mille per l'utilizzo dei nostri servizi! Se hai domande o suggerimenti, non esitate a contattarci via",
"VERIFICATION_EMAIL_SUBJECT": "Attiva il tuo nuovo account TellForm",
"VERIFICATION_EMAIL_TEXT": "Verifica il tuo account facendo clic sul seguente collegamento o copiandolo e incollandolo nel tuo browser: $ {URL}",
"EMAIL_SIGNATURE": "- Il team TellForm",
"WELCOME_EMAIL_PARAGRAPH_1": "Vorremmo darVi il benvenuto come il nostro nuovo membro!",
"WELCOME_EMAIL_PARAGRAPH_2": "Speriamo che ti piace usare TellForm! Se hai problemi, non esitate a contattarci via",
"WELCOME_EMAIL_SUBJECT": "Benvenuto a %s!",
"WELCOME_EMAIL_TEXT": "Il tuo account è stato verificato correttamente.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Si tratta di un messaggio di cortesia per confermare che la password è stata appena modificata".
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Ecco un collegamento speciale che ti permetterà di reimpostare la tua password. Si prega di notare che scadrà in un'ora per la protezione:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Ripristina la tua password",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Se non l'hai richiesta, ignora questa email e la tua password rimane invariata."
}

22
config/locales/sv.json Normal file
View file

@ -0,0 +1,22 @@
{
"500_HEADER": "500 - Internt Serverfel",
"404_HEADER": "404 - Sidan hittades inte",
"404_BODY": "%s är inte en giltig sökväg",
"500_BODY": "Ett oväntat fel verkar ha inträffat. Kan du prova med att uppdatera sidan? Eller kan du kontakta oss om problemet återuppstår igen?",
"EMAIL_GREETING": "Hej där!",
"VERIFICATION_EMAIL_PARAGRAPH_1": "Välkommen till TellForm! Här är en speciell länk till dig för att aktivera ditt nya konto:",
"VERIFICATION_EMAIL_LINK_TEXT": "Aktivera mitt konto",
"VERIFICATION_EMAIL_PARAGRAPH_2": "Tack så mycket för att du använder våra tjänster! Om du har några frågor eller förslag är du varmt välkommen att e-posta oss här på",
"VERIFICATION_EMAIL_SUBJECT": "Aktivera ditt nya TellForm-konto!",
"VERIFICATION_EMAIL_TEXT": "Vänligen verifiera ditt konto genom att klicka på den följande länken, eller genom att kopiera och klistra in den i din webbläsare: ${URL}",
"EMAIL_SIGNATURE": "- TellForm-gruppen",
"WELCOME_EMAIL_PARAGRAPH_1": "Vi skulle vilja välkomna dig som vår nyaste medlem!",
"WELCOME_EMAIL_PARAGRAPH_2": "Vi hoppas att du gillar att använda TellForm! Om du stöter på några problem är du varmt välkommen att e-posta oss här på",
"WELCOME_EMAIL_SUBJECT": "Välkommen till %s!",
"WELCOME_EMAIL_TEXT": "Ditt konto har framgångsrikt blivit verifierat.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_PARAGRAPH_1": "Detta är ett artigt meddelande för att bekräfta att ditt lösenord just har ändrats.",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_1": "Här är en speciell länk som kommer tillåta dig att återställa ditt lösenord. Vänligen notera att det kommer utgå om en timma för din säkerhet:",
"RESET_PASSWORD_REQUEST_EMAIL_LINK_TEXT": "Återställ Ditt Lösenord",
"RESET_PASSWORD_REQUEST_EMAIL_PARAGRAPH_2": "Om du inte begärde detta, vänligen ignorera detta meddelande och ditt lösenord kommer att förbli oförändrat.",
"RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1": "RESET_PASSWORD_CONFIRMATION_EMAIL_BODY_1"
}

View file

@ -9,7 +9,14 @@ var config = require('./config'),
// Define the Socket.io configuration method // Define the Socket.io configuration method
module.exports = function (app, db) { module.exports = function (app, db) {
var server = http.createServer(app); var server = http.createServer(app);
var io = socketio(config.socketPort, { transports: ['websocket', 'polling'] }); var io;
// make it possible to only expose one domain
if (process.env.SOCKET_PORT != process.env.PORT) {
io = socketio(config.socketPort, { transports: ['websocket', 'polling'] });
} else {
io = socketio(server, { transports: ['websocket', 'polling'] });
}
if(config.enableClusterMode){ if(config.enableClusterMode){
var redis = require('socket.io-redis'); var redis = require('socket.io-redis');

View file

@ -16,7 +16,7 @@ module.exports = function () {
function (username, password, done) { function (username, password, done) {
User.findOne({ User.findOne({
$or: [ $or: [
{'username': username}, {'username': username.toLowerCase()},
{'email': username} {'email': username}
] ]
}, function (err, user) { }, function (err, user) {

55
docker-compose.yml Normal file
View file

@ -0,0 +1,55 @@
version: "3"
services:
redis:
restart: always
image: redis
networks:
- back-tier
mongo:
restart: always
image: mongo
volumes:
- ".data/mongo:/data"
networks:
- back-tier
tellform:
build:
context: .
environment:
CREATE_ADMIN: "TRUE"
MONGODB_URI: mongodb://mongo/tellform
REDIS_URL: redis://redis
# volumes:
# - .:/opt/tellform
links:
- mongo
- redis
ports:
- "5000:5000"
depends_on:
- mongo
- redis
networks:
- back-tier
web:
# image: tellform/nginx:stable
build:
context: ./nginx
# image: nginx:1.13
restart: always
ports:
- "80:80"
- "443:443"
- "20523:20523"
environment:
NODE_ENV: development
#volumes:
# - "$ROOT/certs:/certs"
# - ./nginx/conf.d:/etc/nginx/conf.d
networks:
- back-tier
networks:
back-tier:
driver: bridge

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View file

@ -23,11 +23,11 @@ module.exports = function(grunt) {
// Unified Watch Object // Unified Watch Object
var watchFiles = { var watchFiles = {
serverViews: ['app/views/**/*.*'], serverViews: ['app/views/**/*.pug'],
serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', '!app/tests/'], serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', '!app/tests/'],
clientViews: ['public/modules/**/*.html', 'public/form_modules/forms/base/**/*.html', '!public/modules/forms/base/**/*.html',], clientViews: ['public/modules/**/*.html', 'public/form_modules/forms/base/**/*.html', '!public/modules/forms/base/**/*.html',],
clientJS: ['public/js/*.js', 'public/form_modules/**/*.js', 'public/modules/**/*.js'], clientJS: ['public/form_modules/**/*.js', 'public/modules/**/*.js'],
clientCSS: ['public/modules/**/*.css'], clientCSS: ['public/modules/**/*.css'],
serverTests: ['app/tests/**/*.js'], serverTests: ['app/tests/**/*.js'],
@ -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
} }
} }
}, },
@ -145,6 +145,10 @@ module.exports = function(grunt) {
} }
}, },
ngAnnotate: { ngAnnotate: {
options:{
add: true,
remove: true
},
production: { production: {
files: { files: {
'public/dist/application.js': '<%= applicationJavaScriptFiles %>', 'public/dist/application.js': '<%= applicationJavaScriptFiles %>',
@ -291,7 +295,7 @@ module.exports = function(grunt) {
target: { target: {
src: ['./scripts/setup.js'] src: ['./scripts/setup.js']
} }
} },
}); });
grunt.event.on('coverage', function(lcov, done){ grunt.event.on('coverage', function(lcov, done){
@ -325,17 +329,14 @@ module.exports = function(grunt) {
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']); grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
// Default task(s). // Default task(s).
grunt.registerTask('default', ['lint', 'html2js:main', 'html2js:forms', 'env', 'concurrent:default']); grunt.registerTask('default', ['lint', 'loadConfig', 'ngAnnotate', 'uglify', 'html2js:main', 'html2js:forms', 'env', 'concurrent:default']);
grunt.registerTask('dev', ['lint', 'html2js:main', 'html2js:forms', 'env:dev', 'concurrent:default']); grunt.registerTask('dev', ['lint', 'html2js:main', 'html2js:forms', 'env:dev', 'concurrent:default']);
// Debug task. // Debug task.
grunt.registerTask('debug', ['lint', 'html2js:main', 'html2js:forms', 'concurrent:debug']); grunt.registerTask('debug', ['lint', 'html2js:main', 'html2js:forms', 'concurrent:debug']);
// Secure task(s).
grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'html2js:forms', 'concurrent:default']);
// Lint task(s). // Lint task(s).
grunt.registerTask('lint', ['jshint', 'csslint']); grunt.registerTask('lint', ['jshint', 'csslint', 'i18nlint:client', 'i18nlint:server']);
grunt.registerTask('lint:tests', ['jshint:allTests']); grunt.registerTask('lint:tests', ['jshint:allTests']);
// Build task(s). // Build task(s).

19
nginx/Dockerfile Normal file
View file

@ -0,0 +1,19 @@
FROM alpine:edge
RUN apk add --no-cache nginx certbot openssl python py-jinja2
COPY *.py /
COPY conf /conf
RUN chmod +x /start.py
RUN chmod +x /letsencrypt.py
RUN chmod +x /config.py
ENV NODE_ENV=development
ENV PORT=5000
ENV SOCKET_PORT=20523
ENV TLS_FLAVOR=notls
ENV BASE_URL=localhost
ENV SUBDOMAIN_URL=*.localhost
ENV SOCKETS_URL=ws.localhost
CMD /start.py

116
nginx/conf/nginx.conf Normal file
View file

@ -0,0 +1,116 @@
# Basic configuration
user nginx;
worker_processes 1;
error_log /dev/stderr info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Standard HTTP configuration with slight hardening
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
server_tokens off;
#Websockets Server
server {
{% if NODE_ENV == "development" %}
listen {{SOCKET_PORT}};
{% else %}
listen 80;
listen [::]:80;
server_name {{ SOCKETS_URL }};
# Only enable HTTPS if TLS is enabled with no error
{% if TLS and not TLS_ERROR %}
listen 443 ssl;
listen [::]:443 ssl;
include /etc/nginx/tls.conf;
add_header Strict-Transport-Security max-age=15768000;
if ($scheme = http) {
return 301 https://$host$request_uri;
}
{% endif %}
{% endif %}
location / {
proxy_pass http://tellform:20523;
proxy_read_timeout 90;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
{% if TLS and not TLS_ERROR %}
proxy_set_header X-Forwarded-Proto https;
{% endif %}
}
{% if TLS_FLAVOR == 'letsencrypt' %}
location ^~ /.well-known/acme-challenge/ {
proxy_pass http://127.0.0.1:8008;
}
{% endif %}
}
server {
#Add server_name for per-user subdomains
{% if SUBDOMAINS_DISABLED == "FALSE" %}
server_name {{BASE_URL}} {{SUBDOMAIN_URL}};
{% else %}
server_name {{BASE_URL}};
{% endif %}
listen 80;
listen [::]:80;
# Only enable HTTPS if TLS is enabled with no error
{% if TLS and not TLS_ERROR %}
listen 443 ssl;
listen [::]:443 ssl;
include /etc/nginx/tls.conf;
add_header Strict-Transport-Security max-age=15768000;
if ($scheme = http) {
return 301 https://$host$request_uri;
}
{% endif %}
root /usr/share/nginx/html;
index index.html index.htm;
location / {
proxy_pass http://tellform:5000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
{% if TLS and not TLS_ERROR %}
proxy_set_header X-Forwarded-Proto https;
{% endif %}
}
{% if TLS_FLAVOR == 'letsencrypt' %}
location ^~ /.well-known/acme-challenge/ {
proxy_pass http://127.0.0.1:8008;
}
{% endif %}
}
}

7
nginx/conf/tls.conf Normal file
View file

@ -0,0 +1,7 @@
ssl_protocols TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384';
ssl_prefer_server_ciphers on;
ssl_session_timeout 10m;
ssl_certificate {{ TLS[0] }};
ssl_certificate_key {{ TLS[1] }};
ssl_dhparam /certs/dhparam.pem;

26
nginx/config.py Normal file
View file

@ -0,0 +1,26 @@
#!/usr/bin/python
import jinja2
import os
convert = lambda src, dst, args: open(dst, "w").write(jinja2.Template(open(src).read()).render(**args))
args = os.environ.copy()
# TLS configuration
args["TLS"] = {
"cert": ("/certs/cert.pem", "/certs/key.pem"),
"letsencrypt": ("/certs/letsencrypt/live/mailu/fullchain.pem",
"/certs/letsencrypt/live/mailu/privkey.pem"),
"notls": None
}[args["TLS_FLAVOR"]]
if args["TLS"] and not all(os.path.exists(file_path) for file_path in args["TLS"]):
print("Missing cert or key file, disabling TLS")
args["TLS_ERROR"] = "yes"
# Build final configuration paths
convert("/conf/tls.conf", "/etc/nginx/tls.conf", args)
convert("/conf/nginx.conf", "/etc/nginx/nginx.conf", args)
os.system("nginx -s reload")

29
nginx/letsencrypt.py Normal file
View file

@ -0,0 +1,29 @@
#!/usr/bin/python
import os
import time
import subprocess
command = [
"certbot",
"-n", "--agree-tos", # non-interactive
"-d", os.environ["HOSTNAMES"],
"-m", "{}@{}".format(os.environ["POSTMASTER"], os.environ["DOMAIN"]),
"certonly", "--standalone",
"--server", "https://acme-v02.api.letsencrypt.org/directory",
"--cert-name", "tellform",
"--preferred-challenges", "http", "--http-01-port", "8008",
"--keep-until-expiring",
"--rsa-key-size", "4096",
"--config-dir", "/certs/letsencrypt",
"--post-hook", "./config.py"
]
# Wait for nginx to start
time.sleep(5)
# Run certbot every hour
while True:
subprocess.call(command)
time.sleep(3600)

25
nginx/start.py Normal file
View file

@ -0,0 +1,25 @@
#!/usr/bin/python
import os
import subprocess
#Set default port
if not os.environ["PORT"]:
os.environ["PORT"] = "5000"
#Set default sockets port
if not os.environ["SOCKET_PORT"]:
os.environ["SOCKET_PORT"] = "20523"
# Actual startup script
if not os.path.exists("/certs/dhparam.pem") and os.environ["TLS_FLAVOR"] != "notls":
os.system("openssl dhparam -out /certs/dhparam.pem 2048")
if os.environ["TLS_FLAVOR"] == "letsencrypt":
subprocess.Popen(["/letsencrypt.py"])
elif os.environ["TLS_FLAVOR"] == "cert":
if not os.path.exists("/certs/cert.pem"):
os.system("openssl req -newkey rsa:2048 -x509 -keyout /certs/key.pem -out /certs/cert.pem -days 365 -nodes -subj '/C=NA/ST=None/L=None/O=None/CN=" + os.environ["BASE_URL"] + "'")
subprocess.call(["/config.py"])
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])

14204
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
"name": "TellForm", "name": "TellForm",
"description": "Opensource alternative to TypeForm", "description": "Opensource alternative to TypeForm",
"version": "2.1.0", "version": "2.1.0",
"homepage": "https://github.com/whitef0x0/tellform", "homepage": "https://github.com/tellform/tellform",
"authors": [ "authors": [
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)" "David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"
], ],
@ -10,7 +10,7 @@
"private": true, "private": true,
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/whitef0x0/tellform.git" "url": "https://github.com/tellform/tellform.git"
}, },
"engines": { "engines": {
"node": "6.x.x", "node": "6.x.x",
@ -19,27 +19,27 @@
"scripts": { "scripts": {
"addcontrib": "all-contributors add", "addcontrib": "all-contributors add",
"generate": "all-contributors generate", "generate": "all-contributors generate",
"start": "npm run version && grunt", "start": "grunt",
"test": "npm run version && grunt test", "test": "grunt test",
"postinstall": "bower install --config.interactive=false; grunt build;", "postinstall": "bower install --config.interactive=false",
"init": "node scripts/setup.js" "init": "node scripts/setup.js"
}, },
"dependencies": { "dependencies": {
"async": "^1.4.2", "async": "^1.4.2",
"bcrypt": "^0.8.7", "body-parser": "^1.19.0",
"body-parser": "~1.14.1", "bower": "^1.8.8",
"bower": "~1.6.5",
"chalk": "^1.1.3", "chalk": "^1.1.3",
"compression": "~1.6.0", "compression": "^1.7.4",
"connect": "^3.4.1", "connect": "^3.4.1",
"connect-mongo": "~0.8.2", "connect-mongo": "^2.0.0",
"consolidate": "~0.13.1", "consolidate": "~0.14.5",
"cookie-parser": "~1.4.0", "cookie-parser": "~1.4.0",
"deep-diff": "^0.3.4", "deep-diff": "^0.3.4",
"dotenv": "^2.0.0", "dotenv": "^2.0.0",
"email-verification": "~0.4.1", "email-verification": "github:tellform/node-email-verification",
"express": "~4.13.3", "envfile": "^2.1.1",
"express-session": "~1.12.1", "express": "^4.16.4",
"express-session": "^1.16.1",
"glob": "^7.0.3", "glob": "^7.0.3",
"grunt": "~0.4.1", "grunt": "~0.4.1",
"grunt-concurrent": "~2.3.0", "grunt-concurrent": "~2.3.0",
@ -48,16 +48,17 @@
"grunt-contrib-jshint": "~1.0.0", "grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-uglify": "~0.11.0", "grunt-contrib-uglify": "~0.11.0",
"grunt-env": "~0.4.1", "grunt-env": "~0.4.1",
"grunt-html2js": "~0.3.5", "grunt-html2js": "^0.6.0",
"grunt-ng-annotate": "~1.0.1", "grunt-ng-annotate": "~1.0.1",
"helmet": "3.5.0", "helmet": "^3.16.0",
"i18n": "^0.8.3",
"jit-grunt": "^0.9.1", "jit-grunt": "^0.9.1",
"lodash": "^4.17.4", "lodash": "^4.17.11",
"main-bower-files": "~2.9.0", "main-bower-files": "^2.13.1",
"method-override": "~2.3.0", "method-override": "~2.3.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"mongoose": "~4.4.19", "mongoose": "~4.4.19",
"morgan": "~1.8.1", "morgan": "^1.9.1",
"nodemailer": "~4.0.0", "nodemailer": "~4.0.0",
"passport": "~0.3.0", "passport": "~0.3.0",
"passport-anonymous": "^1.0.1", "passport-anonymous": "^1.0.1",
@ -65,16 +66,15 @@
"passport-localapikey-update": "^0.5.0", "passport-localapikey-update": "^0.5.0",
"path-exists": "^2.1.0", "path-exists": "^2.1.0",
"prerender-node": "^2.2.1", "prerender-node": "^2.2.1",
"pug": "^2.0.3",
"random-js": "^1.0.8", "random-js": "^1.0.8",
"raven": "^0.9.0", "raven": "^0.9.0",
"request": "^2.83.0", "request": "^2.88.0",
"socket.io": "^1.4.6", "socket.io": "^1.4.6",
"socket.io-redis": "^1.0.0", "socket.io-redis": "^1.0.0",
"swig": "~1.4.1", "swig": "~1.4.1",
"uuid-token-generator": "^0.5.0", "uuid-token-generator": "^0.5.0",
"wildcard-subdomains": "github:tellform/wildcard-subdomains", "winston": "^2.3.1"
"winston": "^2.3.1",
"winston-logrotate": "^1.2.0"
}, },
"devDependencies": { "devDependencies": {
"all-contributors-cli": "^4.3.0", "all-contributors-cli": "^4.3.0",
@ -87,14 +87,15 @@
"grunt-contrib-concat": "^1.0.1", "grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0", "grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^0.11.1", "grunt-contrib-uglify": "^0.11.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-execute": "^0.2.2", "grunt-execute": "^0.2.2",
"grunt-i18nlint": "github:jwarby/grunt-i18nlint",
"grunt-karma": "~0.12.1",
"grunt-mocha-istanbul": "^3.0.1", "grunt-mocha-istanbul": "^3.0.1",
"grunt-mocha-test": "~0.12.1", "grunt-mocha-test": "~0.12.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-newer": "~1.1.1", "grunt-newer": "~1.1.1",
"grunt-usemin": "^3.1.1",
"grunt-karma": "~0.12.1",
"grunt-nodemon": "~0.4.0", "grunt-nodemon": "~0.4.0",
"grunt-usemin": "^3.1.1",
"grunt-wiredep": "^3.0.1", "grunt-wiredep": "^3.0.1",
"istanbul": "^0.4.0", "istanbul": "^0.4.0",
"jasmine-core": "^2.4.1", "jasmine-core": "^2.4.1",

View file

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
angular.module('view-form').config(['$translateProvider', function ($translateProvider) { angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('english', { $translateProvider.translations('en', {
FORM_SUCCESS: 'Form entry successfully submitted!', FORM_SUCCESS: 'Form entry successfully submitted!',
REVIEW: 'Review', REVIEW: 'Review',
BACK_TO_FORM: 'Go back to Form', BACK_TO_FORM: 'Go back to Form',
@ -28,10 +28,22 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
CANCEL: 'Cancel', CANCEL: 'Cancel',
SUBMIT: 'Submit', SUBMIT: 'Submit',
UPLOAD_FILE: 'Upload your File', UPLOAD_FILE: 'Upload your File',
Y: 'Y',
N: 'N',
OPTION_PLACEHOLDER: 'Type or select an option',
ADD_NEW_LINE_INSTR: 'Press SHIFT+ENTER to add a newline',
ERROR: 'Error',
FORM_404_HEADER: '404 - Form Does Not Exist',
FORM_404_BODY: 'The form you are trying to access does not exist. Sorry about that!',
FORM_UNAUTHORIZED_HEADER: 'Not Authorized to Access Form',
FORM_UNAUTHORIZED_BODY1: 'The form you are trying to access is currently private and not accesible publically.',
FORM_UNAUTHORIZED_BODY2: 'If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin.',
}); });
$translateProvider.preferredLanguage('english') $translateProvider.preferredLanguage('en')
.fallbackLanguage('english') .fallbackLanguage('en')
.useSanitizeValueStrategy('escape'); .useSanitizeValueStrategy('escape');
}]); }]);

View file

@ -2,7 +2,7 @@
angular.module('view-form').config(['$translateProvider', function ($translateProvider) { angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('french', { $translateProvider.translations('fr', {
FORM_SUCCESS: 'Votre formulaire a été enregistré!', FORM_SUCCESS: 'Votre formulaire a été enregistré!',
REVIEW: 'Incomplet', REVIEW: 'Incomplet',
BACK_TO_FORM: 'Retourner au formulaire', BACK_TO_FORM: 'Retourner au formulaire',
@ -14,13 +14,13 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)', COMPLETING_NEEDED: '{{answers_not_completed}} réponse(s) doive(nt) être complétée(s)',
OPTIONAL: 'facultatif', OPTIONAL: 'facultatif',
ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide', ERROR_EMAIL_INVALID: 'Merci de rentrer une adresse mail valide',
ERROR_NOT_A_NUMBER: 'Merce de ne rentrer que des nombres', ERROR_NOT_A_NUMBER: 'Merci de ne rentrer que des nombres',
ERROR_URL_INVALID: 'Merci de rentrer une url valide', ERROR_URL_INVALID: 'Merci de rentrer une url valide',
OK: 'OK', OK: 'OK',
ENTER: 'presser ENTRÉE', ENTER: 'Appuyer sur ENTRÉE',
YES: 'Oui', YES: 'Oui',
NO: 'Non', NO: 'Non',
NEWLINE: 'presser SHIFT+ENTER pour créer une nouvelle ligne', NEWLINE: 'Appuyer sur SHIFT+ENTER pour créer une nouvelle ligne',
CONTINUE: 'Continuer', CONTINUE: 'Continuer',
LEGAL_ACCEPT: 'Jaccepte', LEGAL_ACCEPT: 'Jaccepte',
LEGAL_NO_ACCEPT: 'Je naccepte pas', LEGAL_NO_ACCEPT: 'Je naccepte pas',
@ -30,6 +30,16 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
UPLOAD_FILE: 'Envoyer un fichier', UPLOAD_FILE: 'Envoyer un fichier',
Y: 'O', Y: 'O',
N: 'N', N: 'N',
OPTION_PLACEHOLDER: 'Tapez ou sélectionnez une option',
ADD_NEW_LINE_INSTR: 'Appuyez sur MAJ + ENTRÉE pour ajouter une nouvelle ligne',
ERROR: 'Erreur',
FORM_404_HEADER: '404 - Le formulaire n\'existe pas',
FORM_404_BODY: 'Le formulaire auquel vous essayez d\'accéder n\'existe pas. Désolé pour ça !',
FORM_UNAUTHORIZED_HEADER: 'Non autorisé à accéder au formulaire',
   FORM_UNAUTHORIZED_BODY1: 'Le formulaire auquel vous essayez d\'accéder est actuellement privé et inaccessible publiquement.',
   FORM_UNAUTHORIZED_BODY2: 'Si vous êtes le propriétaire du formulaire, vous pouvez le définir en "Public" dans le panneau "Configuration" du formulaire admin.',
}); });
}]); }]);

View file

@ -2,12 +2,12 @@
angular.module('view-form').config(['$translateProvider', function ($translateProvider) { angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('german', { $translateProvider.translations('de', {
FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.', FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.',
REVIEW: 'Unvollständig', REVIEW: 'Unvollständig',
BACK_TO_FORM: 'Zurück zum Formular', BACK_TO_FORM: 'Zurück zum Formular',
EDIT_FORM: '', EDIT_FORM: 'Bearbeiten Sie diese TellForm',
CREATE_FORM: '', CREATE_FORM: 'Dieses TellForm erstellen',
ADVANCEMENT: '{{done}} von {{total}} beantwortet', ADVANCEMENT: '{{done}} von {{total}} beantwortet',
CONTINUE_FORM: 'Zum Formular', CONTINUE_FORM: 'Zum Formular',
REQUIRED: 'verpflichtend', REQUIRED: 'verpflichtend',
@ -30,6 +30,16 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
UPLOAD_FILE: 'Datei versenden', UPLOAD_FILE: 'Datei versenden',
Y: 'J', Y: 'J',
N: 'N', N: 'N',
OPTION_PLACEHOLDER: 'Geben oder wählen Sie eine Option aus',
ADD_NEW_LINE_INSTR: 'Drücken Sie UMSCHALT + EINGABETASTE, um eine neue Zeile hinzuzufügen',
ERROR: 'Fehler',
FORM_404_HEADER: '404 - Formular existiert nicht',
FORM_404_BODY: 'Das Formular, auf das Sie zugreifen möchten, existiert nicht. Das tut mir leid!',
FORM_UNAUTHORIZED_HEADER: 'Nicht zum Zugriffsformular berechtigt\' ',
   FORM_UNAUTHORIZED_BODY1: 'Das Formular, auf das Sie zugreifen möchten, ist derzeit privat und nicht öffentlich zugänglich.',
   FORM_UNAUTHORIZED_BODY2: 'Wenn Sie der Eigentümer des Formulars sind, können Sie es im Fenster "Konfiguration" im Formular admin auf "Öffentlich" setzen.',
}); });
}]); }]);

View file

@ -2,12 +2,12 @@
angular.module('view-form').config(['$translateProvider', function ($translateProvider) { angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('italian', { $translateProvider.translations('it', {
FORM_SUCCESS: 'Il formulario è stato inviato con successo!', FORM_SUCCESS: 'Il formulario è stato inviato con successo!',
REVIEW: 'Incompleto', REVIEW: 'Incompleto',
BACK_TO_FORM: 'Ritorna al formulario', BACK_TO_FORM: 'Ritorna al formulario',
EDIT_FORM: '', EDIT_FORM: 'Modifica questo TellForm',
CREATE_FORM: '', CREATE_FORM: 'Crea questo TellForm',
ADVANCEMENT: '{{done}} su {{total}} completate', ADVANCEMENT: '{{done}} su {{total}} completate',
CONTINUE_FORM: 'Vai al formulario', CONTINUE_FORM: 'Vai al formulario',
REQUIRED: 'obbligatorio', REQUIRED: 'obbligatorio',
@ -30,6 +30,16 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
UPLOAD_FILE: 'Invia un file', UPLOAD_FILE: 'Invia un file',
Y: 'S', Y: 'S',
N: 'N', N: 'N',
OPTION_PLACEHOLDER: 'Digitare o selezionare un\'opzione',
ADD_NEW_LINE_INSTR: 'Premere SHIFT + INVIO per aggiungere una nuova riga',
ERROR: 'Errore',
FORM_404_HEADER: '404 - Il modulo non esiste',
FORM_404_BODY: 'La forma che stai cercando di accedere non esiste. Ci dispiace!',
FORM_UNAUTHORIZED_HEADER: 'Non autorizzato per accedere al modulo',
   FORM_UNAUTHORIZED_BODY1: 'Il modulo che si sta tentando di accedere è attualmente privato e non accessibile in pubblico.',
   FORM_UNAUTHORIZED_BODY2: 'Se sei il proprietario del modulo, puoi impostarlo su "Pubblico" nel pannello "Configurazione" nell\'amministratore di moduli.',
}); });
}]); }]);

View file

@ -2,12 +2,12 @@
angular.module('view-form').config(['$translateProvider', function ($translateProvider) { angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('spanish', { $translateProvider.translations('es', {
FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!', FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!',
REVIEW: 'Revisar', REVIEW: 'Revisar',
BACK_TO_FORM: 'Regresar al formulario', BACK_TO_FORM: 'Regresar al formulario',
EDIT_FORM: '', EDIT_FORM: 'Editar este TellForm',
CREATE_FORM: '', CREATE_FORM: 'Crear este TellForm',
ADVANCEMENT: '{{done}} de {{total}} contestadas', ADVANCEMENT: '{{done}} de {{total}} contestadas',
CONTINUE_FORM: 'Continuar al formulario', CONTINUE_FORM: 'Continuar al formulario',
REQUIRED: 'Información requerida', REQUIRED: 'Información requerida',
@ -29,7 +29,17 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
SUBMIT: 'Registrar', SUBMIT: 'Registrar',
UPLOAD_FILE: 'Cargar el archivo', UPLOAD_FILE: 'Cargar el archivo',
Y: 'S', Y: 'S',
N: 'N' N: 'N',
OPTION_PLACEHOLDER: 'Escriba o seleccione una opción',
ADD_NEW_LINE_INSTR: 'Presione MAYÚS + ENTRAR para agregar una nueva línea',
ERROR: 'Error',
FORM_404_HEADER: '404 - La forma no existe',
FORM_404_BODY: 'El formulario al que intenta acceder no existe. ¡Lo siento por eso!',
FORM_UNAUTHORIZED_HEADER: 'Non autorizzato per accedere al modulo',
   FORM_UNAUTHORIZED_BODY1: 'Il modulo che si sta tentando di accedere è attualmente privato e non accessibile in pubblico.',
   FORM_UNAUTHORIZED_BODY2: 'Se sei il proprietario del modulo, puoi impostarlo su "Pubblico" nel pannello "Configurazione" nell\'amministratore di moduli.',
}); });
}]); }]);

View file

@ -0,0 +1,45 @@
'use strict';
angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('se', {
FORM_SUCCESS: 'Formulärsvaret skickades framgångsrikt in!',
REVIEW: 'Granska',
BACK_TO_FORM: 'Gå tillbaka till Formuläret',
EDIT_FORM: 'Ändra denna TellForm',
CREATE_FORM: 'Skapa denna TellForm',
ADVANCEMENT: '{{done}} utav {{total}} svar',
CONTINUE_FORM: 'Fortsätt till Form',
REQUIRED: 'krävs',
COMPLETING_NEEDED: '{{answers_not_completed}} svar behöver färdigställas',
OPTIONAL: 'valfri',
ERROR_EMAIL_INVALID: 'Vänligen ange en giltig e-postadress',
ERROR_NOT_A_NUMBER: 'Vänligen ange endast giltiga nummer',
ERROR_URL_INVALID: 'Vänligen en giltig url',
OK: 'OK',
ENTER: 'tryck ENTER',
YES: 'Ja',
NO: 'Nej',
NEWLINE: 'tryck SHIFT+ENTER för att skapa ny rad',
CONTINUE: 'Fortsätt',
LEGAL_ACCEPT: 'Jag accepterar',
LEGAL_NO_ACCEPT: 'Jag accepterar inte',
DELETE: 'Radera',
CANCEL: 'Avbryt',
SUBMIT: 'Skicka',
UPLOAD_FILE: 'Ladda upp din Fil',
Y: 'J',
N: 'N',
OPTION_PLACEHOLDER: 'Skriv eller välj ett alternativ',
ADD_NEW_LINE_INSTR: 'Tryck SHIFT+ENTER för att lägga till ny rad',
ERROR: 'Fel',
FORM_404_HEADER: '404 - Formulär Existerar Inte',
FORM_404_BODY: 'Formuläret du försöker besöka till existerar inte. Ursäkta för det!',
FORM_UNAUTHORIZED_HEADER: 'Inte Auktoriserad att Tillgå Formulär',
FORM_UNAUTHORIZED_BODY1: 'Formuläret du försöker att besöka är för närvarande privat och inte tillgänglig offentligt.',
FORM_UNAUTHORIZED_BODY2: 'Om du är ägaren till formuläret kan du ställa in den till "Offentlig" i panelen "Konfiguration" i formulärets administration.',
});
}]);

View file

@ -120,6 +120,7 @@ div.form-fields {
vertical-align: top; vertical-align: top;
zoom: 1; zoom: 1;
width: 16px; width: 16px;
margin-top: 1px;
padding: 0; padding: 0;
height: 17px; height: 17px;
font-size: 12px; font-size: 12px;
@ -438,11 +439,11 @@ section.public-form .btn {
} }
/*CREATE-NEW FORM MODAL*/ /*CREATE-NEW FORM MODAL*/
.form-item.create-new.new-form { .form-item.new-form {
background-color: rgb(300,131,131); background-color: rgb(300,131,131);
z-index: 11; z-index: 11;
} }
.form-item.create-new.new-form:hover { .form-item.new-form:hover {
background-color: rgb(300,100,100); background-color: rgb(300,100,100);
} }
.form-item.new-form input[type='text'] { .form-item.new-form input[type='text'] {

View file

@ -24,10 +24,9 @@
on-tab-and-shift-key="prevField()" on-tab-and-shift-key="prevField()"
on-tab-key="nextField()" on-tab-key="nextField()"
ng-change="nextField()"> ng-change="nextField()">
<ui-select-match placeholder="Type or select an option"> <ui-select-match placeholder="{{ 'OPTION_PLACEHOLDER' | translate }}">
</ui-select-match> </ui-select-match>
<ui-select-choices repeat="option in field.fieldOptions | filter: $select.search" <ui-select-choices repeat="option in field.fieldOptions | filter: $select.search">
ng-class="{'active': option.option_value === field.fieldValue }">
<span ng-bind-html="option.option_value | highlight: $select.search"></span> <span ng-bind-html="option.option_value | highlight: $select.search"></span>
</ui-select-choices> </ui-select-choices>
</ui-select> </ui-select>

View file

@ -29,7 +29,7 @@
ng-required="field.required" ng-required="field.required"
ng-change="nextField()"/> ng-change="nextField()"/>
<div class="letter" style="float:left"> <div class="letter" style="float:left">
Y {{ 'Y' | translate }}
</div> </div>
<span>{{ 'LEGAL_ACCEPT' | translate }}</span> <span>{{ 'LEGAL_ACCEPT' | translate }}</span>
</label> </label>
@ -43,7 +43,7 @@
ng-required="field.required" ng-required="field.required"
ng-change="nextField()"/> ng-change="nextField()"/>
<div class="letter" style="float:left"> <div class="letter" style="float:left">
N {{ 'N' | translate }}
</div> </div>
<span>{{ 'LEGAL_NO_ACCEPT' | translate }}</span> <span>{{ 'LEGAL_NO_ACCEPT' | translate }}</span>
</label> </label>

View file

@ -14,7 +14,9 @@
</p> </p>
</div> </div>
<div class="col-xs-12 field-input"> <div class="col-xs-12 field-input">
<small style="font-size:0.6em;">Press SHIFT+ENTER to add a newline</small> <small style="font-size:0.6em;">
{{ 'ADD_NEW_LINE_INSTR' | translate }}
</small>
<textarea class="textarea focusOn" type="text" <textarea class="textarea focusOn" type="text"
ng-focus="setActiveField(field._id, null, false)" ng-focus="setActiveField(field._id, null, false)"
ng-model="field.fieldValue" ng-model="field.fieldValue"

View file

@ -38,7 +38,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div ng-show="forms.myForm.{{field.fieldType}}{{index}}.$invalid && !!forms.myForm.{{field.fieldType}}{{index}}.$viewValue " class="alert alert-danger" role="alert"> <div ng-show="forms.myForm.{{field.fieldType}}{{index}}.$invalid && !!forms.myForm.{{field.fieldType}}{{index}}.$viewValue " class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span> <span class="sr-only">{{ 'ERROR' | translate }}:</span>
<span ng-if="field.fieldType == 'email'"> {{ 'ERROR_EMAIL_INVALID' | translate }} </span> <span ng-if="field.fieldType == 'email'"> {{ 'ERROR_EMAIL_INVALID' | translate }} </span>
<span ng-if="field.fieldType == 'number'"> {{ 'ERROR_NOT_A_NUMBER' | translate }} </span> <span ng-if="field.fieldType == 'number'"> {{ 'ERROR_NOT_A_NUMBER' | translate }} </span>
<span ng-if="field.fieldType == 'link'"> {{ 'ERROR_URL_INVALID' | translate }} </span> <span ng-if="field.fieldType == 'link'"> {{ 'ERROR_URL_INVALID' | translate }} </span>

View file

@ -3,10 +3,12 @@ $(".loader").fadeOut("slow");
</script> </script>
<section class="public-form auth sigin-view valign-wrapper"> <section class="public-form auth sigin-view valign-wrapper">
<div class="row valign"> <div class="row valign">
<h3 class="col-md-12 text-center">404 - Form Does not Exist </h3> <h3 class="col-md-12 text-center">
{{ 'FORM_404_HEADER' | translate }}
</h3>
<div class="col-md-4 col-md-offset-4"> <div class="col-md-4 col-md-offset-4">
<div class="col-md-12 text-center" style="padding-bottom: 50px;"> <div class="col-md-12 text-center" style="padding-bottom: 50px;">
The form you are trying to access does not exist. Sorry about that! {{ 'FORM_404_BODY' | translate }}
</div> </div>
</div> </div>
</section> </section>

View file

@ -3,10 +3,13 @@ $(".loader").fadeOut("slow");
</script> </script>
<section class="public-form auth sigin-view valign-wrapper"> <section class="public-form auth sigin-view valign-wrapper">
<div class="row valign"> <div class="row valign">
<h3 class="col-md-12 text-center">Not Authorized to Access Form</h3> <h3 class="col-md-12 text-center">
{{ 'FORM_UNAUTHORIZED_HEADER' | translate }}
</h3>
<div class="col-md-4 col-md-offset-4"> <div class="col-md-4 col-md-offset-4">
<div class="col-md-12 text-center" style="padding-bottom: 50px;"> <div class="col-md-12 text-center" style="padding-bottom: 50px;">
The form you are trying to access is currently private and not accesible publically. <br> If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin. {{ 'FORM_UNAUTHORIZED_BODY1' | translate }} <br>
{{ 'FORM_UNAUTHORIZED_BODY2' | translate }}
</div> </div>
</div> </div>
</div> </div>

View file

@ -2,7 +2,7 @@
// Setting up route // Setting up route
angular.module('core').config(['$stateProvider', '$urlRouterProvider', angular.module('core').config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider, Authorization) { function($stateProvider, $urlRouterProvider) {
// Redirect to home view when route not found // Redirect to home view when route not found
$urlRouterProvider.otherwise('/forms'); $urlRouterProvider.otherwise('/forms');
} }
@ -15,10 +15,13 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
$rootScope.$stateParams = $stateParams; $rootScope.$stateParams = $stateParams;
// add previous state property // add previous state property
$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState) { $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
$state.previous = fromState; $state.previous = {
state: fromState,
params: fromParams
}
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'];
//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){
@ -45,7 +48,7 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
var authenticator, permissions, user; var authenticator, permissions, user;
permissions = next && next.data && next.data.permissions ? next.data.permissions : null; permissions = next && next.data && next.data.permissions ? next.data.permissions : null;
Auth.ensureHasCurrentUser(User); Auth.ensureHasCurrentUser();
user = Auth.currentUser; user = Auth.currentUser;
if(user){ if(user){

View file

@ -8,9 +8,9 @@ angular.module('core').config(['$translateProvider', function ($translateProvide
SIGNIN_TAB: 'Sign In', SIGNIN_TAB: 'Sign In',
SIGNOUT_TAB: 'Signout', SIGNOUT_TAB: 'Signout',
EDIT_PROFILE: 'Edit Profile', EDIT_PROFILE: 'Edit Profile',
MY_FORMS: 'My Forms',
MY_SETTINGS: 'My Settings', MY_SETTINGS: 'My Settings',
CHANGE_PASSWORD: 'Change Password' CHANGE_PASSWORD: 'Change Password',
TOGGLE_NAVIGATION: 'Toggle navigation'
}); });
$translateProvider.preferredLanguage('en') $translateProvider.preferredLanguage('en')

View file

@ -4,12 +4,12 @@ angular.module('core').config(['$translateProvider', function ($translateProvide
$translateProvider.translations('fr', { $translateProvider.translations('fr', {
MENU: 'MENU', MENU: 'MENU',
SIGNUP_TAB: 'Créer un Compte', SIGNUP_TAB: 'Créer un compte',
SIGNIN_TAB: 'Connexion', SIGNIN_TAB: 'Connexion',
SIGNOUT_TAB: 'Créer un compte', SIGNOUT_TAB: 'Créer un compte',
EDIT_PROFILE: 'Modifier Mon Profil', EDIT_PROFILE: 'Modifier mon profil',
MY_FORMS: 'Mes Formulaires', MY_SETTINGS: 'Mes paramètres',
MY_SETTINGS: 'Mes Paramètres', CHANGE_PASSWORD: 'Changer mon mot de passe',
CHANGE_PASSWORD: 'Changer mon Mot de Pass' TOGGLE_NAVIGATION: 'Basculer la navigation',
}); });
}]); }]);

View file

@ -0,0 +1,15 @@
'use strict';
angular.module('core').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('de', {
MENU: 'MENÜ',
SIGNUP_TAB: 'Anmelden',
SIGNIN_TAB: 'Anmeldung',
SIGNOUT_TAB: 'Abmelden',
EDIT_PROFILE: 'Profil bearbeiten',
MY_SETTINGS: 'Meine Einstellungen',
CHANGE_PASSWORD: 'Passwort ändern',
TOGGLE_NAVIGATION: 'Navigation umschalten'
});
}]);

View file

@ -0,0 +1,15 @@
'use strict';
angular.module('core').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('it', {
MENU: 'MENÜ',
SIGNUP_TAB: 'Vi Phrasal',
SIGNIN_TAB: 'Accedi',
SIGNOUT_TAB: 'Esci',
EDIT_PROFILE: 'Modifica Profilo',
MY_SETTINGS: 'Mie Impostazioni',
CHANGE_PASSWORD: 'Cambia la password',
TOGGLE_NAVIGATION: 'Attiva la navigazione'
});
}]);

View file

@ -8,9 +8,9 @@ angular.module('core').config(['$translateProvider', function ($translateProvide
SIGNIN_TAB: 'Entrar', SIGNIN_TAB: 'Entrar',
SIGNOUT_TAB: 'Salir', SIGNOUT_TAB: 'Salir',
EDIT_PROFILE: 'Editar Perfil', EDIT_PROFILE: 'Editar Perfil',
MY_FORMS: 'Mis formularios',
MY_SETTINGS: 'Mis configuraciones', MY_SETTINGS: 'Mis configuraciones',
CHANGE_PASSWORD: 'Cambiar contraseña' CHANGE_PASSWORD: 'Cambiar contraseña',
TOGGLE_NAVIGATION: 'Navegación de palanca'
}); });
}]); }]);

View file

@ -0,0 +1,16 @@
'use strict';
angular.module('core').config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('se', {
MENU: 'MENY',
SIGNUP_TAB: 'Registrera konto',
SIGNIN_TAB: 'Logga In',
SIGNOUT_TAB: 'Logga Ut',
EDIT_PROFILE: 'Redigera Profil',
MY_SETTINGS: 'Mina Inställningar',
CHANGE_PASSWORD: 'Byt Lösenord',
TOGGLE_NAVIGATION: 'Växla navigation'
});
}]);

View file

@ -1,23 +1,19 @@
'use strict'; 'use strict';
angular.module('core').controller('HeaderController', ['$rootScope', '$scope', 'Menus', '$state', 'Auth', 'User', '$window', '$translate', '$locale', angular.module('core').controller('HeaderController', ['$rootScope', '$scope', 'Menus', '$state', 'Auth', 'User', '$window', '$translate',
function ($rootScope, $scope, Menus, $state, Auth, User, $window, $translate, $locale) { function ($rootScope, $scope, Menus, $state, Auth, User, $window, $translate) {
$rootScope.signupDisabled = $window.signupDisabled; $rootScope.signupDisabled = $window.signupDisabled;
$scope.user = $rootScope.user = Auth.ensureHasCurrentUser(User); $scope.user = $rootScope.user = Auth.ensureHasCurrentUser();
$scope.authentication = $rootScope.authentication = Auth; $scope.authentication = $rootScope.authentication = Auth;
$rootScope.languages = $scope.languages = ['en', 'fr', 'es', 'it', 'de']; $rootScope.languages = $scope.languages = ['en', 'fr', 'es', 'it', 'de'];
//Set global app language //Set global app language
if($scope.authentication.isAuthenticated()){
$rootScope.language = $scope.user.language; $rootScope.language = $scope.user.language;
}else { $translate.use($scope.user.language);
$rootScope.language = $locale.id.substring(0,2);
}
$translate.use($rootScope.language);
$scope.isCollapsed = false; $scope.isCollapsed = false;
$rootScope.hideNav = false; $rootScope.hideNav = false;
@ -27,7 +23,7 @@ angular.module('core').controller('HeaderController', ['$rootScope', '$scope', '
var promise = User.logout(); var promise = User.logout();
promise.then(function() { promise.then(function() {
Auth.logout(); Auth.logout();
Auth.ensureHasCurrentUser(User); Auth.ensureHasCurrentUser();
$scope.user = $rootScope.user = null; $scope.user = $rootScope.user = null;
$state.go('listForms'); $state.go('listForms');

View file

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View file

@ -6,9 +6,38 @@
var scope, var scope,
HeaderController; HeaderController;
var sampleUser = {
firstName: 'Full',
lastName: 'Name',
email: 'test@test.com',
username: 'test@test.com',
language: 'en',
password: 'password',
provider: 'local',
roles: ['user'],
_id: 'ed873933b1f1dea0ce12fab9'
};
// Load the main application module // Load the main application module
beforeEach(module(ApplicationConfiguration.applicationModuleName)); beforeEach(module(ApplicationConfiguration.applicationModuleName));
//Mock Authentication Service
beforeEach(module(function($provide) {
$provide.service('Auth', function() {
return {
ensureHasCurrentUser: function() {
return sampleUser;
},
isAuthenticated: function() {
return true;
},
getUserState: function() {
return true;
}
};
});
}));
beforeEach(inject(function($controller, $rootScope) { beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new(); scope = $rootScope.$new();

Some files were not shown because too many files have changed in this diff Show more