Compare commits
121 commits
Author | SHA1 | Date | |
---|---|---|---|
d5c94ce67f | |||
6e32ace806 | |||
a6d61ebf35 | |||
98385954dc | |||
4900d13a47 | |||
210c7544e7 | |||
a9e04b4894 | |||
d07063f636 | |||
643954896b | |||
77cabf15e5 | |||
b3bf791d3c | |||
c3153ed514 | |||
e29742f83a | |||
a24f90ce91 | |||
4eae4de2ce | |||
39c656c41e | |||
15a6324a90 | |||
17b428b304 | |||
81e66f0025 | |||
b1917c9fdd | |||
6453716c99 | |||
639ba9fdb8 | |||
1a9e847741 | |||
995e6aa41c | |||
d7f0cc8127 | |||
e8afc9e7e6 | |||
ad35ae9215 | |||
5bc0d623a5 | |||
13d9bd9ece | |||
19c85f9845 | |||
188705b640 | |||
386b6be968 | |||
d9ef557edd | |||
52a1ab2bff | |||
80beec8ad2 | |||
3b0dee9ea3 | |||
01ac456f62 | |||
9715088e86 | |||
0f2cf42ceb | |||
65fd117b04 | |||
985c3c1aae | |||
808439cf47 | |||
eaab2ff339 | |||
f99049d155 | |||
8c4e519fbe | |||
9a9c1ae02e | |||
2835280ff3 | |||
7afc7eef87 | |||
45f8fe7a02 | |||
623cb865c2 | |||
d6e48544a4 | |||
ca875ed01d | |||
33b0fc02c4 | |||
83ca05e64b | |||
78082f7152 | |||
e2ff321ec8 | |||
38b3618f8b | |||
f5dc78b6d7 | |||
f384f5fee4 | |||
3421c92eab | |||
f47a8d41ae | |||
53fa777ce0 | |||
e725aa1ea3 | |||
c63e905c25 | |||
ee2c59805e | |||
a0092baf31 | |||
b6f5c5f897 | |||
66765278d2 | |||
1ace06555c | |||
4086219189 | |||
7357756625 | |||
ff24843e3a | |||
4447785a56 | |||
341ce5a88f | |||
ed662281cd | |||
13c3263667 | |||
084a8005fd | |||
24cffeee37 | |||
d132133d67 | |||
1539846121 | |||
ed815f68e5 | |||
552f4d8396 | |||
7c3834dcae | |||
5b847b33ec | |||
86f74ce85f | |||
147effe028 | |||
b29d5bad36 | |||
53658da890 | |||
3dc51d9d2c | |||
f8ac5454d7 | |||
4c76e37aba | |||
be6fc12949 | |||
e2d000e6a0 | |||
0f3b59a1ce | |||
492783ec49 | |||
381df20d3c | |||
f7d4394049 | |||
7451311403 | |||
5c58db879c | |||
076f56bf59 | |||
6927f9d5ac | |||
65a8b2d7cc | |||
d304b80913 | |||
a3d203fee3 | |||
dc3bb54774 | |||
3b9f01f92a | |||
a829e08d73 | |||
34b2cba461 | |||
82d60c5a42 | |||
c45d248c3c | |||
4f7d646edd | |||
b0f03d1f0a | |||
25ce55b4c7 | |||
62a34f9ab6 | |||
e6685154dd | |||
fe692d2a7d | |||
8a8f1e9b2e | |||
b3213d5a8a | |||
6899a5d48f | |||
e4ef81af35 | |||
e110820fcb |
3
.bowerrc
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"directory": "public/lib",
|
||||
"analytics": false
|
||||
"analytics": false,
|
||||
"registry": "https://registry.bower.io"
|
||||
}
|
||||
|
|
124
.env.example
Normal 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
|
@ -1,14 +1,11 @@
|
|||
data/
|
||||
dist
|
||||
.vagrant
|
||||
npm-debug.*
|
||||
docs/Oscar_Credentials.md
|
||||
scripts/test_oscarhost.js
|
||||
scripts/oscarhost/private/
|
||||
coverage/
|
||||
e2e_coverage/
|
||||
uploads/
|
||||
app/e2e_tests/screeshots/*
|
||||
tmp
|
||||
|
||||
# iOS / Apple
|
||||
# ===========
|
||||
|
@ -25,6 +22,7 @@ Oscar_Credentials.*
|
|||
npm-debug.log
|
||||
node_modules/
|
||||
public/lib/
|
||||
public/dist
|
||||
app/tests/coverage/
|
||||
.bower-*/
|
||||
.idea/
|
||||
|
|
64
Dockerfile
|
@ -4,33 +4,16 @@
|
|||
# Run:
|
||||
# docker run -it tellform-prod
|
||||
|
||||
FROM phusion/baseimage:0.9.19
|
||||
MAINTAINER David Baldwynn <team@tellform.com>
|
||||
FROM node:10-alpine
|
||||
MAINTAINER Arielle Baldwynn <team@tellform.com>
|
||||
|
||||
# Install Utilities
|
||||
RUN apt-get update -q \
|
||||
&& apt-get install -yqq \
|
||||
curl \
|
||||
ant \
|
||||
# Install some needed packages
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
gcc \
|
||||
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/*
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
# 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
|
||||
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 ./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
|
||||
# and utilities docker container cache to not needing to rebuild
|
||||
# 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
|
||||
COPY ./package.json /opt/tellform/package.json
|
||||
RUN npm install --only=production --quiet
|
||||
RUN bower install --allow-root
|
||||
RUN grunt build
|
||||
|
||||
# Run TellForm server
|
||||
CMD ["node", "server.js"]
|
||||
|
|
|
@ -10,56 +10,7 @@ TellForm Installation Instructions
|
|||
|
||||
## Local deployment with Docker
|
||||
|
||||
### Prerequisites
|
||||
|
||||
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)
|
||||
Refer to [docker_files](https://github.com/tellform/docker_files).
|
||||
|
||||
## AWS AMI Deployment
|
||||
|
||||
|
|
129
README.md
|
@ -1,18 +1,34 @@
|
|||
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)
|
||||
![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&utm_medium=referral&utm_content=whitef0x0/tellform&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)
|
||||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3491e86eb7194308b8fc80711d736ede)](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&utm_medium=referral&utm_content=tellform/tellform&utm_campaign=Badge_Grade)
|
||||
-->
|
||||
|
||||
> 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
|
||||
|
||||
- [Features](#features)
|
||||
- [How to Contribute](#how-to-contribute)
|
||||
- [Quickstart](#quickstart)
|
||||
|
@ -24,11 +40,8 @@ TellForm 2.1.0
|
|||
- [Backers](#backers)
|
||||
- [Contributors](#contributors)
|
||||
- [Mentions on the Web](#mentions-on-the-web)
|
||||
|
||||
## Features
|
||||
|
||||
### Currently following features are implemented:
|
||||
|
||||
- Multi-Language Support
|
||||
- 11 possible question types
|
||||
- Editable start and end pages
|
||||
|
@ -38,7 +51,6 @@ TellForm 2.1.0
|
|||
- Embeddable Forms
|
||||
- Forms as a Service API
|
||||
- Deployable with Heroku and DockerHub
|
||||
|
||||
### On the Roadmap for v3.0.0
|
||||
- Implement encryption for all form data
|
||||
- Add Typeform API integration
|
||||
|
@ -47,37 +59,27 @@ TellForm 2.1.0
|
|||
- Add Stripe/Payment Form field
|
||||
- Add Custom Background and Dropdown Field Images
|
||||
- Add File Upload Form Field
|
||||
|
||||
## How to Contribute
|
||||
|
||||
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.
|
||||
|
||||
## Quickstart
|
||||
|
||||
Before you start, make sure you have
|
||||
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)
|
||||
|
||||
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.
|
||||
```bash
|
||||
$ npm install
|
||||
$ bower install
|
||||
```
|
||||
|
||||
Setup environment.
|
||||
```bash
|
||||
$ grunt build
|
||||
```
|
||||
|
||||
Create your user account
|
||||
```bash
|
||||
$ node ./scripts/setup.js
|
||||
```
|
||||
|
||||
OR create your .env file
|
||||
```
|
||||
GOOGLE_ANALYTICS_ID=yourGAID
|
||||
|
@ -85,92 +87,67 @@ PRERENDER_TOKEN=yourPrerender.ioToken
|
|||
COVERALLS_REPO_TOKEN=yourCoveralls.ioToken
|
||||
BASE_URL=localhost
|
||||
DSN_KEY=yourPrivateRavenKey
|
||||
|
||||
# Mail config
|
||||
MAILER_EMAIL_ID=user@domain.com
|
||||
MAILER_PASSWORD=some-pass
|
||||
MAILER_FROM=user@domain.com
|
||||
|
||||
# Use this for one of Nodemailer's pre-configured service providers
|
||||
MAILER_SERVICE_PROVIDER=SendGrid
|
||||
|
||||
# Use these for a custom service provider
|
||||
# Note: MAILER_SMTP_HOST will override MAILER_SERVICE_PROVIDER
|
||||
MAILER_SMTP_HOST=smtp.domain.com
|
||||
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___
|
||||
|
||||
#### To run the development version:
|
||||
|
||||
Set ```NODE_ENV=development``` in .env file
|
||||
```$ grunt```
|
||||
|
||||
#### To run the production version:
|
||||
|
||||
Set ```NODE_ENV=production``` in .env file
|
||||
```$ 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)
|
||||
|
||||
## Deploying with Docker
|
||||
|
||||
To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/).
|
||||
|
||||
Then run these commands
|
||||
|
||||
```
|
||||
$ docker run -p 27017:27017 -d --name some-mongo mongo
|
||||
$ docker run -p 127.0.0.1:6379:6379 -d --name some-redis redis
|
||||
$ docker run --rm -p 3000:3000 --link some-redis:redis-db --link some-mongo:db -e "SUBDOMAINS_DISABLED=TRUE" -e "DISABLE_CLUSTER_MODE=TRUE" -e "MAILER_EMAIL_ID=<YourEmailAPI_ID>" -e "MAILER_FROM=<noreply@yourdomain.com>" -e "MAILER_SERVICE_PROVIDER=<YourEmailAPIProvider>" -e "MAILER_PASSWORD=<YourAPIKey>" -e "BASE_URL=localhost" -p 80:80 tellform/development
|
||||
```
|
||||
|
||||
|
||||
Then run follow these steps:
|
||||
### Step 1: Clone the repo
|
||||
`$ git clone https://github.com/tellform/docker_files.git`
|
||||
### Step 2: Setup TellForm Configuration
|
||||
Create your .env file by copying the .env.dist file included in the repo and changing it to suit your deployment.
|
||||
Important: You need to fill out all of the ENV variables in the "Mail Settings" section or your TellForm instance won't work.
|
||||
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
|
||||
You can run the full test suite included with TellForm with the test task:
|
||||
|
||||
```
|
||||
$ 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/).
|
||||
|
||||
To execute only the server tests, run the test:server task:
|
||||
|
||||
```
|
||||
$ grunt test:server
|
||||
```
|
||||
|
||||
And to run only the client tests, run the test:client task:
|
||||
|
||||
```
|
||||
$ 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.
|
||||
|
||||
To calculate your total test coverage with Istanbul, run the coverage task
|
||||
```bash
|
||||
$ grunt coverage
|
||||
```
|
||||
|
||||
To calculate your server-side test coverage with Istanbul, run the coverage task
|
||||
```bash
|
||||
$ grunt coverage:server
|
||||
```
|
||||
|
||||
To calculate your client-side test coverage with Istanbul, run the coverage task
|
||||
```bash
|
||||
$ grunt coverage:client
|
||||
```
|
||||
|
||||
## 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`.
|
||||
|
||||
| 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 |
|
||||
|
@ -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 |
|
||||
| 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 |
|
||||
|
||||
## Where to get help
|
||||
|
||||
[Gitter Chat](https://gitter.im/whitef0x0/tellform)
|
||||
|
||||
[Gitter Chat](https://gitter.im/tellform/Lobby)
|
||||
[Official Twitter](https://twitter.com/tellform_real)
|
||||
-->
|
||||
|
||||
|
||||
## 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).
|
||||
|
||||
<a href="https://m.do.co/c/a86fd8843e09" style="padding: 30px 0">
|
||||
<img src="/docs/readme_logos/do_logo.png" height="30px">
|
||||
</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>
|
||||
<a href="https://countable.ca" style="padding: 30px 0">
|
||||
<img src="https://countable.ca/logo.cb446ab0.svg" height="30px">
|
||||
</a> -->
|
||||
|
||||
## 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">
|
||||
<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
|
||||
|
||||
<!-- 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 -->
|
||||
## 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/)
|
||||
|
||||
[BootCSS Expo](http://expo.bootcss.com/)
|
||||
|
|
5
app.json
|
@ -28,5 +28,10 @@
|
|||
"description": "Which mail service/API you will be using (i.e. SparkPost, Mandrill, etc)",
|
||||
"value": "SendGrid"
|
||||
}
|
||||
},
|
||||
"buildpacks": [
|
||||
{
|
||||
"url": "https://github.com/heroku/heroku-buildpack-nodejs#v111"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ exports.deleteSubmissions = function(req, res) {
|
|||
var submission_id_list = req.body.deleted_submissions,
|
||||
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){
|
||||
res.status(400).send({
|
||||
|
@ -79,7 +79,7 @@ exports.createSubmission = function(req, res) {
|
|||
exports.listSubmissions = function(req, res) {
|
||||
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) {
|
||||
console.error(err);
|
||||
res.status(500).send({
|
||||
|
@ -88,17 +88,15 @@ exports.listSubmissions = function(req, res) {
|
|||
}
|
||||
res.json(_submissions);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a new form
|
||||
*/
|
||||
exports.create = function(req, res) {
|
||||
debugger;
|
||||
|
||||
if(!req.body.form){
|
||||
return res.status(401).send({
|
||||
return res.status(400).send({
|
||||
message: 'Invalid Input'
|
||||
});
|
||||
}
|
||||
|
@ -125,15 +123,7 @@ exports.read = function(req, res) {
|
|||
if(!req.user || (req.form.admin.id !== req.user.id) ){
|
||||
readForRender(req, res);
|
||||
} 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();
|
||||
newForm.submissions = _submissions;
|
||||
|
||||
if (req.userId) {
|
||||
if(req.form.admin._id+'' === req.userId+''){
|
||||
|
@ -144,7 +134,6 @@ exports.read = function(req, res) {
|
|||
});
|
||||
}
|
||||
return res.json(newForm);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -256,7 +245,7 @@ exports.list = function(req, res) {
|
|||
|
||||
Form.find(searchObj)
|
||||
.sort('-created')
|
||||
.select('title language submissions admin isLive')
|
||||
.select('title language admin submissions isLive')
|
||||
.populate('admin.username', 'admin._id')
|
||||
.lean()
|
||||
.exec(function(err, forms) {
|
||||
|
@ -288,7 +277,6 @@ exports.formByID = function(req, res, next, id) {
|
|||
}
|
||||
Form.findById(id)
|
||||
.populate('admin')
|
||||
.populate('submissions')
|
||||
.exec(function(err, form) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
|
|
|
@ -9,16 +9,10 @@ var errorHandler = require('../errors.server.controller'),
|
|||
config = require('../../../config/config'),
|
||||
User = mongoose.model('User'),
|
||||
tokgen = require('../../libs/tokenGenerator'),
|
||||
fs = require('fs');
|
||||
|
||||
require.extensions['.html'] = function (module, filename) {
|
||||
module.exports = fs.readFileSync(filename, 'utf8');
|
||||
};
|
||||
|
||||
var welcomeEmail = require("../../views/welcome.email.view.html");
|
||||
var verificationEmail = require("../../views/verification.email.view.html");
|
||||
|
||||
|
||||
fs = require('fs'),
|
||||
i18n = require('i18n'),
|
||||
async = require('async'),
|
||||
pug = require('pug');
|
||||
|
||||
var nev = require('email-verification')(mongoose);
|
||||
|
||||
|
@ -26,6 +20,15 @@ var nev = require('email-verification')(mongoose);
|
|||
var config_nev = function () {
|
||||
|
||||
nev.configure({
|
||||
|
||||
verifyMailOptions: {
|
||||
from: config.mailer.from
|
||||
},
|
||||
|
||||
confirmMailOptions: {
|
||||
from: config.mailer.from
|
||||
},
|
||||
|
||||
persistentUserModel: User,
|
||||
tempUserCollection: config.tempUserCollection,
|
||||
emailAndUsernameUnique: true,
|
||||
|
@ -33,19 +36,7 @@ var config_nev = function () {
|
|||
|
||||
verificationURL: config.baseUrl+'/#!/verify/${URL}',
|
||||
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) {
|
||||
if (err) {
|
||||
throw err;
|
||||
|
@ -63,13 +54,22 @@ var config_nev = function () {
|
|||
throw err;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
config_nev();
|
||||
|
||||
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) {
|
||||
return res.status(500).send( {message: err } );
|
||||
} else if (user){
|
||||
|
@ -83,7 +83,16 @@ exports.validateVerificationToken = function(req, res){
|
|||
};
|
||||
|
||||
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) {
|
||||
return res.status(500).send( {message: errorHandler.getErrorMessage(err) } );
|
||||
}
|
||||
|
@ -107,23 +116,35 @@ exports.signup = function(req, res) {
|
|||
// Init Variables
|
||||
var user = new User(req.body);
|
||||
|
||||
// Set language to visitor's language
|
||||
user.language = req.cookies['userLang'];
|
||||
|
||||
// Add missing user fields
|
||||
user.provider = 'local';
|
||||
|
||||
// Then save the temporary user
|
||||
nev.createTempUser(user, function (err, existingPersistentUser, newTempUser) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return res.status(400).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// new user created
|
||||
if (newTempUser) {
|
||||
var URL = newTempUser[nev.options.URLFieldName];
|
||||
nev.sendVerificationEmail(user.email, URL, function (sendEmailErr, info) {
|
||||
if (sendEmailErr) {
|
||||
const fn = pug.compileFile(__dirname + "/../../views/verification.email.view.pug");
|
||||
var renderedHtml = fn(res.locals);
|
||||
|
||||
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({
|
||||
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.');
|
||||
});
|
||||
} 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
|
||||
*/
|
||||
exports.signin = function(req, res, next) {
|
||||
|
||||
passport.authenticate('local', function(err, user, info) {
|
||||
if (err || !user) {
|
||||
res.status(400).send(info);
|
||||
|
@ -155,6 +177,8 @@ exports.signin = function(req, res, next) {
|
|||
message: errorHandler.getErrorMessage(loginErr)
|
||||
});
|
||||
}
|
||||
|
||||
res.cookie('langCookie', user.language, { maxAge: 90000, httpOnly: true });
|
||||
return res.json(user);
|
||||
});
|
||||
}
|
||||
|
@ -165,138 +189,11 @@ exports.signin = function(req, res, next) {
|
|||
* Signout
|
||||
*/
|
||||
exports.signout = function(req, res) {
|
||||
if(req.cookies.hasOwnProperty('userLang')){
|
||||
res.clearCookie('userLang');
|
||||
}
|
||||
req.logout();
|
||||
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 */
|
||||
|
|
|
@ -11,7 +11,8 @@ var _ = require('lodash'),
|
|||
config = require('../../../config/config'),
|
||||
nodemailer = require('nodemailer'),
|
||||
async = require('async'),
|
||||
crypto = require('crypto');
|
||||
crypto = require('crypto'),
|
||||
pug = require('pug');
|
||||
|
||||
var smtpTransport = nodemailer.createTransport(config.mailer.options);
|
||||
|
||||
|
@ -32,10 +33,23 @@ exports.forgot = function(req, res) {
|
|||
if (req.body.username) {
|
||||
User.findOne({
|
||||
$or: [
|
||||
{'username': req.body.username},
|
||||
{'username': req.body.username.toLowerCase()},
|
||||
{'email': req.body.username}
|
||||
]
|
||||
}, '-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){
|
||||
return res.status(500).send({
|
||||
message: err.message
|
||||
|
@ -45,9 +59,11 @@ exports.forgot = function(req, res) {
|
|||
return res.status(400).send({
|
||||
message: 'No account with that username or email has been found'
|
||||
});
|
||||
} else if (user.provider !== 'local') {
|
||||
}
|
||||
|
||||
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 {
|
||||
user.resetPasswordToken = token;
|
||||
|
@ -65,13 +81,12 @@ exports.forgot = function(req, res) {
|
|||
}
|
||||
},
|
||||
function(token, user, done) {
|
||||
res.render('templates/reset-password-email', {
|
||||
name: user.displayName || 'TellForm User',
|
||||
appName: config.app.title,
|
||||
url: 'http://' + req.headers.host + '/auth/reset/' + token
|
||||
}, function(err, emailHTML) {
|
||||
done(err, emailHTML, user);
|
||||
});
|
||||
const fn = pug.compileFile(__dirname + "/../../views/templates/reset-password-email.server.view.pug");
|
||||
res.locals['url'] = 'http://' + req.headers.host + '/auth/reset/' + token;
|
||||
|
||||
console.log(res.locals);
|
||||
var renderedHtml = fn(res.locals);
|
||||
done(null, renderedHtml, user);
|
||||
},
|
||||
// If valid email, send reset email using service
|
||||
function(emailHTML, user, done) {
|
||||
|
@ -138,10 +153,21 @@ exports.validateResetToken = function(req, res) {
|
|||
* Reset password POST from email token
|
||||
*/
|
||||
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
|
||||
var passwordDetails = req.body;
|
||||
async.waterfall([
|
||||
|
||||
function(done) {
|
||||
User.findOne({
|
||||
resetPasswordToken: req.params.token,
|
||||
|
@ -150,32 +176,25 @@ exports.reset = function(req, res, next) {
|
|||
}
|
||||
}, function(err, user) {
|
||||
if (!err && user) {
|
||||
if (passwordDetails.newPassword === passwordDetails.verifyPassword) {
|
||||
user.password = passwordDetails.newPassword;
|
||||
user.resetPasswordToken = null;
|
||||
user.resetPasswordExpires = null;
|
||||
|
||||
user.save(function(err) {
|
||||
user.save(function(err, savedUser) {
|
||||
if (err) {
|
||||
done(err, null);
|
||||
}
|
||||
done(null, user);
|
||||
done(null, savedUser);
|
||||
});
|
||||
} else {
|
||||
done('Passwords do not match', null);
|
||||
}
|
||||
} else {
|
||||
done('Password reset token is invalid or has expired.', null);
|
||||
}
|
||||
});
|
||||
},
|
||||
function(user, done) {
|
||||
res.render('templates/reset-password-confirm-email', {
|
||||
name: user.displayName,
|
||||
appName: config.app.title
|
||||
}, function(err, emailHTML) {
|
||||
done(err, emailHTML, user);
|
||||
});
|
||||
const fn = pug.compileFile(__dirname + "/../../views/templates/reset-password-confirm-email.server.view.pug");
|
||||
var renderedHtml = fn(res.locals);
|
||||
done(null, renderedHtml, user);
|
||||
},
|
||||
// If valid email, send reset email using service
|
||||
function(emailHTML, user, done) {
|
||||
|
|
|
@ -71,7 +71,6 @@ var VisitorDataSchema = new Schema({
|
|||
userAgent: {
|
||||
type: String
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var formSchemaOptions = {
|
||||
|
@ -219,7 +218,7 @@ FormSchema.virtual('analytics.fields').get(function () {
|
|||
var visitors = this.analytics.visitors;
|
||||
var that = this;
|
||||
|
||||
if(this.form_fields.length === 0) {
|
||||
if(!this.form_fields || this.form_fields.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,19 +9,7 @@ var mongoose = require('mongoose'),
|
|||
config = require('../../config/config'),
|
||||
timeStampPlugin = require('../libs/timestamp.server.plugin'),
|
||||
path = require('path'),
|
||||
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');
|
||||
}
|
||||
});
|
||||
querystring = require('querystring');
|
||||
|
||||
/**
|
||||
* A Validation function for local strategy properties
|
||||
|
@ -37,18 +25,11 @@ var validateLocalStrategyProperty = function(property) {
|
|||
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
|
||||
*/
|
||||
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: {
|
||||
type: String,
|
||||
trim: true,
|
||||
lowercase: true,
|
||||
unique: 'Account already exists with this email',
|
||||
required: 'Please enter your email',
|
||||
validate: {
|
||||
validator: validateLocalStrategyProperty,
|
||||
message: 'Please fill in your email'
|
||||
},
|
||||
match: [/.+\@.+\..+/, 'Please fill a valid email address']
|
||||
match: [/.+\@.+\..+/, 'Please fill a valid email address'],
|
||||
required: [true, 'Email is required']
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
lowercase: true,
|
||||
validate: {
|
||||
validator: validateUsername,
|
||||
message: 'Please use a valid username'
|
||||
}
|
||||
match: [/^[a-zA-Z0-9\-]+$/, 'Username can only contain alphanumeric characters and \'-\''],
|
||||
required: [true, 'Username is required']
|
||||
},
|
||||
passwordHash: {
|
||||
type: String,
|
||||
|
@ -96,7 +71,6 @@ var UserSchema = new Schema({
|
|||
},
|
||||
provider: {
|
||||
type: String,
|
||||
required: 'Provider is required',
|
||||
default: 'local'
|
||||
},
|
||||
providerData: {},
|
||||
|
@ -112,7 +86,6 @@ var UserSchema = new Schema({
|
|||
type: String,
|
||||
enum: ['en', 'fr', 'es', 'it', 'de'],
|
||||
default: 'en',
|
||||
required: 'User must have a language'
|
||||
},
|
||||
lastModified: {
|
||||
type: Date
|
||||
|
|
|
@ -25,6 +25,9 @@ module.exports = function(app) {
|
|||
} else {
|
||||
app.route('/forms/:formIdFast([a-zA-Z0-9]+)/render')
|
||||
.get(forms.readForRender);
|
||||
|
||||
app.route('/view/')
|
||||
.get(core.form);
|
||||
}
|
||||
|
||||
app.route('/forms/:formIdFast([a-zA-Z0-9]+)')
|
||||
|
|
|
@ -14,7 +14,6 @@ module.exports = function(app) {
|
|||
// Setting up the users profile api
|
||||
app.route('/users/me').get(auth.isAuthenticatedOrApiKey, users.getUser);
|
||||
app.route('/users').put(auth.isAuthenticatedOrApiKey, users.update);
|
||||
app.route('/users/accounts').delete(users.requiresLogin, users.removeOAuthProvider);
|
||||
|
||||
// Setting up the users account verification api
|
||||
app.route('/auth/verify/:token').get(users.validateVerificationToken);
|
||||
|
|
|
@ -9,7 +9,8 @@ var should = require('should'),
|
|||
User = mongoose.model('User'),
|
||||
Form = mongoose.model('Form'),
|
||||
Field = mongoose.model('Field'),
|
||||
FormSubmission = mongoose.model('FormSubmission');
|
||||
FormSubmission = mongoose.model('FormSubmission'),
|
||||
async = require('async');
|
||||
|
||||
/**
|
||||
* Globals
|
||||
|
@ -68,7 +69,7 @@ describe('Form Routes Unit tests', function() {
|
|||
.send({form: myForm})
|
||||
.expect(401)
|
||||
.end(function(FormSaveErr, FormSaveRes) {
|
||||
|
||||
console.log(FormSaveRes.text);
|
||||
// Call the assertion callback
|
||||
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
|
||||
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) {
|
||||
// Set Form 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) {
|
||||
// Set Form with a invalid title field
|
||||
myForm.title = '';
|
||||
|
@ -165,10 +193,22 @@ describe('Form Routes Unit tests', function() {
|
|||
|
||||
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
|
||||
loginSession.post('/forms')
|
||||
|
@ -182,7 +222,7 @@ describe('Form Routes Unit tests', function() {
|
|||
}
|
||||
|
||||
// Update Form title
|
||||
myForm.title = 'WHY YOU GOTTA BE SO MEAN?';
|
||||
myForm.title = 'WHY YOU GOTTA BE SO FORMULAIC?';
|
||||
|
||||
// Update an existing Form
|
||||
loginSession.put('/forms/' + FormSaveRes.body._id)
|
||||
|
@ -197,13 +237,12 @@ describe('Form Routes Unit tests', function() {
|
|||
|
||||
// Set assertions
|
||||
(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
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
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
|
||||
authenticatedSession.post('/forms')
|
||||
.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){
|
||||
authenticatedSession.get('/auth/signout')
|
||||
.expect(200)
|
||||
.end(function(signoutErr, signoutRes) {
|
||||
// Handle signout error
|
||||
if (signoutErr) return done(signoutErr);
|
||||
if (signoutErr) {
|
||||
return done(signoutErr);
|
||||
}
|
||||
authenticatedSession.destroy();
|
||||
done();
|
||||
});
|
||||
|
|
|
@ -199,6 +199,7 @@ describe('FormSubmission Model Unit Tests:', function() {
|
|||
|
||||
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 new_form_fields = _.clone(myForm.toObject().form_fields);
|
||||
new_form_fields.splice(0, 1);
|
||||
|
@ -210,8 +211,8 @@ describe('FormSubmission Model Unit Tests:', function() {
|
|||
should.not.exist(err);
|
||||
should.exist(_form.form_fields);
|
||||
|
||||
var actual_fields = _.deepOmit(_form.toObject().form_fields, ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId']);
|
||||
old_fields = _.deepOmit(old_fields, ['deletePreserved', 'globalId', 'lastModified', 'created', '_id', 'submissionId']);
|
||||
var actual_fields = _.deepOmit(_form.toObject().form_fields, fieldPropertiesToOmit);
|
||||
old_fields = _.deepOmit(old_fields, fieldPropertiesToOmit);
|
||||
|
||||
should.deepEqual(actual_fields, old_fields, 'old form_fields not equal to newly saved form_fields');
|
||||
done();
|
||||
|
|
|
@ -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 %}
|
8
app/views/404.server.view.pug
Normal 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)
|
|
@ -1,8 +0,0 @@
|
|||
{% extends 'layout.server.view.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Server Error</h1>
|
||||
<pre>
|
||||
{{error}}
|
||||
</pre>
|
||||
{% endblock %}
|
12
app/views/500.server.view.pug
Normal 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')
|
|
@ -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>
|
109
app/views/form.server.view.pug
Normal 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");
|
|
@ -1,4 +0,0 @@
|
|||
{% extends 'layout.server.view.html' %}
|
||||
{% block content %}
|
||||
<section class="content" ui-view></section>
|
||||
{% endblock %}
|
55
app/views/index.server.view.pug
Normal 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();
|
|
@ -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>
|
61
app/views/layout.server.view.pug
Normal 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");
|
|
@ -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>
|
62
app/views/redoc.server.view.pug
Normal 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");
|
|
@ -30,7 +30,7 @@
|
|||
<p>Hello there!</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 <a href="mailto:team@tellform.com">team@tellform.com</a>.</p>
|
||||
<p> - The {{appName}} team</p>
|
||||
<p> - The #{appName} team</p>
|
||||
</td>
|
||||
<td width="36"></td>
|
||||
</tr>
|
||||
|
|
|
@ -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
|
44
app/views/templates/reset-password-email.server.view.pug
Normal 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
|
|
@ -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 <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>
|
49
app/views/verification.email.view.pug
Normal 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
|
|
@ -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 <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>
|
48
app/views/welcome.email.view.pug
Normal 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
|
|
@ -2,7 +2,7 @@
|
|||
"name": "tellform",
|
||||
"description": "Opensource alternative to TypeForm",
|
||||
"version": "2.0.0",
|
||||
"homepage": "https://github.com/whitef0x0/tellform",
|
||||
"homepage": "https://github.com/tellform/tellform",
|
||||
"authors": [
|
||||
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"
|
||||
],
|
||||
|
@ -37,7 +37,7 @@
|
|||
"angular-translate": "~2.11.0",
|
||||
"ng-translate": "*",
|
||||
"deep-diff": "^0.3.4",
|
||||
"jsep": "^0.3.1",
|
||||
"jsep": "0.3.1",
|
||||
"ngclipboard": "^1.1.1",
|
||||
"mobile-detect": "^1.3.3",
|
||||
"socket.io-client": "^1.7.2",
|
||||
|
|
4
config/env/all.js
vendored
|
@ -28,7 +28,7 @@ module.exports = {
|
|||
socketPort: process.env.SOCKET_PORT || 20523,
|
||||
socketPortExternallyVisible: (process.env.SOCKET_PORT_EXTERN_VISIBLE === 'TRUE'),
|
||||
|
||||
templateEngine: 'swig',
|
||||
templateEngine: 'pug',
|
||||
|
||||
signupDisabled: (process.env.SIGNUP_DISABLED === '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
|
||||
host: process.env.MAILER_SMTP_HOST || '',
|
||||
port: process.env.MAILER_SMTP_PORT || 465,
|
||||
secure: process.env.MAILER_SMTP_SECURE || true,
|
||||
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
|
||||
auth: {
|
||||
user: process.env.MAILER_EMAIL_ID || '',
|
||||
pass: process.env.MAILER_PASSWORD || ''
|
||||
|
|
2
config/env/development.js
vendored
|
@ -21,7 +21,7 @@ module.exports = {
|
|||
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
|
||||
host: process.env.MAILER_SMTP_HOST || '',
|
||||
port: process.env.MAILER_SMTP_PORT || 465,
|
||||
secure: process.env.MAILER_SMTP_SECURE || true,
|
||||
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
|
||||
auth: {
|
||||
user: process.env.MAILER_EMAIL_ID || '',
|
||||
pass: process.env.MAILER_PASSWORD || ''
|
||||
|
|
7
config/env/production.js
vendored
|
@ -28,9 +28,8 @@ module.exports = {
|
|||
domain: process.env.BASE_URL || '.tellform.com'
|
||||
},
|
||||
assets: {
|
||||
bower_js: 'public/dist/vendor.min.js',
|
||||
css: 'public/dist/application.min.css',
|
||||
js: 'public/dist/application.min.js',
|
||||
form_js: 'public/dist/form-application.min.js'
|
||||
css: ['public/dist/application.min.css'],
|
||||
js: ['public/dist/application.min.js', 'public/dist/populate_template_cache.js'],
|
||||
form_js: ['public/dist/form-application.min.js', 'public/dist/form_populate_template_cache.js', 'public/dist/form-vendor.min.js']
|
||||
}
|
||||
};
|
||||
|
|
2
config/env/secure.js
vendored
|
@ -44,7 +44,7 @@ module.exports = {
|
|||
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
|
||||
host: process.env.MAILER_SMTP_HOST || '',
|
||||
port: process.env.MAILER_SMTP_PORT || 587,
|
||||
secure: process.env.MAILER_SMTP_SECURE || true,
|
||||
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
|
||||
auth: {
|
||||
user: process.env.MAILER_EMAIL_ID || '',
|
||||
pass: process.env.MAILER_PASSWORD || ''
|
||||
|
|
2
config/env/test.js
vendored
|
@ -30,7 +30,7 @@ module.exports = {
|
|||
options: process.env.MAILER_SMTP_HOST ? { //Uses custom SMTP if MAILER_SMTP_HOST is set
|
||||
host: process.env.MAILER_SMTP_HOST || '',
|
||||
port: process.env.MAILER_SMTP_PORT || 587,
|
||||
secure: process.env.MAILER_SMTP_SECURE || true,
|
||||
secure: (process.env.MAILER_SMTP_SECURE === 'TRUE'),
|
||||
auth: {
|
||||
user: process.env.MAILER_EMAIL_ID || '',
|
||||
pass: process.env.MAILER_PASSWORD || ''
|
||||
|
|
|
@ -20,7 +20,8 @@ var fs = require('fs'),
|
|||
config = require('./config'),
|
||||
consolidate = require('consolidate'),
|
||||
path = require('path'),
|
||||
client = new raven.Client(config.DSN);
|
||||
client = new raven.Client(config.DSN),
|
||||
i18n = require('i18n');
|
||||
|
||||
var mongoose = require('mongoose');
|
||||
|
||||
|
@ -35,6 +36,18 @@ var configureSocketIO = function (app, db) {
|
|||
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) {
|
||||
// Initialize express app
|
||||
var app = express();
|
||||
|
@ -135,8 +148,6 @@ module.exports = function(db) {
|
|||
// reassign url
|
||||
req.url = subdomainPath;
|
||||
|
||||
req.userId = user._id;
|
||||
|
||||
// Q.E.D.
|
||||
return next();
|
||||
});
|
||||
|
@ -175,19 +186,37 @@ module.exports = function(db) {
|
|||
level: 9
|
||||
}));
|
||||
|
||||
//Setup i18n
|
||||
i18n.configure({
|
||||
locales: supportedLanguages,
|
||||
directory: __dirname + '/locales',
|
||||
defaultLocale: 'en',
|
||||
cookie: 'userLang'
|
||||
});
|
||||
|
||||
// Set swig as the template engine
|
||||
app.engine('server.view.html', consolidate[config.templateEngine]);
|
||||
app.use(i18n.init);
|
||||
|
||||
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
|
||||
app.set('view engine', 'server.view.html');
|
||||
app.set('view engine', 'server.view.pug');
|
||||
app.set('views', './app/views');
|
||||
|
||||
// Enable logger (morgan)
|
||||
app.use(morgan(logger.getLogFormat(), logger.getMorganOptions()));
|
||||
|
||||
// Environment dependent middleware
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
|
||||
// Disable views cache
|
||||
app.set('view cache', false);
|
||||
} else if (process.env.NODE_ENV === 'production') {
|
||||
|
@ -200,6 +229,7 @@ module.exports = function(db) {
|
|||
extended: true,
|
||||
limit: '100mb'
|
||||
}));
|
||||
|
||||
app.use(bodyParser.json({ limit: '100mb' }));
|
||||
app.use(methodOverride());
|
||||
|
||||
|
@ -220,7 +250,6 @@ module.exports = function(db) {
|
|||
app.use(cookieParser());
|
||||
|
||||
// Express MongoDB session storage
|
||||
|
||||
app.use(session({
|
||||
saveUninitialized: true,
|
||||
resave: true,
|
||||
|
@ -237,18 +266,40 @@ module.exports = function(db) {
|
|||
app.use(passport.initialize());
|
||||
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
|
||||
config.getGlobbedFiles('./app/routes/**/*.js').forEach(function(routePath) {
|
||||
require(path.resolve(routePath))(app);
|
||||
});
|
||||
|
||||
|
||||
// Add headers for Sentry
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
|
||||
// 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
|
||||
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
|
||||
|
@ -280,16 +331,11 @@ module.exports = function(db) {
|
|||
// Log it
|
||||
client.captureError(err);
|
||||
|
||||
if(process.env.NODE_ENV === 'production'){
|
||||
res.status(500).render('500', {
|
||||
error: 'Internal Server Error'
|
||||
});
|
||||
} else {
|
||||
// Error page
|
||||
res.status(500).render('500', {
|
||||
__: i18n.__,
|
||||
error: err.stack
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Assume 404 since no middleware responded
|
||||
|
@ -297,7 +343,8 @@ module.exports = function(db) {
|
|||
client.captureError(new Error('Page Not Found'));
|
||||
res.status(404).render('404', {
|
||||
url: req.originalUrl,
|
||||
error: 'Not Found'
|
||||
error: 'Not Found',
|
||||
__: i18n.__
|
||||
});
|
||||
});
|
||||
|
||||
|
|
21
config/locales/de.json
Normal 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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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"
|
||||
}
|
|
@ -9,7 +9,14 @@ var config = require('./config'),
|
|||
// Define the Socket.io configuration method
|
||||
module.exports = function (app, db) {
|
||||
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){
|
||||
var redis = require('socket.io-redis');
|
||||
|
|
|
@ -16,7 +16,7 @@ module.exports = function () {
|
|||
function (username, password, done) {
|
||||
User.findOne({
|
||||
$or: [
|
||||
{'username': username},
|
||||
{'username': username.toLowerCase()},
|
||||
{'email': username}
|
||||
]
|
||||
}, function (err, user) {
|
||||
|
|
55
docker-compose.yml
Normal 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
|
||||
|
BIN
docs/readme_logos/digitalOcean.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
docs/readme_logos/sentryIO.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
docs/readme_logos/sparkPost.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
docs/readme_logos/statusPageIO.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
docs/readme_logos/stickerMule.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
docs/readme_logos/theRoostStand.png
Normal file
After Width: | Height: | Size: 105 KiB |
19
gruntfile.js
|
@ -23,11 +23,11 @@ module.exports = function(grunt) {
|
|||
|
||||
// Unified Watch Object
|
||||
var watchFiles = {
|
||||
serverViews: ['app/views/**/*.*'],
|
||||
serverViews: ['app/views/**/*.pug'],
|
||||
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',],
|
||||
clientJS: ['public/js/*.js', 'public/form_modules/**/*.js', 'public/modules/**/*.js'],
|
||||
clientJS: ['public/form_modules/**/*.js', 'public/modules/**/*.js'],
|
||||
clientCSS: ['public/modules/**/*.css'],
|
||||
|
||||
serverTests: ['app/tests/**/*.js'],
|
||||
|
@ -123,7 +123,7 @@ module.exports = function(grunt) {
|
|||
compress: true
|
||||
},
|
||||
files: {
|
||||
'public/dist/vendor.min.js': bowerArray
|
||||
'public/dist/form-vendor.min.js': bowerArray
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -145,6 +145,10 @@ module.exports = function(grunt) {
|
|||
}
|
||||
},
|
||||
ngAnnotate: {
|
||||
options:{
|
||||
add: true,
|
||||
remove: true
|
||||
},
|
||||
production: {
|
||||
files: {
|
||||
'public/dist/application.js': '<%= applicationJavaScriptFiles %>',
|
||||
|
@ -291,7 +295,7 @@ module.exports = function(grunt) {
|
|||
target: {
|
||||
src: ['./scripts/setup.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
grunt.event.on('coverage', function(lcov, done){
|
||||
|
@ -325,17 +329,14 @@ module.exports = function(grunt) {
|
|||
grunt.registerTask('coverage:server', ['env:test', 'mocha_istanbul:coverageServer']);
|
||||
|
||||
// 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']);
|
||||
|
||||
// Debug task.
|
||||
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).
|
||||
grunt.registerTask('lint', ['jshint', 'csslint']);
|
||||
grunt.registerTask('lint', ['jshint', 'csslint', 'i18nlint:client', 'i18nlint:server']);
|
||||
grunt.registerTask('lint:tests', ['jshint:allTests']);
|
||||
|
||||
// Build task(s).
|
||||
|
|
19
nginx/Dockerfile
Normal 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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
53
package.json
|
@ -2,7 +2,7 @@
|
|||
"name": "TellForm",
|
||||
"description": "Opensource alternative to TypeForm",
|
||||
"version": "2.1.0",
|
||||
"homepage": "https://github.com/whitef0x0/tellform",
|
||||
"homepage": "https://github.com/tellform/tellform",
|
||||
"authors": [
|
||||
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"
|
||||
],
|
||||
|
@ -10,7 +10,7 @@
|
|||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/whitef0x0/tellform.git"
|
||||
"url": "https://github.com/tellform/tellform.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": "6.x.x",
|
||||
|
@ -19,27 +19,27 @@
|
|||
"scripts": {
|
||||
"addcontrib": "all-contributors add",
|
||||
"generate": "all-contributors generate",
|
||||
"start": "npm run version && grunt",
|
||||
"test": "npm run version && grunt test",
|
||||
"postinstall": "bower install --config.interactive=false; grunt build;",
|
||||
"start": "grunt",
|
||||
"test": "grunt test",
|
||||
"postinstall": "bower install --config.interactive=false",
|
||||
"init": "node scripts/setup.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "^1.4.2",
|
||||
"bcrypt": "^0.8.7",
|
||||
"body-parser": "~1.14.1",
|
||||
"bower": "~1.6.5",
|
||||
"body-parser": "^1.19.0",
|
||||
"bower": "^1.8.8",
|
||||
"chalk": "^1.1.3",
|
||||
"compression": "~1.6.0",
|
||||
"compression": "^1.7.4",
|
||||
"connect": "^3.4.1",
|
||||
"connect-mongo": "~0.8.2",
|
||||
"consolidate": "~0.13.1",
|
||||
"connect-mongo": "^2.0.0",
|
||||
"consolidate": "~0.14.5",
|
||||
"cookie-parser": "~1.4.0",
|
||||
"deep-diff": "^0.3.4",
|
||||
"dotenv": "^2.0.0",
|
||||
"email-verification": "~0.4.1",
|
||||
"express": "~4.13.3",
|
||||
"express-session": "~1.12.1",
|
||||
"email-verification": "github:tellform/node-email-verification",
|
||||
"envfile": "^2.1.1",
|
||||
"express": "^4.16.4",
|
||||
"express-session": "^1.16.1",
|
||||
"glob": "^7.0.3",
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-concurrent": "~2.3.0",
|
||||
|
@ -48,16 +48,17 @@
|
|||
"grunt-contrib-jshint": "~1.0.0",
|
||||
"grunt-contrib-uglify": "~0.11.0",
|
||||
"grunt-env": "~0.4.1",
|
||||
"grunt-html2js": "~0.3.5",
|
||||
"grunt-html2js": "^0.6.0",
|
||||
"grunt-ng-annotate": "~1.0.1",
|
||||
"helmet": "3.5.0",
|
||||
"helmet": "^3.16.0",
|
||||
"i18n": "^0.8.3",
|
||||
"jit-grunt": "^0.9.1",
|
||||
"lodash": "^4.17.4",
|
||||
"main-bower-files": "~2.9.0",
|
||||
"lodash": "^4.17.11",
|
||||
"main-bower-files": "^2.13.1",
|
||||
"method-override": "~2.3.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mongoose": "~4.4.19",
|
||||
"morgan": "~1.8.1",
|
||||
"morgan": "^1.9.1",
|
||||
"nodemailer": "~4.0.0",
|
||||
"passport": "~0.3.0",
|
||||
"passport-anonymous": "^1.0.1",
|
||||
|
@ -65,16 +66,15 @@
|
|||
"passport-localapikey-update": "^0.5.0",
|
||||
"path-exists": "^2.1.0",
|
||||
"prerender-node": "^2.2.1",
|
||||
"pug": "^2.0.3",
|
||||
"random-js": "^1.0.8",
|
||||
"raven": "^0.9.0",
|
||||
"request": "^2.83.0",
|
||||
"request": "^2.88.0",
|
||||
"socket.io": "^1.4.6",
|
||||
"socket.io-redis": "^1.0.0",
|
||||
"swig": "~1.4.1",
|
||||
"uuid-token-generator": "^0.5.0",
|
||||
"wildcard-subdomains": "github:tellform/wildcard-subdomains",
|
||||
"winston": "^2.3.1",
|
||||
"winston-logrotate": "^1.2.0"
|
||||
"winston": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"all-contributors-cli": "^4.3.0",
|
||||
|
@ -87,14 +87,15 @@
|
|||
"grunt-contrib-concat": "^1.0.1",
|
||||
"grunt-contrib-copy": "^1.0.0",
|
||||
"grunt-contrib-uglify": "^0.11.1",
|
||||
"grunt-contrib-watch": "~0.6.1",
|
||||
"grunt-execute": "^0.2.2",
|
||||
"grunt-i18nlint": "github:jwarby/grunt-i18nlint",
|
||||
"grunt-karma": "~0.12.1",
|
||||
"grunt-mocha-istanbul": "^3.0.1",
|
||||
"grunt-mocha-test": "~0.12.1",
|
||||
"grunt-contrib-watch": "~0.6.1",
|
||||
"grunt-newer": "~1.1.1",
|
||||
"grunt-usemin": "^3.1.1",
|
||||
"grunt-karma": "~0.12.1",
|
||||
"grunt-nodemon": "~0.4.0",
|
||||
"grunt-usemin": "^3.1.1",
|
||||
"grunt-wiredep": "^3.0.1",
|
||||
"istanbul": "^0.4.0",
|
||||
"jasmine-core": "^2.4.1",
|
||||
|
|
0
public/dist/.placeholder
vendored
4675
public/dist/application.js
vendored
4
public/dist/application.min.css
vendored
5
public/dist/application.min.js
vendored
1342
public/dist/form-application.js
vendored
2
public/dist/form-application.min.js
vendored
35
public/dist/form_populate_template_cache.js
vendored
19
public/dist/vendor.min.js
vendored
0
public/dist/vendor.min.js.report.txt
vendored
20611
public/dist/vendor_forms_uglified.js
vendored
19430
public/dist/vendor_uglified.js
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
|
||||
|
||||
$translateProvider.translations('english', {
|
||||
$translateProvider.translations('en', {
|
||||
FORM_SUCCESS: 'Form entry successfully submitted!',
|
||||
REVIEW: 'Review',
|
||||
BACK_TO_FORM: 'Go back to Form',
|
||||
|
@ -28,10 +28,22 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
|
|||
CANCEL: 'Cancel',
|
||||
SUBMIT: 'Submit',
|
||||
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')
|
||||
.fallbackLanguage('english')
|
||||
$translateProvider.preferredLanguage('en')
|
||||
.fallbackLanguage('en')
|
||||
.useSanitizeValueStrategy('escape');
|
||||
|
||||
}]);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
|
||||
|
||||
$translateProvider.translations('french', {
|
||||
$translateProvider.translations('fr', {
|
||||
FORM_SUCCESS: 'Votre formulaire a été enregistré!',
|
||||
REVIEW: 'Incomplet',
|
||||
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)',
|
||||
OPTIONAL: 'facultatif',
|
||||
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',
|
||||
OK: 'OK',
|
||||
ENTER: 'presser ENTRÉE',
|
||||
ENTER: 'Appuyer sur ENTRÉE',
|
||||
YES: 'Oui',
|
||||
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',
|
||||
LEGAL_ACCEPT: 'J’accepte',
|
||||
LEGAL_NO_ACCEPT: 'Je n’accepte pas',
|
||||
|
@ -30,6 +30,16 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
|
|||
UPLOAD_FILE: 'Envoyer un fichier',
|
||||
Y: 'O',
|
||||
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.',
|
||||
});
|
||||
|
||||
}]);
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
|
||||
|
||||
$translateProvider.translations('german', {
|
||||
$translateProvider.translations('de', {
|
||||
FORM_SUCCESS: 'Ihre Angaben wurden gespeichert.',
|
||||
REVIEW: 'Unvollständig',
|
||||
BACK_TO_FORM: 'Zurück zum Formular',
|
||||
EDIT_FORM: '',
|
||||
CREATE_FORM: '',
|
||||
EDIT_FORM: 'Bearbeiten Sie diese TellForm',
|
||||
CREATE_FORM: 'Dieses TellForm erstellen',
|
||||
ADVANCEMENT: '{{done}} von {{total}} beantwortet',
|
||||
CONTINUE_FORM: 'Zum Formular',
|
||||
REQUIRED: 'verpflichtend',
|
||||
|
@ -30,6 +30,16 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
|
|||
UPLOAD_FILE: 'Datei versenden',
|
||||
Y: 'J',
|
||||
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.',
|
||||
});
|
||||
|
||||
}]);
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
|
||||
|
||||
$translateProvider.translations('italian', {
|
||||
$translateProvider.translations('it', {
|
||||
FORM_SUCCESS: 'Il formulario è stato inviato con successo!',
|
||||
REVIEW: 'Incompleto',
|
||||
BACK_TO_FORM: 'Ritorna al formulario',
|
||||
EDIT_FORM: '',
|
||||
CREATE_FORM: '',
|
||||
EDIT_FORM: 'Modifica questo TellForm',
|
||||
CREATE_FORM: 'Crea questo TellForm',
|
||||
ADVANCEMENT: '{{done}} su {{total}} completate',
|
||||
CONTINUE_FORM: 'Vai al formulario',
|
||||
REQUIRED: 'obbligatorio',
|
||||
|
@ -30,6 +30,16 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
|
|||
UPLOAD_FILE: 'Invia un file',
|
||||
Y: 'S',
|
||||
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.',
|
||||
});
|
||||
|
||||
}]);
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
angular.module('view-form').config(['$translateProvider', function ($translateProvider) {
|
||||
|
||||
$translateProvider.translations('spanish', {
|
||||
$translateProvider.translations('es', {
|
||||
FORM_SUCCESS: '¡El formulario ha sido enviado con éxito!',
|
||||
REVIEW: 'Revisar',
|
||||
BACK_TO_FORM: 'Regresar al formulario',
|
||||
EDIT_FORM: '',
|
||||
CREATE_FORM: '',
|
||||
EDIT_FORM: 'Editar este TellForm',
|
||||
CREATE_FORM: 'Crear este TellForm',
|
||||
ADVANCEMENT: '{{done}} de {{total}} contestadas',
|
||||
CONTINUE_FORM: 'Continuar al formulario',
|
||||
REQUIRED: 'Información requerida',
|
||||
|
@ -29,7 +29,17 @@ angular.module('view-form').config(['$translateProvider', function ($translatePr
|
|||
SUBMIT: 'Registrar',
|
||||
UPLOAD_FILE: 'Cargar el archivo',
|
||||
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.',
|
||||
});
|
||||
|
||||
}]);
|
||||
|
|
45
public/form_modules/forms/base/config/i18n/swedish.js
Normal 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.',
|
||||
});
|
||||
|
||||
}]);
|
|
@ -120,6 +120,7 @@ div.form-fields {
|
|||
vertical-align: top;
|
||||
zoom: 1;
|
||||
width: 16px;
|
||||
margin-top: 1px;
|
||||
padding: 0;
|
||||
height: 17px;
|
||||
font-size: 12px;
|
||||
|
@ -438,11 +439,11 @@ section.public-form .btn {
|
|||
}
|
||||
|
||||
/*CREATE-NEW FORM MODAL*/
|
||||
.form-item.create-new.new-form {
|
||||
.form-item.new-form {
|
||||
background-color: rgb(300,131,131);
|
||||
z-index: 11;
|
||||
}
|
||||
.form-item.create-new.new-form:hover {
|
||||
.form-item.new-form:hover {
|
||||
background-color: rgb(300,100,100);
|
||||
}
|
||||
.form-item.new-form input[type='text'] {
|
||||
|
|
|
@ -24,10 +24,9 @@
|
|||
on-tab-and-shift-key="prevField()"
|
||||
on-tab-key="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-choices repeat="option in field.fieldOptions | filter: $select.search"
|
||||
ng-class="{'active': option.option_value === field.fieldValue }">
|
||||
<ui-select-choices repeat="option in field.fieldOptions | filter: $select.search">
|
||||
<span ng-bind-html="option.option_value | highlight: $select.search"></span>
|
||||
</ui-select-choices>
|
||||
</ui-select>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
ng-required="field.required"
|
||||
ng-change="nextField()"/>
|
||||
<div class="letter" style="float:left">
|
||||
Y
|
||||
{{ 'Y' | translate }}
|
||||
</div>
|
||||
<span>{{ 'LEGAL_ACCEPT' | translate }}</span>
|
||||
</label>
|
||||
|
@ -43,7 +43,7 @@
|
|||
ng-required="field.required"
|
||||
ng-change="nextField()"/>
|
||||
<div class="letter" style="float:left">
|
||||
N
|
||||
{{ 'N' | translate }}
|
||||
</div>
|
||||
<span>{{ 'LEGAL_NO_ACCEPT' | translate }}</span>
|
||||
</label>
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
</p>
|
||||
</div>
|
||||
<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"
|
||||
ng-focus="setActiveField(field._id, null, false)"
|
||||
ng-model="field.fieldValue"
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<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">
|
||||
<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 == 'number'"> {{ 'ERROR_NOT_A_NUMBER' | translate }} </span>
|
||||
<span ng-if="field.fieldType == 'link'"> {{ 'ERROR_URL_INVALID' | translate }} </span>
|
||||
|
|
|
@ -3,10 +3,12 @@ $(".loader").fadeOut("slow");
|
|||
</script>
|
||||
<section class="public-form auth sigin-view valign-wrapper">
|
||||
<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-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>
|
||||
</section>
|
||||
|
|
|
@ -3,10 +3,13 @@ $(".loader").fadeOut("slow");
|
|||
</script>
|
||||
<section class="public-form auth sigin-view valign-wrapper">
|
||||
<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-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>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// Setting up route
|
||||
angular.module('core').config(['$stateProvider', '$urlRouterProvider',
|
||||
function($stateProvider, $urlRouterProvider, Authorization) {
|
||||
function($stateProvider, $urlRouterProvider) {
|
||||
// Redirect to home view when route not found
|
||||
$urlRouterProvider.otherwise('/forms');
|
||||
}
|
||||
|
@ -15,10 +15,13 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
|
|||
$rootScope.$stateParams = $stateParams;
|
||||
|
||||
// add previous state property
|
||||
$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState) {
|
||||
$state.previous = fromState;
|
||||
$rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
|
||||
$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
|
||||
if(statesToIgnore.indexOf(toState.name) > 0){
|
||||
|
@ -45,7 +48,7 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
|
|||
var authenticator, permissions, user;
|
||||
permissions = next && next.data && next.data.permissions ? next.data.permissions : null;
|
||||
|
||||
Auth.ensureHasCurrentUser(User);
|
||||
Auth.ensureHasCurrentUser();
|
||||
user = Auth.currentUser;
|
||||
|
||||
if(user){
|
||||
|
|
|
@ -8,9 +8,9 @@ angular.module('core').config(['$translateProvider', function ($translateProvide
|
|||
SIGNIN_TAB: 'Sign In',
|
||||
SIGNOUT_TAB: 'Signout',
|
||||
EDIT_PROFILE: 'Edit Profile',
|
||||
MY_FORMS: 'My Forms',
|
||||
MY_SETTINGS: 'My Settings',
|
||||
CHANGE_PASSWORD: 'Change Password'
|
||||
CHANGE_PASSWORD: 'Change Password',
|
||||
TOGGLE_NAVIGATION: 'Toggle navigation'
|
||||
});
|
||||
|
||||
$translateProvider.preferredLanguage('en')
|
||||
|
|
|
@ -4,12 +4,12 @@ angular.module('core').config(['$translateProvider', function ($translateProvide
|
|||
|
||||
$translateProvider.translations('fr', {
|
||||
MENU: 'MENU',
|
||||
SIGNUP_TAB: 'Créer un Compte',
|
||||
SIGNUP_TAB: 'Créer un compte',
|
||||
SIGNIN_TAB: 'Connexion',
|
||||
SIGNOUT_TAB: 'Créer un compte',
|
||||
EDIT_PROFILE: 'Modifier Mon Profil',
|
||||
MY_FORMS: 'Mes Formulaires',
|
||||
MY_SETTINGS: 'Mes Paramètres',
|
||||
CHANGE_PASSWORD: 'Changer mon Mot de Pass'
|
||||
EDIT_PROFILE: 'Modifier mon profil',
|
||||
MY_SETTINGS: 'Mes paramètres',
|
||||
CHANGE_PASSWORD: 'Changer mon mot de passe',
|
||||
TOGGLE_NAVIGATION: 'Basculer la navigation',
|
||||
});
|
||||
}]);
|
||||
|
|
15
public/modules/core/config/i18n/german.js
Normal 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'
|
||||
});
|
||||
}]);
|
15
public/modules/core/config/i18n/italian.js
Normal 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'
|
||||
});
|
||||
}]);
|
|
@ -8,9 +8,9 @@ angular.module('core').config(['$translateProvider', function ($translateProvide
|
|||
SIGNIN_TAB: 'Entrar',
|
||||
SIGNOUT_TAB: 'Salir',
|
||||
EDIT_PROFILE: 'Editar Perfil',
|
||||
MY_FORMS: 'Mis formularios',
|
||||
MY_SETTINGS: 'Mis configuraciones',
|
||||
CHANGE_PASSWORD: 'Cambiar contraseña'
|
||||
CHANGE_PASSWORD: 'Cambiar contraseña',
|
||||
TOGGLE_NAVIGATION: 'Navegación de palanca'
|
||||
});
|
||||
|
||||
}]);
|
||||
|
|
16
public/modules/core/config/i18n/swedish.js
Normal 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'
|
||||
});
|
||||
|
||||
}]);
|
|
@ -1,23 +1,19 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('core').controller('HeaderController', ['$rootScope', '$scope', 'Menus', '$state', 'Auth', 'User', '$window', '$translate', '$locale',
|
||||
function ($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) {
|
||||
|
||||
$rootScope.signupDisabled = $window.signupDisabled;
|
||||
|
||||
$scope.user = $rootScope.user = Auth.ensureHasCurrentUser(User);
|
||||
$scope.user = $rootScope.user = Auth.ensureHasCurrentUser();
|
||||
|
||||
$scope.authentication = $rootScope.authentication = Auth;
|
||||
|
||||
$rootScope.languages = $scope.languages = ['en', 'fr', 'es', 'it', 'de'];
|
||||
|
||||
//Set global app language
|
||||
if($scope.authentication.isAuthenticated()){
|
||||
$rootScope.language = $scope.user.language;
|
||||
}else {
|
||||
$rootScope.language = $locale.id.substring(0,2);
|
||||
}
|
||||
$translate.use($rootScope.language);
|
||||
$translate.use($scope.user.language);
|
||||
|
||||
$scope.isCollapsed = false;
|
||||
$rootScope.hideNav = false;
|
||||
|
@ -27,7 +23,7 @@ angular.module('core').controller('HeaderController', ['$rootScope', '$scope', '
|
|||
var promise = User.logout();
|
||||
promise.then(function() {
|
||||
Auth.logout();
|
||||
Auth.ensureHasCurrentUser(User);
|
||||
Auth.ensureHasCurrentUser();
|
||||
$scope.user = $rootScope.user = null;
|
||||
$state.go('listForms');
|
||||
|
||||
|
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
@ -6,9 +6,38 @@
|
|||
var scope,
|
||||
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
|
||||
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) {
|
||||
scope = $rootScope.$new();
|
||||
|
||||
|
|