redmine_extensions 0.0.36 → 0.0.37

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: d3f9a38656f8dd1905443c62f28a474d343a85d1
4
- data.tar.gz: 2d754bfeff6d1660ab67d7fced4de34c77d5bc60
3
+ metadata.gz: 1b7e8987102321dff2248fd2573be28b0c578fb4
4
+ data.tar.gz: 981153016e95e14037fde84cc6e3eff0a6207e0a
5
5
  SHA512:
6
- metadata.gz: 9f8a3463a6edc8cfefaf63e9093abe5e354cc2ad32177d74a9a0d340ed1f30be5ffc75964a4331c84d814601b039a77f7f656c2fea18c55c74584431cc2367d3
7
- data.tar.gz: ef3ee2923abc88eb42fd8427b8d8ad42ddff8457e954b8adffb817ce942a3d2163c48398004328dff9ad75c0eb8b0ab99b98cd64035dc1af9750c983c873fdbb
6
+ metadata.gz: d1806d41f9c0eeb29ea3a0fe34eb1aa50d2132b472e63f3349301fc9b9d63c66ba098fe299d9516726548468f4b335ffb9672f6dea6a74718246d71723dbfaf3
7
+ data.tar.gz: d92366f7fc7925c02ccfaf2a922a933cd1b4a8c4b512057febd4ad75e31182859dafdcd6d2c787ea3eb81e3da787659d12ffaf22967f2831cf4db3a0b4da1d14
@@ -389,7 +389,7 @@ window.closeFlashMessage = (function($element){
389
389
  select.append(option);
390
390
  });
391
391
  $container = $elem.closest('.easy-multiselect-tag-container');
392
- $container.children(':input').prop('disabled', true);
392
+ $container.find(':input').prop('disabled', true);
393
393
  $container.children().hide();
394
394
  $container.append(select);
395
395
  that.valueElement = select;
