shorten html

pull/6827/head
Tim Felgentreff 14 years ago
parent e1c269ba8e
commit 585faa1719
  1. 4
      lib/widget/controls/delete.rb
  2. 26
      lib/widget/controls/save_as.rb

@ -3,7 +3,7 @@ class Widget::Controls::Delete < Widget::Base
return "" if @query.new_record?
content_tag :span do
button = link_to_function l(:button_delete), "toggle_delete_form();",
button = link_to l(:button_delete), "#",
:class => 'breadcrumb_icon icon-delete',
:id => 'query-icon-delete',
:title => l(:button_delete)
@ -12,7 +12,7 @@ class Widget::Controls::Delete < Widget::Base
question = content_tag :p, l(:label_really_delete_question)
options = content_tag :p do
opt1 = link_to l(:button_delete), url_for(:action => 'delete', :id => @query.id)
opt2 = link_to l(:button_cancel), :id => "query-icon-delete-cancel", :class => 'icon icon-cancel'
opt2 = link_to l(:button_cancel), "#", :id => "query-icon-delete-cancel", :class => 'icon icon-cancel'
opt1 + opt2
end
question + options

@ -6,34 +6,32 @@ class Widget::Controls::SaveAs < Widget::Base
link_name = l(:button_save_as)
end
content_tag :span do
button = link_to link_name, {}, :class => 'breadcrumb_icon icon-save-as',
button = link_to link_name, "#",
:class => 'breadcrumb_icon icon-save-as',
:id => 'query-icon-save-as', :title => l(:button_save_as)
button + render_popup
end
end
def render_popup_form
content_tag :form, :id => "query_save_as_form", :method => "post", :action => "#" do
name = content_tag :p do
label(:query_name, l(:field_name)) +
text_field_tag(:query_name, @query.name || l(:label_default))
end
box = content_tag :p do
label(:query_is_public, l(:field_is_public)) +
check_box_tag(:query_is_public)
end
name + box
name = content_tag :p do
label_tag(:query_name, l(:field_name)) +
text_field_tag(:query_name, @query.name || l(:label_default))
end
box = content_tag :p do
label_tag(:query_is_public, l(:field_is_public)) +
check_box_tag(:query_is_public)
end
name + box
end
def render_popup_buttons
content_tag(:p) do
save = link_to content_tag(:span, content_tag(:em, l(:button_save))), {},
save = link_to content_tag(:span, content_tag(:em, l(:button_save))), "#",
:id => "query-icon-save-button",
:class => "button save",
:href => "#",
:"data-target" => url_for(:action => 'create', :set_filter => '1')
cancel = link_to l(:button_cancel), {},
cancel = link_to l(:button_cancel), "#",
:id => "query-icon-save-as-cancel",
:class => 'icon icon-cancel'
save + cancel

Loading…
Cancel
Save