Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth Dahlstrøm <kenneth@keda.no>
  • Loading branch information
kedano committed Mar 2, 2016
0 parents commit 2b7845a
Show file tree
Hide file tree
Showing 16 changed files with 1,272 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
presets: ["es2015"]
}
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "vendor"
}
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parser": "babel-eslint",
"rules": {
"strict": 0
}
}
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OS generated files #
######################
.DS_Store*
thumbs.db
# Icon?
Thumbs.db

build/**/*
dist/**/*
vendor/**/*
node_modules/**/*

tmp
secret.json
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

280 changes: 280 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
module.exports = function(grunt) {
// Loads each task referenced in the packages.json file
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
require('time-grunt')(grunt);

// Initiate grunt tasks
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
moment: require('moment'),
// Tasks
sass: {
options: {

},
dist: {
files: {
'build/feedback-form.css': 'app/assets/sass/feedback-form.scss'
}
}
},

autoprefixer: {
options: {
browsers: ['last 2 versions', 'ie 8', 'ie 9']
//diff: 'build/config/*.diff'
},
prefix: {
expand: true,
//flatten: true,
src: 'build/*.css'
//dest: 'tmp/css/prefixed/'
}
},
cssmin: {
main: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> by <%= pkg.author %>, released: <%= moment().format("HH:mm DD-MM-YYYY") %> */'
},
expand: true,
cwd: 'build',
src: ['*.css', '!*.min.css'],
dest: 'build/',
ext: '.v<%= pkg.version %>.min.css'
}
},
copy: {
dist: {
expand: true,
cwd: 'build/',
src: '**',
dest: 'dist',
filter: 'isFile'
}
},
clean: {
dist: ['dist/**/*'],
deploy: ['deploy/**/*'],
build: ['build/**/*']
},

eslint: {
options: {
//format: require('babel-eslint'),
quiet: true
//rulePath: ['node_modules/eslint-rules-es2015/lib/index.js']
},
target: ['app/assets/js/**/*.js']
},

handlebars: {
options: {
namespace: 'Hiof.Templates',
processName: function(filePath) {
if (filePath.substring(0, 4) === 'vend') {
return filePath.replace(/^vendor\/frontend\/app\/templates\//, '').replace(/\.hbs$/, '');
} else {
return filePath.replace(/^app\/templates\//, '').replace(/\.hbs$/, '');
}
}
},
all: {
files: {
"build/templates.js": ["app/templates/**/*.hbs"]
}
}
},
babel: {
options: {
sourceMap: true,
presets: ['es2015']
},
dist: {
files: {
'build/_<%= pkg.name %>.js': 'app/assets/js/_component_feedbackform.js'
}
}
},
concat: {
scripts: {
src: [
'vendor/jQuery-ajaxTransport-XDomainRequest/jquery.xdomainrequest.min.js',
'build/templates.js',
'build/_<%= pkg.name %>.js'
],
dest: 'build/<%= pkg.name %>.v<%= pkg.version %>.js'
}
},
uglify: {
options: {
mangle: false,
//compress: true,
preserveComments: false,
banner: '/*! <%= pkg.name %> v<%= pkg.version %> by <%= pkg.author %>, released: <%= moment().format("HH:mm DD-MM-YYYY") %>, license: <%= pkg.license %> */'
},
main: {
files: {
'build/<%= pkg.name %>.v<%= pkg.version %>.min.js': ['build/<%= pkg.name %>.v<%= pkg.version %>.js']
}
}
},
versioning: {
options: {
cwd: 'build/',
outputConfigDir: 'build/',
namespace: 'hiof'
},
build: {
files: [{
assets: [{
src: ['build/<%= pkg.name %>.v<%= pkg.version %>.min.js'],
dest: 'build/<%= pkg.name %>.v<%= pkg.version %>.min.js'
}],
key: 'assets',
dest: '',
type: 'js',
ext: '.min.js'
}, {
assets: [{
src: 'build/<%= pkg.name %>.v<%= pkg.version %>.min.css',
dest: 'build/<%= pkg.name %>.v<%= pkg.version %>.min.css'
}],
key: 'assets',
dest: '',
type: 'css',
ext: '.min.css'
}]
},
deploy: {
options: {
output: 'php',
outputConfigDir: 'build/',
},
files: [{
assets: [{
src: ['build/<%= pkg.name %>.v<%= pkg.version %>.min.js'],
dest: 'build/<%= pkg.name %>.v<%= pkg.version %>.min.js'
}],
key: 'assets',
dest: '',
type: 'js',
ext: '.min.js'
},

{
assets: [{
src: 'build/<%= pkg.name %>.v<%= pkg.version %>.min.css',
dest: 'build/<%= pkg.name %>.v<%= pkg.version %>.min.css'
}],
key: 'assets',
dest: '',
type: 'css',
ext: '.min.css'
}
]
}
},
secret: grunt.file.readJSON('secret.json'),
sftp: {
stage: {
files: {
"./": "dist/**"
},
options: {
path: '<%= secret.stage.path %>',
srcBasePath: "dist/",
host: '<%= secret.stage.host %>',
username: '<%= secret.stage.username %>',
password: '<%= secret.stage.password %>',
//privateKey: grunt.file.read('id_rsa'),
//passphrase: '<%= secret.passphrase %>',
showProgress: true,
createDirectories: true,
directoryPermissions: parseInt(755, 8)
}
},
prod: {
files: {
"./": "dist/**"
},
options: {
path: '<%= secret.prod.path %>',
srcBasePath: "dist/",
host: '<%= secret.prod.host %>',
username: '<%= secret.prod.username %>',
password: '<%= secret.prod.password %>',
//privateKey: grunt.file.read('id_rsa'),
//passphrase: '<%= secret.passphrase %>',
showProgress: true,
createDirectories: true,
directoryPermissions: parseInt(755, 8)
}
},
stage2: {
files: {
"./": "dist/**"
},
options: {
path: '<%= secret.stage2.path %>',
srcBasePath: "dist/",
host: '<%= secret.stage2.host %>',
username: '<%= secret.stage2.username %>',
password: '<%= secret.stage2.password %>',
//privateKey: grunt.file.read('id_rsa'),
//passphrase: '<%= secret.passphrase %>',
showProgress: true,
createDirectories: true,
directoryPermissions: parseInt(755, 8)
}
},
prod2: {
files: {
"./": "dist/**"
},
options: {
path: '<%= secret.prod2.path %>',
srcBasePath: "dist/",
host: '<%= secret.prod2.host %>',
username: '<%= secret.prod2.username %>',
password: '<%= secret.prod2.password %>',
//privateKey: grunt.file.read('id_rsa'),
//passphrase: '<%= secret.passphrase %>',
showProgress: true,
createDirectories: true,
directoryPermissions: parseInt(755, 8)
}
}
}
//watch: {
// hbs: {
// files: ['app/templates/**/*.hbs'],
// tasks: ['handlebars', 'copy:jstemplates'],
// options: {
// livereload: true,
// },
// },
// js: {
// files: ['app/assets/js/**/*.js', 'app/assets/js/**/*.json'],
// tasks: ['jshint', 'concat:scripts', 'versioning:build'],
// options: {
// livereload: true,
// },
// },
//}

});

