Skip to content

Commit 04f9c52

Browse files
committed
init
0 parents  commit 04f9c52

17 files changed

+587
-0
lines changed

Diff for: .bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "components"
3+
}

Diff for: .editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

Diff for: .gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/nbproject/
2+
/node_modules/
3+
/build/
4+
/components/
5+
.tmp/

Diff for: .jshintrc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"node": true,
3+
"browser": true,
4+
"esnext": true,
5+
"bitwise": true,
6+
"camelcase": true,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": true,
12+
"newcap": true,
13+
"noarg": true,
14+
"quotmark": "single",
15+
"regexp": true,
16+
"undef": true,
17+
"unused": true,
18+
"strict": true,
19+
"trailing": true,
20+
"smarttabs": true,
21+
"predef": ["angular"]
22+
}

Diff for: README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# adf-widget-redmine
2+
3+
redmine widget for the [angular-dashboard-framework](https://github.com/sdorra/angular-dashboard-framework).
4+
5+
## Build
6+
7+
The widget is build with the help of [node](https://nodejs.org/), [npm](https://www.npmjs.com/), [bower](http://bower.io/) and [gulp](http://gulpjs.com/). For a install instruction for node and npm, please have a look [here](https://docs.npmjs.com/getting-started/installing-node).
8+
9+
#### Installing bower and gulp
10+
11+
```bash
12+
npm install -g bower
13+
npm install -g gulp
14+
```
15+
16+
#### Installing dependencies
17+
18+
```bash
19+
npm install
20+
bower install
21+
```
22+
23+
#### Build the adf-widget-redmine
24+
25+
```bash
26+
gulp
27+
```
28+
29+
The compiled and optimized files can be found in the dist directory.
30+
31+
#### Other build goals
32+
33+
Each goal can be used as parameter for the gulp command.
34+
35+
* *clean*: removes the dist folder
36+
* *lint*: checks css and javascript files for common errors
37+
* *serve*: starts an webserver to test the widget
38+
39+
## Usage
40+
41+
Include the script in your index.html and be sure it is loaded after [angular](https://angularjs.org/) and after the [angular-dashboard-framework](https://github.com/sdorra/angular-dashboard-framework).
42+
43+
```html
44+
<script type="text/javascript" src="path/to/redmine.min.js"></script>
45+
```
46+
47+
Define a dependency for the module:
48+
49+
```javascript
50+
angular.module('sample', ['adf', 'adf.widget.redmine']);
51+
```

Diff for: bower.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "adf-widget-redmine",
3+
"version": "0.1.0",
4+
"main": "dist/adf-widget-redmine.js",
5+
"ignore": [
6+
"bower.json",
7+
".bowerrc",
8+
".jshintrc",
9+
".gitignore",
10+
"gulpfile.js",
11+
"node_modules",
12+
"package.json",
13+
"components",
14+
"src"
15+
],
16+
"keywords": [
17+
"dashboard",
18+
"widget",
19+
"adf",
20+
"adf-widget"
21+
],
22+
"description": "description",
23+
"dependencies": {
24+
"angular-dashboard-framework": ">=0.10",
25+
"angular-smart-table": "~2.1.8"
26+
},
27+
"devDependencies": {
28+
"angular-local-storage": ">=0.2"
29+
},
30+
"overrides": {
31+
"bootstrap" : {
32+
"main": [
33+
"less/bootstrap.less",
34+
"dist/css/bootstrap.css",
35+
"dist/js/bootstrap.js"
36+
]
37+
}
38+
}
39+
}

Diff for: dist/adf-widget-redmine.js

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
(function(window, undefined) {'use strict';
2+
3+
4+
angular.module('adf.widget.redmine', ['adf.provider', 'smart-table'])
5+
.constant("redmineEndpoint", "http://www.redmine.org/")
6+
.config(["dashboardProvider", function(dashboardProvider){
7+
dashboardProvider
8+
.widget('redmineIssues', {
9+
title: 'Redmine Issues',
10+
description: 'Show Issues of an given Redmine Instance.',
11+
templateUrl: '{widgetsPath}/redmine/src/issues/view.html',
12+
controller: 'IssueController',
13+
controllerAs: 'vm',
14+
resolve: {
15+
/** @ngInject **/
16+
issues: ["redmineService", function(redmineService){
17+
return redmineService.getIssues();
18+
}]
19+
},
20+
edit: {
21+
templateUrl: '{widgetsPath}/redmine/src/issues/edit/edit.html'
22+
}
23+
});
24+
}]);
25+
26+
angular.module("adf.widget.redmine").run(["$templateCache", function($templateCache) {$templateCache.put("{widgetsPath}/redmine/src/issues/view.html","<table st-table=rowCollection class=\"table table-striped\"><thead><tr><th>ID</th><th>Tracker</th><th>Status</th><th>Thema</th></tr></thead><tbody><tr ng-repeat=\"issue in vm.issues\"><td><a href=\'{{\"http://www.redmine.org/issues/\"+issue.id}}\'>{{issue.id}}</a></td><td>{{issue.tracker.name}}</td><td>{{issue.status.name}}</td><td>{{issue.subject}}</td></tr></tbody></table>");
27+
$templateCache.put("{widgetsPath}/redmine/src/issues/edit/edit.html","<form role=form><div class=form-group><label for=sample>Sample</label> <input type=text class=form-control id=sample ng-model=config.sample placeholder=\"Enter sample\"></div></form>");}]);
28+
29+
30+
angular.module('adf.widget.redmine')
31+
.controller('IssueController', ["issues", "config", function(issues, config){
32+
var vm = this;
33+
34+
vm.issues = issues.issues;
35+
}]);
36+
37+
38+
39+
angular.module('adf.widget.redmine')
40+
.factory('redmineService', ["$http", "redmineEndpoint", function($http, redmineEndpoint){
41+
42+
function data(response){
43+
return response.data;
44+
}
45+
46+
function request(param){
47+
return $http.get(redmineEndpoint+param).then(data);
48+
}
49+
50+
function getIssues(){
51+
return request('issues.json?limit=2');
52+
}
53+
return {
54+
getIssues: getIssues
55+
};
56+
}]);
57+
})(window);

Diff for: dist/adf-widget-redmine.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: gulpfile.js

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
var gulp = require('gulp');
2+
var connect = require('gulp-connect');
3+
var wiredep = require('wiredep').stream;
4+
var $ = require('gulp-load-plugins')();
5+
var del = require('del');
6+
var jsReporter = require('jshint-stylish');
7+
var annotateAdfPlugin = require('ng-annotate-adf-plugin');
8+
var pkg = require('./package.json');
9+
10+
var annotateOptions = {
11+
plugin: [
12+
annotateAdfPlugin
13+
]
14+
};
15+
16+
var templateOptions = {
17+
root: '{widgetsPath}/redmine/src',
18+
module: 'adf.widget.redmine'
19+
};
20+
21+
/** lint **/
22+
23+
gulp.task('csslint', function(){
24+
gulp.src('src/**/*.css')
25+
.pipe($.csslint())
26+
.pipe($.csslint.reporter());
27+
});
28+
29+
gulp.task('jslint', function(){
30+
gulp.src('src/**/*.js')
31+
.pipe($.jshint())
32+
.pipe($.jshint.reporter(jsReporter));
33+
});
34+
35+
gulp.task('lint', ['csslint', 'jslint']);
36+
37+
/** serve **/
38+
39+
gulp.task('templates', function(){
40+
return gulp.src('src/**/*.html')
41+
.pipe($.angularTemplatecache('templates.tpl.js', templateOptions))
42+
.pipe(gulp.dest('.tmp/dist'));
43+
});
44+
45+
gulp.task('sample', ['templates'], function(){
46+
var files = gulp.src(['src/**/*.js', 'src/**/*.css', 'src/**/*.less', '.tmp/dist/*.js'])
47+
.pipe($.if('*.js', $.angularFilesort()));
48+
49+
gulp.src('sample/index.html')
50+
.pipe(wiredep({
51+
directory: './components/',
52+
bowerJson: require('./bower.json'),
53+
devDependencies: true,
54+
dependencies: true
55+
}))
56+
.pipe($.inject(files))
57+
.pipe(gulp.dest('.tmp/dist'))
58+
.pipe(connect.reload());
59+
});
60+
61+
gulp.task('watch', function(){
62+
gulp.watch(['src/**'], ['sample']);
63+
});
64+
65+
gulp.task('serve', ['watch', 'sample'], function(){
66+
connect.server({
67+
root: ['.tmp/dist', '.'],
68+
livereload: true,
69+
port: 9002
70+
});
71+
});
72+
73+
/** build **/
74+
75+
gulp.task('css', function(){
76+
gulp.src(['src/**/*.css', 'src/**/*.less'])
77+
.pipe($.if('*.less', $.less()))
78+
.pipe($.concat(pkg.name + '.css'))
79+
.pipe(gulp.dest('dist'))
80+
.pipe($.rename(pkg.name + '.min.css'))
81+
.pipe($.minifyCss())
82+
.pipe(gulp.dest('dist'));
83+
});
84+
85+
gulp.task('js', function() {
86+
gulp.src(['src/**/*.js', 'src/**/*.html'])
87+
.pipe($.if('*.html', $.minifyHtml()))
88+
.pipe($.if('*.html', $.angularTemplatecache(pkg.name + '.tpl.js', templateOptions)))
89+
.pipe($.angularFilesort())
90+
.pipe($.if('*.js', $.replace(/'use strict';/g, '')))
91+
.pipe($.concat(pkg.name + '.js'))
92+
.pipe($.headerfooter('(function(window, undefined) {\'use strict\';\n', '})(window);'))
93+
.pipe($.ngAnnotate(annotateOptions))
94+
.pipe(gulp.dest('dist'))
95+
.pipe($.rename(pkg.name + '.min.js'))
96+
.pipe($.uglify())
97+
.pipe(gulp.dest('dist'));
98+
});
99+
100+
/** clean **/
101+
102+
gulp.task('clean', function(cb){
103+
del(['dist', '.tmp'], cb);
104+
});
105+
106+
gulp.task('default', ['css', 'js']);

Diff for: package.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "adf-widget-redmine",
3+
"version": "0.1.0",
4+
"keywords": [
5+
"dashboard",
6+
"widget",
7+
"adf",
8+
"adf-widget"
9+
],
10+
"description": "description",
11+
"dependencies": {},
12+
"devDependencies": {
13+
"gulp": "^3.8.11",
14+
"gulp-angular-filesort": "^1.1.1",
15+
"gulp-angular-templatecache": "^1.6.0",
16+
"gulp-concat": "^2.5.2",
17+
"gulp-connect": "~2.2.0",
18+
"gulp-csslint": "^0.1.5",
19+
"gulp-headerfooter": "^1.0.3",
20+
"gulp-if": "^1.2.5",
21+
"gulp-inject": "^1.2.0",
22+
"gulp-jshint": "^1.9.4",
23+
"gulp-less": "^3.0.2",
24+
"gulp-load-plugins": "^0.9.0",
25+
"gulp-minify-css": "^1.0.0",
26+
"gulp-minify-html": "^1.0.1",
27+
"gulp-ng-annotate": "^0.5.2",
28+
"gulp-rename": "^1.2.0",
29+
"gulp-replace": "^0.5.3",
30+
"ng-annotate-adf-plugin": "^0.1.2",
31+
"gulp-uglify": "^1.1.0",
32+
"jshint-stylish": "^1.0.1",
33+
"wiredep": "~2.2.2",
34+
"del": "^1.1.1"
35+
}
36+
}

0 commit comments

Comments
 (0)