Module | OutputHelper |
In: |
app/helpers/output_helper.rb
|
ファイル出力の helper を与える。
ファイル出力設定画面のボタンを返す。
# File app/helpers/output_helper.rb, line 4 4: def output_button_box(x) 5: link_to_output = link_to(h(s_("ConfigOutput|Output")), {:action => "download", :id => @display_to_list.id}, :class => "button") 6: link_to_save = submit_tag(h(s_("ConfigOutput|Save"))) 7: link_to_clear = link_to_view_motion(h(s_("ConfigOutput|Clear")), "detail", "clear", {"_" => x}, {:action => "clear", :id => @display_to_list.id}, :class => "button") 8: @lcr_buttons = { 9: :left => link_to_close({"_" => x}, {:controller => "menu", :action => "list"}, :class => "button"), 10: :center => link_to_output + " " + link_to_save, 11: :right => link_to_clear, 12: } 13: lcr_button_box 14: end
ファイル出力の対象になる項目を並び替え可能にする。
# File app/helpers/output_helper.rb, line 38 38: def sortable_items 39: sortable_element("config_output_items_tbody", 40: :complete => visual_effect(:highlight, "config_output_items"), 41: :url => {:action => "sort", :id => params[:id]}, 42: :constraint => false, 43: :handle => "handle", 44: :tag => "tr") 45: end
ファイル出力の対象になる項目のテーブルを返す。
# File app/helpers/output_helper.rb, line 17 17: def tbody_items 18: content = @config_output_items.map do |config_output_item| 19: tr_item(config_output_item) 20: end.join 21: return content_tag(:tbody, content, :id => "config_output_items_tbody") 22: end
ファイル出力の対象になる項目のノードを返す。
# File app/helpers/output_helper.rb, line 25 25: def tr_item(config_output_item) 26: @config_output_item = config_output_item 27: return "<tr id=\"config_output_item_\#{@config_output_item.id}\">\n<td>\#{check_box \"config_output_item[]\", \"enabled\"}</td>\n<td>\#{text_field \"config_output_item[]\", \"name\"}/\#{@config_output_item.item.name}</td>\n<td class=\"handle\">handle</td>\n</tr>\n" 28: end