diff --git a/README.md b/README.md index 69d30d86..df51617a 100755 --- a/README.md +++ b/README.md @@ -18,13 +18,14 @@ TellForm 2.0.0 - [Quickstart](#quickstart) - [Deploying with Docker](#deploying-with-docker) - [Testing your Application](#testing-your-application) +- [FORMA](#forma) - [Where to Get Help](#where-to-get-help) - [Sponsors](#sponsors) - [Backers](#backers) - [Contributors](#contributors) - [Mentions on the Web](#mentions-on-the-web) -## Features +## Features ### Currently following features are implemented: @@ -55,7 +56,7 @@ All contributors are eligible to get a free [TellForm Sticker](https://www.stick ## Quickstart -Before you start, make sure you have +Before you start, make sure you have 1. [Redis](https://redis.io/) installed and running at 127.0.0.1:6379 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) @@ -106,7 +107,7 @@ Your application should run on port 3000 or the port you specified in your .env ## Deploying with Docker -To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/). +To deploy with docker, first install docker [here](https://docs.docker.com/engine/installation/). Then run these commands @@ -155,6 +156,63 @@ To calculate your client-side test coverage with Istanbul, run the coverage task $ grunt coverage:client ``` +## FORMA + +#### Prerequisite: +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) +3. [Docker](https://docs.docker.com/engine/installation/) installed and running + +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: +``` +$ npm install +$ bower install +``` + +#### Prepare .env file: +Create .env file at project root folder. Fill in MAILER_SERVICE_PROVIDER, MAILER_EMAIL_ID and MAILER_PASSWORD. +``` +APP_NAME=forma +APP_DESC= +APP_KEYWORDS= +NODE_ENV=development +BASE_URL=localhost:5000 +PORT=5000 +username=forma_admin +MAILER_SERVICE_PROVIDER= +MAILER_EMAIL_ID= +MAILER_PASSWORD= +MAILER_FROM=forma@data.gov.sg +SIGNUP_DISABLED=false +SUBDOMAINS_DISABLED=true +DISABLE_CLUSTER_MODE=true +GOOGLE_ANALYTICS_ID= +RAVEN_DSN= +PRERENDER_TOKEN= +COVERALLS_REPO_TOKEN= +``` + +#### Deploy with Docker: +Create and start mongo & redis docker container. +``` +$ docker run -p 27017:27017 -d --name forma-mongo mongo +$ docker run -p 127.0.0.1:6379:6379 -d --name forma-redis redis +``` + +After code changes, build and start docker containers. +``` +$ docker start forma-mongo && docker start forma-redis +$ docker build -t forma-tellform . +$ docker stop forma-tellform +$ docker run --rm -p 5000:5000 --link forma-redis:redis-db --link forma-mongo:db --name forma-tellform forma-tellform +``` + +Your application should run on port 5000 or the port you specified in your .env file, so in your browser just go to [http://localhost:5000](http://localhost:5000) + ## Where to get help @@ -200,7 +258,7 @@ Love our work and community? [Become a backer](https://opencollective.com/tellfo -## Contributors +## Contributors | [
David Baldwynn](http://baldwynn.me)
[πŸ’»](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") | [
Samuel Laulhau](https://samuellaulhau.fr)
[πŸ’»](https://github.com/tellform/TellForm/commits?author=lalop "Code") [🌍](#translation-lalop "Translation") | [
Arun Pattnaik](http://arun.co)
[🎨](#design-arunpattnaik "Design") | [
ThiΓͺn ToΓ‘n](https://toanalien.com)
[πŸ›](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") | [
Adrian Portabales](https://github.com/AdrianP-)
[πŸ›](https://github.com/tellform/TellForm/issues?q=author%3AAdrianP- "Bug reports") [πŸ’»](https://github.com/tellform/TellForm/commits?author=AdrianP- "Code") | [
Peter Thaleikis](https://github.com/spekulatius)
[πŸ“–](https://github.com/tellform/TellForm/commits?author=spekulatius "Documentation") | [
MickaΓ«l Andrieu](http://www.mickael-andrieu.com)
[πŸ“–](https://github.com/tellform/TellForm/commits?author=mickaelandrieu "Documentation") | diff --git a/config/env/development.js b/config/env/development.js index b3099268..2506743b 100755 --- a/config/env/development.js +++ b/config/env/development.js @@ -2,6 +2,7 @@ module.exports = { baseUrl: process.env.BASE_URL || 'http://localhost:5000', + port: process.env.PORT || 5000, db: { uri: 'mongodb://'+( process.env.DB_PORT_27017_TCP_ADDR || process.env.DB_HOST || '0.0.0.0') +'/mean', options: { diff --git a/config/express.js b/config/express.js index af955864..a1d48020 100755 --- a/config/express.js +++ b/config/express.js @@ -93,11 +93,7 @@ module.exports = function(db) { urlPath = url.parse(req.url).path.split('/'); if (urlPath.indexOf('static') > -1) { urlPath.splice(1, 1); - if(process.env.NODE_ENV === 'development'){ - req.root = req.protocol + '://' + config.baseUrl + ':' + config.port + urlPath.join('/'); - } else { - req.root = req.protocol + '://' + config.baseUrl + urlPath.join('/'); - } + req.root = req.protocol + '://' + config.baseUrl + urlPath.join('/'); return next(); } @@ -289,7 +285,7 @@ module.exports = function(db) { if (!err) { return next(); } - + // Log it client.captureError(err); diff --git a/gruntfile.js b/gruntfile.js index 52da56c5..a2fccd86 100755 --- a/gruntfile.js +++ b/gruntfile.js @@ -363,8 +363,8 @@ module.exports = function(grunt) { grunt.registerTask('secure', ['env:secure', 'lint', 'html2js:main', 'html2js:forms', 'concurrent:default']); // Lint task(s). - grunt.registerTask('lint', ['jshint', 'csslint']); - grunt.registerTask('lint:tests', ['jshint:allTests']); + // grunt.registerTask('lint', ['jshint', 'csslint']); + // grunt.registerTask('lint:tests', ['jshint:allTests']); // Build task(s). grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'closure-compiler', 'html2js:main', 'html2js:forms']); diff --git a/public/modules/forms/admin/views/admin-form.client.view.html b/public/modules/forms/admin/views/admin-form.client.view.html index 9b07323f..0afea076 100644 --- a/public/modules/forms/admin/views/admin-form.client.view.html +++ b/public/modules/forms/admin/views/admin-form.client.view.html @@ -64,7 +64,7 @@ - +
@@ -187,6 +187,55 @@ + + + + +
+
+
+ + +
+
+ {{ 'TELLFORM_URL' | translate }} +
+
+ +
+
+ +
+
+
+ +
+
+ {{ 'COPY_AND_PASTE' | translate }} +
+
+ + + +
+
+ +
+
+
+
+
+
+
+
diff --git a/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html b/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html index 2a9bbe5a..4823d60a 100644 --- a/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html +++ b/public/modules/forms/admin/views/directiveViews/form/edit-form.client.view.html @@ -585,10 +585,11 @@
+