redmine_extensions 0.1.10 → 0.1.11
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 +9 -6
- data/app/assets/javascripts/redmine_extensions/redmine_extensions.js.orig +648 -0
- data/app/controllers/easy_settings_controller.rb +1 -1
- data/app/helpers/redmine_extensions/application_helper.rb +2 -2
- data/app/helpers/redmine_extensions/application_helper.rb.orig +189 -0
- data/app/views/common/_closing_modal.html.erb +2 -2
- data/app/views/common/_collapsible_module_layout.html.erb +1 -1
- data/app/views/common/close_modal.js.erb +4 -4
- data/app/views/easy_entity_assignments/_query_index.html.erb.orig +16 -0
- data/app/views/easy_settings/edit.html.erb +1 -1
- data/config/database.yml +15 -0
- data/config/routes.rb +7 -3
- 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/edit.html.erb.erb +18 -18
- data/lib/generators/redmine_extensions/entity/templates/edit.js.erb.erb +16 -16
- 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/index.js.erb.erb +10 -10
- 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/new.html.erb.erb +18 -18
- data/lib/generators/redmine_extensions/entity/templates/new.js.erb.erb +16 -16
- 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/generators/redmine_extensions/entity/templates/show.js.erb.erb +10 -10
- data/lib/redmine_extensions/engine.rb +0 -9
- data/lib/redmine_extensions/redmine_patches/controllers/issues_controller_patch.rb +9 -0
- data/lib/redmine_extensions/version.rb +1 -1
- data/lib/redmine_extensions/version.rb.orig +7 -0
- 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
- data/spec/support/easy_queries_helpers.rb +0 -0
- metadata +1933 -1925
@@ -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
|
28
|
+
redirect_back_or_default edit_easy_setting_path(@easy_settings)
|
29
29
|
else
|
30
30
|
render :edit
|
31
31
|
end
|
@@ -207,7 +207,7 @@ module RedmineExtensions
|
|
207
207
|
|
208
208
|
|
209
209
|
def autocomplete_field_tag(name, jsonpath_or_array, selected_values, options = {})
|
210
|
-
options.reverse_merge!({select_first_value: false, show_toggle_button: false, load_immediately: false, preload: true})
|
210
|
+
options.reverse_merge!({select_first_value: false, show_toggle_button: false, load_immediately: false, preload: true, multiple: true})
|
211
211
|
options[:id] ||= sanitize_to_id(name)
|
212
212
|
|
213
213
|
selected_values ||= []
|
@@ -220,7 +220,7 @@ module RedmineExtensions
|
|
220
220
|
|
221
221
|
content_tag(:span, :class => 'easy-multiselect-tag-container') do
|
222
222
|
text_field_tag('', '', (options[:html_options] || {}).merge(id: options[:id])) +
|
223
|
-
javascript_tag("$('##{options[:id]}').easymultiselect({multiple:
|
223
|
+
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} });")
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
@@ -0,0 +1,189 @@
|
|
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,3 +1,3 @@
|
|
1
|
-
<p>
|
2
|
-
<%= l(:text_modal_is_closing) %>
|
1
|
+
<p>
|
2
|
+
<%= l(:text_modal_is_closing) %>
|
3
3
|
</p>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= content_tag(:div, class: 'module-heading ' + renderer.heading_class, onclick: (renderer.collapsible? && 'EasyToggler.toggle(this.nextElementSibling, event)' || nil)) do %>
|
3
3
|
<%= content_tag(:span, ' ', class: 'expander module-toggler') if renderer.collapsible? %>
|
4
4
|
<%= content_tag(renderer.heading_tag, renderer.heading, class: renderer.icon) %>
|
5
|
-
<%= content_tag(:span, renderer.heading_links, class: 'module-heading-links') if renderer.heading_links %>
|
5
|
+
<%= content_tag(:span, renderer.heading_links, class: 'module-heading-links') if renderer.heading_links.presence %>
|
6
6
|
<% end if renderer.heading.present? %>
|
7
7
|
<div class="module-content" id="<%= renderer.id %>"<%=raw renderer.collapsed? && %q{ style="display:none"} || nil %>>
|
8
8
|
<%= content -%>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
$("#ajax-modal").html("<%= j render(:partial => 'common/closing_modal', :formats => [:html]) %>");
|
2
|
-
$("#ajax-modal").dialog('option', {
|
3
|
-
buttons: []
|
4
|
-
});
|
1
|
+
$("#ajax-modal").html("<%= j render(:partial => 'common/closing_modal', :formats => [:html]) %>");
|
2
|
+
$("#ajax-modal").dialog('option', {
|
3
|
+
buttons: []
|
4
|
+
});
|
5
5
|
window.location = "<%= j params[:back_url] %>";
|
@@ -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(
|
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/database.yml
ADDED
@@ -0,0 +1,15 @@
|
|
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
|
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
|
-
|
6
|
+
# Redmine routes
|
7
|
+
Rails.application.routes.draw do
|
8
|
+
mount RedmineExtensions::Engine => '/redmine_extensions'
|
9
|
+
|
10
|
+
resources :easy_settings, except: :destroy
|
11
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<ul>
|
2
|
-
<%% if @<%= model_name_underscored %> && !@<%= model_name_underscored %>.new_record? %>
|
3
|
-
<li><%%= link_to l(:button_edit), edit_polymorphic_path([@project, @<%= model_name_underscored %>]), title: l(:button_edit), class: 'icon icon-edit' %></li>
|
4
|
-
<%% end %>
|
5
|
-
<%% if @<%= model_name_underscored %>.nil? %>
|
6
|
-
<li><%%= link_to l(:button_<%= model_name_underscored %>_new), new_polymorphic_path([@project, :<%= model_name_underscored %>]), title: l(:title_<%= model_name_underscored %>_new), class: 'icon icon-add button button-positive' %></li>
|
7
|
-
<%% end %>
|
8
|
-
<li><%%= link_to l(:label_<%= model_name_pluralize_underscored %>), polymorphic_path([@project, :<%= model_name_pluralize_underscored %>], set_filter: '1'), title: l(:label_<%= model_name_pluralize_underscored %>), class: 'icon icon-folder button' %></li>
|
1
|
+
<ul>
|
2
|
+
<%% if @<%= model_name_underscored %> && !@<%= model_name_underscored %>.new_record? %>
|
3
|
+
<li><%%= link_to l(:button_edit), edit_polymorphic_path([@project, @<%= model_name_underscored %>]), title: l(:button_edit), class: 'icon icon-edit' %></li>
|
4
|
+
<%% end %>
|
5
|
+
<%% if @<%= model_name_underscored %>.nil? %>
|
6
|
+
<li><%%= link_to l(:button_<%= model_name_underscored %>_new), new_polymorphic_path([@project, :<%= model_name_underscored %>]), title: l(:title_<%= model_name_underscored %>_new), class: 'icon icon-add button button-positive' %></li>
|
7
|
+
<%% end %>
|
8
|
+
<li><%%= link_to l(:label_<%= model_name_pluralize_underscored %>), polymorphic_path([@project, :<%= model_name_pluralize_underscored %>], set_filter: '1'), title: l(:label_<%= model_name_pluralize_underscored %>), class: 'icon icon-folder button' %></li>
|
9
9
|
</ul>
|
@@ -1,8 +1,8 @@
|
|
1
|
-
<ul>
|
2
|
-
<%% if @<%= model_name_underscored %> -%>
|
3
|
-
<li><%%= context_menu_link l(:button_edit), edit_<%= model_name_underscored %>_path(@<%= model_name_underscored %>), class: 'icon icon-edit', disabled: !@can[:edit] %></li>
|
4
|
-
<%% end %>
|
5
|
-
<li><%%= context_menu_link l(:button_delete), <%= model_name_pluralize_underscored %>_path(ids: @<%= model_name_underscored %>_ids, back_url: @back), method: :delete, data: {confirm: l(:text_are_you_sure)}, class: 'icon icon-del', disabled: !@can[:delete] %></li>
|
6
|
-
|
7
|
-
<%%= call_hook(:view_<%= model_name_pluralize_underscored %>_context_menu_end, {<%= model_name_underscored %>: @<%= model_name_underscored %>, <%= model_name_pluralize_underscored %>: @<%= model_name_pluralize_underscored %>, can: @can, back: @back, project: @project}) %>
|
1
|
+
<ul>
|
2
|
+
<%% if @<%= model_name_underscored %> -%>
|
3
|
+
<li><%%= context_menu_link l(:button_edit), edit_<%= model_name_underscored %>_path(@<%= model_name_underscored %>), class: 'icon icon-edit', disabled: !@can[:edit] %></li>
|
4
|
+
<%% end %>
|
5
|
+
<li><%%= context_menu_link l(:button_delete), <%= model_name_pluralize_underscored %>_path(ids: @<%= model_name_underscored %>_ids, back_url: @back), method: :delete, data: {confirm: l(:text_are_you_sure)}, class: 'icon icon-del', disabled: !@can[:delete] %></li>
|
6
|
+
|
7
|
+
<%%= call_hook(:view_<%= model_name_pluralize_underscored %>_context_menu_end, {<%= model_name_underscored %>: @<%= model_name_underscored %>, <%= model_name_pluralize_underscored %>: @<%= model_name_pluralize_underscored %>, can: @can, back: @back, project: @project}) %>
|
8
8
|
</ul>
|
@@ -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,19 +1,19 @@
|
|
1
|
-
<%%= title l(:heading_<%= model_name_underscored %>_edit) %>
|
2
|
-
|
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
|
-
<%%= error_messages_for @<%= model_name_underscored %> %>
|
5
|
-
|
6
|
-
<div class="box">
|
7
|
-
<%%= render partial: 'form', locals: {<%= model_name_underscored %>: @<%= model_name_underscored %>} %>
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<%% if !request.xhr? %>
|
11
|
-
<p>
|
12
|
-
<%%= submit_tag l(:button_update), title: l(:button_update) %>
|
13
|
-
</p>
|
14
|
-
<%% end %>
|
15
|
-
<%% end %>
|
16
|
-
<%% ### PAGE CUSTOMS ########################################################## %>
|
17
|
-
<%% content_for :sidebar do %>
|
18
|
-
<%%= render :partial => '<%= model_name_pluralize_underscored %>/sidebar' %>
|
1
|
+
<%%= title l(:heading_<%= model_name_underscored %>_edit) %>
|
2
|
+
|
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
|
+
<%%= error_messages_for @<%= model_name_underscored %> %>
|
5
|
+
|
6
|
+
<div class="box">
|
7
|
+
<%%= render partial: 'form', locals: {<%= model_name_underscored %>: @<%= model_name_underscored %>} %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<%% if !request.xhr? %>
|
11
|
+
<p>
|
12
|
+
<%%= submit_tag l(:button_update), title: l(:button_update) %>
|
13
|
+
</p>
|
14
|
+
<%% end %>
|
15
|
+
<%% end %>
|
16
|
+
<%% ### PAGE CUSTOMS ########################################################## %>
|
17
|
+
<%% content_for :sidebar do %>
|
18
|
+
<%%= render :partial => '<%= model_name_pluralize_underscored %>/sidebar' %>
|
19
19
|
<%% end %>
|
@@ -1,17 +1,17 @@
|
|
1
|
-
$("#ajax-modal").html("<%%= j render(:template => '<%= model_name_pluralize_underscored %>/edit', :formats => [:html]) %>");
|
2
|
-
showModal('ajax-modal');
|
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]
|
1
|
+
$("#ajax-modal").html("<%%= j render(:template => '<%= model_name_pluralize_underscored %>/edit', :formats => [:html]) %>");
|
2
|
+
showModal('ajax-modal');
|
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
17
|
});
|
@@ -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,5 +1,5 @@
|
|
1
|
-
<%%= render @query %>
|
2
|
-
<%% ### PAGE CUSTOMS ########################################################## %>
|
3
|
-
<%% content_for :sidebar do %>
|
4
|
-
<%%= render :partial => '<%= model_name_pluralize_underscored %>/sidebar' %>
|
1
|
+
<%%= render @query %>
|
2
|
+
<%% ### PAGE CUSTOMS ########################################################## %>
|
3
|
+
<%% content_for :sidebar do %>
|
4
|
+
<%%= render :partial => '<%= model_name_pluralize_underscored %>/sidebar' %>
|
5
5
|
<%% end %>
|