@@ -554,17 +554,20 @@ window.closeFlashMessage = (function($element){
554
554
 
555
555
  setValue: function(values) {
556
556
  var that = this;
557
- if( typeof values == 'undefined' || !values )
557
+ if( typeof values === 'undefined' || !values )
558
558
  return false;
559
559
 
560
- if( that.options.multiple ) {
561
- that.valueElement.entityArray('clear');
562
- }
563
560
  if( this.options.preload ) {
564
561
  this.load(function(){
565
- that._setValues(values)
562
+ if( that.options.multiple ) {
563
+ that.valueElement.entityArray('clear');
564
+ }
565
+ that._setValues(values);
566
566
  });
567
567
  } else {
568
+ if( that.options.multiple ) {
569
+ that.valueElement.entityArray('clear');
570
+ }
568
571
  that._setValues(values);
569
572
  }
570
573
  },
@@ -340,6 +340,8 @@ window.closeFlashMessage = (function($element){
340
340
  this._initData(this.options.source);
341
341
  } else if ( this.options.preload && this.options.load_immediately) {
342
342
  this.load();
343
+ } else if ( this.selectedValues ) {
344
+ this.setValue( this.selectedValues );
343
345
  }
344
346
  },
345
347
 
@@ -387,7 +389,7 @@ window.closeFlashMessage = (function($element){
387
389
  select.append(option);
388
390
  });
389
391
  $container = $elem.closest('.easy-multiselect-tag-container');
390
- $container.children(':input').prop('disabled', true);
392
+ $container.find(':input').prop('disabled', true);
391
393
  $container.children().hide();
392
394
  $container.append(select);
393
395
  that.valueElement = select;
@@ -494,7 +496,7 @@ window.closeFlashMessage = (function($element){
494
496
  },
495
497
 
496
498
  _initData: function(data) {
497
- this.possibleValues = this._formatData(data)
499
+ this.possibleValues = this._formatData(data);
498
500
  this.valuesLoaded = true;
499
501
 
500
502
  this.selectedValues = this.selectedValues ? this.selectedValues : [];
@@ -552,7 +554,7 @@ window.closeFlashMessage = (function($element){
552
554
 
553
555
  setValue: function(values) {
554
556
  var that = this;
555
- if( typeof values == 'undefined' || !values )
557
+ if( typeof values === 'undefined' || !values )
556
558
  return false;
557
559
 
558
560
  if( that.options.multiple ) {
@@ -560,9 +562,21 @@ window.closeFlashMessage = (function($element){
560
562
  }
561
563
  if( this.options.preload ) {
562
564
  this.load(function(){
565
+ <<<<<<< HEAD
563
566
  that._setValues(values)
564
567
  });
565
568
  } else {
569
+ =======
570
+ if( that.options.multiple ) {
571
+ that.valueElement.entityArray('clear');
572
+ }
573
+ that._setValues(values);
574
+ });
575
+ } else {
576
+ if( that.options.multiple ) {
577
+ that.valueElement.entityArray('clear');
578
+ }
579
+ >>>>>>> stable
566
580
  that._setValues(values);
567
581
  }
568
582
  },
@@ -599,21 +613,24 @@ window.closeFlashMessage = (function($element){
599
613
  }
600
614
  },
601
615
 
616
+ getValue: function(with_label) {
617
+ var result;
618
+ if ( this.options.multiple && !this.expanded ) {
602
619
  <<<<<<< HEAD
603
- getValue: function() {
604
- if( this.options.multiple && !this.expanded ) {
605
- return this.valueElement.entityArray('getValue'); // entityArray
620
+ result = this.valueElement.entityArray('getValue'); // entityArray
606
621
  } else if ( this.options.multiple ) {
607
- return this.valueElement.val(); //select multiple=true
622
+ result = this.valueElement.val(); // select multiple=true
608
623
  } else {
609
- return [this.valueElement.val()]; // hidden field
624
+ result = [this.valueElement.val()]; // hidden field
625
+ }
626
+ if( with_label ) {
627
+ result = this.possibleValues.filter(function(el) {
628
+ return result.indexOf( el.id ) >= 0;
629
+ });
610
630
  =======
611
- getValue: function(with_label) {
612
- var result;
613
- if ( this.options.multiple && !this.expanded ) {
614
631
  result = this.valueElement.entityArray('getValue'); // entityArray
615
632
  } else if ( this.options.multiple ) {
616
- return this.valueElement.val(); // select multiple=true
633
+ result = this.valueElement.val(); // select multiple=true
617
634
  } else {
618
635
  result = [this.valueElement.val()]; // hidden field
619
636
  }
@@ -621,8 +638,9 @@ window.closeFlashMessage = (function($element){
621
638
  result = this.possibleValues.filter(function(el) {
622
639
  return result.indexOf( el.id ) >= 0;
623
640
  });
624
- >>>>>>> 4a3284c... labels
641
+ >>>>>>> stable
625
642
  }
643
+ return result;
626
644
  }
627
645
 
628
646
  });
@@ -25,7 +25,7 @@ class EasySettingsController < ApplicationController
25
25
  Setting.send "plugin_#{@plugin.id}=", params[:settings] if params[:settings]
26
26
  if @easy_settings.save
27
27
  flash[:notice] = l(:notice_successful_update)
28
- redirect_back_or_default redmine_extensions_engine.edit_easy_setting_path(@easy_settings)
28
+ redirect_back_or_default edit_easy_setting_path(@easy_settings)
29
29
  else
30
30
  render :edit
31
31
  end
@@ -164,7 +164,7 @@ module RedmineExtensions
164
164
  end
165
165
 
166
166
  def autocomplete_field_tag(name, jsonpath_or_array, selected_values, options = {})
167
- options.reverse_merge!({select_first_value: false, show_toggle_button: false, load_immediately: false, preload: true})
167
+ options.reverse_merge!({select_first_value: false, show_toggle_button: false, load_immediately: false, preload: true, multiple: true})
168
168
  options[:id] ||= sanitize_to_id(name)
169
169
 
170
170
  selected_values ||= []
@@ -177,7 +177,7 @@ module RedmineExtensions
177
177
 
178
178
  content_tag(:span, :class => 'easy-multiselect-tag-container') do
179
179
  text_field_tag('', '', (options[:html_options] || {}).merge(id: options[:id])) +
180
- javascript_tag("$('##{options[:id]}').easymultiselect({multiple: true, rootElement: #{options[:rootElement].to_json}, inputName: '#{name}', preload: #{options[:preload]}, source: #{source}, selected: #{selected_values.to_json}, show_toggle_button: #{options[:show_toggle_button]}, select_first_value: #{options[:select_first_value]}, load_immediately: #{options[:load_immediately]}, autocomplete_options: #{(options[:jquery_auto_complete_options]||{}).to_json} });")
180
+ javascript_tag("$('##{options[:id]}').easymultiselect({multiple: #{options[:multiple]}, rootElement: #{options[:rootElement].to_json}, inputName: '#{name}', preload: #{options[:preload]}, source: #{source}, selected: #{selected_values.to_json}, show_toggle_button: #{options[:show_toggle_button]}, select_first_value: #{options[:select_first_value]}, load_immediately: #{options[:load_immediately]}, autocomplete_options: #{(options[:jquery_auto_complete_options]||{}).to_json} });")
181
181
  end
182
182
  end
183
183
 
@@ -1,5 +1,5 @@
1
1
  <% if display_style == :list %>
2
- <%= render :partial => 'easy_queries/easy_query_entities_list', :locals => {:query => query, :entities => referenced_entities, :options => {:hascontextmenu => true, :disable_sort => true} } -%>
2
+ <%= render :partial => 'easy_queries/easy_query_entities_list', :locals => {:query => query, :entities => entities, :options => {:hascontextmenu => true, :disable_sort => true} } -%>
3
3
  <% elsif display_style == :tile %>
4
4
  <div class="easy-entity-cards-container">
5
5
  <div class="splitcontent">
@@ -0,0 +1,16 @@
1
+ <<<<<<< HEAD
2
+ <% query_outputs(query, entities: referenced_entities, options: { hascontextmenu: true, disable_sort: true }).each do |output| %>
3
+ <%= output.render_data %>
4
+ =======
5
+ <% if display_style == :list %>
6
+ <%= render :partial => 'easy_queries/easy_query_entities_list', :locals => {:query => query, :entities => entities, :options => {:hascontextmenu => true, :disable_sort => true} } -%>
7
+ <% elsif display_style == :tile %>
8
+ <div class="easy-entity-cards-container">
9
+ <div class="splitcontent">
10
+ <% entities.each do |referenced_entity| %>
11
+ <%# render_easy_entity_card(referenced_entity, entity, options.merge(:referenced_entities => referenced_entities)) %>
12
+ <% end %>
13
+ </div>
14
+ </div>
15
+ >>>>>>> stable
16
+ <% end %>
@@ -1,4 +1,4 @@
1
- <%= form_for([redmine_extensions_engine, @easy_settings], html: { class: 'form-box easy-setting-plugin-form' }) do |f| %>
1
+ <%= form_for(@easy_settings, html: { class: 'form-box easy-setting-plugin-form' }) do |f| %>
2
2
  <%= hidden_field_tag :back_url, params[:back_url] %>
3
3
 
4
4
  <%= render "easy_settings/#{@easy_settings.plugin.id}", easy_settings: @easy_settings, settings: @settings, form: f %>
data/config/routes.rb CHANGED
@@ -1,7 +1,11 @@
1
+ # Engine routes
1
2
  RedmineExtensions::Engine.routes.draw do
2
-
3
3
  resources :easy_settings, except: :destroy
4
-
5
4
  end
6
5
 
7
- RedmineExtensions::Engine.automount!
6
+ # Redmine routes
7
+ Rails.application.routes.draw do
8
+ mount RedmineExtensions::Engine => '/redmine_extensions'
9
+
10
+ resources :easy_settings, except: :destroy
11
+ end
@@ -4,15 +4,6 @@ require 'redmine_extensions/redmine_patches/patches'
4
4
  module RedmineExtensions
5
5
  class Engine < ::Rails::Engine
6
6
 
7
- def self.automount!(path = nil)
8
- engine = self
9
- path ||= engine.to_s.underscore.split('/').first
10
- Rails.application.routes.draw do
11
- mount engine => path
12
- resources :easy_settings, only: [:edit]
13
- end
14
- end
15
-
16
7
  config.generators do |g|
17
8
  g.test_framework :rspec, :fixture => false
18
9
  g.fixture_replacement :factory_girl, :dir => 'spec/factories'
@@ -1,3 +1,3 @@
1
1
  module RedmineExtensions
2
- VERSION = '0.0.36'
2
+ VERSION = '0.0.37'
3
3
  end
@@ -0,0 +1,7 @@
1
+ module RedmineExtensions
2
+ <<<<<<< HEAD
3
+ VERSION = '0.1.09'
4
+ =======
5
+ VERSION = '0.0.36'
6
+ >>>>>>> stable
7
+ 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.0.36
4
+ version: 0.0.37
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-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -119,6 +119,7 @@ files:
119
119
  - app/presenters/redmine_extensions/easy_setting_presenter.rb
120
120
  - app/views/easy_entity_assignments/_assignments_container.html.erb
121
121
  - app/views/easy_entity_assignments/_query_index.html.erb
122
+ - app/views/easy_entity_assignments/_query_index.html.erb.orig
122
123
  - app/views/easy_queries/_entities.html.erb
123
124
  - app/views/easy_queries/_index.html.erb
124
125
  - app/views/easy_queries/_settings.html.erb
@@ -193,6 +194,7 @@ files:
193
194
  - lib/redmine_extensions/redmine_patches/controllers/issues_controller_patch.rb
194
195
  - lib/redmine_extensions/redmine_patches/patches.rb
195
196
  - lib/redmine_extensions/version.rb
197
+ - lib/redmine_extensions/version.rb.orig
196
198
  - lib/tasks/redmine_extensions_tasks.rake
197
199
  - spec/factories/easy_queries.rb
198
200
  - spec/factories/easy_settings.rb