Revision 755:bde9c5bfb559 vendor/plugins

View differences:

vendor/plugins/redmine_tags/app/views/projects/_filtered_projects.rhtml
1
<% if @featured_projects && @featured_projects.any? %>
2

  
3
  <div class="splitcontentleft">
4
    <%= render_project_hierarchy_with_filtering(@projects, @custom_fields, @question) %>
5
  </div>
6

  
7
  <div class="splitcontentright">
8
    <h3 id="featured-projects-title"><%=l(:project_filtering_featured_projects_label) %></h3>
9
    <div id="featured-projects-box" class="box">
10
      <%= render_project_hierarchy_with_filtering(@featured_projects, @custom_fields, @question) %>
11
    </div>
12
  </div>
13

  
14
<% else %>
15

  
16
  <%= render_project_hierarchy_with_filtering(@projects, @custom_fields, @question) %>
17

  
18
<% end %>
19

  
1
<%= render_project_table_with_filtering(@filtered_projects, @question) %>
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>
3
    <% if @user_projects %>  
4
    <div>
5
      <%= render_my_project_hierarchy(@user_projects)%>
6
    </div>
7
  <% end %>
8
</fieldset>
vendor/plugins/redmine_tags/app/views/projects/index.rhtml
7 7
    <%= '| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
8 8
</div>
9 9

  
10

  
11

  
12
<div style="clear:both;"></div>
13
<% if User.current.logged? %>
14
  <%= render :partial => 'my_projects' %>
15
<% end %>
16

  
17

  
18
<div style="clear:both;"></div>
10 19
<% form_tag('/projects', :method => :get, :id => :project_filtering) do %>
11 20
  <fieldset id="filters" class="collapsible">
12 21
    <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
......
16 25
        <%= text_field_tag 'q', @question, :size => 30, :id => 'search-input' %>
17 26
      </p>
18 27

  
19
      <p class='buttons'><%= submit_tag( l(:button_send), :id => 'filter_button') -%></p>
20

  
21 28
      <div id='filter_tags'>
22 29
        <%= render :partial => 'filter_tags' %>
23 30
      </div>
24
            
25
      <%= link_to_remote('Submit', :url => { :controller => :projects, :action => :index, :format => :js }, :method => :get, :class => 'buttons') %>
26
      
31

  
32
      <p class='buttons'><%= submit_tag( l('button_filter'), :id => 'filter_button') -%></p>                  
27 33
    </div>
28 34
  </fieldset>
29 35
<% end %>
30 36

  
31
<div id="projects">
32
  <%= render :partial => 'filtered_projects' %>
33
</div>
34

  
35

  
36 37
<div style="clear:both;"></div>
37

  
38
<% if User.current.logged? %>
39
<p style="text-align:right;">
40
<span class="my-project"><%= l(:label_my_projects) %></span>
41
</p>
42
<% end %>
43

  
44

  
45
END
46

  
47
<% if @user_projects %>  
48
  <%= render_my_project_hierarchy(@user_projects)%>
49
<% end %>
50

  
51 38
<h2>
52 39
  <%= l("label_project_all") %>
53 40
</h2>
54 41

  
55
<%= render_project_table_with_filtering(@projects, @question) %>
42
<div id="projects">
43
  <%= render :partial => 'filtered_projects' %>
44
</div>
56 45

  
57 46
<p class="pagination"><%= pagination_links_full @project_pages, @project_count %></p>
58 47

  
vendor/plugins/redmine_tags/config/locales/en.yml
35 35
  auto_complete_new_tag: Add new...
36 36
  
37 37
  project_filtering_q_label: "Textual search"
38
  button_filter: "Filter"
vendor/plugins/redmine_tags/lib/redmine_project_filtering.rb
3 3
  # transforms a question and a list of custom fields into something that Project.search can process
4 4
  def self.calculate_tokens(question, custom_fields=nil)
5 5
    list = []
6
    list << custom_fields.values if custom_fields.present?
7 6
    list << question if question.present?
8 7

  
9 8
    tokens = list.join(' ').scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)})
vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb
25 25
          end
26 26
        end
27 27

  
28
        # luisf - TO BE REMOVED?
29
        def calculate_project_filtering_settings
30
          @project_filtering_settings = Setting[:plugin_redmine_project_filtering]
31
        end
28
        # # luisf - TO BE REMOVED?
29
        # def calculate_project_filtering_settings
30
        #   @project_filtering_settings = Setting[:plugin_redmine_project_filtering]
31
        # end
32 32

  
33 33
        def filter_projects
34 34
          @project = Project.new
......
53 53

  
54 54
        private
55 55

  
56
        def calculate_filtered_projects
56
        def calculate_filtered_projects                  
57 57
          @question = (params[:q] || "").strip     
58 58

  
59 59
          if params.has_key?(:project)
......
70 70
          @projects = @projects.search_by_question(@question) unless @question == ""
71 71
          @tagged_projects_ids = Project.tagged_with(@tag_list).collect{ |project| Project.find(project.id) } unless @tag_list.empty?
72 72

  
73
          debugger
74

  
73 75
          # intersection of both prject groups            
74 76
          @projects = @projects && @tagged_projects_ids unless @tag_list.empty?
75

  
76
          # luisf: what exactly are the featured projects? could they be "my projects"?
77
          #        if not should remove this code…
78
          @featured_projects = @featured_projects.search_by_question(@question) if @featured_projects
79

  
77
          
78
          @filtered_projects = @projects
80 79
        end
81 80
      end
82 81
    end
vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb
19 19
        # general activity level, whether there is anything actually hosted
20 20
        # here for the project, etc.
21 21
        def render_project_table_with_filtering(projects, question)
22
          debugger
23
          
22 24
          custom_fields = ""
23 25
          s = ""
24 26
          if projects.any?

Also available in: Unified diff