app/helpers/cmsedit_helper.rb in drg_cms-0.5.52.2 vs app/helpers/cmsedit_helper.rb in drg_cms-0.5.52.3
- old
+ new
@@ -71,11 +71,12 @@
url = yaml['url']
else
url['controller'] = yaml['controller'] if yaml['controller']
url['action'] = yaml['action'] || action
url['table'] = yaml['table'] if yaml['table']
- url['formname'] = yaml['formname'] if yaml['formname']
+ url['form_name'] = yaml['form_name'] if yaml['form_name']
+ url['form_name'] = yaml['formname'] if yaml['formname']
end
# html link options
yhtml = yaml['html'] || {}
yhtml['title'] = yaml['title'] if yaml['title']
html << '<li class="dc-animate">'
@@ -159,11 +160,11 @@
#{ select(nil, 'filter_field1', options_for_select(choices, field_name), { include_blank: true }) }
#{ select(nil, 'filter_oper', options_for_select(choices4_operators, operators_value)) }
</td>
<td class="dc-link dc-animate drgcms_popup_submit" data-url="#{url}">#{fa_icon('check-square-o')} #{t('drgcms.filter_on')}</td>
- <td class="dc-link dc-animate">#{dc_link_to('drgcms.filter_off','close', {action: :index, filter: 'off', table: @form['table'], formname: params['formname']}) }</td>
+ <td class="dc-link dc-animate">#{dc_link_to('drgcms.filter_off','close', {action: :index, filter: 'off', table: @form['table'], form_name: params['form_name']}) }</td>
</table>
</div>
EOT
html.html_safe
end
@@ -250,11 +251,12 @@
parms['id'] = document.id
end
parms['controller'] = yaml['controller'] if yaml['controller']
parms['action'] = yaml['action'] if yaml['action']
parms['table'] = yaml['table'] if yaml['table']
- parms['formname'] = yaml['formname'] if yaml['formname']
+ parms['form_name'] = yaml['form_name'] if yaml['form_name']
+ parms['form_name'] = yaml['formname'] if yaml['formname']
parms['target'] = yaml['target'] if yaml['target']
dc_link_or_ajax(yaml, parms)
else # error.
yaml['type'].to_s
end
@@ -288,11 +290,11 @@
if @tables.size == 1 and sort_ok
icon = 'sort lg'
if v['name'] == sort_field
icon = sort_direction == '1' ? 'sort-alpha-asc lg' : 'sort-alpha-desc lg'
end
- th << ">#{dc_link_to(caption, icon, sort: v['name'], table: params[:table], formname: params[:formname], action: :index )}</th>"
+ th << ">#{dc_link_to(caption, icon, sort: v['name'], table: params[:table], form_name: params[:form_name], action: :index )}</th>"
else
th << ">#{caption}</th>"
end
c << th
end
@@ -309,19 +311,19 @@
yaml = @form['result_set']['dblclick']
opts = {}
opts[:controller] = yaml['controller'] || 'cmsedit'
opts[:action] = yaml['action']
opts[:table] = yaml['table']
- opts[:formname] = yaml['formname']
+ opts[:form_name] = yaml['form_name'] || yaml['formname']
opts[:method] = yaml['method'] || 'get'
opts[:id] = document['id']
html << ' data-dblclick=' + url_for(opts)
else
html << (' data-dblclick=' +
url_for(action: 'show', controller: 'cmsedit', id: document,
readonly: (params[:readonly] ? 2 : 1), table: params[:table],
- formname: params[:formname], ids: params[:ids]) ) if @form['form']
+ form_name: params[:form_name], ids: params[:ids]) ) if @form['form']
end
html
end
############################################################################
@@ -547,11 +549,11 @@
# make url
else
parms['controller'] = v['controller']
parms['action'] = v['action']
parms['table'] = v['table']
- parms['formname'] = v['formname']
+ parms['form_name'] = v['form_name'] || v['formname']
parms['id'] = @record.id
# additional parameters
v['params'].each { |k,v| parms[k] = v } if v['params']
end
# Error if controller param is missing
@@ -559,10 +561,9 @@
"<td>#{t('drgcms.error')}</td>"
else
v['caption'] ||= v['text']
caption = t("#{v['caption'].downcase}", v['caption'])
url = url_for(parms)
- p url
request = v['request'] || v['method'] || 'get'
icon = v['icon'] ? "#{fa_icon(v['icon'])} " : ''
if v['type'] == 'ajax' # ajax button
%Q[<td class="dc-link-ajax dc-animate" id="dc-submit-ajax" data-url="#{url}"
data-request="#{request}" title="#{v['title']}">#{icon}#{caption}</td>]