Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a directive re-using the wiki view controller for #495
- Loading branch information
Showing
10 changed files
with
285 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> |
1 change: 1 addition & 0 deletions
1
hawtio-web/src/main/webapp/app/wiki/exemplar/properties-file.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add properties here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
<div> | ||
<div class="file-list-toolbar"> | ||
<ul class="nav nav-tabs" ng-controller="Wiki.NavBarController"> | ||
<li class="caption"> | ||
{{$parent.caption}} | ||
</li> | ||
|
||
<li class="pull-right dropdown"> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | ||
Actions <span class="caret"></span> | ||
</a> | ||
<ul class="dropdown-menu"> | ||
<li ng-show="sourceLink()"> | ||
<a ng-href="{{sourceLink()}}" title="View source code" | ||
data-placement="bottom"> | ||
<i class="icon-file-alt"></i> Source</a> | ||
</li> | ||
<li> | ||
<a ng-href="{{historyLink}}{{hash}}" ng-hide="!historyLink" title="View the history of this file" | ||
data-placement="bottom"> | ||
<i class="icon-comments-alt"></i> History</a> | ||
</li> | ||
<li class="divider"> | ||
</li> | ||
<li> | ||
<a ng-click="openRenameDialog()" ng-disabled="gridOptions.selectedItems.length !== 1" | ||
title="Rename the selected document" | ||
data-placement="bottom"> | ||
<i class="icon-adjust"></i> Rename</a> | ||
</li> | ||
<li> | ||
<a ng-click="openMoveDialog()" ng-disabled="!gridOptions.selectedItems.length" | ||
title="move the selected documents to a new folder" | ||
data-placement="bottom"> | ||
<i class="icon-move"></i> Move</a> | ||
</li> | ||
<li class="divider"> | ||
</li> | ||
<li> | ||
<a ng-click="openDeleteDialog()" ng-disabled="!gridOptions.selectedItems.length" | ||
title="Delete the selected document(s)" | ||
data-placement="bottom"> | ||
<i class="icon-remove"></i> Delete</a> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="pull-right"> | ||
<a ng-href="{{editLink()}}{{hash}}" ng-hide="!editLink()" title="Edit this page" | ||
data-placement="bottom"> | ||
<i class="icon-edit"></i> Edit</a> | ||
</li> | ||
<li class="pull-right"> | ||
<a title="Create new page" ng-click="openAddDialog()" | ||
data-placement="bottom"> | ||
<i class="icon-plus"></i> Create</a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div> | ||
<div ng-hide="!children"> | ||
<div class="wikiGridStyle" ng-grid="gridOptions"></div> | ||
</div> | ||
|
||
<!-- | ||
<div ng-hide="!html"> | ||
<div ng-bind-html-unsafe="html"></div> | ||
</div> | ||
--> | ||
<!-- | ||
<div ng-include="sourceView" class="editor-autoresize"></div> | ||
--> | ||
</div> | ||
|
||
<div class="modal-large"> | ||
<div modal="addDialog.show" close="addDialog.close()" ng-options="addDialog.options"> | ||
<div class="modal-header"><h4>Create Document</h4></div> | ||
<div class="modal-body"> | ||
<div class="control-group"> | ||
<div hawtio-tree="createDocumentTree" hideRoot="true" onSelect="onCreateDocumentSelect" | ||
activateNodes="createDocumentTreeActivations"></div> | ||
</div> | ||
|
||
<div class="control-group"> | ||
<div class="well"> | ||
{{selectedCreateDocumentTemplate.tooltip}} | ||
</div> | ||
</div> | ||
|
||
<form class="form-inline" ng-submit="addAndCloseDialog()"> | ||
<label class="control-label" for="fileName">Name: </label> | ||
|
||
<input id="fileName" type="text" ng-model="newDocumentName" | ||
placeholder="{{selectedCreateDocumentTemplate.exemplar}}"/> | ||
</form> | ||
|
||
<div class="control-group"> | ||
<div ng-show="fileExists.exists" class="alert"> | ||
Please choose a different name as <b>{{fileExists.name}}</b> already exists | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<input id="submit" class="btn btn-primary add" type="submit" ng-click="addAndCloseDialog()" | ||
ng-disabled="!selectedCreateDocumentTemplate.exemplar || fileExists.exists" | ||
value="Create"> | ||
<button class="btn btn-warning cancel" type="button" ng-click="addDialog.close()">Cancel</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div hawtio-confirm-dialog="deleteDialog" | ||
ok-button-text="Delete" | ||
on-ok="deleteAndCloseDialog()"> | ||
<div class="dialog-body"> | ||
<p>You are about to delete | ||
<ng-pluralize count="gridOptions.selectedItems.length" | ||
when="{'1': 'this document!', 'other': 'these {} documents!'}"> | ||
</ng-pluralize> | ||
</p> | ||
<div ng-bind-html-unsafe="selectedFileHtml"></div> | ||
</div> | ||
</div> | ||
|
||
<div modal="moveDialog.show" close="moveDialog.close()" ng-options="moveDialog.options"> | ||
<form class="form-horizontal" ng-submit="moveAndCloseDialog()"> | ||
<div class="modal-header"><h4>Move Document</h4></div> | ||
<div class="modal-body"> | ||
<div class="control-group"> | ||
<label class="control-label" for="moveFolder">Folder</label> | ||
|
||
<div class="controls"> | ||
<input type="text" id="moveFolder" ng-model="moveFolder" | ||
typeahead="title for title in folderNames($viewValue) | filter:$viewValue" typeahead-editable='true'> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<input class="btn btn-primary" type="submit" | ||
ng-disabled="!moveFolder" | ||
value="Move"> | ||
<button class="btn btn-warning cancel" type="button" ng-click="moveDialog.close()">Cancel</button> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<div modal="renameDialog.show" close="renameDialog.close()" ng-options="renameDialog.options"> | ||
<form class="form-horizontal" ng-submit="renameAndCloseDialog()"> | ||
<div class="modal-header"><h4>Rename Document</h4></div> | ||
<div class="modal-body"> | ||
<div class="control-group"> | ||
<label class="control-label" for="renameFileName">Name</label> | ||
|
||
<div class="controls"> | ||
<input type="text" id="renameFileName" ng-model="fileName"> | ||
</div> | ||
</div> | ||
|
||
<div class="control-group"> | ||
<div ng-show="fileExists.exists" class="alert"> | ||
Please choose a different name as <b>{{fileExists.name}}</b> already exists | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<input class="btn btn-primary" type="submit" | ||
ng-disabled="!fileName || fileExists.exists" | ||
value="Rename"> | ||
<button class="btn btn-warning cancel" type="button" ng-click="renameDialog.close()">Cancel</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> |
45 changes: 45 additions & 0 deletions
45
hawtio-web/src/main/webapp/app/wiki/js/fileListDirective.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
module Wiki { | ||
|
||
export class FileList { | ||
public restrict = 'A'; | ||
public replace = true; | ||
public templateUrl = Wiki.templatePath + 'filelist.html'; | ||
|
||
public scope = { | ||
branch: '@', | ||
pageId: '@', | ||
caption: '@' | ||
}; | ||
|
||
public controller = ($scope, $location, $routeParams, $http, $timeout, workspace:Workspace, marked, fileExtensionTypeRegistry, wikiRepository:GitWikiRepository, $compile) => { | ||
|
||
$scope.nameOnly = true; | ||
|
||
Wiki.ViewController($scope, $location, $routeParams, $http, $timeout, workspace, marked, fileExtensionTypeRegistry, wikiRepository, $compile); | ||
|
||
}; | ||
|
||
public link = ($scope, $element, $attrs) => { | ||
|
||
$scope.$watch('branch', (oldValue, newValue) => { | ||
setTimeout(() => { | ||
$scope.updateView(); | ||
Core.$apply($scope); | ||
}, 50); | ||
}); | ||
|
||
$scope.$watch('pageId', (oldValue, newValue) => { | ||
setTimeout(() => { | ||
$scope.updateView(); | ||
Core.$apply($scope); | ||
}, 50); | ||
}); | ||
|
||
$scope.branch = $attrs['branch']; | ||
$scope.pageId = $attrs['pageId']; | ||
$scope.caption = $attrs['caption']; | ||
}; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.