Diff
Modified: trunk/app/controllers/search_controller.rb (3288 => 3289)
--- trunk/app/controllers/search_controller.rb 2013-01-07 08:57:37 UTC (rev 3288)
+++ trunk/app/controllers/search_controller.rb 2013-01-08 13:56:49 UTC (rev 3289)
@@ -29,7 +29,11 @@
end
if @type == "all"
- search_all
+ if shortcut = Conf.shortcut_keywords[params[:query].downcase]
+ redirect_to(shortcut)
+ else
+ search_all
+ end
else
case params[:type]
when 'workflows'
Modified: trunk/app/views/networks/show.rhtml (3288 => 3289)
--- trunk/app/views/networks/show.rhtml 2013-01-07 08:57:37 UTC (rev 3288)
+++ trunk/app/views/networks/show.rhtml 2013-01-08 13:56:49 UTC (rev 3289)
@@ -15,7 +15,7 @@
<% unless mine? @network %>
<% if @network.member? current_user.id %>
<% cur_membership = Membership.find(:first, :conditions => ["network_id = ? AND user_id = ?", @network.id, current_user.id] ) %>
- <% if cur_membership %>
+ <% if false %>
<li><%= icon('network-leave', user_membership_path(cur_membership.user_id, cur_membership), nil, { :confirm => "Are you sure want to leave this group?", :method => :delete }, 'Leave Group') %></li>
<% end %>
<% elsif !current_user.membership_pending?(@network.id) && address@hidden %>
Modified: trunk/config/default_settings.yml (3288 => 3289)
--- trunk/config/default_settings.yml 2013-01-07 08:57:37 UTC (rev 3288)
+++ trunk/config/default_settings.yml 2013-01-08 13:56:49 UTC (rev 3289)
@@ -161,10 +161,6 @@
link: /packs
controller: packs
- - label: Services
- link: /services
- controller: services
-
- label: Topics
link: /topics
controller: topics
@@ -676,3 +672,12 @@
num_options: ["10", "20", "25", "50", "100"]
+# Shortcut keywords
+# These are special keywords that, when typed into the search box (when 'All' is selected) will instantly jump to a
+# specified page instead of returning a list of search results.
+#
+# Example (when 'biovel' is searched for, it will jump to the group's page):
+#
+# shortcut_keywords:
+# biovel: /groups/643
+#
\ No newline at end of file
Modified: trunk/lib/conf.rb (3288 => 3289)
--- trunk/lib/conf.rb 2013-01-07 08:57:37 UTC (rev 3288)
+++ trunk/lib/conf.rb 2013-01-08 13:56:49 UTC (rev 3289)
@@ -254,6 +254,10 @@
self.model_alias_convert(self.model_aliases.invert, str)
end
+ def self.shortcut_keywords
+ self.fetch_entry('shortcut_keywords')
+ end
+
private
def self.model_alias_convert(map, str)