Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding forgotten templates

  • Loading branch information...
commit d0a8702aee8b98cc0c4efeca1b3a3c23e51b4e8e 1 parent 5a63bf8
@timbrown01886 timbrown01886 authored
View
20 app/views/measures/_measure_selector.html.erb
@@ -0,0 +1,20 @@
+<span class="header_commands"><input type="checkbox" id="all_measures"/><label for="all_measures">all quality measures</label></span>
+<div id="tabs">
+ <!-- set up a tab header for each measure group -->
+ <ul>
+ <% @measures_categories.sort.each do |category, measures| %>
+ <li>
+ <a href="#<%= category.tr(" '", "_") %>"><%= category %></a><span id="<%= category.tr(" '", "_") %>_group_total"></span></li>
+ <% end %>
+ </ul>
+
+ <% @measures_categories.sort.each do |category, measures| %>
+ <!-- set up a checkbox for each top-level measure in the group -->
+ <div id="<%= category.tr(" '", "_")%>" class="measure_group"> <span class="header_commands"><input type="checkbox" id="<%= category.tr(" '", "_")%>_group" class="measure_group_all"/><label for="<%= category.tr(" '", "_")%>_group">all <%= category %> measures</label></span><br/>
+ <% measures.each do |m| %>
+ <input type="checkbox" name="product_test[measure_ids][]" value="<%= m['id'] %>" class="measure_cb"/><%= m.display_name %><br/>
+ <% end %>
+ </div>
+ <% end %>
+
+</div>
View
39 app/views/measures/by_type.js.erb
@@ -0,0 +1,39 @@
+
+// Render the measure selector
+$('#measures').html("<%= escape_javascript(render :partial => 'measure_selector') %>");
+
+function tallyMeasureGroups() {
+ var grandTotal = 0;
+ $.each($('.measure_group'), function(index, item){
+ var total = Math.max(0,$(this).find('input.measure_cb:checked').length);
+ $('#' + $(item).attr('id') +'_group').prop('checked', $(this).find('input.measure_cb').length == total);
+ grandTotal += total;
+ $('#' + $(item).attr('id') +'_group_total').empty().html(total > 0 ? total : '');
+ });
+ $('#all_measures').prop('checked',$('#wizard-measures-screen input.measure_cb').length == grandTotal)
+ $('form').valid();
+}
+
+// for handling the selection of measures from groups
+$('#all_measures').click(function () {
+ $('#wizard-measures-screen input:checkbox').prop('checked', $(this).prop('checked'));
+ $('.measure_group').prop('checked', $(this).prop('checked'));
+ tallyMeasureGroups();
+});
+
+$('.measure_group_all').click(function () {
+ var groupName = $(this).attr('id');
+ $(this).closest('div').find('input:checkbox').prop('checked', $(this).prop('checked'));
+ tallyMeasureGroups();
+});
+
+$('.measure_cb').change(function() {
+ tallyMeasureGroups();
+});
+$('#tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix').css({
+ "width":"90%",
+ "margin-left":"5%"
+});
+$("#tabs li").removeClass('ui-corner-top').addClass('ui-corner-left');
+$('#tabs').tabs("select",2)
+
Please sign in to comment.
Something went wrong with that request. Please try again.