Revision 776:af852d82b00b
| vendor/plugins/redmine_tags/app/views/projects/_my_projects.rhtml | ||
|---|---|---|
| 1 |
<fieldset id="filters" class="collapsible"> |
|
| 2 |
<legend onclick="toggleFieldset(this);"><%= l(:label_my_projects) %></legend> |
|
| 1 |
<% if @myproj_status %> |
|
| 2 |
<fieldset id="my_projects_fieldset" class="collapsible"> |
|
| 3 |
<legend onclick="toggleFieldsetWithState(this);"><%= l(:label_my_projects) %></legend> |
|
| 4 |
<% else %> |
|
| 5 |
<fieldset id="my_projects_fieldset" class="collapsible collapsed"> |
|
| 6 |
<legend onclick="toggleFieldsetWithState(this);"><%= l(:label_my_projects) %></legend> |
|
| 7 |
<div style="display: none;"> |
|
| 8 |
<% end%> |
|
| 3 | 9 |
<% if @user_projects %> |
| 4 | 10 |
<div> |
| 5 | 11 |
<%= render_my_project_hierarchy(@user_projects)%> |
| vendor/plugins/redmine_tags/app/views/projects/index.rhtml | ||
|---|---|---|
| 16 | 16 |
<%= render :partial => 'my_projects' %> |
| 17 | 17 |
<% end %> |
| 18 | 18 |
|
| 19 |
|
|
| 20 | 19 |
<div style="clear:both;"></div> |
| 21 | 20 |
<% form_tag(:controller => :projects, :action => :index, :method => :get, :id => :project_filtering) do %> |
| 22 |
<fieldset id="filters" class="collapsible collapsed"> |
|
| 23 |
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
| 24 |
<div style="display: none;"> |
|
| 21 |
|
|
| 22 |
|
|
| 23 |
<% if @filter_status %> |
|
| 24 |
<fieldset id="filters_fieldset" class="collapsible"> |
|
| 25 |
<legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> |
|
| 26 |
<% else %> |
|
| 27 |
<fieldset id="filters_fieldset" class="collapsible collapsed"> |
|
| 28 |
<legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> |
|
| 29 |
<div style="display: none;"> |
|
| 30 |
<% end %> |
|
| 25 | 31 |
<div> |
| 26 | 32 |
<p class='q'> |
| 27 | 33 |
<%= label_tag 'q', l('project_filtering_q_label') %>
|
| vendor/plugins/redmine_tags/assets/javascripts/projects_index.js | ||
|---|---|---|
| 1 | 1 |
Event.observe(window, 'load', function() {
|
| 2 | 2 |
|
| 3 |
}); |
|
| 3 |
}); |
|
| 4 |
|
|
| 5 |
|
|
| 6 |
function toggleFieldsetWithState(this_field){
|
|
| 7 |
toggleFieldset(this_field); |
|
| 8 |
|
|
| 9 |
id = Element.up(this_field, 'fieldset').id; |
|
| 10 |
|
|
| 11 |
// is the fieldset collapsed? |
|
| 12 |
status = $(id).hasClassName("collapsed");
|
|
| 13 |
|
|
| 14 |
change_session(id, status); |
|
| 15 |
}; |
|
| 16 |
|
|
| 17 |
function change_session(id, nstatus) {
|
|
| 18 |
var url = "projects/set_fieldset_status"; |
|
| 19 |
var request = new Ajax.Request(url, {
|
|
| 20 |
method: 'post', |
|
| 21 |
parameters: {field_id: id, status: nstatus},
|
|
| 22 |
asynchronous: true |
|
| 23 |
}); |
|
| 24 |
} |
|
| vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb | ||
|---|---|---|
| 7 | 7 |
base.send(:include, InstanceMethods) |
| 8 | 8 |
base.class_eval do |
| 9 | 9 |
unloadable |
| 10 |
skip_before_filter :authorize, :only => [:set_fieldset_status] |
|
| 11 |
skip_before_filter :find_project, :only => [:set_fieldset_status] |
|
| 10 | 12 |
before_filter :add_tags_to_project, :only => [:save, :update] |
| 11 | 13 |
# before_filter :filter_projects, :only => :index |
| 12 | 14 |
|
| ... | ... | |
| 30 | 32 |
end |
| 31 | 33 |
end |
| 32 | 34 |
|
| 33 |
|
|
| 34 | 35 |
def paginate_projects |
| 35 | 36 |
sort_init 'name' |
| 36 | 37 |
sort_update %w(name lft created_on updated_on) |
| ... | ... | |
| 40 | 41 |
@offset ||= @project_pages.current.offset |
| 41 | 42 |
end |
| 42 | 43 |
|
| 43 |
def set_fieldset_status(field, status) |
|
| 44 |
def set_fieldset_status |
|
| 45 |
|
|
| 46 |
# luisf. test for missing parameters……… |
|
| 47 |
field = params[:field_id] |
|
| 48 |
status = params[:status] |
|
| 49 |
|
|
| 44 | 50 |
session[(field + "_status").to_sym] = status |
| 51 |
render :nothing => true |
|
| 45 | 52 |
end |
| 46 | 53 |
|
| 47 | 54 |
# gets the status of the collabsible fieldsets |
| 48 |
def get_fieldset_statuses
|
|
| 49 |
if session[:filter_status].nil?
|
|
| 50 |
@filter_status = session[:filter_status]
|
|
| 55 |
def get_fieldset_statuses |
|
| 56 |
if session[:my_projects_fieldset_status].nil?
|
|
| 57 |
@myproj_status = true
|
|
| 51 | 58 |
else |
| 59 |
@myproj_status = session[:my_projects_fieldset_status] |
|
| 60 |
end |
|
| 61 |
|
|
| 62 |
if session[:filters_fieldset_status].nil? |
|
| 52 | 63 |
@filter_status = false |
| 53 |
end |
|
| 54 |
|
|
| 55 |
if session[:myproj_status].nil? |
|
| 56 |
@myproj_status = session[:myproj_status] |
|
| 57 | 64 |
else |
| 58 |
@myproj_status = true
|
|
| 65 |
@filter_status = session[:filters_fieldset_status]
|
|
| 59 | 66 |
end |
| 60 | 67 |
end |
| 61 | 68 |
|
| ... | ... | |
| 64 | 71 |
def filtered_index |
| 65 | 72 |
@project = Project.new |
| 66 | 73 |
filter_projects |
| 74 |
|
|
| 75 |
debugger |
|
| 76 |
|
|
| 77 |
logger.error { "JASUS" }
|
|
| 78 |
|
|
| 67 | 79 |
get_fieldset_statuses |
| 68 | 80 |
|
| 69 | 81 |
respond_to do |format| |
| ... | ... | |
| 117 | 129 |
|
| 118 | 130 |
# intersection of both prject groups |
| 119 | 131 |
@projects = @projects & @tagged_projects_ids unless @tag_list.empty? |
| 120 |
|
|
| 121 |
debugger |
|
| 122 |
|
|
| 123 | 132 |
end |
| 124 | 133 |
end |
| 125 | 134 |
end |
| vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb | ||
|---|---|---|
| 18 | 18 |
# description, manager(s), creation date, last activity date, |
| 19 | 19 |
# general activity level, whether there is anything actually hosted |
| 20 | 20 |
# here for the project, etc. |
| 21 |
def render_project_table_with_filtering(projects, question) |
|
| 22 |
debugger |
|
| 23 |
|
|
| 21 |
def render_project_table_with_filtering(projects, question) |
|
| 24 | 22 |
custom_fields = "" |
| 25 | 23 |
s = "" |
| 26 | 24 |
if projects.any? |
Also available in: Unified diff