diff --git a/lib/split/dashboard/public/dashboard-filtering.js b/lib/split/dashboard/public/dashboard-filtering.js new file mode 100644 index 00000000..98436824 --- /dev/null +++ b/lib/split/dashboard/public/dashboard-filtering.js @@ -0,0 +1,19 @@ +$(function() { + $('#filter').on('keyup', function() { + $input = $(this); + + if ($input.val() == '') { + $('div.experiment').show(); + return false; + } + + $('div.experiment').hide(); + selector = 'div.experiment[data-name*="' + $input.val() + '"]'; + $(selector).show(); + }); + + $('#clear-filter').on('click', function() { + $('#filter').val(''); + $('div.experiment').show(); + }); +}); diff --git a/lib/split/dashboard/public/style.css b/lib/split/dashboard/public/style.css index 1222e89b..088570c8 100644 --- a/lib/split/dashboard/public/style.css +++ b/lib/split/dashboard/public/style.css @@ -312,4 +312,8 @@ a.button.green:focus, button.green:focus, input[type="submit"].green:focus { background:#768E7A; } +#filter, #clear-filter { + padding: 10px; +} + diff --git a/lib/split/dashboard/views/_experiment.erb b/lib/split/dashboard/views/_experiment.erb index d7e42873..8646cb1c 100644 --- a/lib/split/dashboard/views/_experiment.erb +++ b/lib/split/dashboard/views/_experiment.erb @@ -6,7 +6,7 @@ <% experiment.calc_winning_alternatives %> -
The list below contains all the registered experiments along with the number of test participants, completed and conversion rate currently in the system.
+ + + <% @experiments.each do |experiment| %> <% if experiment.goals.empty? %> <%= erb :_experiment, :locals => {:goal => nil, :experiment => experiment} %> @@ -14,4 +17,4 @@ <% else %>No experiments have started yet, you need to define them in your code and introduce them to your users.
Check out the Readme for more help getting started.
-<% end %> \ No newline at end of file +<% end %> diff --git a/lib/split/dashboard/views/layout.erb b/lib/split/dashboard/views/layout.erb index 767828ea..f7edb9f8 100644 --- a/lib/split/dashboard/views/layout.erb +++ b/lib/split/dashboard/views/layout.erb @@ -6,6 +6,7 @@ +Powered by Split v<%=Split::VERSION %>