Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #92 from tubit/master
Browse files Browse the repository at this point in the history
Added prefix option to search
  • Loading branch information
falkenbt committed Mar 28, 2013
2 parents ac863b8 + eac3736 commit ccef6eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/gdash/sinatra_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def initialize(graphite_base, graph_templates, options = {})
result = mapper.select {|d| d[:name] == dashboard && (category == nil || d[:category] == category )}

if result.count == 1
redirect "#{result[0][:category]}/#{result[0][:link]}"
redirect "#{@prefix}/#{result[0][:category]}/#{result[0][:link]}"
elsif result.count == 0 then
@error = "No dashboards found in the templates directory, Search = <b>'#{search_string}'</b>"
@dashboard_to_display = mapper.group_by {|d| d[:category]}
Expand Down
2 changes: 1 addition & 1 deletion views/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</li>
</ul>
<div class="pull-right" style="" class='nav input-append'>
<form id="form-search" name="dashboards" style="margin: 0;" class="form-search" method="get" action="/search">
<form id="form-search" name="dashboards" style="margin: 0;" class="form-search" method="get" action="<%= @prefix %>/search">
<div class="input-append">
<input class="span2 search-query" name="dashboard" type="text" placeholder="Dashboard..." data-provide="typeahead" data-items="10" data-source='<%= @search_elements.to_s %>' autocomplete="off" />
<button class="btn btn-primary" style="margin-left: -5px; padding-bottom: 5px;" type="submit" value"submit" /><i class="icon-search icon-white"></i></button>
Expand Down

0 comments on commit ccef6eb

Please sign in to comment.