diff --git a/app/templates/gulpfile.js b/app/templates/gulpfile.js index 8e790bea..0f4fd33b 100644 --- a/app/templates/gulpfile.js +++ b/app/templates/gulpfile.js @@ -24,7 +24,7 @@ var options = { }; gulp.task('jshint', function() { - gulp.src('ui/app/**/*.js') + gulp.src(['ui/app/**/*.js', '!ui/app/bower_components/**/*.js', '!ui/app/scripts/vendor/**/*.js']) .pipe(jshint()) .pipe(jshint.reporter('default')); }); @@ -38,7 +38,7 @@ gulp.task('less', function() { // Concatenate & Minify JS gulp.task('scripts', function() { - return gulp.src('./ui/app/**/*.js') + return gulp.src(['./ui/app/**/*.js', '!ui/app/bower_components/**/*.js', '!ui/app/scripts/vendor/**/*.js']) .pipe(concat('all.js')) .pipe(gulp.dest('dist')) .pipe(rename('all.min.js')) @@ -77,7 +77,7 @@ gulp.task('server', function() { var app = connect() .use(connect.static('ui/app')) .use('/v1', proxy(url.parse('http://' + options.mlHost + ':' + options.mlPort + '/v1'))); - http.createServer(app).listen(options.appPort, 'localhost'); + http.createServer(app).listen(options.appPort); }); // Default Task diff --git a/app/templates/ui/app/common/services/mlrest.js b/app/templates/ui/app/common/services/mlrest.js index ef2e8651..16adc995 100644 --- a/app/templates/ui/app/common/services/mlrest.js +++ b/app/templates/ui/app/common/services/mlrest.js @@ -147,15 +147,19 @@ createSearchContext: function(options) { return new SearchContext(options, $q, $http); }, - getDocument: function(uri) { + getDocument: function(uri, options) { var d = $q.defer(); + if (options === undefined || options === null) { + options = {}; + } + angular.extend(options, { + format: 'json', + uri: uri + }); $http.get( '/v1/documents', { - params: { - format: 'json', - uri: uri - } + params: options }) .success( function(data) { diff --git a/app/templates/ui/app/detail/detail-ctrl.js b/app/templates/ui/app/detail/detail-ctrl.js index 3ab73c78..dd8fe157 100644 --- a/app/templates/ui/app/detail/detail-ctrl.js +++ b/app/templates/ui/app/detail/detail-ctrl.js @@ -9,8 +9,9 @@ detail: {} }; - mlRest.getDocument(uri, { format: 'json' }).then(function(data) { + mlRest.getDocument(uri, { transform: 'detail' }).then(function(data) { model.detail = data; + var z=0; }); angular.extend($scope, { diff --git a/app/templates/ui/app/detail/detail.html b/app/templates/ui/app/detail/detail.html index 29282372..abb2336a 100644 --- a/app/templates/ui/app/detail/detail.html +++ b/app/templates/ui/app/detail/detail.html @@ -1,86 +1,4 @@ -
-

{{model.demo.name}}

- -
- - {{model.demo.host}} - () -
-
- - - / - -
-
- -
    -
  • {{browser}}
  • -
-
- -
- - -
-
- - - ({{model.demo.email}}) -
-
- - -
-
- - -
-
- - -
-
- - -
-
- Cancel - -
-
-
-
{{bug.msg}}
-
    -
  • Status:
  • -
  • Created by {{bug.username}} on {{bug.dateTime}}
  • -
  • Browser: {{bug.browser}}
  • -
-
-
-
- - Expand - Collapse -
-
{{bug.msg}}
-
    -
  • Status:
  • -
  • Created by {{bug.username}} on {{bug.dateTime}}
  • -
  • Browser: {{bug.browser}}
  • -
-
-
-
-

Comments

- -
-

Comment by {{comment.username}}

-

on {{comment.dateTime}}

- {{comment.msg}} -
-
-
+ + +
+ diff --git a/app/templates/ui/app/index.html b/app/templates/ui/app/index.html index ccb11fb0..28722e6e 100644 --- a/app/templates/ui/app/index.html +++ b/app/templates/ui/app/index.html @@ -60,6 +60,7 @@ + diff --git a/app/templates/ui/app/scripts/app.js b/app/templates/ui/app/scripts/app.js index d7483c3e..5c3449b8 100644 --- a/app/templates/ui/app/scripts/app.js +++ b/app/templates/ui/app/scripts/app.js @@ -1,5 +1,5 @@ -angular.module('sample', ['ngRoute', 'ngCkeditor', 'sample.search', 'sample.common',, 'sample.detail', 'ui.bootstrap']) +angular.module('sample', ['ngRoute', 'ngCkeditor', 'sample.search', 'sample.common', 'sample.detail', 'ui.bootstrap', 'compile']) .config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { 'use strict'; diff --git a/app/templates/ui/app/scripts/directives/compile.js b/app/templates/ui/app/scripts/directives/compile.js new file mode 100644 index 00000000..3ca20974 --- /dev/null +++ b/app/templates/ui/app/scripts/directives/compile.js @@ -0,0 +1,28 @@ +// Copied from https://docs.angularjs.org/api/ng/service/$compile +angular.module('compile', [], function($compileProvider) { + 'use strict'; + // configure new 'compile' directive by passing a directive + // factory function. The factory function injects the '$compile' + $compileProvider.directive('compile', function($compile) { + // directive factory creates a link function + return function(scope, element, attrs) { + scope.$watch( + function(scope) { + // watch the 'compile' expression for changes + return scope.$eval(attrs.compile); + }, + function(value) { + // when the 'compile' expression changes + // assign it into the current DOM + element.html(value); + + // compile the new DOM and link it to the current + // scope. + // NOTE: we only compile .childNodes so that + // we don't get into infinite loop compiling ourselves + $compile(element.contents())(scope); + } + ); + }; + }); +}); diff --git a/rest-api/transforms/detail.xslt b/rest-api/transforms/detail.xslt new file mode 100644 index 00000000..4e68e69b --- /dev/null +++ b/rest-api/transforms/detail.xslt @@ -0,0 +1,66 @@ + + + + + + + + + + +
+ + Return to + + + +

+ +
+ +
+
+ +
+
+
+ + + + + + +
+ +
+
+ + +
  • + + +
  • +
    + + +