redmine_extensions 0.1.04 → 0.1.05

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91db9f8871e2bd980dcfd0ade7540b9506ba2f63
4
- data.tar.gz: 8941936776dc0c4bdfafa8017fdd48685f2d3e8c
3
+ metadata.gz: 5db9a307843534efd5b78eb74983f18ed76bb6e4
4
+ data.tar.gz: b4d307b3969ea6ba5d8f9547054ed5e3dda480b2
5
5
  SHA512:
6
- metadata.gz: 6a6d4453f052613fa10c42059d40b3c41913915811cdcc5f251c25e0779b2073ec48e4f2d9a2124d83f2cfa508063ee87d6574bf5d18386c6c13ef2773ad24f1
7
- data.tar.gz: 5e9f37b10d63761c6e68538eb51823e0223d833929fc1b8e7da187797eef8c9414e2cacd4b48df8d090e97b2644a02aa1e8e33dc3fb817549b3a2eb12f1feda9
6
+ metadata.gz: f60499c0b0c62af6d2964afdb42a543dd3095bcb50fe8b936fcfa15a1e7f02a5f41da520577d736e27bf8c8b7a873cd1a769fe9b76d01674725792baf8aa00cb
7
+ data.tar.gz: 3ce2eb9ca5e081fd5f4da418c365ba1aae7c3b1c52aae0d36affd15a9622d4b70b77cd9fb2aa5631ac575edc49bb581341a396684f4454847873722d5335d882
@@ -0,0 +1,3 @@
1
+ <p>
2
+ <%= l(:text_modal_is_closing) %>
3
+ </p>
@@ -0,0 +1,5 @@
1
+ $("#ajax-modal").html("<%= j render(:partial => 'common/closing_modal', :formats => [:html]) %>");
2
+ $("#ajax-modal").dialog('option', {
3
+ buttons: []
4
+ });
5
+ window.location = "<%= j params[:back_url] %>";
@@ -1,3 +1,4 @@
1
1
  en:
2
2
  nothing: Nothing
3
3
  button_update_easy_settings: Update settings
4
+ text_modal_is_closing: This modal dialog will be closed automatically, please wait.
@@ -37,6 +37,7 @@ class <%= controller_class %>Controller < ApplicationController
37
37
 
38
38
  respond_to do |format|
39
39
  format.html
40
+ format.js
40
41
  end
41
42
  end
42
43
 
@@ -46,7 +47,9 @@ class <%= controller_class %>Controller < ApplicationController
46
47
  @<%= model_name_underscored %>.project = @project
47
48
  <%- end -%>
48
49
  @<%= model_name_underscored %>.safe_attributes = params[:<%= model_name_underscored %>]
50
+ <%- if acts_as_attachable? -%>
49
51
  @<%= model_name_underscored %>.save_attachments(params[:attachments] || (params[:<%= model_name_underscored %>] && params[:<%= model_name_underscored %>][:uploads]))
52
+ <%- end -%>
50
53
 
51
54
  if @<%= model_name_underscored %>.save
52
55
  respond_to do |format|
@@ -55,11 +58,13 @@ class <%= controller_class %>Controller < ApplicationController
55
58
  redirect_back_or_default <%= model_name_underscored %>_path(@<%= model_name_underscored %>)
56
59
  }
57
60
  format.api { render :action => 'show', :status => :created, :location => <%= model_name_underscored %>_url(@<%= model_name_underscored %>) }
61
+ format.js { render :template => 'common/close_modal' }
58
62
  end
59
63
  else
60
64
  respond_to do |format|
61
65
  format.html { render :action => 'new' }
62
66
  format.api { render_validation_errors(@<%= model_name_underscored %>) }
67
+ format.js { render :action => 'new' }
63
68
  end
64
69
  end
65
70
  end
@@ -69,12 +74,15 @@ class <%= controller_class %>Controller < ApplicationController
69
74
 
70
75
  respond_to do |format|
71
76
  format.html
77
+ format.js
72
78
  end
73
79
  end
74
80
 
75
81
  def update
76
82
  @<%= model_name_underscored %>.safe_attributes = params[:<%= model_name_underscored %>]
83
+ <%- if acts_as_attachable? -%>
77
84
  @<%= model_name_underscored %>.save_attachments(params[:attachments] || (params[:<%= model_name_underscored %>] && params[:<%= model_name_underscored %>][:uploads]))
85
+ <%- end -%>
78
86
 
79
87
  if @<%= model_name_underscored %>.save
80
88
  respond_to do |format|
@@ -83,11 +91,13 @@ class <%= controller_class %>Controller < ApplicationController
83
91
  redirect_back_or_default <%= model_name_underscored %>_path(@<%= model_name_underscored %>)
84
92
  }
85
93
  format.api { render_api_ok }
94
+ format.js { render :template => 'common/close_modal' }
86
95
  end
87
96
  else
88
97
  respond_to do |format|
89
98
  format.html { render :action => 'edit' }
90
99
  format.api { render_validation_errors(@<%= model_name_underscored %>) }
100
+ format.js { render :action => 'edit' }
91
101
  end
92
102
  end
93
103
  end
@@ -1,15 +1,17 @@
1
1
  <%%= title l(:heading_<%= model_name_underscored %>_edit) %>
2
2
 
3
- <%%= form_for([@project, @<%= model_name_underscored %>], html: {multipart: <%= acts_as_attachable? %>, id: '<%= model_name_underscored %>_form', class: 'tabular'}) do |f| %>
3
+ <%%= form_for([@project, @<%= model_name_underscored %>], html: {multipart: <%= acts_as_attachable? %>, id: '<%= model_name_underscored %>_form', class: 'tabular', remote: request.xhr?}) do |f| %>
4
4
  <%%= error_messages_for @<%= model_name_underscored %> %>
