redmine_extensions 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db4258140f1bd4b853bfd72b8a7c9a315ec0719943440d5c7f8d1182a5e5a81f
4
- data.tar.gz: 45e45ab584f1a1fd838fde047261fe8fb4402c0b496a70c1b9a945167b775a40
3
+ metadata.gz: 2a09c29deceeb65baa0a4b83ea1546cdf8a316535ac6813777889b7aa45d0661
4
+ data.tar.gz: 2946755a797aea4a7b5d135d893cc67e6d1b352c565022553e35342c52f1f8a2
5
5
  SHA512:
6
- metadata.gz: f46c4283187a9cbcfa66017cf06a2f6f2984efd2a36624fc737b0e0a936c4358251b822110a7a43cf1949347711d0fef0df743161db485b55f6580faa32ec70a
7
- data.tar.gz: c188d2f7e3f5326e4a3e068cf546d070a679077b0c51b13bac9e728b77426b534f9f815636968e89d7d309a7efbbed4a3bb713b7308e266a90b0223e4537afb2
6
+ metadata.gz: bbf4463f41a86b822392978939c9902c31071e05745f419abc50ca1f2d893cd5c1098c009ac4361d3b3078fa6aa2a27710d7d9a7023c823bf4dd9dc908fd9d35
7
+ data.tar.gz: 354ce6a7fcd2d02b718e4642280083e4af5592be0542d92ce4a1142e4f53200c8ed53c22917c4e5d375a735396fb8358fe23315306699029b872c13583efdc4e
@@ -57,12 +57,10 @@ module RedmineExtensions
57
57
  end
58
58
 
59
59
  def copy_templates
60
- template '_form.html.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/_form.html.erb"
61
60
  template '_sidebar.html.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/_sidebar.html.erb"
62
61
  template 'context_menu.html.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/context_menu.html.erb"
63
62
  template 'controller.rb.erb', "#{plugin_path}/app/controllers/#{model_name_pluralize_underscored}_controller.rb"
64
63
  template('custom_field.rb.erb', "#{plugin_path}/app/models/#{model_name_underscored}_custom_field.rb") if acts_as_customizable?
65
- template 'edit.html.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/edit.html.erb"
66
64
  template 'edit.js.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/edit.js.erb"
67
65
 
68
66
  tests_root = rys ? './spec' : "#{plugin_path}/test"
@@ -104,11 +102,10 @@ module RedmineExtensions
104
102
 
105
103
  template 'migration.rb.erb', "#{plugin_path}/db/migrate/#{Time.now.strftime('%Y%m%d%H%M%S%L')}_create_#{@model_name_pluralize_underscored}.rb"
106
104
  template 'model.rb.erb', "#{plugin_path}/app/models/#{model_name_underscored}.rb"
107
- template 'new.html.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/new.html.erb"
108
105
  template 'new.js.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/new.js.erb"
109
106
 
110
107
  if easy?
111
- template 'easy_query.rb.erb', "#{plugin_path}/app/models/#{model_name_underscored}_query.rb"
108
+ easy_model_template '%model_name_underscored%_query.rb'
112
109
  template 'entity_attribute_helper_patch.rb.erb', "#{plugin_path}/extra/easy_patch/easy_extensions/helpers/entity_attribute_helper_patch.rb"
113
110
 
114
111
  if File.exists?("#{plugin_path}/extra/easy_patch/easy_extensions/helpers/entity_attribute_helper_patch.rb")
@@ -239,15 +236,22 @@ module RedmineExtensions
239
236
  template 'show.js.erb.erb', "#{plugin_path}/app/views/#{model_name_pluralize_underscored}/show.js.erb"
240
237
 
241
238
  # New templates
242
- template 'app/models/%model_name_underscored%_query.rb'
243
- template 'app/views/%model_name_pluralize_underscored%/_%model_name_underscored%.api.rsb'
244
- template 'app/views/%model_name_pluralize_underscored%/_form.html.erb'
245
- template 'app/views/%model_name_pluralize_underscored%/new.html.erb'
246
- template 'app/views/%model_name_pluralize_underscored%/edit.html.erb'
239
+ easy_view_template '_%model_name_underscored%.api.rsb'
240
+ easy_view_template '_form.html.erb'
241
+ easy_view_template 'new.html.erb'
242
+ easy_view_template 'edit.html.erb'
247
243
  end
248
244
 
249
245
  private
250
246
 
247
+ def easy_model_template(name)
248
+ template "app/models/#{name}", "#{plugin_path}/app/models/#{name}"
249
+ end
250
+
251
+ def easy_view_template(name)
252
+ template "app/views/%model_name_pluralize_underscored%/#{name}", "#{plugin_path}/app/views/%model_name_pluralize_underscored%/#{name}"
253
+ end
254
+
251
255
  def easy?
252
256
  Redmine::Plugin.installed?(:easy_extensions)
253
257
  end
@@ -1,8 +1,8 @@
1
1
  <%%= title l(:heading_<%= model_name_underscored %>_edit) %>
2
2
 
3
- <%%= render partial: 'form', locals: { <%= model_name_underscored %>: @<%= model_name_underscored %>n } %>
3
+ <%%= render partial: 'form', locals: { <%= model_name_underscored %>: @<%= model_name_underscored %> } %>
4
4
 
5
- <% ### PAGE CUSTOMS ########################################################## %>
6
- <% content_for :sidebar do %>
7
- <%= render partial: '<%= model_name_pluralize_underscored %>/sidebar' %>
8
- <% end %>
5
+ <%% ### PAGE CUSTOMS ########################################################## %>
6
+ <%% content_for :sidebar do %>
7
+ <%%= render partial: '<%= model_name_pluralize_underscored %>/sidebar' %>
8
+ <%% end %>
@@ -1,8 +1,8 @@
1
1
  <%%= title l(:heading_<%= model_name_underscored %>_new) %>
2
2
 
3
- <%%= render partial: 'form', locals: { <%= model_name_underscored %>: @<%= model_name_underscored %>n } %>
3
+ <%%= render partial: 'form', locals: { <%= model_name_underscored %>: @<%= model_name_underscored %> } %>
4
4
 
5
- <% ### PAGE CUSTOMS ########################################################## %>
6
- <% content_for :sidebar do %>
7
- <%= render partial: '<%= model_name_pluralize_underscored %>/sidebar' %>
8
- <% end %>
5
+ <%% ### PAGE CUSTOMS ########################################################## %>
6
+ <%% content_for :sidebar do %>
7
+ <%%= render partial: '<%= model_name_pluralize_underscored %>/sidebar' %>
8
+ <%% end %>
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.7'
3
3
  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.3.6
4
+ version: 0.3.7
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: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2019-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails