Revision 1252:fe3777d42b76 plugins
| plugins/redmine_tags/app/views/projects/index.html.erb | ||
|---|---|---|
| 4 | 4 |
<% end %> |
| 5 | 5 |
<%= javascript_include_tag 'projects_index', :plugin => 'redmine_tags' %> |
| 6 | 6 |
|
| 7 |
|
|
| 8 | 7 |
<div class="contextual"> |
| 9 | 8 |
<%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
|
| 10 | 9 |
<%= ('| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add')).html_safe if User.current.allowed_to?(:add_project, nil, :global => true) %>
|
| ... | ... | |
| 16 | 15 |
</h2> |
| 17 | 16 |
|
| 18 | 17 |
<div style="clear:both;"></div> |
| 19 |
<%- form_tag(:controller => :projects, :action => :index, :method => :get, :html => {:id => :project_filtering_form}, :remote => true) do -%>
|
|
| 18 |
<%= form_tag(:controller => :projects, :action => :index, :method => :get, :html => {:id => :project_filtering_form}, :remote => true) do -%>
|
|
| 20 | 19 |
|
| 21 |
<% if @filter_status=="true" %> |
|
| 22 |
<fieldset id="filters_fieldset" class="collapsible"> |
|
| 23 |
<legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> |
|
| 24 |
<%- else -%> |
|
| 25 |
<fieldset id="filters_fieldset" class="collapsible collapsed"> |
|
| 26 |
<legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> |
|
| 27 |
<div style="display: none;"> |
|
| 28 |
<%- end -%> |
|
| 20 |
<fieldset id="filters_fieldset" class="collapsible"> |
|
| 21 |
<legend><%= l(:label_filter_plural) %></legend> |
|
| 29 | 22 |
|
| 30 |
<div> |
|
| 31 |
<div id='filter_tags'> |
|
| 32 |
<%= render :partial => 'filter_search_tags' -%> |
|
| 33 |
</div> |
|
| 23 |
<div>
|
|
| 24 |
<div id='filter_tags'>
|
|
| 25 |
<%= render :partial => 'filter_search_tags' -%>
|
|
| 26 |
</div>
|
|
| 34 | 27 |
|
| 35 |
<p class='q'> |
|
| 36 |
<%= label_tag 'q', l('project_filtering_q_label') %>
|
|
| 37 |
<%= text_field_tag 'q', @question, :size => 30, :id => 'search-input' %> |
|
| 38 |
</p> |
|
| 28 |
<p class='q'>
|
|
| 29 |
<%= label_tag 'q', l('project_filtering_q_label') %>
|
|
| 30 |
<%= text_field_tag 'q', @question, :size => 30, :id => 'search-input' %>
|
|
| 31 |
</p>
|
|
| 39 | 32 |
|
| 40 |
<p style="display: none;"><%= submit_tag( l('button_filter'), :id => 'submitButton') -%></p>
|
|
| 41 |
<%= link_to l(:button_apply), {}, :onclick => "$('submitButton').click(); return false;", :class => 'icon icon-checked' -%>
|
|
| 42 |
<%= link_to l(:button_clear), {}, :class => 'icon icon-reload' %>
|
|
| 43 |
</div> |
|
| 33 |
<p style="display: none;"><%= submit_tag( l('button_filter'), :id => 'submitButton') -%></p>
|
|
| 34 |
<%= link_to l(:button_apply), {}, :onclick => "$('submitButton').click(); return false;", :class => 'icon icon-checked' -%>
|
|
| 35 |
<%= link_to l(:button_clear), {}, :class => 'icon icon-reload' %>
|
|
| 36 |
</div>
|
|
| 44 | 37 |
|
| 45 |
<% unless @filter_status=="true" %> |
|
| 46 |
</div> |
|
| 47 |
<%- end -%> |
|
| 38 |
</fieldset> |
|
| 39 |
<%- end -%> |
|
| 48 | 40 |
|
| 49 | 41 |
|
| 50 |
<%- end -%> |
|
| 51 |
</fieldset> |
|
| 52 |
|
|
| 53 | 42 |
<div id="projects"> |
| 54 | 43 |
<%= render :partial => 'filtered_projects' %> |
| 55 | 44 |
</div> |
| 56 | 45 |
|
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 | 46 |
<% other_formats_links do |f| %> |
| 61 | 47 |
<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
|
| 62 | 48 |
<% end %> |
| plugins/redmine_tags/assets/javascripts/projects_index.js | ||
|---|---|---|
| 1 |
function toggleFieldsetWithState(this_field){
|
|
| 2 |
id = Element.up(this_field, 'fieldset').id; |
|
| 1 |
var IndexFilter = {
|
|
| 2 |
init: function(){
|
|
| 3 |
var self = this; |
|
| 4 |
$('fieldset#filters_fieldset legend').live("click", self.toggle);
|
|
| 5 |
}, |
|
| 3 | 6 |
|
| 4 |
// is the fieldset collapsed? |
|
| 5 |
var status = $(id).hasClassName("collapsed");
|
|
| 6 |
change_session(id, status); |
|
| 7 |
expanded: false, |
|
| 7 | 8 |
|
| 8 |
toggleFieldset(this_field); |
|
| 9 |
} |
|
| 9 |
toggle: function(){
|
|
| 10 |
var fieldset = $(this).parents('fieldset').first();
|
|
| 11 |
fieldset.toggleClass('collapsed');
|
|
| 12 |
fieldset.children('div').toggle();
|
|
| 13 |
} |
|
| 14 |
}; |
|
| 10 | 15 |
|
| 11 |
function submitForm(){
|
|
| 12 |
$('submitButton').click();
|
|
| 13 |
}
|
|
| 16 |
/*
|
|
| 17 |
function toggleFieldsetWithState(obj){
|
|
| 18 |
var fset = $(obj).parent('fieldset');
|
|
| 14 | 19 |
|
| 15 |
function change_session(id, nstatus) {
|
|
| 20 |
// is the fieldset collapsed? |
|
| 21 |
var status = fset.hasClass("collapsed");
|
|
| 22 |
|
|
| 23 |
// change_session(fset, status); |
|
| 24 |
// toggleFieldset(fset); |
|
| 25 |
} |
|
| 26 |
|
|
| 27 |
|
|
| 28 |
function submitForm(){
|
|
| 29 |
$('submitButton').click();
|
|
| 30 |
} |
|
| 31 |
|
|
| 32 |
|
|
| 33 |
function change_session(id, nstatus) {
|
|
| 16 | 34 |
var url = "projects/set_fieldset_status"; |
| 17 |
var request = new Ajax.Request(url, {
|
|
| 18 |
method: 'post', |
|
| 19 |
parameters: {field_id: id, status: nstatus},
|
|
| 20 |
asynchronous: true |
|
| 21 |
}); |
|
| 22 |
} |
|
| 35 |
var request = new jQuery.ajax(url, {
|
|
| 36 |
method: 'post', |
|
| 37 |
parameters: {field_id: id, status: nstatus},
|
|
| 38 |
asynchronous: true |
|
| 39 |
}); |
|
| 40 |
} |
|
| 41 |
|
|
| 23 | 42 |
|
| 24 | 43 |
function keypressHandler (event){
|
| 25 | 44 |
var key = event.which || event.keyCode; |
| ... | ... | |
| 32 | 51 |
} |
| 33 | 52 |
} |
| 34 | 53 |
|
| 54 |
*/ |
|
| 55 |
|
|
| 35 | 56 |
$(document).ready(function(){
|
| 36 |
$('search-input').on('keypress', keypressHandler);
|
|
| 57 |
// $('search-input').on('keypress', keypressHandler);
|
|
| 58 |
IndexFilter.init(); |
|
| 37 | 59 |
}); |
Also available in: Unified diff