redmine_extensions 0.2.3 → 0.2.4

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
  SHA1:
3
- metadata.gz: 5bf428f184580b1d84aa970ae3db9319a468c808
4
- data.tar.gz: bd001b0f6ac3a274b77734c7a4e7fa476bdb6840
3
+ metadata.gz: eee22e1f0eeb964e748a80f0610126541f431768
4
+ data.tar.gz: 6d824882250e9379351fae51a6fb68ea4d62924c
5
5
  SHA512:
6
- metadata.gz: 23d1c6ae87326b37fc1c21ce99cc63af709c8c3d568a6f29889e46a17db33ea3d2836b3fd8aad754d65c0c4ad809eaf8ec82c1e8869afae9fc3e31dc9cb95195
7
- data.tar.gz: 30214f00044665230086c685d6217e0b1d57bfe9230e08da2fc2fe62a2f11c39af181b7bdcb9f69c8f26e0b5588acdf99e0f0525ace2ee947c328ed965ca2753
6
+ metadata.gz: fc4adc022915545c8432e4867827169ba72e0d0af19eac89c2e0961fdd7843b461c241b6139791a91c3bb24e8280a9cb2109fee45219b794509f490b677b9db4
7
+ data.tar.gz: 938ab6557a3b51aee80e345aaad6c37237bb1cae9b725280763e4f2ca38e6fc72ab85e1db651a40ee1e2bd7fb79ec70fc91fae49cd5132af54d49c73a35db9c9
@@ -124,6 +124,25 @@ module RedmineExtensions
124
124
  end
125
125
 
126
126
 
127
+ def easy_avatar_url(user = nil)
128
+ user ||= User.current
129
+ result = if Setting.gravatar_enabled?
130
+ options = {:ssl => (request && request.ssl?), :default => Setting.gravatar_default}
131
+ email = nil
132
+ if user.respond_to?(:mail)
133
+ email = user.mail
134
+ elsif user.to_s =~ %r{<(.+?)>}
135
+ email = $1
136
+ end
137
+ email ? gravatar_url(email, options) : ''
138
+ elsif user.easy_avatar_url.present?
139
+ user.easy_avatar_url
140
+ elsif user.respond_to?(:easy_avatar) && (av = user.easy_avatar).present? && (img_url = av.image.url(:small))
141
+ get_easy_absolute_uri_for(img_url).to_s
142
+ end
143
+ result
144
+ end
145
+
127
146
  # ==== Options
128
147
  # * <tt>class: Hash or String</tt> - This option can be used to add custom CSS classes. It can be *String* or *Hash*.
129
148
  # class: {heading: 'heading-additional-css', container: 'container-additional-css'}
@@ -172,7 +172,7 @@ class EasySetting < ActiveRecord::Base
172
172
  EasySetting.where(name: key, project_id: project_id).limit(1).pluck(:value).first
173
173
  end
174
174
 
175
- if use_fallback && result.blank?
175
+ if use_fallback && result.nil?
176
176
  result = Rails.cache.fetch(fallback_cache_key) do
177
177
  EasySetting.where(name: key, project_id: nil).limit(1).pluck(:value).first
178
178
  end