grunt.registerTask('subtaskJs', ['eslint', 'handlebars', 'babel', 'concat:scripts', 'uglify']);
grunt.registerTask('subtaskCss', ['sass', 'autoprefixer', 'cssmin']);

grunt.registerTask('build', ['clean:build', 'clean:dist', 'subtaskJs', 'subtaskCss', 'versioning:build']);
grunt.registerTask('deploy', ['clean:build', 'clean:dist', 'subtaskJs', 'subtaskCss', 'versioning:deploy', 'copy:dist']);



grunt.registerTask('deploy-staging', ['deploy', 'sftp:stage']);
grunt.registerTask('deploy-prod', ['deploy', 'sftp:prod']);
grunt.registerTask('deploy-staging2', ['deploy', 'sftp:stage2']);
grunt.registerTask('deploy-prod2', ['deploy', 'sftp:prod2']);

};
18 changes: 18 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# License

Østfold University College frontend code
Copyright (C) 2015 Østfold University College

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Hiof Feedback form package

## About

A package with the required files for the it-services views.

## Copyright

This project is distributed under a GNU General Public License v3 - Take a look at the COPYING file for details.

## Install

Install [Git](http://git-scm.com) if it's not already installed on your computer. Then run (this will download this project to the folder the shell has open):

```
$ git clone https://github.com/hiof/feedback-form.git
```

Install [io.js](https://iojs.org) (or [Node.js](http://nodejs.org)) if it's not already installed on your computer. Then run (this will install the project dependencies):

```
$ sudo npm install -g grunt-cli
$ npm install
$ bower install
```

## Build

`$ grunt build`: Compiles and builds the feedback-form package

## Deploy

1. Rename secret-template.json to secret.json and add your credentials.
2. Deploy and test your code on the staging server `$ grunt deploy-staging2`
3. Deploy to production `$ grunt deploy-prod2`

## Releases

v1.0.0 - Initial feedback form release

[Github releases](https://github.com/hiof/feedback-form/releases)

### Roadmap
Loading

0 comments on commit 2b7845a

Please sign in to comment.