5
5
 
6
6
  <div class="box">
7
7
  <%%= render partial: 'form', locals: {<%= model_name_underscored %>: @<%= model_name_underscored %>} %>
8
8
  </div>
9
9
 
10
+ <%% if !request.xhr? %>
10
11
  <p>
11
12
  <%%= submit_tag l(:button_update), title: l(:button_update) %>
12
13
  </p>
14
+ <%% end %>
13
15
  <%% end %>
14
16
  <%% ### PAGE CUSTOMS ########################################################## %>
15
17
  <%% content_for :sidebar do %>
@@ -0,0 +1,17 @@
1
+ $("#ajax-modal").html("<%%= j render(:template => '<%= model_name_pluralize_underscored %>/edit', :formats => [:html]) %>");
2
+ showModal('ajax-modal', '60%');
3
+ var submitButton = {
4
+ text:"<%=j l(:button_update) -%>",
5
+ title:"<%=j l(:button_update) -%>",
6
+ click: function() {$(this).find('form').submit()},
7
+ 'class': 'button-positive'
8
+ }
9
+ var closeButton = {
10
+ text: "<%=j l(:button_close) -%>",
11
+ title: "<%=j l(:button_close) -%>",
12
+ click: function() {$(this).dialog('close');},
13
+ 'class': 'button'
14
+ }
15
+ $("#ajax-modal").dialog('option', {
16
+ buttons: [closeButton, submitButton]
17
+ });
@@ -1,15 +1,17 @@
1
1
  <%%= title l(:heading_<%= model_name_underscored %>_new) %>
2
2
 
3
- <%%= form_for([@project, @<%= model_name_underscored %>], html: {multipart: <%= acts_as_attachable? %>, id: '<%= model_name_underscored %>_form', class: 'tabular'}) do |f| %>
3
+ <%%= form_for([@project, @<%= model_name_underscored %>], html: {multipart: <%= acts_as_attachable? %>, id: '<%= model_name_underscored %>_form', class: 'tabular', remote: request.xhr?}) do |f| %>
4
4
  <%%= error_messages_for @<%= model_name_underscored %> %>
5
5
 
6
6
  <div class="box">
7
7
  <%%= render partial: 'form', locals: {<%= model_name_underscored %>: @<%= model_name_underscored %>} %>
8
8
  </div>
9
9
 
10
+ <%% if !request.xhr? %>
10
11
  <p>
11
12
  <%%= submit_tag l(:button_create), title: l(:button_create) %>
12
13
  </p>
14
+ <%% end %>
13
15
  <%% end %>
14
16
  <%% ### PAGE CUSTOMS ########################################################## %>
15
17
  <%% content_for :sidebar do %>
@@ -0,0 +1,17 @@
1
+ $("#ajax-modal").html("<%%= j render(:template => '<%= model_name_pluralize_underscored %>/new', :formats => [:html]) %>");
2
+ showModal('ajax-modal', '60%');
3
+ var submitButton = {
4
+ text:"<%=j l(:button_create) -%>",
5
+ title:"<%=j l(:button_create) -%>",
6
+ click: function() {$(this).find('form').submit()},
7
+ 'class': 'button-positive'
8
+ }
9
+ var closeButton = {
10
+ text: "<%=j l(:button_close) -%>",
11
+ title: "<%=j l(:button_close) -%>",
12
+ click: function() {$(this).dialog('close');},
13
+ 'class': 'button'
14
+ }
15
+ $("#ajax-modal").dialog('option', {
16
+ buttons: [closeButton, submitButton]
17
+ });
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.1.04'
2
+ VERSION = '0.1.05'
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.1.04
4
+ version: 0.1.05
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: 2016-06-27 00:00:00.000000000 Z
11
+ date: 2016-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -116,7 +116,9 @@ files:
116
116
  - app/presenters/easy_query_adapter_presenter.rb
117
117
  - app/presenters/redmine_extensions/base_presenter.rb
118
118
  - app/presenters/redmine_extensions/easy_setting_presenter.rb
119
+ - app/views/common/_closing_modal.html.erb
119
120
  - app/views/common/_collapsible_module_layout.html.erb
121
+ - app/views/common/close_modal.js.erb
120
122
  - app/views/easy_entity_assignments/_assignments_container.html.erb
121
123
  - app/views/easy_entity_assignments/_query_index.html.erb
122
124
  - app/views/easy_queries/_easy_query_tile.html.erb
@@ -137,6 +139,7 @@ files:
137
139
  - lib/generators/redmine_extensions/entity/templates/controller.rb.erb
138
140
  - lib/generators/redmine_extensions/entity/templates/custom_field.rb.erb
139
141
  - lib/generators/redmine_extensions/entity/templates/edit.html.erb.erb
142
+ - lib/generators/redmine_extensions/entity/templates/edit.js.erb.erb
140
143
  - lib/generators/redmine_extensions/entity/templates/en.yml.erb
141
144
  - lib/generators/redmine_extensions/entity/templates/helper.rb.erb
142
145
  - lib/generators/redmine_extensions/entity/templates/hooks.rb.erb
@@ -150,6 +153,7 @@ files:
150
153
  - lib/generators/redmine_extensions/entity/templates/migration.rb.erb
151
154
  - lib/generators/redmine_extensions/entity/templates/model.rb.erb
152
155
  - lib/generators/redmine_extensions/entity/templates/new.html.erb.erb
156
+ - lib/generators/redmine_extensions/entity/templates/new.js.erb.erb
153
157
  - lib/generators/redmine_extensions/entity/templates/query.rb.erb
154
158
  - lib/generators/redmine_extensions/entity/templates/routes.rb.erb
155
159
  - lib/generators/redmine_extensions/entity/templates/show.api.rsb.erb