@@ -0,0 +1,92 @@
1
+ <% content_for :header_tags do %>
2
+ <%=
3
+ if params['combine_by_pipeline'].nil?
4
+ if Rails.env.development? && ENV['DART'] == '1'
5
+ javascript_include_tag('dart/localhost', plugin: plugin)
6
+ else
7
+ javascript_include_tag("#{plugin}.dart", defer: true)
8
+ end
9
+ else
10
+ if params['combine_by_pipeline'] == 'false'
11
+ #javascript_include_tag('dart/debug', plugin: plugin, defer: true)
12
+ if ENV['DART'] == '1'
13
+ javascript_include_tag('dart/localhost', plugin: plugin)
14
+ end
15
+ else
16
+ javascript_include_tag("#{plugin}.dart", defer: true)
17
+ end
18
+ end
19
+ %>
20
+
21
+ <%
22
+ standard_lang_files = [
23
+ :notice_successful_create,
24
+ :notice_successful_update,
25
+ :notice_successful_delete,
26
+ :error_default_server_error,
27
+ :notice_not_implemented,
28
+ :notice_service_unavailable,
29
+ :notice_not_authorized,
30
+ :notice_not_acceptable,
31
+ :label_updated_on,
32
+
33
+ :field_created_on,
34
+ :field_updated_on,
35
+ :field_tracker,
36
+ :field_description,
37
+ :field_assigned_to,
38
+ :field_status,
39
+ :field_fixed_version,
40
+ :field_done_ratio,
41
+ :field_start_date,
42
+ :field_due_date,
43
+ :field_estimated_hours,
44
+ :field_homepage,
45
+ :field_author,
46
+ :field_spent_hours,
47
+ :field_priority,
48
+ :field_activity,
49
+ :field_category,
50
+
51
+ :button_save,
52
+ :button_delete,
53
+ :button_submit,
54
+ :label_expand_editor,
55
+ :label_collapse_editor,
56
+ :text_are_you_sure,
57
+ :general_text_Yes,
58
+ :general_text_No,
59
+ :button_cancel,
60
+ :button_print,
61
+ :button_edit,
62
+ :button_close,
63
+ :label_favorite,
64
+ :label_unfavorite,
65
+ :button_fullscreen,
66
+ :label_no_entity_selected,
67
+ :date
68
+ ]
69
+
70
+ user = User.current
71
+
72
+ front_end_commons = {
73
+ global_settings: {
74
+ locale: I18n.locale,
75
+ date_format: Setting.date_format,
76
+ html5_dates: EasySetting.value('html5_dates'),
77
+ ckeditor_toolbar_config: EasySetting.value('ckeditor_toolbar_config') || 'Basic',
78
+ show_issue_id: EasySetting.value('show_issue_id')
79
+ },
80
+ user: {
81
+ id: User.current.id,
82
+ name: User.current.name,
83
+ avatar_url: easy_avatar_url(user)
84
+ },
85
+ standard_lang_files: Hash[*standard_lang_files.collect { |v| [v, l(v)] }.flatten]
86
+ }
87
+
88
+ %>
89
+ <script>
90
+ window.frontEndCommons = "<%= escape_javascript(front_end_commons.to_json.html_safe) %>";
91
+ </script>
92
+ <% end %>
@@ -0,0 +1,37 @@
1
+ <script>
2
+ function interopAdapterForLookupCustomFieldDialog(url, closeButtonLabel, submitButtonLabel, fieldId, selectedValues, onClose) {
3
+ $.post(url, {'selected_values': selectedValues}, function (data) {
4
+ var ajaxModal = $("#ajax-modal");
5
+ if ($('#easy_modal').length === 0) {
6
+ ajaxModal.parent().append($("<div/>").attr({id: "easy_modal"}).hide());
7
+ }
8
+ var modal = $('#easy_modal');
9
+ modal.html(data);
10
+
11
+ EASY.modalSelector.showEasyModal(function () {
12
+ return [url + '&' + $('#modal_selector_query_form, .modal-selected-values form').serialize() + '&page=', ''];
13
+ });
14
+
15
+ var btns = [];
16
+
17
+ btns.push({
18
+ text: closeButtonLabel,
19
+ click: function () {
20
+ $(this).dialog('close');
21
+ },
22
+ 'class': 'button'
23
+ });
24
+
25
+ btns.push({
26
+ text: submitButtonLabel,
27
+ click: function () {
28
+ EASY.modalSelector.saveAndCloseModal(fieldId);
29
+ onClose();
30
+ },
31
+ 'class': 'button-positive'
32
+ });
33
+
34
+ modal.dialog({title: $("#" + fieldId + "_lookup_trigger_container").prev("label").text(), buttons: btns});
35
+ });
36
+ }
37
+ </script>
@@ -1,7 +1,7 @@
1
- class <%= model_name %>CustomField < CustomField
2
-
3
- def type_name
4
- :label_<%= @model_name_pluralize_underscored %>
5
- end
6
-
7
- end
1
+ class <%= model_name %>CustomField < CustomField
2
+
3
+ def type_name
4
+ :label_<%= @model_name_pluralize_underscored %>
5
+ end
6
+
7
+ end
@@ -1,5 +1,5 @@
1
- api.array :<%= model_name_pluralize_underscored %>, api_meta(total_count: @entity_count, offset: @offset, limit: @limit) do
2
- @entities.each do |<%= model_name_underscored %>|
3
- render_api_<%= model_name_underscored %>(api, <%= model_name_underscored %>)
4
- end
5
- end
1
+ api.array :<%= model_name_pluralize_underscored %>, api_meta(total_count: @entity_count, offset: @offset, limit: @limit) do
2
+ @entities.each do |<%= model_name_underscored %>|
3
+ render_api_<%= model_name_underscored %>(api, <%= model_name_underscored %>)
4
+ end
5
+ end
@@ -1 +1 @@
1
- <h1><%%= link_to(@<%= model_name_underscored %>.to_s, @<%= model_name_underscored %>_url) %></h1>
1
+ <h1><%%= link_to(@<%= model_name_underscored %>.to_s, @<%= model_name_underscored %>_url) %></h1>
@@ -1,2 +1,2 @@
1
- <%%= @<%= model_name_underscored %>.to_s %>
2
- <%%= @<%= model_name_underscored %>_url %>
1
+ <%%= @<%= model_name_underscored %>.to_s %>
2
+ <%%= @<%= model_name_underscored %>_url %>
@@ -1,2 +1,2 @@
1
- <%%= @<%= model_name_underscored %>.to_s %>
2
- <%%= @<%= model_name_underscored %>_url %>
1
+ <%%= @<%= model_name_underscored %>.to_s %>
2
+ <%%= @<%= model_name_underscored %>_url %>
@@ -1,13 +1,13 @@
1
- <% if project? %>
2
- resources :projects do
3
- resources :<%= model_name_pluralize_underscored %>
4
- end
5
- <% end %>
6
- resources :<%= model_name_pluralize_underscored %> do
7
- collection do
8
- get 'autocomplete'
9
- get 'bulk_edit'
10
- post 'bulk_update'
11
- get 'context_menu'
12
- end
1
+ <% if project? %>
2
+ resources :projects do
3
+ resources :<%= model_name_pluralize_underscored %>
4
+ end
5
+ <% end %>
6
+ resources :<%= model_name_pluralize_underscored %> do
7
+ collection do
8
+ get 'autocomplete'
9
+ get 'bulk_edit'
10
+ post 'bulk_update'
11
+ get 'context_menu'
12
+ end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
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.2.3
4
+ version: 0.2.4
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: 2017-08-30 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -167,6 +167,8 @@ files:
167
167
  - app/views/common/close_modal.js.erb
