},
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 */
.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)
<span class='glyphicon glyphicon-star'/> Grades
</a>
</li>
+
+ <!-- license -->
+ <li role='presentation' ui-sref-active='active' ng-if='
+ vm.mentity.class_name == "MPackage"'>
+ <a ui-sref='.license'>
+ <span class='glyphicon glyphicon-copyright-mark'/> License
+ </a>
+ </li>
+
+ <!-- contrib -->
+ <li role='presentation' ui-sref-active='active' ng-if='
+ vm.mentity.class_name == "MPackage"'>
+ <a ui-sref='.contrib'>
+ <span class='glyphicon glyphicon-gift'/> Contributing
+ </a>
+ </li>
</ul>
<br>
<ui-view />