优化页面代码

This commit is contained in:
sw 2014-10-28 09:30:43 +08:00
parent 01120d063d
commit 4e7965d060
2 changed files with 26 additions and 21 deletions

View File

@ -137,6 +137,11 @@ class IssueQuery < Query
:type => :list_optional, :values => role_values :type => :list_optional, :values => role_values
) unless role_values.empty? ) unless role_values.empty?
#done_values = [10,20,30,40,50,60,70,80,90,100]
#add_available_filter("done_ratio_111",
# :type => :list_optional, :values => done_values
#)
if versions.any? if versions.any?
add_available_filter "fixed_version_id", add_available_filter "fixed_version_id",
:type => :list_optional, :type => :list_optional,

View File

@ -1,28 +1,28 @@
<%= javascript_tag do %> <%= javascript_tag do %>
var operatorLabels = <%= raw_json Query.operators_labels %>; var operatorLabels = <%= raw_json Query.operators_labels %>;
var operatorByType = <%= raw_json Query.operators_by_filter_type %>; var operatorByType = <%= raw_json Query.operators_by_filter_type %>;
var availableFilters = <%= raw_json query.available_filters_as_json %>; var availableFilters = <%= raw_json query.available_filters_as_json %>;
var labelDayPlural = <%= raw_json l(:label_day_plural) %>; var labelDayPlural = <%= raw_json l(:label_day_plural) %>;
var allProjects = <%= raw query.all_projects_values.to_json %>; var allProjects = <%= raw query.all_projects_values.to_json %>;
$(document).ready(function(){ $(document).ready(function(){
initFilters(); initFilters();
<% query.filters.each do |field, options| %> <% query.filters.each do |field, options| %>
addFilter("<%= field %>", <%= raw_json query.operator_for(field) %>, <%= raw_json query.values_for(field) %>); addFilter("<%= field %>", <%= raw_json query.operator_for(field) %>, <%= raw_json query.values_for(field) %>);
<% end %> <% end %>
}); });
<% end %> <% end %>
<table style="width:100%"> <table style="width:100%">
<tr> <tr>
<td> <td>
<table id="filters-table"> <table id="filters-table">
</table> </table>
</td> </td>
<td class="add-filter"> <td class="add-filter">
<%= label_tag('add_filter_select', l(:label_filter_add)) %> <%= label_tag('add_filter_select', l(:label_filter_add)) %>
<%= select_tag 'add_filter_select', filters_options_for_select(query), :name => nil %> <%= select_tag 'add_filter_select', filters_options_for_select(query), :name => nil %>
</td> </td>
</tr> </tr>
</table> </table>
<%= hidden_field_tag 'f[]', '' %> <%= hidden_field_tag 'f[]', '' %>
<% include_calendar_headers_tags %> <% include_calendar_headers_tags %>