rich_table_component 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +156 -139
- data/app/helpers/component_helper.rb +176 -0
- data/app/helpers/documents_helper.rb +22 -0
- data/app/helpers/menus_helper.rb +182 -0
- data/app/helpers/paragraph_helper.rb +57 -0
- data/app/helpers/translations_helper.rb +9 -0
- data/app/views/application/_document_fields.html.haml +20 -0
- data/app/views/application/_edit.html.haml +11 -0
- data/app/views/application/_new.html.haml +11 -0
- data/app/views/application/access_denied.js.erb +5 -0
- data/app/views/application/create.js.erb +19 -0
- data/app/views/application/destroy.js.erb +9 -0
- data/app/views/application/destroy_fail.js.erb +2 -0
- data/app/views/application/edit.html.haml +8 -0
- data/app/views/application/edit.js.erb +28 -0
- data/app/views/application/index.js.erb +7 -0
- data/app/views/application/index.pdf.haml +87 -0
- data/app/views/application/index.xls.haml +64 -0
- data/app/views/application/new.html.haml +7 -0
- data/app/views/application/new.js.erb +23 -0
- data/app/views/application/recapitulation.js.erb +12 -0
- data/app/views/application/recapitulation.pdf.haml +68 -0
- data/app/views/application/recapitulation.xls.haml +41 -0
- data/app/views/application/session_expired.js.erb +5 -0
- data/app/views/application/show.js.erb +29 -0
- data/app/views/application/update.js.erb +15 -0
- data/app/views/layouts/print/pdf.html.haml +8 -0
- data/app/views/layouts/print/recapitulation.html.haml +8 -0
- data/app/views/rich_table_component/_notification.html.haml +9 -0
- data/app/views/rich_table_component/_pagination.html.haml +11 -0
- data/app/views/rich_table_component/_recapitulation_matrix_groups.html.haml +42 -0
- data/app/views/rich_table_component/component/_ajax_upload.html.haml +6 -0
- data/app/views/rich_table_component/component/_ajax_upload_result.html.haml +2 -0
- data/app/views/rich_table_component/component/_breadcrumbs.html.haml +25 -0
- data/app/views/rich_table_component/component/_breadcrumbs_dropdown.html.haml +18 -0
- data/app/views/rich_table_component/component/_tabbed.html.haml +5 -0
- data/app/views/rich_table_component/rtc/_advanced_search.html.haml +95 -0
- data/app/views/rich_table_component/rtc/_advanced_search_recapitulation.html.haml +90 -0
- data/app/views/rich_table_component/rtc/_component.html.haml +62 -0
- data/app/views/rich_table_component/rtc/_component_actions.html.haml +69 -0
- data/app/views/rich_table_component/rtc/_component_content.html.haml +37 -0
- data/app/views/rich_table_component/rtc/_component_title.html.haml +37 -0
- data/app/views/rich_table_component/rtc/_content.html.haml +22 -0
- data/app/views/rich_table_component/rtc/_footer.html.haml +4 -0
- data/app/views/rich_table_component/rtc/_header.html.haml +56 -0
- data/app/views/rich_table_component/rtc/_recapitulation_matrix.html.haml +25 -0
- data/app/views/rich_table_component/rtc/_recapitulation_matrix_form.html.haml +47 -0
- data/app/views/rich_table_component/rtc/_table.html.haml +22 -0
- data/lib/pagination_list_link_renderer.rb +51 -0
- data/lib/rich_table_component/version.rb +1 -1
- data/lib/rich_table_component.rb +0 -8
- data/rich_table_component.gemspec +0 -1
- data/vendor/assets/images/icons/file_extension/file_extension_.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_3gp.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_7z.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ace.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ai.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_aif.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_aiff.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_amr.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_asf.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_asx.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_bat.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_bin.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_bmp.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_bup.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_cab.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_cbr.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_cda.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_cdl.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_cdr.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_chm.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_dat.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_divx.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_dll.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_dmg.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_doc.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_dss.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_dvf.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_dwg.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_eml.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_eps.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_exe.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_fla.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_flv.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_gif.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_gz.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_hqx.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_htm.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_html.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ifo.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_indd.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_iso.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_jar.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_jpeg.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_jpg.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_lnk.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_log.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_m4a.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_m4b.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_m4p.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_m4v.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mcd.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mdb.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mid.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mov.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mp2.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mp4.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mpeg.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mpg.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_msi.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_mswmm.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ogg.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_pdf.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_png.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_pps.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ppt.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ps.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_psd.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_pst.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ptb.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_pub.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_qbb.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_qbw.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_qxd.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ram.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_rar.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_rm.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_rmvb.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_rtf.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_sea.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ses.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_sit.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_sitx.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ss.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_swf.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_tgz.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_thm.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_tif.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_tmp.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_torrent.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_ttf.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_txt.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_vcd.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_vob.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_wav.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_wma.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_wmv.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_wps.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_xls.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_xpi.png +0 -0
- data/vendor/assets/images/icons/file_extension/file_extension_zip.png +0 -0
- data/vendor/assets/images/loading_image.gif +0 -0
- data/vendor/assets/images/pbar-ani.gif +0 -0
- data/vendor/assets/javascripts/admin/starqle.grid.js +708 -0
- data/vendor/assets/javascripts/admin/starqle.ui.jquery.js +927 -0
- data/vendor/assets/javascripts/ckeditor/config.js +112 -0
- data/vendor/assets/javascripts/jquery-ui-1.8.13.custom.min.js +445 -0
- data/vendor/assets/javascripts/jquery.fileupload-ui.js +533 -0
- data/vendor/assets/javascripts/jquery.fileupload.js +975 -0
- data/vendor/assets/javascripts/jquery.tmpl.min.js +1 -0
- data/vendor/assets/javascripts/jquery.tokeninput.js +860 -0
- data/vendor/assets/javascripts/nested_attribute_action.js +19 -0
- data/vendor/assets/javascripts/rich_table_component.js +51 -0
- data/vendor/assets/stylesheets/fontfaces/england_hand_db/Freeware License.txt +5 -0
- data/vendor/assets/stylesheets/fontfaces/england_hand_db/england-webfont.eot +0 -0
- data/vendor/assets/stylesheets/fontfaces/england_hand_db/england-webfont.svg +146 -0
- data/vendor/assets/stylesheets/fontfaces/england_hand_db/england-webfont.ttf +0 -0
- data/vendor/assets/stylesheets/fontfaces/england_hand_db/england-webfont.woff +0 -0
- data/vendor/assets/stylesheets/fontfaces/england_hand_db/stylesheet.css +16 -0
- data/vendor/assets/stylesheets/fontfaces/museo300-regular-webfont.eot +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo300-regular-webfont.svg +249 -0
- data/vendor/assets/stylesheets/fontfaces/museo300-regular-webfont.ttf +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo300-regular-webfont.woff +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo500-regular-webfont.eot +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo500-regular-webfont.svg +249 -0
- data/vendor/assets/stylesheets/fontfaces/museo500-regular-webfont.ttf +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo500-regular-webfont.woff +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo700-regular-webfont.eot +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo700-regular-webfont.svg +249 -0
- data/vendor/assets/stylesheets/fontfaces/museo700-regular-webfont.ttf +0 -0
- data/vendor/assets/stylesheets/fontfaces/museo700-regular-webfont.woff +0 -0
- data/vendor/assets/stylesheets/partial/_base_functions.sass +101 -0
- data/vendor/assets/stylesheets/partial/_base_variables.sass +76 -0
- data/vendor/assets/stylesheets/partial/_form.sass +57 -0
- data/vendor/assets/stylesheets/partial/_grid.css +374 -0
- data/vendor/assets/stylesheets/partial/_notification.sass +33 -0
- data/vendor/assets/stylesheets/partial/_position.sass +122 -0
- data/vendor/assets/stylesheets/partial/_starqle.ui.grid.sass +495 -0
- data/vendor/assets/stylesheets/partial/_style.sass +674 -0
- data/vendor/assets/stylesheets/partial/_tabbed.sass +33 -0
- data/vendor/assets/stylesheets/partial/_user_component.sass +2 -0
- data/vendor/assets/stylesheets/rich_table_component/_custom.sass +0 -0
- data/vendor/assets/stylesheets/rich_table_component.css +18 -0
- data/vendor/assets/stylesheets/rtc_bootstrap_and_overrides.css.less +315 -0
- data/vendor/assets/stylesheets/rtc_config.sass +31 -0
- data/vendor/assets/stylesheets/rtc_jquery.fileupload-ui.css +155 -0
- data/vendor/assets/stylesheets/smoothness/images/Thumbs.db +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/vendor/assets/stylesheets/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/vendor/assets/stylesheets/smoothness/jquery-ui-1.8.11.custom.css +573 -0
- metadata +209 -17
@@ -0,0 +1,22 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- rtc_column_header = true if rtc_column_header.nil?
|
3
|
+
- rtc_partial = rtc_controller_name.singularize if rtc_partial.nil?
|
4
|
+
- rtc_empty_data_message = sanitize "Data #{t(rtc_controller_name)} kosong" if rtc_empty_data_message.nil?
|
5
|
+
- columns_width = columns_width.presence || []
|
6
|
+
|
7
|
+
.rtc_content
|
8
|
+
.rtc_grid_header{style: (rtc_column_header.present? ? '' : 'display: none !important')}
|
9
|
+
- if columns_width.present?
|
10
|
+
- headers.each_with_index do |header, i|
|
11
|
+
.rtc_gh_item{'data-column-width' => columns_width[i]}
|
12
|
+
= header.present? ? sort_link(header, rtc_controller_name: rtc_controller_name, params: params, rtc_partial: rtc_partial) : raw(" ")
|
13
|
+
- else
|
14
|
+
- headers.each do |header|
|
15
|
+
.rtc_gh_item
|
16
|
+
= header.present? ? sort_link(header, rtc_controller_name: rtc_controller_name, params: params, rtc_partial: rtc_partial) : raw(" ")
|
17
|
+
|
18
|
+
.rtc_grid
|
19
|
+
= render "rich_table_component/rtc/table",
|
20
|
+
rtc_controller_name: rtc_controller_name,
|
21
|
+
rtc_partial: rtc_partial,
|
22
|
+
rtc_empty_data_message: rtc_empty_data_message
|
@@ -0,0 +1,56 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- toggle_view = false if toggle_view.nil?
|
3
|
+
- rtc_partial = rtc_controller_name.singularize if rtc_partial.nil?
|
4
|
+
- search_key ||= 'q'
|
5
|
+
- advanced_search_attributes ||= nil
|
6
|
+
- table_title ||= nil
|
7
|
+
|
8
|
+
|
9
|
+
.rtc_header
|
10
|
+
.rtc_title
|
11
|
+
- if table_title.present?
|
12
|
+
= "#{table_title}"
|
13
|
+
- else
|
14
|
+
= t("#{rtc_controller_name.singularize}")
|
15
|
+
|
16
|
+
|
17
|
+
- if search_constraint.present?
|
18
|
+
.rtc_item.right
|
19
|
+
= search_form_for instance_variable_get("@#{search_key}"), as: search_key.to_sym, url: '#', html: {method: :get, class: "rtc_search input-append", style: 'margin-bottom: 0px'}, remote: true do |f|
|
20
|
+
|
21
|
+
- new_params = Hash.new
|
22
|
+
- new_params.merge! params
|
23
|
+
- if search_constraint.instance_of?(Hash) && search_constraint[:params].present?
|
24
|
+
- new_params.merge! search_constraint[:params].stringify_keys!
|
25
|
+
- new_params.select{|key, val| key != "action" && key != "controller"}.each_pair do |key, val|
|
26
|
+
= hidden_field_tag key.to_s, val.to_s
|
27
|
+
|
28
|
+
= hidden_field_tag 'rtc_controller_name', rtc_controller_name if rtc_controller_name.present?
|
29
|
+
= hidden_field_tag 'rtc_partial', rtc_partial if rtc_partial.present?
|
30
|
+
|
31
|
+
= f.text_field (search_constraint.instance_of?(Hash) ? search_constraint[:constraint] : search_constraint), :class => "small", :id => "search", style: 'padding: 1px 3px !important; width: 160px'
|
32
|
+
%button{type: 'submit', class: 'add-on btn', style: 'height: 19px; line-height: 12px; padding: 4px 6px'}>
|
33
|
+
%i= icon('search')
|
34
|
+
|
35
|
+
- if toggle_view
|
36
|
+
.rtc_item_separator.right
|
37
|
+
|
38
|
+
.rtc_item.right
|
39
|
+
.btn-group.btn-group-view-toggle{'data-toggle' => 'buttons-radio'}
|
40
|
+
%a.btn.btn-mini.active{href: '#', 'data-remote' => true, 'data-list-view' => 'list'}= icon 'list'
|
41
|
+
%a.btn.btn-mini{href: '#', 'data-remote' => true, 'data-list-view' => 'th'}= icon 'th'
|
42
|
+
|
43
|
+
|
44
|
+
- if advanced_search_attributes
|
45
|
+
.rtc_item_separator.right
|
46
|
+
|
47
|
+
.rtc_item.right
|
48
|
+
.btn.btn-mini.advanced_search_toggle_button{'data-toggle' => 'button'}= t('advanced_search')
|
49
|
+
|
50
|
+
.rtc_header_expanded
|
51
|
+
- if advanced_search_attributes.present?
|
52
|
+
= render "rich_table_component/rtc/advanced_search",
|
53
|
+
search_key: search_key,
|
54
|
+
rtc_controller_name: rtc_controller_name,
|
55
|
+
advanced_search_attributes: advanced_search_attributes,
|
56
|
+
params: params
|
@@ -0,0 +1,25 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- recapitulation_matrix ||= nil
|
3
|
+
- advanced_search_attributes ||= nil
|
4
|
+
|
5
|
+
- items = []
|
6
|
+
- recapitulation_matrix.each do |item|
|
7
|
+
- case item
|
8
|
+
- when Hash
|
9
|
+
- label = t(item[:label])
|
10
|
+
- value = item[:value]
|
11
|
+
- else
|
12
|
+
- label_splitter = item.split('__').first.split('.')
|
13
|
+
- label = label_splitter.pop
|
14
|
+
- label = t([label_splitter, label].compact.join('_'))
|
15
|
+
- value = item
|
16
|
+
- items << [value, label]
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
.well
|
21
|
+
|
22
|
+
= render "rich_table_component/rtc/recapitulation_matrix_form",
|
23
|
+
recapitulation_model: instance_variable_get("@#{rtc_controller_name}").klass.name,
|
24
|
+
items: items,
|
25
|
+
advanced_search_attributes: advanced_search_attributes.presence || nil
|
@@ -0,0 +1,47 @@
|
|
1
|
+
- rm_operation ||= nil
|
2
|
+
|
3
|
+
- @q = recapitulation_model.tableize.classify.constantize.search(params[:q])
|
4
|
+
= simple_form_for @q, url: {controller: recapitulation_model.tableize, action: 'index'}, html: {method: :get, class: 'form-horizontal recapitulation_form'}, remote: true do |f|
|
5
|
+
|
6
|
+
= hidden_field_tag 'recapitulation', true
|
7
|
+
|
8
|
+
.control-group.select.optional
|
9
|
+
%label.select.optional.control-label{for: 'group_row'}= t('row')
|
10
|
+
.controls
|
11
|
+
= select_tag "group_row",
|
12
|
+
options_from_collection_for_select(items,
|
13
|
+
:first, :last), include_blank: true, class: 'select optional'
|
14
|
+
|
15
|
+
|
16
|
+
.control-group.select.optional
|
17
|
+
%label.select.optional.control-label{for: 'group_col'}= t('column')
|
18
|
+
.controls
|
19
|
+
= select_tag "group_col",
|
20
|
+
options_from_collection_for_select(items,
|
21
|
+
:first, :last), include_blank: true, class: 'select optional'
|
22
|
+
|
23
|
+
- if rm_operation.present?
|
24
|
+
.control-group.select.optional
|
25
|
+
%label.select.optional.control-label{for: 'operation_value'}= t('operation_value')
|
26
|
+
.controls
|
27
|
+
= select_tag "operation_value",
|
28
|
+
options_from_collection_for_select( rm_operation[:column].map{|m| (m.class == Hash ? [m[:value], t(m[:label])] : [m, t(m)])} ,
|
29
|
+
:first, :last), include_blank: true, class: 'select optional'
|
30
|
+
|
31
|
+
.control-group.select.optional
|
32
|
+
%label.select.optional.control-label{for: 'operation_type'}= t('operation_type')
|
33
|
+
.controls
|
34
|
+
= select_tag "operation_type",
|
35
|
+
options_from_collection_for_select(rm_operation[:type].map{|m| [m, t(m)]},
|
36
|
+
:first, :last), include_blank: true, class: 'select optional'
|
37
|
+
|
38
|
+
- if advanced_search_attributes.present?
|
39
|
+
= render "rich_table_component/rtc/advanced_search_recapitulation",
|
40
|
+
recapitulation_model: recapitulation_model,
|
41
|
+
advanced_search_attributes: advanced_search_attributes,
|
42
|
+
f: f
|
43
|
+
|
44
|
+
.form-actions
|
45
|
+
= submit_tag "#{t('show_recapitulation')}", class: 'btn btn-primary'
|
46
|
+
%input.btn{type: "submit", name: "export_pdf", value: t('pdf')}
|
47
|
+
%input.btn{type: "submit", name: "export_xls", value: t('xls')}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- rtc_partial = rtc_controller_name.singularize if rtc_partial.nil?
|
3
|
+
- rtc_empty_data_message = sanitize "Data #{t(rtc_controller_name)} kosong" if rtc_empty_data_message.nil?
|
4
|
+
|
5
|
+
- @controller_names = instance_variable_get("@#{rtc_controller_name}")
|
6
|
+
|
7
|
+
%form#filter_form
|
8
|
+
- params.select{|key, val| key != "action" && key != "controller" && key.to_s != "q"}.each_pair do |key, val|
|
9
|
+
= hidden_field_tag key.to_s, val.to_s
|
10
|
+
|
11
|
+
%table
|
12
|
+
- if @controller_names.present?
|
13
|
+
- unless params[:list_view].eql? 'th'
|
14
|
+
= render partial: rtc_partial, collection: @controller_names
|
15
|
+
- else
|
16
|
+
%ul
|
17
|
+
= render partial: rtc_partial, collection: @controller_names
|
18
|
+
- else
|
19
|
+
.rtc_empty_message
|
20
|
+
%br
|
21
|
+
%center
|
22
|
+
%span.rtc_data_empty_text= rtc_empty_data_message
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class PaginationListLinkRenderer < WillPaginate::ActionView::LinkRenderer
|
2
|
+
# << < page x of x > >> y per page
|
3
|
+
|
4
|
+
def container_attributes
|
5
|
+
super.except(:first_label, :last_label)
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_html
|
9
|
+
html = pagination.map do |item|
|
10
|
+
item.is_a?(Fixnum) ?
|
11
|
+
page_number(item) :
|
12
|
+
send(item)
|
13
|
+
end.join(@options[:link_separator])
|
14
|
+
|
15
|
+
@options[:container] ? html_container(html) : html
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
def pagination
|
21
|
+
#[ :first_page, :previous_page, :current_page_info, :next_page, :last_page, :per_page_navigator, :input_page_navigator ]
|
22
|
+
[ :first_page, :previous_page, :current_page_info, :next_page, :last_page, :input_page_navigator ]
|
23
|
+
end
|
24
|
+
|
25
|
+
def first_page
|
26
|
+
previous_or_next_page(current_page == 1 ? nil : 1, "<<", "first_page")
|
27
|
+
end
|
28
|
+
|
29
|
+
def last_page
|
30
|
+
previous_or_next_page(current_page == total_pages ? nil : total_pages, ">>", "last_page")
|
31
|
+
end
|
32
|
+
|
33
|
+
def current_page_info
|
34
|
+
'<div class="current_page_part">' + I18n.t("will_paginate.current_page_info", {current_page: current_page, total_pages: total_pages}) + '</div>'
|
35
|
+
end
|
36
|
+
|
37
|
+
def input_page_navigator
|
38
|
+
'<div class="go_to_page_part"><div>' + I18n.t("will_paginate.go_to_page") + ": </div>" + tag(:input, "", :type => "text", :name => "page", :value => @options[:page].presence || 1) + tag(:a, "Go", :href => "#{url(1)}", :class => 'gotopage btn-mini', "data-remote" => 'true') + '</div>'
|
39
|
+
end
|
40
|
+
|
41
|
+
def per_page_navigator
|
42
|
+
per_page_options = [2, 5, 10, 20, 50, 100]
|
43
|
+
'<div class="per_page_part">' + (tag(:select, per_page_options.map{|m| "<option #{(m==@options[:per_page]? 'selected=selected' : '')}>#{m}</option>"}.join, :data_value => @options[:per_page], :name => "per_page").html_safe) + I18n.t("will_paginate.per_page") + '</div>'
|
44
|
+
end
|
45
|
+
|
46
|
+
def link(text, target, attributes = {})
|
47
|
+
attributes["data-remote"] = @options[:remote].presence || false
|
48
|
+
super
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/lib/rich_table_component.rb
CHANGED
@@ -9,7 +9,6 @@ require 'paperclip'
|
|
9
9
|
require 'ckeditor'
|
10
10
|
require 'ransack'
|
11
11
|
require 'squeel'
|
12
|
-
require 'simple_form'
|
13
12
|
require 'redis'
|
14
13
|
require 'will_paginate'
|
15
14
|
require 'wicked_pdf'
|
@@ -42,12 +41,6 @@ module RichTableComponent
|
|
42
41
|
helper_method :sort_column, :sort_direction
|
43
42
|
end
|
44
43
|
|
45
|
-
module InstanceMethods
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
44
|
|
52
45
|
|
53
46
|
|
@@ -593,7 +586,6 @@ module RichTableComponent
|
|
593
586
|
|
594
587
|
|
595
588
|
|
596
|
-
end
|
597
589
|
|
598
590
|
end
|
599
591
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|