168
168
  - app/views/easy_entity_assignments/_assignments_container.html.erb
169
169
  - app/views/easy_entity_assignments/_query_index.html.erb
170
+ - app/views/easy_front_end/_easy_front_end.html.erb
171
+ - app/views/easy_front_end/_interop_lookup_cf.erb
170
172
  - app/views/easy_queries/_easy_query_list.html.erb
171
173
  - app/views/easy_queries/_easy_query_tiles.html.erb
172
174
  - app/views/easy_queries/_entities.html.erb
@@ -293,22 +295,22 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
295
  version: '0'
294
296
  requirements: []
295
297
  rubyforge_project:
296
- rubygems_version: 2.5.2
298
+ rubygems_version: 2.6.7
297
299
  signing_key:
298
300
  specification_version: 4
299
301
  summary: Redmine Extensions is set of usefull features for Redmine. Main focus is
300
302
  on development helpers, but many users can find it helpfull
301
303
  test_files:
302
- - spec/rails_helper.rb
303
- - spec/factories/time_entries.rb
304
+ - spec/factories/easy_queries.rb
304
305
  - spec/factories/easy_settings.rb
305
306
  - spec/factories/issues.rb
306
307
  - spec/factories/projects.rb
308
+ - spec/factories/time_entries.rb
307
309
  - spec/factories/trackers.rb
308
- - spec/factories/easy_queries.rb
309
310
  - spec/factories/users.rb
311
+ - spec/features/autocomplete_spec.rb
312
+ - spec/models/easy_setting_spec.rb
310
313
  - spec/presenters/redmine_extensions/easy_setting_presenter_spec.rb
311
- - spec/support/plugin_generator.rb
314
+ - spec/rails_helper.rb
312
315
  - spec/spec_helper.rb
313
- - spec/models/easy_setting_spec.rb
314
- - spec/features/autocomplete_spec.rb
316
+ - spec/support/plugin_generator.rb