Skip to content

Commit

Permalink
Allow Ransack advanced search & saved lists to be enabled, disabled b…
Browse files Browse the repository at this point in the history
…y default as an 'alpha feature'
  • Loading branch information
ndbroadbent committed Feb 22, 2012
1 parent 6068b4e commit d6cd94d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/views/accounts/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

.title_tools
= link_to_inline(:create_account, new_account_path, :text => t(:create_account)) << " | "
= link_to_inline(:advanced_search, advanced_search_accounts_path, :text => t(:advanced_search)) << " | "
- if Setting.advanced_search_enabled
= link_to_inline(:advanced_search, advanced_search_accounts_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_accounts_path, :text=> t(:options))

.title
Expand Down
3 changes: 2 additions & 1 deletion app/views/campaigns/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

.title_tools
= link_to_inline(:create_campaign, new_campaign_path, :text => t(:create_campaign)) << " | "
= link_to_inline(:advanced_search, advanced_search_campaigns_path, :text => t(:advanced_search)) << " | "
- if Setting.advanced_search_enabled
= link_to_inline(:advanced_search, advanced_search_campaigns_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_campaigns_path, :text => t(:options))

.title
Expand Down
3 changes: 2 additions & 1 deletion app/views/contacts/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

.title_tools
= link_to_inline(:create_contact, new_contact_path, :text=> t(:create_contact)) << " | "
= link_to_inline(:advanced_search, advanced_search_contacts_path, :text => t(:advanced_search)) << " | "
- if Setting.advanced_search_enabled
= link_to_inline(:advanced_search, advanced_search_contacts_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_contacts_path, :text=> t(:options))

.title
Expand Down
5 changes: 4 additions & 1 deletion app/views/layouts/_sidebar.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
- begin
= render sidebar
- rescue MissingTemplate
= render "shared/lists"

- if Setting.advanced_search_enabled
= render "shared/lists"

= render "shared/recently"
3 changes: 2 additions & 1 deletion app/views/leads/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

.title_tools
= link_to_inline(:create_lead, new_lead_path, :text => t(:create_lead)) << " | "
= link_to_inline(:advanced_search, advanced_search_leads_path, :text => t(:advanced_search)) << " | "
- if Setting.advanced_search_enabled
= link_to_inline(:advanced_search, advanced_search_leads_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_leads_path, :text => t(:options))

.title
Expand Down
3 changes: 2 additions & 1 deletion app/views/opportunities/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

.title_tools
= link_to_inline(:create_opportunity, new_opportunity_path, :text => t(:create_opportunity)) << " | "
= link_to_inline(:advanced_search, advanced_search_opportunities_path, :text => t(:advanced_search)) << " | "
- if Setting.advanced_search_enabled
= link_to_inline(:advanced_search, advanced_search_opportunities_path, :text => t(:advanced_search)) << " | "
= link_to_inline(:options, options_opportunities_path, :text => t(:options))

.title
Expand Down
6 changes: 6 additions & 0 deletions config/settings.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,9 @@ task_completed:
- :completed_this_month
- :completed_last_month


# Alpha features
#------------------------------------------------------------------------------
# Enable the advanced search feature provided by Ransack
# (Feature works, but UI design is still in progress)
advanced_search_enabled: false

0 comments on commit d6cd94d

Please sign in to comment.