star.removeClass('fav').addClass('notfav');
star.attr('title', '<%= escape_javascript message('click_to_add_to_favourites') -%>');
}
+ $j('#filters-sidebar').load(baseUrl + '/measures/filters');
}
});
});
</script>
<% end %>
-<h2>My Measure Filters</h2>
-<table class="data marginbottom10" id="my-filters">
- <thead>
- <tr>
- <th class="thin"></th>
- <th><%= message('name') -%></th>
- <th><%= message('measure_filter.sharing') -%></th>
- <th class="right"><%= message('operations') -%></th>
- </tr>
- </thead>
- <tbody>
- <% if current_user.measure_filters.empty? %>
- <tr class="even">
- <td colspan="4"><%= message('filters.no_filters') -%></td>
- </tr>
- <% else %>
- <% current_user.measure_filters.each do |filter| %>
- <tr id="my-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'my-filters') -%>">
- <td>
- <%= measure_filter_star(filter, @fav_filter_ids.include?(filter.id)) -%>
- </td>
- <td>
- <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%>
- <% if filter.description %>
- <div><%= h filter.description -%></div>
- <% end %>
- </td>
- <td>
- <% if filter.shared %>
- Shared with all users
- <% else %>
- Private
- <% end %>
- </td>
- <td class="thin nowrap right">
- <a id="edit_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
-
- <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
-
- <%= link_to_action message('delete'), "#{ApplicationController.root_context}/measures/delete/#{filter.id}",
- :class => 'link-action link-red',
- :id => "delete_#{filter.name.parameterize}",
- :confirm_button => message('delete'),
- :confirm_title => 'measure_filter.delete_confirm_title',
- :confirm_msg => 'measure_filter.are_you_sure_want_delete_filter_x',
- :confirm_msg_params => [filter.name] -%>
- </td>
+<div>
+ <div class="page-split-left">
+ <ul class="nav-pills" id="nav-pills">
+ <li><a href="<%= ApplicationController.root_context -%>/measures" id="search-pill">Search</a></li>
+ <li class="active"><a href="#" id="filters-pill">Filters</a></li>
+ </ul>
+
+ <div id="filters-sidebar">
+ <%= render :partial => 'measures/filters' -%>
+ </div>
+ </div>
+
+ <div class="page-split-right width100">
+ <h2>My Measure Filters</h2>
+ <table class="data marginbottom10" id="my-filters">
+ <thead>
+ <tr>
+ <th class="thin"></th>
+ <th><%= message('name') -%></th>
+ <th><%= message('measure_filter.sharing') -%></th>
+ <th class="right"><%= message('operations') -%></th>
</tr>
- <% end %>
- <% end %>
- </tbody>
-</table>
-
-<br/>
-
-<h2>Shared Measure Filters</h2>
-<table class="data" id="shared-filters">
- <thead>
- <tr>
- <th class="thin"></th>
- <th><%= message('name') -%></th>
- <th><%= message('shared_by') -%></th>
- <th class="right"><%= message('operations') -%></th>
- </tr>
- </thead>
- <tbody>
- <% if @shared_filters.empty? %>
- <tr class="even">
- <td colspan="4"><%= message('filters.no_filters') -%></td>
- </tr>
- <% else %>
- <% @shared_filters.each do |filter| %>
- <tr id="shared-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'shared-filters') -%>">
- <td>
- <%= measure_filter_star(filter, @fav_filter_ids.include?(filter.id)) -%>
- </td>
- <td>
- <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%>
- <% if filter.description %>
- <div><%= h filter.description -%></div>
- <% end %>
- </td>
- <td>
- <%= filter.user ? h(filter.user.name) : '-' -%>
- </td>
- <td class="thin nowrap right">
- <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
- </td>
+ </thead>
+ <tbody>
+ <% if current_user.measure_filters.empty? %>
+ <tr class="even">
+ <td colspan="4"><%= message('filters.no_filters') -%></td>
+ </tr>
+ <% else %>
+ <% current_user.measure_filters.each do |filter| %>
+ <tr id="my-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'my-filters') -%>">
+ <td>
+ <%= measure_filter_star(filter, @fav_filter_ids.include?(filter.id)) -%>
+ </td>
+ <td>
+ <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%>
+ <% if filter.description %>
+ <div><%= h filter.description -%></div>
+ <% end %>
+ </td>
+ <td>
+ <% if filter.shared %>
+ Shared with all users
+ <% else %>
+ Private
+ <% end %>
+ </td>
+ <td class="thin nowrap right">
+ <a id="edit_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
+
+ <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
+
+ <%= link_to_action message('delete'), "#{ApplicationController.root_context}/measures/delete/#{filter.id}",
+ :class => 'link-action link-red',
+ :id => "delete_#{filter.name.parameterize}",
+ :confirm_button => message('delete'),
+ :confirm_title => 'measure_filter.delete_confirm_title',
+ :confirm_msg => 'measure_filter.are_you_sure_want_delete_filter_x',
+ :confirm_msg_params => [filter.name] -%>
+ </td>
+ </tr>
+ <% end %>
+ <% end %>
+ </tbody>
+ </table>
+
+ <br/>
+
+ <h2>Shared Measure Filters</h2>
+ <table class="data" id="shared-filters">
+ <thead>
+ <tr>
+ <th class="thin"></th>
+ <th><%= message('name') -%></th>
+ <th><%= message('shared_by') -%></th>
+ <th class="right"><%= message('operations') -%></th>
</tr>
+ </thead>
+ <tbody>
+ <% if @shared_filters.empty? %>
+ <tr class="even">
+ <td colspan="4"><%= message('filters.no_filters') -%></td>
+ </tr>
+ <% else %>
+ <% @shared_filters.each do |filter| %>
+ <tr id="shared-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'shared-filters') -%>">
+ <td>
+ <%= measure_filter_star(filter, @fav_filter_ids.include?(filter.id)) -%>
+ </td>
+ <td>
+ <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%>
+ <% if filter.description %>
+ <div><%= h filter.description -%></div>
+ <% end %>
+ </td>
+ <td>
+ <%= filter.user ? h(filter.user.name) : '-' -%>
+ </td>
+ <td class="thin nowrap right">
+ <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/measures/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
+ </td>
+ </tr>
+
+ <% end %>
+ <% end %>
+ </tbody>
+ </table>
+
+ </div>
+
+</div>
+
+
+
+
+
+
+
+
+
- <% end %>
- <% end %>
- </tbody>
-</table>
<% content_for :style do %>
<style type="text/css">
- #filter-form [type="text"].large-input {
+ #search-form [type="text"].large-input {
width: 180px;
}
- #filter-form select.large-input {
+ #search-form select.large-input {
width: 100%;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
- #filter-form select option {
+ #search-form select option {
padding: 1px 10px 1px 4px;
}
</style>
<script>
function submitSearch() {
// remove empty parameters from URL
- var form = $j("#filter-form");
+ var form = $j("#search-form");
form.find(':input[value=""]').attr('name', '');
form.submit();
return false;
});
window.location = url;
}
+ var filtersLoaded = false;
+ $j(document).ready(function () {
+ $j('#search-pill').on('click', function (e) {
+ $j('#search-pill').parent().addClass('active');
+ $j('#filters-pill').parent().removeClass('active');
+ $j('#search-form').show();
+ $j('#filters').hide();
+ });
+ $j('#filters-pill').on('click', function (e) {
+ $j('#search-pill').parent().removeClass('active');
+ $j('#filters-pill').parent().addClass('active');
+ $j('#search-form').hide();
+ $j('#filters').show();
+ if (!filtersLoaded) {
+ $j('#filters').load(baseUrl + '/measures/filters');
+ filtersLoaded=true;
+ }
+ });
+ }
+ );
</script>
<% end %>
<div id="measure-filters">
<div class="page-split-left">
- <form id="filter-form" method="GET" action="<%= ApplicationController.root_context -%>/measures/search">
+ <ul class="nav-pills" id="nav-pills">
+ <li class="active"><a href="#" id="search-pill">Search</a></li>
+ <li><a href="#" id="filters-pill">Filters</a></li>
+ </ul>
+ <div id="filters" style="display:none"><%= image_tag 'loading.gif' -%></div>
+ <form id="search-form" method="GET" action="<%= ApplicationController.root_context -%>/measures/search">
<% if @filter.id %>
<input type="hidden" name="id" value="<%= @filter.id -%>">
<% end %>
</tbody>
</table>
</form>
-
- <br/>
- <ul id="system-filters">
- <% MeasureFilter.find(:all, :select => ['id,name'], :conditions => ['system=?', true]).each do |system_filter| %>
- <li>
- <a href="<%= ApplicationController.root_context -%>/measures/filter/<%= system_filter.id -%>"><%= h system_filter.name -%></a>
- </li>
- <% end %>
- </ul>
-
- <% if logged_in? %>
- <br/>
- <ul id="fav-filters">
- <% current_user.favourited_measure_filters.each do |my_filter| %>
- <li>
- <a href="<%= ApplicationController.root_context -%>/measures/filter/<%= my_filter.id -%>"><%= h my_filter.name -%></a>
- </li>
- <% end %>
- </ul>
- <a href="<%= ApplicationController.root_context -%>/measures/manage" class="link-action">Manage</a>
- <% end %>
</div>
<% if @filter.results && @filter.display %>
border-top: 0;
padding: 5px;
}
-
-#time_machine {
- margin: 10px 0;
-}
-
-#time_machine #selected {
- background-image: url("../images/timemachine.png");
- background-repeat: repeat-x;
- background-position: left;
- background-color: #9D9D9D;
- border: 2px solid #ccc;
- color: #fff;
-}
-
-#time_machine #selected a {
- border-bottom: 1px dotted #fff;
-}
-
-#time_machine #selected a.nolink {
- border-bottom: 0;
-}
-
-#time_machine #selector {
- background-color: #EFEFEF;
- border: 1px solid #DDD;
-}
-
.comments {
color: #777;
font-size: 12px;
border-top: 1px solid #ddd;
}
-.hoverable.selected a, #time_machine #selected h3, #time_machine #selected a {
+.hoverable.selected a {
color: #fff;
}
-#time_machine td, .gwt-SourcePanel .sources td {
+.gwt-SourcePanel .sources td {
vertical-align: top;
}
border-top: 1px solid #DDD;
}
+select:not([multiple]) {
+ padding: 2px 5px;
+}
+
select.small-width {
max-width: 120px;
}
max-width: 175px;
width: 175px;
}
-
-.pipe-left {
- background-image: url('../images/sep12.png');
- background-position: left center;
- background-repeat: no-repeat;
- padding-left: 8px;
- margin-left: 8px;
-}
-
-.pipe-right {
- background-image: url('../images/sep12.png');
- background-position: right center;
- background-repeat: no-repeat;
- margin-right: 8px;
- padding-right: 8px;
-}
-
/* Dependencies */
#dependencies {
padding: 10px;
.property table.data > thead > tr > th {
vertical-align: top;
+}
+
+.nav-pills:before, .nav-pills:after {
+ content: "";
+ display: table;
+ line-height: 0;
+}
+
+.nav-pills:after {
+ clear: both;
+}
+
+.nav-pills > li {
+ float: left;
+}
+
+.nav-pills > li > a {
+ line-height: 14px;
+ margin-right: 2px;
+ padding-left: 10px;
+ padding-right: 10px;
+ display: block;
+}
+
+.nav-pills > li > a {
+ border-radius: 5px 5px 5px 5px;
+ margin-bottom: 2px;
+ margin-top: 2px;
+ padding-bottom: 6px;
+ padding-top: 6px;
+}
+
+.nav-pills > .active > a, .nav-pills > .active > a:hover {
+ background-color: #4b9fd5;
+ color: #FFFFFF;
}
\ No newline at end of file