Revision 803:6fa65a452888 vendor/plugins/redmine_tags/lib/redmine_tags/patches

View differences:

vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb
63 63
            @filter_status = "false"
64 64
          else
65 65
            @filter_status = session[:filters_fieldset_status]
66
          end                            
66
          end
67
          
68
          if params && params[:project] && !params[:project][:tag_list].nil?
69
            @filter_status = "true"
70
          end
71
                                      
67 72
        end
68 73

  
69 74
        # Lists visible projects. Paginator is for top-level projects only
vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb
160 160
          s.join "\n"
161 161
        end
162 162
        
163
        # Renders a tree of projects where the current user belongs
164
        # as a nested set of unordered lists
165
        # The given collection may be a subset of the whole project tree
166
        # (eg. some intermediate nodes are private and can not be seen)
167
        def render_my_project_hierarchy_with_tags(projects)
168

  
169
          s = ''
170

  
171
          original_project = @project
172

  
173
          projects.each do |project|
174
            if project.root? || !projects.include?(project.parent)
175
              s << render_my_project_in_hierarchy_with_tags(project)
176
            end
177
          end
178

  
179
          @project = original_project
180

  
181
          if s != ''
182
            a = ''
183
            a << "<ul class='projects root'>\n"
184
            a << s
185
            a << "</ul>\n"
186
            s = a
187
          end
188

  
189
          s
190

  
191
        end
192
        
193
        
194
        
195

  
196
        def render_my_project_in_hierarchy_with_tags(project)
197

  
198
          s = ''
199

  
200
          if User.current.member_of?(project)
201

  
202
            # set the project environment to please macros.
203
            @project = project
204

  
205
            classes = (project.root? ? 'root' : 'child')
206

  
207
            s << "<li class='#{classes}'><div class='#{classes}'>" +
208
              link_to_project(project, {}, :class => "project my-project")
209
            if project.is_public?
210
              s << " <span class='public'>" << l("field_is_public") << "</span>"
211
            else
212
              s << " <span class='private'>" << l("field_is_private") << "</span>"
213
            end
214
            s << render_project_short_description(project)
215

  
216
            s << l(:tags) << ":&nbsp"
217
            s << project.tag_counts.collect{ |t| render_project_tag_link(t) }.join(', ')
218

  
219
            s << "</div>\n"
220

  
221
            cs = ''
222
            project.children.each do |child|
223
              cs << render_my_project_in_hierarchy(child)
224
            end
225

  
226
            if cs != ''
227
              s << "<ul class='projects'>\n" << cs << "</ul>\n";
228
            end
229

  
230
          end
231

  
232
          s
233

  
234
        end
235

  
236
        
237
        
163 238
        private
164 239
        
165 240
        # copied from search_helper. This one doesn't escape html or limit the text length

Also available in: Unified diff