Skip to content

Commit

Permalink
hide the .profile extension and use a nicer icon for profiles #518
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Sep 12, 2013
1 parent c6bbdf7 commit 28bcafb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
11 changes: 10 additions & 1 deletion hawtio-web/src/main/webapp/app/wiki/js/helpers.ts
Expand Up @@ -7,6 +7,11 @@ module Wiki {

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

/**
* Which extensions do we wish to hide in the wiki file listing
*/
export var hideExtentions = [".profile"];

/**
* The wizard tree for creating new content in the wiki
*/
Expand Down Expand Up @@ -234,7 +239,11 @@ module Wiki {

if (!icon) {
if (directory) {
css = "icon-folder-close";
if ("profile" === extension) {
css = "icon-book";
} else {
css = "icon-folder-close";
}
} else if ("xml" === extension) {
css = "icon-cog";
} else {
Expand Down
12 changes: 11 additions & 1 deletion hawtio-web/src/main/webapp/app/wiki/js/view.ts
Expand Up @@ -43,7 +43,7 @@ module Wiki {
{
field: 'name',
displayName: 'Name',
cellTemplate: '<div class="ngCellText"><a href="{{childLink(row.entity)}}"><span class="file-icon" ng-bind-html-unsafe="fileIconHtml(row)"></span> {{row.getProperty(col.field)}}</a></div>',
cellTemplate: '<div class="ngCellText"><a href="{{childLink(row.entity)}}"><span class="file-icon" ng-bind-html-unsafe="fileIconHtml(row)"></span> {{fileName(row.entity)}}</a></div>',
cellFilter: ""
}
]
Expand Down Expand Up @@ -96,6 +96,16 @@ module Wiki {
return Core.createHref($location, prefix + path + postFix, ["form"]);
};

$scope.fileName = (entity) => {
var name = entity.name;
angular.forEach(Wiki.hideExtentions, (extension) => {
if (name.endsWith(extension)) {
name = name.substring(0, name.length - extension.length);
}
});
return name;
};

$scope.fileIconHtml = (entity) => {
return Wiki.fileIconHtml(entity);
};
Expand Down

0 comments on commit 28bcafb

Please sign in to comment.