Skip to content

Commit

Permalink
added folder breadcrumbs and source/cancel/save icons #383
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Jul 8, 2013
1 parent 8a47c2c commit 4e4849d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
38 changes: 35 additions & 3 deletions hawtio-web/src/main/webapp/app/wiki/html/dozerMappings.html
@@ -1,19 +1,51 @@
<div ng-controller="Wiki.DozerMappingsController">
<h3>Mappings</h3>
<div class="row-fluid" ng-controller="Wiki.NavBarController">
<div class="">
<ul class="nav nav-tabs connected">
<li ng-repeat="link in breadcrumbs" ng-class='{active : isActive(link.href)}'>
<a ng-href="{{link.href}}{{hash}}">{{link.name}}</a>
</li>

<!--
<li class="pull-right">
<a ng-href="{{editLink()}}{{hash}}" ng-hide="!editLink()" title="Edit this camel configuration"
data-placement="bottom">
<i class="icon-edit"></i> Edit</a></li>
<li class="pull-right" ng-show="sourceLink()">
-->
<li class="pull-right">
<a href="" id="saveButton" ng-disabled="!isValid()" ng-click="save()"
title="Saves the Mappings document">
<i class="icon-save"></i> Save</a>
</li>
<li class="pull-right">
<a href="" id="cancelButton" ng-click="cancel()"
title="Discards any updates">
<i class="icon-remove"></i> Cancel</a>
</li>

<li class="pull-right">
<a ng-href="{{sourceLink()}}" title="View source code"
data-placement="bottom">
<i class="icon-file-alt"></i> Source</a>
</li>
</ul>
</div>
</div>

<!--
<div class="gridStyle" hawtio-datatable="gridOptions"></div>
<div class="gridStyle" ng-grid="gridOptions"></div>
-->

<div class="row-fluid">
<div id="tree-container" class="span3">
<div id="tree-container" class="span4">
<div hawtio-tree="mappingTree" onselect="onNodeSelect" onDragEnter="onNodeDragEnter" onDrop="onNodeDrop"
onRoot="onRootTreeNode"
hideRoot="true"></div>
</div>

<div class="span9">
<div class="span8">
<div ng-include="propertiesTemplate"></div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/dozerMappings.ts
Expand Up @@ -84,6 +84,7 @@ module Wiki {
};

$scope.save = () => {
console.log("Saving the dozer mapping file!");
// generate the new XML
/*
if ($scope.rootFolder) {
Expand Down
2 changes: 2 additions & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/helpers.ts
Expand Up @@ -6,6 +6,8 @@ module Wiki {
export var droolsNamespaces = ["http://drools.org/schema/drools-spring"];
export var dozerNamespaces = ["http://dozer.sourceforge.net"];

export var customViewLinks = ["/wiki/formTable", "/wiki/camel/diagram", "/wiki/camel/properties", "/wiki/dozer/mappings"];

export function startLink(branch:string) {
var start = "#/wiki";
if (branch) {
Expand Down
5 changes: 2 additions & 3 deletions hawtio-web/src/main/webapp/app/wiki/js/navbar.ts
@@ -1,7 +1,6 @@
module Wiki {
export function NavBarController($scope, $location, $routeParams, workspace:Workspace, wikiRepository:GitWikiRepository) {

var customViewLinks = ["/wiki/formTable", "/wiki/camel/diagram", "/wiki/camel/properties"];

$scope.createLink = () => {
var pageId = Wiki.pageId($routeParams, $location);
Expand All @@ -11,7 +10,7 @@ module Wiki {
$scope.sourceLink = () => {
var path = $location.path();
var answer = null;
angular.forEach(customViewLinks, (link) => {
angular.forEach(Wiki.customViewLinks, (link) => {
if (path.startsWith(link)) {
answer = Core.createHref($location, Wiki.startLink($scope.branch) + "/view" + path.substring(link.length))
}
Expand Down Expand Up @@ -69,7 +68,7 @@ module Wiki {
var loc = $location.path();
if ($scope.breadcrumbs.length) {
var swizzled = false;
angular.forEach(customViewLinks, (link) => {
angular.forEach(Wiki.customViewLinks, (link) => {
if (!swizzled && loc.startsWith(link)) {
// lets swizzle the view to the current link
switchFromViewToCustomLink($scope.breadcrumbs.last(), Core.trimLeading(link, "/"));
Expand Down

0 comments on commit 4e4849d

Please sign in to comment.