redmine_extensions 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/views/redmine_extensions/_custom_field_rows.html.erb +11 -0
- data/lib/generators/redmine_extensions/entity/entity_generator.rb +23 -1
- data/lib/generators/redmine_extensions/entity/templates/_form.html.erb.erb +8 -0
- data/lib/generators/redmine_extensions/entity/templates/controller.rb.erb +8 -4
- data/lib/generators/redmine_extensions/entity/templates/custom_field.rb.erb +4 -0
- data/lib/generators/redmine_extensions/entity/templates/easy_query.rb.erb +38 -0
- data/lib/generators/redmine_extensions/entity/templates/entity_attribute_helper_patch.rb.erb +10 -0
- data/lib/generators/redmine_extensions/entity/templates/index.html.erb.erb +35 -6
- data/lib/generators/redmine_extensions/entity/templates/model.rb.erb +7 -9
- data/lib/generators/redmine_extensions/entity/templates/query.rb.erb +27 -11
- data/lib/generators/redmine_extensions/entity/templates/show.html.erb.erb +11 -1
- data/lib/generators/redmine_extensions/plugin/USAGE +1 -1
- data/lib/generators/redmine_extensions/plugin/plugin_generator.rb +5 -5
- data/lib/generators/redmine_extensions/plugin/templates/Gemfile.erb +1 -1
- data/lib/generators/redmine_extensions/plugin/templates/after_init.rb.erb +1 -0
- data/lib/generators/redmine_extensions/plugin/templates/init.rb.erb +5 -0
- data/lib/redmine_extensions/version.rb +1 -1
- metadata +14 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee45cc8ecef4a8702670c2992e3599fdb96682dd
|
4
|
+
data.tar.gz: ffd40d9a0183a752fc463c8f7be2ae4aec17ddf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3561ac257b97d0eb8a69a1cf5b7a7c185e852e0dc40db32f6d192a2e82ebe8336f44e741d2963d18602c37b43bebd343caa90afb804f54a66dad60321fa1cb89
|
7
|
+
data.tar.gz: fae10df3d70b5b551fa62bdf4289ff09490eba0cc3aa6423307923e49674e8fa5580e431419408c2ba706681ac783c003293ad3c56323f49f34e6d0254898615
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% half_size = (custom_field_values.size / 2.0).ceil %>
|
2
|
+
<% 0.upto(half_size - 1).each do |row|
|
3
|
+
left_value = custom_field_values[row]
|
4
|
+
right_value = custom_field_values[row + half_size] %>
|
5
|
+
<tr>
|
6
|
+
<th><%= left_value ? h(left_value.custom_field.translated_name) : '' %></th>
|
7
|
+
<td><%= left_value ? show_value(left_value, true) : '' %></td>
|
8
|
+
<th><%= right_value ? h(right_value.custom_field.translated_name) : '' %></th>
|
9
|
+
<td><%= right_value ? show_value(right_value, true) : '' %></td>
|
10
|
+
</tr>
|
11
|
+
<% end %>
|
@@ -87,7 +87,29 @@ module RedmineExtensions
|
|
87
87
|
template 'model.rb.erb', "#{plugin_path}/app/models/#{model_name_underscored}.rb"
|
88
88
|
template 'new.html.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/new.html.erb"
|
89
89
|
template 'new.js.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/new.js.erb"
|
90
|
-
|
90
|
+
|
91
|
+
if Redmine::Plugin.installed?(:easy_extensions)
|
92
|
+
template 'easy_query.rb.erb', "#{plugin_path}/app/models/#{model_name_underscored}_query.rb"
|
93
|
+
template 'entity_attribute_helper_patch.rb.erb', "#{plugin_path}/extra/easy_patch/easy_extensions/helpers/entity_attribute_helper_patch.rb"
|
94
|
+
|
95
|
+
if File.exists?("#{plugin_path}/extra/easy_patch/easy_extensions/helpers/entity_attribute_helper_patch.rb")
|
96
|
+
|
97
|
+
inject_into_file "#{plugin_path}/extra/easy_patch/easy_extensions/helpers/entity_attribute_helper_patch.rb",
|
98
|
+
"\n def format_html_#{model_name_underscored}_attribute(entity_class, attribute, unformatted_value, options={})" +
|
99
|
+
"\n value = format_entity_attribute(entity_class, attribute, unformatted_value, options)" +
|
100
|
+
"\n case attribute.name" +
|
101
|
+
"\n when :name" +
|
102
|
+
"\n link_to(value, #{model_name_underscored.singularize}_path(options[:entity].id))" +
|
103
|
+
"\n else" +
|
104
|
+
"\n h(value)" +
|
105
|
+
"\n end" +
|
106
|
+
"\n end" +
|
107
|
+
"\n", after: "base.class_eval do"
|
108
|
+
|
109
|
+
end
|
110
|
+
else
|
111
|
+
template 'query.rb.erb', "#{plugin_path}/app/models/#{model_name_underscored}_query.rb"
|
112
|
+
end
|
91
113
|
|
92
114
|
if File.exists?("#{plugin_path}/config/routes.rb")
|
93
115
|
if project?
|
@@ -26,6 +26,14 @@
|
|
26
26
|
</p>
|
27
27
|
<%% end %>
|
28
28
|
<%- end -%>
|
29
|
+
<% associations.each do |assoc| %>
|
30
|
+
<%- next if assoc[1][:type] == 'has_many' -%>
|
31
|
+
<% association_name = assoc[0] %>
|
32
|
+
<p>
|
33
|
+
<%%= f.label l(:label_<%= association_name %>) %>
|
34
|
+
<%%= f.select :<%= association_name %>_id, <%= association_name.camelcase %>.visible.sorted.map{ |<%= association_name %>| [<%= association_name %>.to_s, <%= association_name %>.id]} %>
|
35
|
+
</p>
|
36
|
+
<% end %>
|
29
37
|
<%- if acts_as_customizable? -%>
|
30
38
|
<%% custom_field_values = <%= model_name_underscored %>.visible_custom_field_values %>
|
31
39
|
<%% custom_field_values.each do |value| %>
|
@@ -2,12 +2,12 @@ class <%= controller_class %>Controller < ApplicationController
|
|
2
2
|
|
3
3
|
menu_item :<%= model_name_pluralize_underscored %>
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
before_action :authorize_global
|
6
|
+
before_action :find_<%= model_name_underscored %>, only: [:show, :edit, :update]
|
7
|
+
before_action :find_<%= model_name_pluralize_underscored %>, only: [:context_menu, :bulk_edit, :bulk_update, :destroy]
|
7
8
|
<%- if project? -%>
|
8
|
-
|
9
|
+
before_action :find_project
|
9
10
|
<%- end -%>
|
10
|
-
before_filter :authorize_global
|
11
11
|
|
12
12
|
helper :<%= model_name_pluralize_underscored %>
|
13
13
|
helper :custom_fields
|
@@ -19,7 +19,11 @@ class <%= controller_class %>Controller < ApplicationController
|
|
19
19
|
accept_api_auth :index, :show, :create, :update, :destroy
|
20
20
|
|
21
21
|
def index
|
22
|
+
<% if Redmine::Plugin.installed?(:easy_extensions) %>
|
22
23
|
index_for_easy_query(<%= model_name %>Query)
|
24
|
+
<% else %>
|
25
|
+
retrieve_query(<%= model_name %>Query)
|
26
|
+
<% end %>
|
23
27
|
end
|
24
28
|
|
25
29
|
def show
|
@@ -0,0 +1,38 @@
|
|
1
|
+
class <%= model_name %>Query < EasyQuery
|
2
|
+
|
3
|
+
self.queried_class = <%= model_name %>
|
4
|
+
|
5
|
+
def initialize_available_filters
|
6
|
+
<%- db_columns.each do |column_name, column_options| -%>
|
7
|
+
<%- if project? && column_name == 'project_id' -%>
|
8
|
+
if project.nil?
|
9
|
+
add_available_filter '<%= column_name %>', name: <%= model_name %>.human_attribute_name(:<%= column_name %>), type: :<%= column_options[:query_type] %>, values: all_projects_values
|
10
|
+
end
|
11
|
+
<%- else -%>
|
12
|
+
add_available_filter '<%= column_name %>', name: <%= model_name %>.human_attribute_name(:<%= column_name %>), type: :<%= column_options[:query_type] %>
|
13
|
+
<%- end -%>
|
14
|
+
<%- end -%>
|
15
|
+
<%- if acts_as_customizable? -%>
|
16
|
+
add_custom_fields_filters(<%= model_name %>CustomField)
|
17
|
+
<%- end -%>
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize_available_columns
|
21
|
+
return @available_columns if @available_columns
|
22
|
+
group = l("label_filter_group_#{self.class.name.underscore}")
|
23
|
+
|
24
|
+
<%- db_columns.each do |column_name, column_options| -%>
|
25
|
+
add_available_column '<%= column_options[:query_column_name] || column_name %>', caption: <%= model_name %>.human_attribute_name(:<%= column_name %>), title: <%= model_name %>.human_attribute_name(:<%= column_name %>), group: group
|
26
|
+
<%- end -%>
|
27
|
+
<%- if acts_as_customizable? -%>
|
28
|
+
@available_columns += <%= model_name %>CustomField.visible.collect { |cf| EasyQueryCustomFieldColumn.new(cf, :group => l(:label_filter_group_custom_fields)) }
|
29
|
+
<%- end -%>
|
30
|
+
|
31
|
+
@available_columns
|
32
|
+
end
|
33
|
+
|
34
|
+
def default_list_columns
|
35
|
+
super.presence || <%= db_columns.collect{|column_name, column_options| (column_options[:query_column_name] || column_name).to_s}[0..3].to_s %>.flat_map{|c| [c.to_s, c.to_sym]}
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module <%= plugin_name.camelcase %>Patch
|
2
|
+
module EntityAttributeHelperPatch
|
3
|
+
def self.included(base)
|
4
|
+
base.class_eval do
|
5
|
+
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
EasyExtensions::PatchManager.register_helper_patch 'EntityAttributeHelper', '<%= plugin_name.camelcase %>Patch::EntityAttributeHelperPatch'
|
@@ -1,9 +1,38 @@
|
|
1
|
+
<% if Redmine::Plugin.installed?(:easy_extensions) %>
|
1
2
|
<%%= render @query %>
|
2
3
|
<%% ### PAGE CUSTOMS ########################################################## %>
|
3
|
-
<%%= context_menu context_menu_<%= model_name_pluralize_underscored %>_path(:
|
4
|
+
<%%= context_menu context_menu_<%= model_name_pluralize_underscored %>_path(project_id: @project) %>
|
4
5
|
<%% content_for :sidebar do %>
|
5
|
-
<%%= render :
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<%%= render partial: '<%= model_name_pluralize_underscored %>/sidebar' %>
|
7
|
+
<%%= render partial: 'sidebar/saved_easyqueries_by_type', locals: {query_class: @query.class, project: @project} %>
|
8
|
+
<%% end %>
|
9
|
+
<% else %>
|
10
|
+
<div class="contextual">
|
11
|
+
<%% if User.current.allowed_to?(:add_<%= model_name_pluralize_underscored %>, @project, global: true) %>
|
12
|
+
<%%= link_to l(:button_<%= model_name_underscored %>_new), new_<%= model_name_underscored %>_path, class: 'icon icon-add' %>
|
13
|
+
<%% end %>
|
14
|
+
</div>
|
15
|
+
<h2><%%= @query.queried_class.to_s %></h2>
|
16
|
+
<div id="query_form_with_buttons" class="hide-when-print">
|
17
|
+
<div id="query_form_content">
|
18
|
+
<table class="list issues">
|
19
|
+
<thead>
|
20
|
+
<%% @query.available_columns.each do |column| %>
|
21
|
+
<th>
|
22
|
+
<%%= column.caption %>
|
23
|
+
</th>
|
24
|
+
<%% end %>
|
25
|
+
</thead>
|
26
|
+
<tbody>
|
27
|
+
<%% @query.<%= model_name_pluralize_underscored %>.each do |entity| %>
|
28
|
+
<tr>
|
29
|
+
<%% @query.available_columns.each do |column| %>
|
30
|
+
<%%= content_tag('td', column_content(column, entity)) %>
|
31
|
+
<%% end %>
|
32
|
+
</tr>
|
33
|
+
<%% end %>
|
34
|
+
</tbody>
|
35
|
+
</table>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
@@ -2,7 +2,7 @@ class <%= model_name %> < ActiveRecord::Base
|
|
2
2
|
include Redmine::SafeAttributes
|
3
3
|
|
4
4
|
<%= 'belongs_to :project' if project? %>
|
5
|
-
<%= 'belongs_to :author, class_name: \'User\''
|
5
|
+
<%= 'belongs_to :author, class_name: \'User\'' if author? %>
|
6
6
|
|
7
7
|
scope :visible, lambda { |*args|
|
8
8
|
where(<%= model_name %>.visible_condition(args.shift || User.current, *args))<%= '.joins(:project)' if project? %>
|
@@ -11,7 +11,7 @@ class <%= model_name %> < ActiveRecord::Base
|
|
11
11
|
scope :sorted, lambda { order("#{table_name}.<%= name_column %> ASC") }
|
12
12
|
<% end %>
|
13
13
|
|
14
|
-
|
14
|
+
<%- if acts_as_searchable? -%>
|
15
15
|
acts_as_searchable columns: [<%= string_columns.collect{|c, _| "\"\#{#{model_name}.table_name}.#{c}\"" }.join(', ') %>],
|
16
16
|
date_column: :created_at
|
17
17
|
<%- end -%>
|
@@ -45,13 +45,11 @@ class <%= model_name %> < ActiveRecord::Base
|
|
45
45
|
<%= values[:type] %> :<%= assoc_name %><%= options %>
|
46
46
|
<%- end -%>
|
47
47
|
<%- end -%>
|
48
|
-
|
49
|
-
<%- if safe_columns.any? -%>
|
50
|
-
|
51
|
-
<%-
|
52
|
-
|
53
|
-
safe_attributes 'custom_field_values', 'custom_fields'
|
54
|
-
<%- end -%>
|
48
|
+
<%- attributes = [] -%>
|
49
|
+
<%- attributes += safe_columns.keys if safe_columns.any? -%>
|
50
|
+
<%- attributes += ['custom_field_values', 'custom_fields'] if acts_as_customizable? -%>
|
51
|
+
<%-attributes += associations.keys.map{ |assoc| "#{assoc}_id" } -%>
|
52
|
+
safe_attributes *%w(<%= attributes.join(' ') %>)
|
55
53
|
<%- if project? -%>
|
56
54
|
safe_attributes 'project_id', if: ->(<%= model_name_underscored %>, _user) { <%= model_name_underscored %>.new_record? }
|
57
55
|
<%- end -%>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class <%= model_name %>Query <
|
1
|
+
class <%= model_name %>Query < Query
|
2
2
|
|
3
3
|
self.queried_class = <%= model_name %>
|
4
4
|
|
@@ -6,10 +6,10 @@ class <%= model_name %>Query < EasyQuery
|
|
6
6
|
<%- db_columns.each do |column_name, column_options| -%>
|
7
7
|
<%- if project? && column_name == 'project_id' -%>
|
8
8
|
if project.nil?
|
9
|
-
add_available_filter '<%= column_name %>', name:
|
9
|
+
add_available_filter '<%= column_name %>', name: <%= model_name %>.human_attribute_name(:<%= column_name %>), type: :<%= column_options[:query_type] %>, values: all_projects_values
|
10
10
|
end
|
11
11
|
<%- else -%>
|
12
|
-
add_available_filter '<%= column_name %>', name:
|
12
|
+
add_available_filter '<%= column_name %>', name: <%= model_name %>.human_attribute_name(:<%= column_name %>), type: :<%= column_options[:query_type] %>
|
13
13
|
<%- end -%>
|
14
14
|
<%- end -%>
|
15
15
|
|
@@ -20,27 +20,43 @@ class <%= model_name %>Query < EasyQuery
|
|
20
20
|
|
21
21
|
def available_columns
|
22
22
|
return @available_columns if @available_columns
|
23
|
+
@available_columns = []
|
23
24
|
group = l("label_filter_group_#{self.class.name.underscore}")
|
24
25
|
|
25
26
|
<%- db_columns.each do |column_name, column_options| -%>
|
26
|
-
|
27
|
+
@available_columns << QueryColumn.new('<%= column_options[:query_column_name] || column_name %>', caption: <%= model_name %>.human_attribute_name(:<%= column_name %>), title: <%= model_name %>.human_attribute_name(:<%= column_name %>), group: group)
|
27
28
|
<%- end -%>
|
28
29
|
<%- if acts_as_customizable? -%>
|
29
|
-
<% if Redmine::Plugin.installed?(:easy_extensions) %>
|
30
|
-
@available_columns += <%= model_name %>CustomField.visible.collect { |cf| EasyQueryCustomFieldColumn.new(cf, :group => l(:label_filter_group_custom_fields)) }
|
31
|
-
<% else %>
|
32
30
|
@available_columns += <%= model_name %>CustomField.visible.collect { |cf| QueryCustomFieldColumn.new(cf) }
|
33
31
|
<%- end -%>
|
34
|
-
<%- end -%>
|
35
32
|
|
36
33
|
@available_columns
|
37
34
|
end
|
38
35
|
|
39
|
-
def
|
36
|
+
def default_columns_names
|
40
37
|
super.presence || <%= db_columns.collect{|column_name, column_options| (column_options[:query_column_name] || column_name).to_s}[0..3].to_s %>.flat_map{|c| [c.to_s, c.to_sym]}
|
41
38
|
end
|
42
39
|
|
43
|
-
def
|
44
|
-
|
40
|
+
def <%= model_name_pluralize_underscored %>(options={})
|
41
|
+
order_option = [group_by_sort_order, (options[:order] || sort_clause)].flatten.reject(&:blank?)
|
42
|
+
|
43
|
+
scope = <%= model_name %>.visible.
|
44
|
+
where(statement).
|
45
|
+
includes(((options[:include] || [])).uniq).
|
46
|
+
where(options[:conditions]).
|
47
|
+
order(order_option).
|
48
|
+
joins(joins_for_order_statement(order_option.join(','))).
|
49
|
+
limit(options[:limit]).
|
50
|
+
offset(options[:offset])
|
51
|
+
|
52
|
+
if has_custom_field_column?
|
53
|
+
scope = scope.preload(:custom_values)
|
54
|
+
end
|
55
|
+
|
56
|
+
<%= model_name_pluralize_underscored %> = scope.to_a
|
57
|
+
|
58
|
+
<%= model_name_pluralize_underscored %>
|
59
|
+
rescue ::ActiveRecord::StatementInvalid => e
|
60
|
+
raise StatementInvalid.new(e.message)
|
45
61
|
end
|
46
62
|
end
|
@@ -9,10 +9,20 @@
|
|
9
9
|
<%- else -%>
|
10
10
|
<%% rows.right ::<%= model_name %>.human_attribute_name(:<%= column[0] %>), format_object(@<%= model_name_underscored %>.<%= column[0] %>) %>
|
11
11
|
<%- end -%>
|
12
|
+
<%- end -%>
|
13
|
+
<% associations.each_with_index do |assoc, idx| %>
|
14
|
+
<%- next if assoc[1][:type] == 'has_many' -%>
|
15
|
+
<% association_name = assoc[0] %>
|
16
|
+
<%- if idx % 2 == 0 -%>
|
17
|
+
<%% rows.left l(:label_<%= association_name %>), format_object(@<%= model_name_underscored %>.<%= association_name %>) %>
|
18
|
+
<%- else -%>
|
19
|
+
<%% rows.right l(:label_<%= association_name %>), format_object(@<%= model_name_underscored %>.<%= association_name %>) %>
|
20
|
+
<%- end -%>
|
12
21
|
<%- end -%>
|
13
22
|
<%% end %>
|
14
23
|
<%- if acts_as_customizable? -%>
|
15
|
-
|
24
|
+
<hr />
|
25
|
+
<%%= render partial: 'redmine_extensions/custom_field_rows', :locals => { :custom_field_values => @<%= model_name_underscored %>.visible_custom_field_values } %>
|
16
26
|
<%- end -%>
|
17
27
|
<%%= call_hook(:view_<%= model_name_pluralize_underscored %>_show_details_bottom, :<%= model_name_underscored %> => @<%= model_name_underscored %>) %>
|
18
28
|
</table>
|
@@ -2,7 +2,7 @@ Description:
|
|
2
2
|
The plugin generator creates stubs for new Redmine plugin.
|
3
3
|
Plugin is prepared for use in Redmine and Easy Redmine as well.
|
4
4
|
You can use --customer flag to generate a special plugin if you can make just a few changes to code. Backup this plugin before Redmine or Easy Redmine upgrade and move back for keep you changes.
|
5
|
-
You can use --
|
5
|
+
You can use --easy_plugin flag to specify easy plugin build.
|
6
6
|
|
7
7
|
Example:
|
8
8
|
rails g redmine_extensions:plugin NameOfNewPlugin
|
@@ -2,18 +2,18 @@ module RedmineExtensions
|
|
2
2
|
class PluginGenerator < Rails::Generators::NamedBase
|
3
3
|
source_root File.expand_path('../templates', __FILE__)
|
4
4
|
|
5
|
-
attr_reader :plugin_path, :plugin_name_underscored, :plugin_pretty_name, :plugin_title
|
5
|
+
attr_reader :plugin_path, :plugin_name_underscored, :plugin_pretty_name, :plugin_title, :easy_plugin
|
6
6
|
|
7
7
|
class_option :customer, type: :boolean, default: false, banner: '', :desc => 'plugin will act as customer modification. It is useful for changing few things and be uptodate with the core.'
|
8
|
-
class_option :
|
8
|
+
class_option :easy_plugin, type: :boolean, default: false, banner: '', :desc => 'generate easy plugin'
|
9
9
|
|
10
10
|
def initialize(*args)
|
11
11
|
super
|
12
|
-
|
12
|
+
@easy_plugin = options[:easy_plugin]
|
13
13
|
@plugin_name_underscored = options[:customer] ? "modification_#{file_name.underscore}" : file_name.underscore
|
14
14
|
@plugin_pretty_name = plugin_name_underscored.titleize
|
15
15
|
|
16
|
-
@plugin_path = (
|
16
|
+
@plugin_path = (easy_plugin ? "plugins/easyproject/easy_plugins" : "plugins") + "/#{plugin_name_underscored}"
|
17
17
|
@plugin_title = @plugin_name_underscored.camelize
|
18
18
|
end
|
19
19
|
|
@@ -45,7 +45,7 @@ module RedmineExtensions
|
|
45
45
|
template 'gitkeep.erb', "#{plugin_path}/lib/#{plugin_name_underscored}/easy_patch/redmine/others/.gitkeep"
|
46
46
|
|
47
47
|
template 'after_init.rb.erb', "#{plugin_path}/after_init.rb"
|
48
|
-
template 'Gemfile.erb', "#{plugin_path}/Gemfile"
|
48
|
+
template 'Gemfile.erb', "#{plugin_path}/Gemfile" unless easy_plugin
|
49
49
|
template 'init.rb.erb', "#{plugin_path}/init.rb"
|
50
50
|
template 'javascript.js', "#{plugin_path}/assets/javascripts/#{plugin_name_underscored}.js"
|
51
51
|
template 'stylesheet.css', "#{plugin_path}/assets/stylesheets/#{plugin_name_underscored}.css"
|
@@ -1 +1 @@
|
|
1
|
-
gem 'redmine_extensions' unless Dir.exist?(File.expand_path('../../easyproject', __FILE__))
|
1
|
+
gem 'redmine_extensions' unless Dir.exist?(File.expand_path('../../easyproject', __FILE__))
|
@@ -1,4 +1,5 @@
|
|
1
1
|
Dir[File.dirname(__FILE__) + '/lib/<%= plugin_name_underscored %>/easy_patch/**/*.rb'].each {|file| require_dependency file }
|
2
|
+
Dir[File.dirname(__FILE__) + '/extra/easy_patch/**/*.rb'].each { |file| require_dependency file }
|
2
3
|
|
3
4
|
# this block is executed once just after Redmine is started
|
4
5
|
# means after all plugins are initialized
|
@@ -7,9 +7,14 @@ Redmine::Plugin.register :<%= plugin_name_underscored %> do
|
|
7
7
|
|
8
8
|
#into easy_settings goes available setting as a symbol key, default value as a value
|
9
9
|
settings easy_settings: { }
|
10
|
+
<% if easy_plugin %>
|
11
|
+
plugin_in_relative_subdirectory File.join('easyproject', 'easy_plugins')
|
12
|
+
<% end %>
|
10
13
|
end
|
11
14
|
|
15
|
+
<% unless easy_plugin %>
|
12
16
|
unless Redmine::Plugin.registered_plugins[:easy_extensions]
|
13
17
|
require_relative 'after_init'
|
14
18
|
end
|
15
19
|
|
20
|
+
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Easy Software Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- app/views/easy_queries/_index.html.erb
|
182
182
|
- app/views/easy_queries/_settings.html.erb
|
183
183
|
- app/views/easy_settings/edit.html.erb
|
184
|
+
- app/views/redmine_extensions/_custom_field_rows.html.erb
|
184
185
|
- app/views/redmine_extensions/_development_mode.html.erb
|
185
186
|
- config/locales/cs.yml
|
186
187
|
- config/locales/en.yml
|
@@ -195,9 +196,11 @@ files:
|
|
195
196
|
- lib/generators/redmine_extensions/entity/templates/controller.rb.erb
|
196
197
|
- lib/generators/redmine_extensions/entity/templates/controller_spec.rb.erb
|
197
198
|
- lib/generators/redmine_extensions/entity/templates/custom_field.rb.erb
|
199
|
+
- lib/generators/redmine_extensions/entity/templates/easy_query.rb.erb
|
198
200
|
- lib/generators/redmine_extensions/entity/templates/edit.html.erb.erb
|
199
201
|
- lib/generators/redmine_extensions/entity/templates/edit.js.erb.erb
|
200
202
|
- lib/generators/redmine_extensions/entity/templates/en.yml.erb
|
203
|
+
- lib/generators/redmine_extensions/entity/templates/entity_attribute_helper_patch.rb.erb
|
201
204
|
- lib/generators/redmine_extensions/entity/templates/factories.rb.erb
|
202
205
|
- lib/generators/redmine_extensions/entity/templates/helper.rb.erb
|
203
206
|
- lib/generators/redmine_extensions/entity/templates/hooks.rb.erb
|
@@ -301,22 +304,22 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
304
|
version: '0'
|
302
305
|
requirements: []
|
303
306
|
rubyforge_project:
|
304
|
-
rubygems_version: 2.6.
|
307
|
+
rubygems_version: 2.6.12
|
305
308
|
signing_key:
|
306
309
|
specification_version: 4
|
307
310
|
summary: Redmine Extensions is set of usefull features for Redmine. Main focus is
|
308
311
|
on development helpers, but many users can find it helpfull
|
309
312
|
test_files:
|
310
|
-
- spec/
|
311
|
-
- spec/
|
313
|
+
- spec/spec_helper.rb
|
314
|
+
- spec/features/autocomplete_spec.rb
|
315
|
+
- spec/models/easy_setting_spec.rb
|
316
|
+
- spec/presenters/redmine_extensions/easy_setting_presenter_spec.rb
|
317
|
+
- spec/support/plugin_generator.rb
|
312
318
|
- spec/factories/easy_settings.rb
|
313
|
-
- spec/factories/issues.rb
|
314
319
|
- spec/factories/projects.rb
|
315
320
|
- spec/factories/trackers.rb
|
321
|
+
- spec/factories/time_entries.rb
|
316
322
|
- spec/factories/easy_queries.rb
|
317
323
|
- spec/factories/users.rb
|
318
|
-
- spec/
|
319
|
-
- spec/
|
320
|
-
- spec/spec_helper.rb
|
321
|
-
- spec/models/easy_setting_spec.rb
|
322
|
-
- spec/features/autocomplete_spec.rb
|
324
|
+
- spec/factories/issues.rb
|
325
|
+
- spec/rails_helper.rb
|