To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / plugins / redmine_tags / lib / redmine_tags / patches / issues_helper_patch.rb @ 1244:a3ed5c4d90f0

History | View | Annotate | Download (1013 Bytes)

1

    
2
require_dependency 'issues_helper'
3

    
4
module RedmineTags
5
  module Patches
6
    module IssuesHelperPatch
7
      def self.included(base)
8
        base.send(:include, InstanceMethods)
9
      end
10

    
11
      module InstanceMethods
12
        include TagsHelper
13

    
14
        def sidebar_tags
15
          unless @sidebar_tags
16
            @sidebar_tags = []
17
            if :none != RedmineTags.settings[:issues_sidebar].to_sym
18
              @sidebar_tags = Issue.available_tags({
19
                :project => @project,
20
                :open_only => (RedmineTags.settings[:issues_open_only].to_i == 1)
21
              })
22
            end
23
          end
24
          @sidebar_tags
25
        end
26

    
27
        def render_sidebar_tags
28
          render_tags_list(sidebar_tags, {
29
            :show_count => (RedmineTags.settings[:issues_show_count].to_i == 1),
30
            :open_only => (RedmineTags.settings[:issues_open_only].to_i == 1),
31
            :style => RedmineTags.settings[:issues_sidebar].to_sym
32
          })
33
        end
34
      end
35
    end
36
  end
37
end