Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Support display_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanramage committed Nov 6, 2012
1 parent a25f148 commit 4855ae7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ exports.open_path = function (doc) {
};

exports.app_title = function (cfg) {
var title = cfg.name;
var title = cfg.display_name || cfg.name;
return title.substr(0, 1).toUpperCase() + title.substr(1);
};

Expand Down
8 changes: 6 additions & 2 deletions lib/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ exports.keyword_search = {
var by = meta.pushed_by;


var title = config.display_name || config.name;
title = title.substr(0, 1).toUpperCase() + title.substr(1);

_.each(keywords, function(token){
emit(token, {
_id : doc._id,
name : meta.name,
description: meta.description,
name : config.name,
display_name : title,
description: config.description,
keywords : keywords,
icon_96 : icon,
by : by
Expand Down
2 changes: 1 addition & 1 deletion templates/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<tr>
<td>
<a href="details/{{name}}"><img src="_db/{{_id}}/{{icon_96}}" width="96" style="float: left"/></a>
<a href="details/{{name}}" class="title">{{name}}</a>
<a href="details/{{name}}" class="title">{{display_name}}</a>
<div class="by">
by <a href="user/{{by}}">{{by}}</a>
</div>
Expand Down

0 comments on commit 4855ae7

Please sign in to comment.