Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Mar 24, 2017
1 parent fa94914 commit cd51dd7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 34 deletions.
35 changes: 13 additions & 22 deletions app/controllers/miq_ae_class_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,34 +284,25 @@ def replace_right_cell(options = {})
replace_trees_by_presenter(presenter, :ae => build_ae_tree) unless replace_trees.blank?

if @sb[:action] == "miq_ae_field_seq"
if @flash_array
replace_partial_div = :flash_msg_div
end
update_partial_div = :class_fields_div
update_partial = "fields_seq_form"
presenter.update(:class_fields_div, r[:partial => "fields_seq_form"])

elsif @sb[:action] == "miq_ae_domain_priority_edit"
if @flash_array
replace_partial_div = :flash_msg_div
end
update_partial_div = :ns_list_div
update_partial = "domains_priority_form"
presenter.update(:ns_list_div, r[:partial => "domains_priority_form"])

elsif MIQ_AE_COPY_ACTIONS.include?(@sb[:action])
if @flash_array
replace_partial_div = :flash_msg_div
end
update_partial_div = :main_div
update_partial = "copy_objects_form"
presenter.update(:main_div, r[:partial => "copy_objects_form"])

else
if @sb[:action] == "miq_ae_class_edit"
@sb[:active_tab] = 'props'
else
@sb[:active_tab] ||= 'instances'
end
update_partial_div = :main_div
update_partial = "all_tabs"
presenter.update(:main_div, r[:partial => 'all_tabs']) # check
end
presenter.replace(replace_partial_div, r[:partial => "layouts/flash_msg"]) if replace_partial_div
presenter.update(update_partial_div, r[:partial => update_partial]) if update_partial

presenter.replace('flash_msg_div', r[:partial => "layouts/flash_msg"]) if @flash_array

if @in_a_form
action_url = create_action_url(nodes.first)
# incase it was hidden for summary screen, and incase there were no records on show_list
Expand Down Expand Up @@ -1277,7 +1268,7 @@ def field_select
@changed = (@edit[:new] != @edit[:current])
render :update do |page|
page << javascript_prologue
page.replace_html("class_fields_div", :partial => "class_fields")
page.replace("class_fields_div", :partial => "class_fields")
page << javascript_for_miq_button_visibility(@changed)
page << "miqSparkle(false);"
end
Expand All @@ -1291,7 +1282,7 @@ def field_accept
@dtype_combo_xml = build_dtype_options
render :update do |page|
page << javascript_prologue
page.replace_html("class_fields_div", :partial => "class_fields")
page.replace("class_fields_div", :partial => "class_fields")
page << javascript_for_miq_button_visibility(@changed)
page << "miqSparkle(false);"
end
Expand All @@ -1311,7 +1302,7 @@ def field_delete
@changed = (@edit[:new] != @edit[:current])
render :update do |page|
page << javascript_prologue
page.replace_html("class_fields_div", :partial => "class_fields")
page.replace("class_fields_div", :partial => "class_fields")
page << javascript_for_miq_button_visibility(@changed)
page << "miqSparkle(false);"
end
Expand Down
1 change: 1 addition & 0 deletions app/views/miq_ae_class/_all_tabs.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
= render :partial => "layouts/flash_msg"
#ae_tabs
-# Toplevel Tabbar
- nodes = x_node.split('-')
Expand Down
10 changes: 5 additions & 5 deletions app/views/miq_ae_class/_class_fields.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- if x_node.split('-')[0] == "aec" || params[:pressed] || %w(field_select field_accept field_delete).include?(params[:action])
- if !@in_a_form_fields
/ Show Schema
= render :partial => "layouts/flash_msg"
-#= render :partial => "layouts/flash_msg"
%h3= _('Schema')
- if @ae_class.ae_fields.present?
%table.table.table-striped.table-bordered
Expand Down Expand Up @@ -46,8 +46,8 @@
- url = url_for_only_path(:action => 'fields_form_field_changed', :id => (@ae_class.id || 'new'))
- obs = {:interval => '.5', :url => url}.to_json
/ Edit Schema
#form_div
= render :partial => "layouts/flash_msg"
.form_div
-#= render :partial => "layouts/flash_msg"
%h3= _('Schema')
%table.table.table-striped.table-bordered
%thead
Expand Down Expand Up @@ -76,7 +76,7 @@
- combo_name = "fields_#{fname}#{i}"
- combo_options = (fname == "aetype" ? @combo_xml : @dtype_combo_xml)
- combo_url = "/miq_ae_class/fields_form_field_changed/#{@ae_class.id || 'new'}"
#form-group
.form-group
= select_tag(combo_name,
options_for_select(combo_options, field[fname]),
"title" => "Choose",
Expand Down Expand Up @@ -122,7 +122,7 @@
- combo_name = "field_#{fname}"
- combo_options = @edit[:new]["#{fname}s".to_sym]
- combo_url = "/miq_ae_class/fields_form_field_changed/#{@ae_class.id || 'new'}"
#form-group
.form-group
= select_tag(combo_name,
options_for_select(combo_options, session[:field_data][fname]),
"title" => "Choose",
Expand Down
4 changes: 2 additions & 2 deletions app/views/miq_ae_class/_class_instances.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#class_instances_div
- if !@in_a_form
= render :partial => "layouts/flash_msg"
-#= render :partial => "layouts/flash_msg"
%h3= _('Instances')
- if @record.ae_instances.present?
%table#class_instances_grid.table.table-striped.table-bordered.table-hover.table-clickable.table-checkable
Expand Down Expand Up @@ -29,5 +29,5 @@
:locals => {:message => _("No instances found")}
- elsif @edit[:new][:ae_inst]
#form_div
= render :partial => "layouts/flash_msg"
-#= render :partial => "layouts/flash_msg"
= render :partial => "instance_form", :locals => {:prefix => "cls_"}
6 changes: 3 additions & 3 deletions app/views/miq_ae_class/_class_methods.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#class_methods_div
- if !@in_a_form
= render :partial => "layouts/flash_msg"
-#= render :partial => "layouts/flash_msg"
%h3= _('Methods')
- if @record.ae_methods.present?
%table#class_methods_grid.table.table-striped.table-bordered.table-hover.table-clickable.table-checkable
Expand Down Expand Up @@ -28,6 +28,6 @@
= render :partial => "layouts/info_msg",
:locals => {:message => _("No methods found")}
- elsif @edit[:new][:fields]
#form_div
= render :partial => "layouts/flash_msg"
.form_div
-#= render :partial => "layouts/flash_msg"
= render :partial => "method_form", :locals => {:prefix => "cls_"}
4 changes: 2 additions & 2 deletions app/views/miq_ae_class/_class_props.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#class_props_div
- if x_node.split('-')[0] == "aec" || params[:pressed] || ["field_select","field_accept","field_delete"].include?(params[:action]) || (x_node.split('-')[0] == "aen" && params[:button] == "reset")
- if !@in_a_form_props
= render :partial => "layouts/flash_msg"
-#= render :partial => "layouts/flash_msg"
%h3= _('Properties')
%table.table.table-striped.table-bordered
%tbody
Expand Down Expand Up @@ -34,5 +34,5 @@
- else
#form_div
%div{:style => "padding-top: 10px;"}
= render :partial => "layouts/flash_msg"
-#= render :partial => "layouts/flash_msg"
= render :partial => "class_form"

0 comments on commit cd51dd7

Please sign in to comment.