redmine_extensions 0.0.37 → 0.0.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/redmine_extensions/redmine_extensions.js +1 -1
- data/lib/generators/redmine_extensions/entity/templates/_sidebar.html.erb.erb +8 -8
- data/lib/generators/redmine_extensions/entity/templates/context_menu.html.erb.erb +7 -7
- data/lib/generators/redmine_extensions/entity/templates/custom_field.rb.erb +7 -7
- data/lib/generators/redmine_extensions/entity/templates/index.api.rsb.erb +5 -5
- data/lib/generators/redmine_extensions/entity/templates/index.html.erb.erb +4 -4
- data/lib/generators/redmine_extensions/entity/templates/mail_added.html.erb.erb +1 -1
- data/lib/generators/redmine_extensions/entity/templates/mail_added.text.erb.erb +2 -2
- data/lib/generators/redmine_extensions/entity/templates/mail_updated.text.erb.erb +2 -2
- data/lib/generators/redmine_extensions/entity/templates/migration.rb.erb +9 -9
- data/lib/generators/redmine_extensions/entity/templates/routes.rb.erb +12 -12
- data/lib/generators/redmine_extensions/entity/templates/show.html.erb.erb +37 -37
- data/lib/redmine_extensions/version.rb +1 -1
- data/spec/redmine/bin/about +0 -0
- data/spec/redmine/bin/bundle +0 -0
- data/spec/redmine/bin/rails +0 -0
- data/spec/redmine/bin/rake +0 -0
- data/spec/redmine/extra/svn/reposman.rb +0 -0
- data/spec/redmine/public/dispatch.fcgi.example +0 -0
- data/spec/redmine/script/about +0 -0
- data/spec/redmine/script/rails +0 -0
- metadata +1900 -1908
- data/app/assets/javascripts/redmine_extensions/redmine_extensions.js.orig +0 -648
- data/app/helpers/redmine_extensions/application_helper.rb.orig +0 -189
- data/app/views/easy_entity_assignments/_query_index.html.erb.orig +0 -16
- data/config/database.yml +0 -15
- data/lib/redmine_extensions/redmine_patches/controllers/issues_controller_patch.rb +0 -9
- data/lib/redmine_extensions/version.rb.orig +0 -7
- data/spec/support/easy_queries_helpers.rb +0 -0
@@ -1,189 +0,0 @@
|
|
1
|
-
module RedmineExtensions
|
2
|
-
module ApplicationHelper
|
3
|
-
include RenderingHelper
|
4
|
-
|
5
|
-
# -------= Hack methods =------
|
6
|
-
|
7
|
-
def plugin_settings_path(plugin, *attrs)
|
8
|
-
if plugin.is_a?(Redmine::Plugin) && (plugin.settings[:only_easy] || plugin.settings[:easy_settings])
|
9
|
-
edit_easy_setting_path(plugin, *attrs)
|
10
|
-
else
|
11
|
-
super
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
# -------= Rendering and presenting methods =-------
|
16
|
-
|
17
|
-
def present(model, options={}, &block)
|
18
|
-
if model.is_a?(RedmineExtensions::BasePresenter)
|
19
|
-
presenter = model.update_options(options.merge(view_context: self))
|
20
|
-
else
|
21
|
-
presenter = RedmineExtensions::BasePresenter.present(model, self, options)
|
22
|
-
end
|
23
|
-
if block_given?
|
24
|
-
yield presenter
|
25
|
-
else
|
26
|
-
presenter
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
# --- COMMON RENDERING ----
|
31
|
-
|
32
|
-
# hide elements for issues and users
|
33
|
-
def detect_hide_elements(uniq_id, user = nil, default = true)
|
34
|
-
return ''.html_safe if uniq_id.blank?
|
35
|
-
return 'style="display:none"'.html_safe if !toggle_button_expanded?(uniq_id, user, default)
|
36
|
-
end
|
37
|
-
|
38
|
-
def url_to_entity(entity, options={})
|
39
|
-
m = "url_to_#{entity.class.name.underscore}".to_sym
|
40
|
-
if respond_to?(m)
|
41
|
-
send(m, entity, options)
|
42
|
-
else
|
43
|
-
nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def render_entity_assignments(entity, target_class, options = {}, &block)
|
48
|
-
options ||= {}
|
49
|
-
collection_name = options.delete(:collection_name) || target_class.name.pluralize.underscore
|
50
|
-
|
51
|
-
project = options.delete(:project)
|
52
|
-
query_class = options.delete(:query_class)
|
53
|
-
|
54
|
-
if query_class.nil?
|
55
|
-
query_class_name = target_class.name + 'Query'
|
56
|
-
|
57
|
-
query_class = query_class_name.constantize #if Object.const_defined?(query_class_name)
|
58
|
-
end
|
59
|
-
|
60
|
-
return '' if !query_class || !(query_class < EasyQuery) || !entity.respond_to?(collection_name)
|
61
|
-
|
62
|
-
query = query_class.new(:name => 'c_query')
|
63
|
-
query.project = project
|
64
|
-
query.set_entity_scope(entity, collection_name)
|
65
|
-
query.column_names = options[:query_column_names] unless options[:query_column_names].blank?
|
66
|
-
|
67
|
-
entities = query.entities
|
68
|
-
|
69
|
-
entities_count = entities.size
|
70
|
-
options[:entities_count] = entities_count
|
71
|
-
|
72
|
-
options[:module_name] ||= "entity_#{entity.class.name.underscore}_#{entity.id}_#{collection_name}"
|
73
|
-
options[:heading] ||= l("label_#{target_class.name.underscore}_plural", :default => 'Heading')
|
74
|
-
|
75
|
-
if options[:context_menus_path].nil?
|
76
|
-
options[:context_menus_path] = [
|
77
|
-
"context_menu_#{collection_name}_path".to_sym,
|
78
|
-
"context_menus_#{collection_name}_path".to_sym,
|
79
|
-
"#{collection_name}_context_menu_path".to_sym
|
80
|
-
].detect do |m|
|
81
|
-
m if respond_to?(m)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
render(:partial => 'easy_entity_assignments/assignments_container', :locals => {
|
86
|
-
:entity => entity,
|
87
|
-
:query => query, :target_class => target_class, :project => project,
|
88
|
-
:entities => entities, :entities_count => entities_count, :options => options})
|
89
|
-
end
|
90
|
-
|
91
|
-
def entity_css_icon(entity_or_entity_class)
|
92
|
-
return '' if entity_or_entity_class.nil?
|
93
|
-
|
94
|
-
if entity_or_entity_class.is_a?(Class) && entity_or_entity_class.respond_to?(:css_icon)
|
95
|
-
entity_or_entity_class.css_icon
|
96
|
-
elsif entity_or_entity_class.is_a?(ActiveRecord::Base)
|
97
|
-
if entity_or_entity_class.respond_to?(:css_icon)
|
98
|
-
entity_or_entity_class.css_icon
|
99
|
-
elsif entity_or_entity_class.class.respond_to?(:css_icon)
|
100
|
-
entity_or_entity_class.class.css_icon
|
101
|
-
else
|
102
|
-
"icon icon-#{entity_or_entity_class.class.name.dasherize}"
|
103
|
-
end
|
104
|
-
else
|
105
|
-
"icon icon-#{entity_or_entity_class.class.name.dasherize}"
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
# options:
|
110
|
-
# => options[:heading] = text beside of plus button
|
111
|
-
# => options[:container_html] = a hash of html attributes
|
112
|
-
# => options[:default_button_state] = (true => expanded -), (false => collapsed +)
|
113
|
-
# => options[:ajax_call] = make ajax call for saving state (true => ajax call, false => no call, no save)
|
114
|
-
# => options[:wrapping_heading_element] = html element outside heading => h3, h4
|
115
|
-
def render_toggler(container_uniq_id, user = nil, options={}, &block)
|
116
|
-
user ||= User.current
|
117
|
-
options[:heading] ||= ''
|
118
|
-
options[:heading_links] ||= []
|
119
|
-
options[:heading_links] = [options[:heading_links]] if options[:heading_links] && !options[:heading_links].is_a?(Array)
|
120
|
-
options[:container_html] ||= {}
|
121
|
-
options[:default_button_state] = false #if is_mobile_device?
|
122
|
-
options[:default_button_state] = true if options[:default_button_state].nil?
|
123
|
-
options[:ajax_call] = true if options[:ajax_call].nil?
|
124
|
-
|
125
|
-
s = ''
|
126
|
-
if !options.key?(:no_heading_button)
|
127
|
-
options[:heading] << content_tag(:div, options[:heading_links].join(' ').html_safe, :class => 'module-heading-links') unless options[:heading_links].blank?
|
128
|
-
s << render_toggler_header(user, options[:heading].html_safe, container_uniq_id, options)
|
129
|
-
end
|
130
|
-
|
131
|
-
if options[:ajax_call] == false
|
132
|
-
expanded = options[:default_button_state]
|
133
|
-
else
|
134
|
-
expanded = true
|
135
|
-
end
|
136
|
-
|
137
|
-
s << (content_tag(:div, {
|
138
|
-
:id => container_uniq_id,
|
139
|
-
:style => (expanded ? '' : 'display:none')
|
140
|
-
}.merge(options[:container_html]) { |k, o, n| "#{o}; #{n}" }, &block))
|
141
|
-
s.html_safe
|
142
|
-
end
|
143
|
-
|
144
|
-
def render_toggler_header(user, content, modul_uniq_id, options={})
|
145
|
-
expander_options = options[:expander_options] || {}
|
146
|
-
wrapping_heading_element = options[:wrapping_heading_element] || 'h3'
|
147
|
-
wrapping_heading_element_classes = (options[:wrapping_heading_element_classes] || '') + ' module-heading'
|
148
|
-
wrapping_heading_element_styles = options[:wrapping_heading_element_styles]
|
149
|
-
ajax_call = options.delete(:ajax_call) ? 'true' : 'false'
|
150
|
-
|
151
|
-
html = ''
|
152
|
-
|
153
|
-
if options[:no_expander]
|
154
|
-
html << content_tag(wrapping_heading_element, content, :class => wrapping_heading_element_classes, :style => wrapping_heading_element_styles)
|
155
|
-
else
|
156
|
-
html << '<div class="module-toggle-button">'
|
157
|
-
html << "<div class='group open' >"
|
158
|
-
html << content_tag(wrapping_heading_element, content, :class => wrapping_heading_element_classes, :style => wrapping_heading_element_styles, :onclick => "var event = arguments[0] || window.event; if( !$(event.target).hasClass('do_not_toggle') && !$(event.target).parent().hasClass('module-heading-links') ) toggleMyPageModule(this,'#{modul_uniq_id}','#{user.id}', #{ajax_call})")
|
159
|
-
html << "<span class='expander #{expander_options[:class]}' onclick=\"toggleMyPageModule($(this),'#{modul_uniq_id}','#{user.id}', #{ajax_call}); return false;\" id=\"expander_#{modul_uniq_id}\"> </span>"
|
160
|
-
html << '</div></div>'
|
161
|
-
end
|
162
|
-
|
163
|
-
html.html_safe
|
164
|
-
end
|
165
|
-
|
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})
|
168
|
-
options[:id] ||= sanitize_to_id(name)
|
169
|
-
|
170
|
-
selected_values ||= []
|
171
|
-
|
172
|
-
if jsonpath_or_array.is_a?(Array)
|
173
|
-
source = jsonpath_or_array.to_json
|
174
|
-
else
|
175
|
-
source = "'#{jsonpath_or_array}'"
|
176
|
-
end
|
177
|
-
|
178
|
-
content_tag(:span, :class => 'easy-multiselect-tag-container') do
|
179
|
-
text_field_tag('', '', (options[:html_options] || {}).merge(id: options[:id])) +
|
180
|
-
<<<<<<< HEAD
|
181
|
-
javascript_tag("$('##{options[:id]}').easymultiselect({multiple: true, rootElement: #{options[:rootElement].to_json}, inputName: '#{name}', preload: true, 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} });")
|
182
|
-
=======
|
183
|
-
javascript_tag("$('##{options[:id]}').easymultiselect({multiple: true, rootElement: #{options[:rootElement]}, 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} });")
|
184
|
-
>>>>>>> 4a3284c... labels
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
end
|
189
|
-
end
|
@@ -1,16 +0,0 @@
|
|
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 %>
|
data/config/database.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
test:
|
3
|
-
adapter:
|
4
|
-
database: test_redmine_8e3d204de2b24cab
|
5
|
-
host: 127.0.0.1
|
6
|
-
username:
|
7
|
-
password:
|
8
|
-
encoding: utf8
|
9
|
-
development:
|
10
|
-
adapter:
|
11
|
-
database: redmine_8e3d204de2b24cab
|
12
|
-
host: 127.0.0.1
|
13
|
-
username:
|
14
|
-
password:
|
15
|
-
encoding: utf8
|
File without changes
|