Skip to content

Commit

Permalink
Support adding arbitrary files in the wiki into a dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Sep 30, 2013
1 parent 2058552 commit dcf0310
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hawtio-web/src/main/webapp/app/wiki/html/viewPage.html
@@ -1,5 +1,5 @@
<div ng-controller="Wiki.ViewController">
<div class="logbar" ng-controller="Wiki.NavBarController">
<div ng-hide="inDashboard" class="logbar" ng-controller="Wiki.NavBarController">
<div class="wiki logbar-container">
<ul class="nav nav-tabs">
<li ng-show="branches.length || branch" class="dropdown">
Expand Down Expand Up @@ -76,6 +76,11 @@
<i class="icon-plus"></i> Create</a>
-->
</li>
<li class="pull-right">
<a ng-hide="children || profile" title="Add to dashboard" ng-href="{{createDashboardLink()}}" data-placement="bottom">
<i class="icon-share"></i>
</a>
</li>
</ul>
</div>
</div>
Expand Down
15 changes: 15 additions & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/view.ts
Expand Up @@ -60,6 +60,21 @@ module Wiki {
});
}

$scope.createDashboardLink = () => {
var href = '/wiki/branch/:branch/view/*page';
var title = $routeParams['page'].split("/").last();
var size = angular.toJson({
size_x: 2,
size_y: 2
});

return "#/dashboard/add?tab=dashboard" +
"&href=" + encodeURIComponent(href) +
"&size=" + encodeURIComponent(size) +
"&title=" + encodeURIComponent(title) +
"&routeParams=" + encodeURIComponent(angular.toJson($routeParams));
};

$scope.childLink = (child) => {
var start = startLink($scope.branch);
var prefix = start + "/view";
Expand Down
4 changes: 4 additions & 0 deletions hawtio-web/src/main/webapp/css/site-base.css
Expand Up @@ -1974,3 +1974,7 @@ a.dashboard-link:hover {
.container-profile-settings span.folder-title {
font-weight: bold;
}

.widget-body div div .wiki-fixed {
margin: 3px;
}

0 comments on commit dcf0310

Please sign in to comment.