From: Alexandre Terrasa Date: Wed, 2 May 2018 23:41:26 +0000 (-0400) Subject: nitweb: add HTML view for ini commands X-Git-Url: http://nitlanguage.org nitweb: add HTML view for ini commands Signed-off-by: Alexandre Terrasa --- diff --git a/share/nitweb/javascripts/entities.js b/share/nitweb/javascripts/entities.js index 2ca4e04..4b08707 100644 --- a/share/nitweb/javascripts/entities.js +++ b/share/nitweb/javascripts/entities.js @@ -280,6 +280,44 @@ }, controllerAs: 'vm', }) + .state('doc.entity.license', { + url: '/license', + templateUrl: 'views/doc/license.html', + resolve: { + content: function(Model, $q, $stateParams, $state) { + var d = $q.defer(); + Model.loadEntityLicenseContent($stateParams.id, d.resolve, + function() { + $state.go('404', null, { location: false }) + }); + return d.promise; + } + }, + controller: function(mentity, content) { + this.mentity = mentity; + this.content = content; + }, + controllerAs: 'vm', + }) + .state('doc.entity.contrib', { + url: '/contrib', + templateUrl: 'views/doc/contrib.html', + resolve: { + content: function(Model, $q, $stateParams, $state) { + var d = $q.defer(); + Model.loadEntityContribContent($stateParams.id, d.resolve, + function() { + $state.go('404', null, { location: false }) + }); + return d.promise; + } + }, + controller: function(mentity, content) { + this.mentity = mentity; + this.content = content; + }, + controllerAs: 'vm', + }) }) /* Model */ @@ -371,6 +409,24 @@ .error(cbErr); }, + loadEntityLicenseContent: function(id, cb, cbErr) { + $http.get('/api/ini/license-content/' + id) + .success(cb) + .error(cbErr); + }, + + loadEntityContribContent: function(id, cb, cbErr) { + $http.get('/api/ini/contrib-content/' + id) + .success(cb) + .error(cbErr); + }, + + loadEntityGraph: function(id, cb, cbErr) { + $http.get('/api/graph/inheritance/' + id + '?format=svg&cdepth=3') + .success(cb) + .error(cbErr); + }, + search: function(q, p, n, cb, cbErr) { $http.get('/api/search?q=' + q + '&p=' + p + '&l=' + n) .success(cb) diff --git a/share/nitweb/views/doc/contrib.html b/share/nitweb/views/doc/contrib.html new file mode 100644 index 0000000..05f0477 --- /dev/null +++ b/share/nitweb/views/doc/contrib.html @@ -0,0 +1,7 @@ +
+
+ +

Contributing rules from file {{vm.content.file}}

+
+	
+
diff --git a/share/nitweb/views/doc/entity.html b/share/nitweb/views/doc/entity.html index e6b559f..9480512 100644 --- a/share/nitweb/views/doc/entity.html +++ b/share/nitweb/views/doc/entity.html @@ -87,6 +87,22 @@ Grades + + +
  • + + License + +
  • + + +
  • + + Contributing + +

  • diff --git a/share/nitweb/views/doc/license.html b/share/nitweb/views/doc/license.html new file mode 100644 index 0000000..8644b88 --- /dev/null +++ b/share/nitweb/views/doc/license.html @@ -0,0 +1,7 @@ +
    +
    + +

    License from file {{vm.content.file}}

    +
    +	
    +