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,41 @@
|
|
1
|
+
!!! XML
|
2
|
+
%Workbook{:xmlns => "urn:schemas-microsoft-com:office:spreadsheet", "xmlns:html" => "http://www.w3.org/TR/REC-html40", "xmlns:o" => "urn:schemas-microsoft-com:office:office", "xmlns:ss" => "urn:schemas-microsoft-com:office:spreadsheet", "xmlns:x" => "urn:schemas-microsoft-com:office:excel"}
|
3
|
+
%Styles
|
4
|
+
%Style{"ss:ID" => "Title"}
|
5
|
+
%Alignment{"ss:Horizontal" => "Center", "ss:Vertical" => "Bottom"}
|
6
|
+
%Font{"ss:Bold" => "1", "ss:Size" => "16"}
|
7
|
+
%Style{"ss:ID" => "Header"}
|
8
|
+
%Alignment{"ss:Horizontal" => "Center", "ss:Vertical" => "Bottom"}
|
9
|
+
%Borders
|
10
|
+
%Border{"ss:Color" => "#666666", "ss:LineStyle" => "Continuous", "ss:Position" => "Left", "ss:Weight" => "1"}
|
11
|
+
%Border{"ss:Color" => "#666666", "ss:LineStyle" => "Continuous", "ss:Position" => "Top", "ss:Weight" => "1"}
|
12
|
+
%Border{"ss:Color" => "#666666", "ss:LineStyle" => "Continuous", "ss:Position" => "Right", "ss:Weight" => "1"}
|
13
|
+
%Border{"ss:Color" => "#666666", "ss:LineStyle" => "Continuous", "ss:Position" => "Bottom", "ss:Weight" => "1"}
|
14
|
+
%Font{"ss:Bold" => "1", "ss:Color" => "#333333", "ss:Size" => "11"}
|
15
|
+
%Interior{"ss:Color" => "#DDDDDD", "ss:Pattern" => "Solid"}
|
16
|
+
%Style{"ss:ID" => "Content"}
|
17
|
+
%Borders
|
18
|
+
%Border{"ss:Color" => "#666666", "ss:LineStyle" => "Continuous", "ss:Position" => "Left", "ss:Weight" => "1"}
|
19
|
+
%Border{"ss:Color" => "#666666", "ss:LineStyle" => "Continuous", "ss:Position" => "Right", "ss:Weight" => "1"}
|
20
|
+
%Border{"ss:Color" => "#666666", "ss:LineStyle" => "Continuous", "ss:Position" => "Bottom", "ss:Weight" => "1"}
|
21
|
+
%Font{"ss:Color" => "#333333", "ss:Size" => "11"}
|
22
|
+
%Worksheet{"ss:Name" => "Sheet1"}
|
23
|
+
%Table
|
24
|
+
- if @recapitulation_matrix.present?
|
25
|
+
- label_cols = @recapitulation_matrix.shift
|
26
|
+
%Row
|
27
|
+
- label_cols.each do |label_col|
|
28
|
+
%Cell{"ss:StyleID" => "Header"}
|
29
|
+
- if label_col.present?
|
30
|
+
%Data{"ss:Type" => "String"}= label_col
|
31
|
+
- @recapitulation_matrix.each do |row|
|
32
|
+
%Row
|
33
|
+
- row.each_with_index do |cell, i|
|
34
|
+
- if i == 0
|
35
|
+
%Cell{"ss:StyleID" => "Content"}
|
36
|
+
%Data{"ss:Type" => "String"}= strip_tags(cell.to_s)
|
37
|
+
- else
|
38
|
+
%Cell{"ss:StyleID" => "Content"}
|
39
|
+
%Data{"ss:Type" => "Number"}= strip_tags(cell.to_s)
|
40
|
+
|
41
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
$('.modal, .modal-backdrop').remove();
|
3
|
+
$('.cke_skin_kama').remove();
|
4
|
+
|
5
|
+
<% params[:remote] = true %>
|
6
|
+
<% params[:form_partial] ||= "form" %>
|
7
|
+
<% params[:form_title] ||= params[:modal_title].presence || "#{t('editing')} #{t(controller_name.singularize)}" %>
|
8
|
+
|
9
|
+
var $modal = $('<%= j(render "modal_show", form_partial: params[:form_partial], form_title: params[:form_title]) %>');
|
10
|
+
$modal.modal();
|
11
|
+
$modal.on('shown', function(){
|
12
|
+
|
13
|
+
// Fix Rich Table Component
|
14
|
+
renderModalTableGrid();
|
15
|
+
|
16
|
+
// call jquery-file-upload
|
17
|
+
renderJqueryFileUpload();
|
18
|
+
|
19
|
+
// call ckeditor
|
20
|
+
renderRemoteCkeditor();
|
21
|
+
|
22
|
+
// call tokens
|
23
|
+
renderTokens();
|
24
|
+
|
25
|
+
}).on('hidden', function(){
|
26
|
+
$('.showing_new_form').removeClass('showing_new_form');
|
27
|
+
$('.lvr_entry_edited').removeClass('lvr_entry_edited');
|
28
|
+
$('.modal, .modal-backdrop, .token-input-dropdown-bootstrap').remove();
|
29
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% rtc_controller_name = params[:rtc_controller_name].presence || controller_name %>
|
2
|
+
<% controller_name_singular = rtc_controller_name.singularize %>
|
3
|
+
<% @controller_name = instance_variable_get("@#{controller_name_singular}") %>
|
4
|
+
|
5
|
+
var $new_item = $('<%= j(render :partial => params[:rtc_partial].presence || controller_name_singular, locals: {"#{(params[:rtc_partial].presence || controller_name_singular).split('/').last}".to_sym => @controller_name}) %>').st_formatRow().addClass('updated');
|
6
|
+
$('.lvr_entry_edited').after($new_item).remove();
|
7
|
+
$('.lvr_entry_edited').removeClass('lvr_entry_edited');
|
8
|
+
|
9
|
+
$('.modal').modal('hide');
|
10
|
+
|
11
|
+
showGlobalNotification('<%= flash[:notice] %>', {type: SUCCESS});
|
12
|
+
|
13
|
+
|
14
|
+
<% flash[:error].try(:clear) %>
|
15
|
+
<% flash[:notice].try(:clear) %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- @controller_names = instance_variable_get("@#{rtc_controller_name}")
|
3
|
+
- if @controller_names.respond_to?(:total_pages)
|
4
|
+
- if @controller_names.length > 0
|
5
|
+
= will_paginate(@controller_names, :renderer => PaginationListLinkRenderer, params: params, remote: true, :page => params[:page], :per_page => params[:per_page].presence || @controller_names.per_page)
|
6
|
+
.page_entries_info
|
7
|
+
= page_entries_info @controller_names
|
8
|
+
|
9
|
+
- else
|
10
|
+
.rtc_empty_data{style: 'font-size: 11px'}
|
11
|
+
= sanitize "Data #{t(rtc_controller_name.singularize)} kosong"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
%br
|
5
|
+
|
6
|
+
%ul.nav.nav-tabs
|
7
|
+
|
8
|
+
- groups.each_with_index do |rm, idx|
|
9
|
+
%li{class: (idx == 0 ? 'active' : '')}
|
10
|
+
%a{"data-toggle" => "tab", :href => "#rm_#{rm[:recapitulation_model].tableize}"}
|
11
|
+
= rm[:recapitulation_title].presence || "#{t(rm[:recapitulation_model].tableize)}"
|
12
|
+
|
13
|
+
.tab-content
|
14
|
+
|
15
|
+
- groups.each_with_index do |rm, idx|
|
16
|
+
- advanced_search_attributes = rm[:advanced_search_attributes]
|
17
|
+
.tab-pane{id: "rm_#{rm[:recapitulation_model].tableize}", class: (idx == 0 ? 'active' : '')}
|
18
|
+
- items = []
|
19
|
+
- recapitulation_matrix = rm[:recapitulation_matrix]
|
20
|
+
- recapitulation_matrix.each do |item|
|
21
|
+
- case item
|
22
|
+
- when Hash
|
23
|
+
- label = t(item[:label])
|
24
|
+
- value = item[:value]
|
25
|
+
- else
|
26
|
+
- label_splitter = item.split('__').first.split('.')
|
27
|
+
- label = label_splitter.pop
|
28
|
+
- label = t([label_splitter, label].compact.join('_'))
|
29
|
+
- value = item
|
30
|
+
- items << [value, label]
|
31
|
+
|
32
|
+
.well
|
33
|
+
%h2
|
34
|
+
= "Rekapitulasi "
|
35
|
+
= rm[:recapitulation_title].presence || "#{t(rm[:recapitulation_model].tableize)}"
|
36
|
+
%br
|
37
|
+
|
38
|
+
= render "rich_table_component/rtc/recapitulation_matrix_form",
|
39
|
+
recapitulation_model: rm[:recapitulation_model],
|
40
|
+
rm_operation: rm[:operation],
|
41
|
+
items: items,
|
42
|
+
advanced_search_attributes: advanced_search_attributes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
- if breadcrumbs.count > 1
|
2
|
+
.component#breadcrumbs_component
|
3
|
+
.component_content
|
4
|
+
%ul.breadcrumb
|
5
|
+
- last = breadcrumbs.pop
|
6
|
+
- breadcrumbs.each do |breadcrumb|
|
7
|
+
- if breadcrumb.instance_of? Hash
|
8
|
+
%li.dropdown
|
9
|
+
= render 'rich_table_component/component/breadcrumbs_dropdown', breadcrumb: breadcrumb, limit: limit
|
10
|
+
%span.divider= '/'
|
11
|
+
- else
|
12
|
+
%li
|
13
|
+
= breadcrumb
|
14
|
+
%span.divider= '/'
|
15
|
+
- if last.instance_of? Hash
|
16
|
+
%li.dropdown
|
17
|
+
= render 'rich_table_component/component/breadcrumbs_dropdown', breadcrumb: last, limit: limit
|
18
|
+
- else
|
19
|
+
%li
|
20
|
+
= last
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
= breadcrumb[:current]
|
2
|
+
%ul.dropdown-menu
|
3
|
+
- if breadcrumb[:parent_object].present?
|
4
|
+
- if breadcrumb[:parent_object].respond_to?(breadcrumb[:resource])
|
5
|
+
- breadcrumb[:parent_object].send(breadcrumb[:resource]).limit(limit).each do |resource|
|
6
|
+
%li= link_to resource, {controller: breadcrumb[:resource], action: 'show', id: resource} if can?(:read, resource)
|
7
|
+
- - total_breadcrumb_data = breadcrumb[:parent_object].send(breadcrumb[:resource]).count
|
8
|
+
- if total_breadcrumb_data > limit
|
9
|
+
%li= link_to "- - #{t('see_all')} (#{total_breadcrumb_data} data) - -".html_safe, {controller: breadcrumb[:resource], action: 'index', "#{breadcrumb[:parent_object].class.name.underscore}_id" => breadcrumb[:parent_object].id} if can?(:read, breadcrumb[:resource].classify.constantize)
|
10
|
+
- else
|
11
|
+
- resource = breadcrumb[:parent_object].send(breadcrumb[:resource].singularize)
|
12
|
+
%li= link_to resource, {controller: breadcrumb[:resource], action: 'show', id: resource} if can?(:read, resource)
|
13
|
+
- else
|
14
|
+
- breadcrumb[:resource].classify.constantize.limit(limit).each do |parent_resource|
|
15
|
+
%li= link_to parent_resource, {controller: breadcrumb[:resource], action: 'show', id: parent_resource} if can?(:read, parent_resource)
|
16
|
+
- total_breadcrumb_data = breadcrumb[:resource].classify.constantize.count
|
17
|
+
- if total_breadcrumb_data > limit
|
18
|
+
%li= link_to "- - #{t('see_all')} (#{total_breadcrumb_data} data) - -".html_safe, {controller: breadcrumb[:resource], action: 'index'} if can?(:read, breadcrumb[:resource].classify.constantize)
|
@@ -0,0 +1,5 @@
|
|
1
|
+
.component.tabbed_component
|
2
|
+
.tabs
|
3
|
+
- tabs.each do |tab|
|
4
|
+
%a{href: tab[:url], title: tab[:name], class: ( (tab[:url].eql?(request.original_fullpath) || tab[:url].eql?(request.url)) || tab[:url].eql?(request.fullpath) ) || (tab[:default].present? && !tabs.map{|m| m[:url]}.include?(request.original_fullpath) && !tabs.map{|m| m[:url]}.include?(request.uri) ) ? 'current_tab' : ''}
|
5
|
+
= tab[:name]
|
@@ -0,0 +1,95 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- the_klass = instance_variable_get("@#{rtc_controller_name}").klass
|
3
|
+
- search_key ||= 'q'
|
4
|
+
- advanced_search_attributes ||= nil
|
5
|
+
|
6
|
+
= simple_form_for instance_variable_get("@#{search_key}"), as: search_key.to_sym, url: '#', html: {method: :get, id: "#{rtc_controller_name}_advanced_search", class: 'rtc_advanced_search form-horizontal'}, remote: true do |f|
|
7
|
+
- advanced_search_attributes.compact.each do |att|
|
8
|
+
|
9
|
+
- # Check attribute type, then breakdown att
|
10
|
+
- case att
|
11
|
+
- when Hash
|
12
|
+
- att_params = att[:params]
|
13
|
+
- att = att[:input]
|
14
|
+
|
15
|
+
- attribute = att.to_s
|
16
|
+
- range = true
|
17
|
+
- if att.instance_of?(Hash)
|
18
|
+
- attribute = att[:attribute].to_s
|
19
|
+
- range = att[:range].presence || true
|
20
|
+
- label_name = att[:label]
|
21
|
+
- splitter = attribute.split('.')
|
22
|
+
- attribute_name = splitter.pop
|
23
|
+
- attribute_type = splitter.inject(the_klass){|memo, obj| memo.reflect_on_all_associations.find{|c| c.name.eql?(obj.to_sym)}.klass}.columns_hash[attribute_name].type
|
24
|
+
- underscore_attribute = attribute.gsub('.', '_')
|
25
|
+
- label_name ||= [splitter.last, attribute_name].compact.join('_')
|
26
|
+
|
27
|
+
- if att_params.present?
|
28
|
+
= f.input "#{underscore_attribute}_eq".to_sym, att_params.merge!({required: false})
|
29
|
+
- else
|
30
|
+
|
31
|
+
- case attribute_type
|
32
|
+
- when :string
|
33
|
+
= f.input "#{underscore_attribute}_cont".to_sym, label: label_name, required: false
|
34
|
+
- when :text
|
35
|
+
= f.input "#{underscore_attribute}_cont".to_sym, label: label_name, required: false
|
36
|
+
- when :integer
|
37
|
+
- if range
|
38
|
+
.control-group.optional.range.integer
|
39
|
+
%label.integer.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
40
|
+
.controls
|
41
|
+
%input.integer.numeric.optional{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
42
|
+
%span.floating
|
43
|
+
= t('to')
|
44
|
+
.controls.floating
|
45
|
+
%input.integer.numeric.optional{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
46
|
+
- else
|
47
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false
|
48
|
+
- when :float
|
49
|
+
- if range
|
50
|
+
.control-group.optional.range.float
|
51
|
+
%label.float.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
52
|
+
.controls
|
53
|
+
%input.float.numeric.optional{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
54
|
+
%span.floating
|
55
|
+
= t('to')
|
56
|
+
.controls.floating
|
57
|
+
%input.float.numeric.optional{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
58
|
+
- else
|
59
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false
|
60
|
+
- when :date
|
61
|
+
- if range
|
62
|
+
.control-group.string.optional.range
|
63
|
+
%label.string.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
64
|
+
.controls
|
65
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
66
|
+
%p.help-block DD-MM-YYYY
|
67
|
+
%span.floating
|
68
|
+
= t('to')
|
69
|
+
.controls.floating
|
70
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
71
|
+
%p.help-block DD-MM-YYYY
|
72
|
+
- else
|
73
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false, input_html: { class: 'datepicker' }, hint: 'DD-MM-YYYY'
|
74
|
+
- when :datetime
|
75
|
+
- if range
|
76
|
+
.control-group.string.optional.range
|
77
|
+
%label.string.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
78
|
+
.controls
|
79
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
80
|
+
%p.help-block DD-MM-YYYY
|
81
|
+
%span.floating
|
82
|
+
= t('to')
|
83
|
+
.controls.floating
|
84
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
85
|
+
%p.help-block DD-MM-YYYY
|
86
|
+
- else
|
87
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false, input_html: { class: 'datepicker' }, hint: 'DD-MM-YYYY'
|
88
|
+
|
89
|
+
.form-actions
|
90
|
+
%button{type: 'submit', class: 'btn btn-primary'}
|
91
|
+
= icon('search', t('search'))
|
92
|
+
.clear_advanced_search.btn.btn-mini
|
93
|
+
= t('reset')
|
94
|
+
.hide_advanced_search.btn.btn-mini
|
95
|
+
= t('hide')
|
@@ -0,0 +1,90 @@
|
|
1
|
+
|
2
|
+
- advanced_search_attributes.compact.each do |att|
|
3
|
+
|
4
|
+
- # Check attribute type, then breakdown att
|
5
|
+
- case att
|
6
|
+
- when Hash
|
7
|
+
- att_params = att[:params]
|
8
|
+
- att = att[:input]
|
9
|
+
|
10
|
+
- attribute = att.to_s
|
11
|
+
- range = true
|
12
|
+
- if att.instance_of?(Hash)
|
13
|
+
- attribute = att[:attribute].to_s
|
14
|
+
- range = att[:range].presence || true
|
15
|
+
- label_name = att[:label]
|
16
|
+
- splitter = attribute.split('.')
|
17
|
+
- attribute_name = splitter.pop
|
18
|
+
- attribute_type = splitter.inject(recapitulation_model.constantize){|memo, obj| memo.reflect_on_all_associations.find{|c| c.name.eql?(obj.to_sym)}.klass}.columns_hash[attribute_name].type
|
19
|
+
- underscore_attribute = attribute.gsub('.', '_')
|
20
|
+
- label_name ||= [splitter.last, attribute_name].compact.join('_')
|
21
|
+
|
22
|
+
- if att_params.present?
|
23
|
+
= f.input "#{underscore_attribute}_eq".to_sym, att_params.merge!({required: false})
|
24
|
+
- else
|
25
|
+
|
26
|
+
- case attribute_type
|
27
|
+
- when :string
|
28
|
+
= f.input "#{underscore_attribute}_cont".to_sym, label: label_name, required: false
|
29
|
+
- when :text
|
30
|
+
= f.input "#{underscore_attribute}_cont".to_sym, label: label_name, required: false
|
31
|
+
- when :integer
|
32
|
+
- if range
|
33
|
+
.range_input
|
34
|
+
.control-group.optional.range.integer
|
35
|
+
%label.integer.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
36
|
+
.controls
|
37
|
+
%input.integer.numeric.optional{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
38
|
+
.control-group.optional.range.integer
|
39
|
+
%label.integer.optional.control-label
|
40
|
+
= t('to')
|
41
|
+
.controls
|
42
|
+
%input.integer.numeric.optional{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
43
|
+
- else
|
44
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false
|
45
|
+
- when :float
|
46
|
+
- if range
|
47
|
+
.range_input
|
48
|
+
.control-group.optional.range.float
|
49
|
+
%label.float.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
50
|
+
.controls
|
51
|
+
%input.float.numeric.optional{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
52
|
+
.control-group.optional.range.float
|
53
|
+
%label.float.optional.control-label
|
54
|
+
= t('to')
|
55
|
+
.controls
|
56
|
+
%input.float.numeric.optional{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
57
|
+
- else
|
58
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false
|
59
|
+
- when :date
|
60
|
+
- if range
|
61
|
+
.range_input
|
62
|
+
.control-group.string.optional.range
|
63
|
+
%label.string.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
64
|
+
.controls
|
65
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
66
|
+
%p.help-block DD-MM-YYYY
|
67
|
+
.control-group.string.optional.range
|
68
|
+
%label.string.optional.control-label
|
69
|
+
= t('to')
|
70
|
+
.controls
|
71
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
72
|
+
%p.help-block DD-MM-YYYY
|
73
|
+
- else
|
74
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false, input_html: { class: 'datepicker' }, hint: 'DD-MM-YYYY'
|
75
|
+
- when :datetime
|
76
|
+
- if range
|
77
|
+
.range_input
|
78
|
+
.control-group.string.optional.range
|
79
|
+
%label.string.optional.control-label{for: "q_#{attribute_name}_gteq"}= t(label_name)
|
80
|
+
.controls
|
81
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_gteq", name: "q[#{attribute_name}_gteq]", size: "50", type: "text"}
|
82
|
+
%p.help-block DD-MM-YYYY
|
83
|
+
.control-group.string.optional.range
|
84
|
+
%label.string.optional.control-label
|
85
|
+
= t('to')
|
86
|
+
.controls
|
87
|
+
%input.string.optional.datepicker{id: "q_#{attribute_name}_lteq", name: "q[#{attribute_name}_lteq]", size: "50", type: "text"}
|
88
|
+
%p.help-block DD-MM-YYYY
|
89
|
+
- else
|
90
|
+
= f.input "#{underscore_attribute}_eq".to_sym, label: label_name, required: false, input_html: { class: 'datepicker' }, hint: 'DD-MM-YYYY'
|
@@ -0,0 +1,62 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- search_constraint ||= nil
|
3
|
+
- search_key ||= 'q'
|
4
|
+
- rtc_title = true if rtc_title.nil?
|
5
|
+
- rtc_header = true if rtc_header.nil?
|
6
|
+
- rtc_column_header = true if rtc_column_header.nil?
|
7
|
+
- rtc_footer = true if rtc_footer.nil?
|
8
|
+
- rtc_partial = rtc_controller_name.singularize if rtc_partial.nil?
|
9
|
+
- toggle_view = false if toggle_view.nil?
|
10
|
+
- add_form_remote = true if add_form_remote.nil?
|
11
|
+
- rtc_empty_data_message = sanitize "Data #{t(rtc_controller_name)} kosong" if rtc_empty_data_message.nil?
|
12
|
+
- rtc_button_new ||= nil
|
13
|
+
- rtc_selection_checkbox ||= nil
|
14
|
+
- advanced_search_attributes ||= nil
|
15
|
+
- columns_width = columns_width.presence || []
|
16
|
+
- rtc_actions ||= nil
|
17
|
+
- export_attributes ||= nil
|
18
|
+
- recapitulation_matrix ||= nil
|
19
|
+
- table_title ||= nil
|
20
|
+
|
21
|
+
.component.rich_table_component{class: "#{rtc_controller_name}_component"}
|
22
|
+
- if rtc_title.present? || rtc_button_new.present?
|
23
|
+
= render "rich_table_component/rtc/component_title",
|
24
|
+
rtc_controller_name: rtc_controller_name,
|
25
|
+
rtc_title: rtc_title
|
26
|
+
|
27
|
+
= render "rich_table_component/rtc/component_actions",
|
28
|
+
rtc_controller_name: rtc_controller_name,
|
29
|
+
params: params,
|
30
|
+
rtc_title: rtc_title,
|
31
|
+
add_form_remote: add_form_remote,
|
32
|
+
rtc_button_new: rtc_button_new,
|
33
|
+
rtc_actions: rtc_actions,
|
34
|
+
export_attributes: export_attributes
|
35
|
+
|
36
|
+
= render "rich_table_component/rtc/component_content",
|
37
|
+
search_constraint: search_constraint,
|
38
|
+
search_key: search_key,
|
39
|
+
headers: headers,
|
40
|
+
rtc_header: rtc_header,
|
41
|
+
rtc_column_header: rtc_column_header,
|
42
|
+
rtc_footer: rtc_footer,
|
43
|
+
rtc_controller_name: rtc_controller_name,
|
44
|
+
rtc_partial: rtc_partial,
|
45
|
+
toggle_view: toggle_view,
|
46
|
+
rtc_empty_data_message: rtc_empty_data_message,
|
47
|
+
advanced_search_attributes: advanced_search_attributes,
|
48
|
+
columns_width: columns_width,
|
49
|
+
table_title: table_title,
|
50
|
+
params: params
|
51
|
+
|
52
|
+
- if rtc_selection_checkbox
|
53
|
+
- if rtc_selection_checkbox[:action]
|
54
|
+
%form{action: rtc_selection_checkbox[:action], class: "rtc_selection_checkbox", id: "rtc_selection_checkbox_#{rtc_controller_name}"}
|
55
|
+
- if rtc_selection_checkbox[:label]
|
56
|
+
%input{type: 'submit', class: 'button', value: rtc_selection_checkbox[:label]}
|
57
|
+
|
58
|
+
|
59
|
+
- if recapitulation_matrix
|
60
|
+
= render 'rich_table_component/rtc/recapitulation_matrix',
|
61
|
+
rtc_controller_name: rtc_controller_name,
|
62
|
+
recapitulation_matrix: recapitulation_matrix
|
@@ -0,0 +1,69 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- rtc_title = true if rtc_title.nil?
|
3
|
+
- the_klass = instance_variable_get("@#{rtc_controller_name}").klass
|
4
|
+
- the_klass_name = the_klass.name
|
5
|
+
- add_form_remote = true if add_form_remote.nil?
|
6
|
+
- rtc_button_new ||= nil
|
7
|
+
- export_attributes ||= nil
|
8
|
+
- export_attribute_ids = []
|
9
|
+
- rtc_actions ||= nil
|
10
|
+
|
11
|
+
.rtc_actions
|
12
|
+
- if rtc_button_new.eql?(true) || rtc_button_new.eql?('true') || rtc_button_new.nil?
|
13
|
+
- if rtc_controller_name != controller_name || instance_variable_get("@#{controller_name.singularize}").nil?
|
14
|
+
= link_to icon('plus', 'Tambah ' + t("#{the_klass_name.tableize.singularize}").titleize).html_safe,
|
15
|
+
params.merge({controller: the_klass_name.tableize, action: 'new'}),
|
16
|
+
remote: add_form_remote ? true : false,
|
17
|
+
class: 'btn btn-mini btn-success btn_new' if can?(:create, the_klass)
|
18
|
+
- else
|
19
|
+
= link_to icon('plus', 'Tambah ' + t("#{rtc_controller_name.singularize}").titleize).html_safe,
|
20
|
+
params.merge({controller: rtc_controller_name, action: 'new', "#{controller_name.singularize}_id".to_sym => instance_variable_get("@#{controller_name.singularize}").id }),
|
21
|
+
remote: add_form_remote ? true : false,
|
22
|
+
class: 'btn btn-mini btn-success btn_new' if can?(:create, rtc_controller_name.classify.constantize)
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
- if rtc_actions.present?
|
29
|
+
- rtc_actions = [rtc_actions].flatten
|
30
|
+
- rtc_actions.each do |rtc_action|
|
31
|
+
= rtc_action
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
- if export_attributes.present?
|
40
|
+
= (link_to (t('xls')).html_safe, '#', class: 'btn btn-mini btn_export btn_xls')
|
41
|
+
= (link_to (t('pdf')).html_safe, '#', class: 'btn btn-mini btn_export btn_pdf')
|
42
|
+
|
43
|
+
.hide
|
44
|
+
- new_params = Hash.new
|
45
|
+
- new_params.merge! params
|
46
|
+
- new_params[:controller] ||= the_klass_name.tableize
|
47
|
+
- new_params[:format] = 'xls'
|
48
|
+
- path = url_for(new_params)
|
49
|
+
%form{"accept-charset" => "UTF-8", action: path, method: :get, class: 'simple_form form-horizontal export_form'}
|
50
|
+
= hidden_field_tag 'rtc_controller_name', the_klass_name.tableize
|
51
|
+
= hidden_field_tag 'pgos', true unless action_name.eql? 'index'
|
52
|
+
.control-group.check_boxes.optional
|
53
|
+
.check_boxes.optional.control-label
|
54
|
+
= t("data")
|
55
|
+
- export_attributes.each do |ea|
|
56
|
+
- if ea.instance_of?(Hash)
|
57
|
+
attribute = ea.keys.first.to_s
|
58
|
+
- else
|
59
|
+
- attribute = ea.to_s
|
60
|
+
- splitter = attribute.split('.')
|
61
|
+
- splitter = attribute.split('.')
|
62
|
+
- attribute_name = t((splitter.last(2) - ['to_s']).join('_').presence || the_klass_name.underscore)
|
63
|
+
.controls
|
64
|
+
%label.checkbox
|
65
|
+
= check_box_tag 'export_attribute_ids[]', ea, true
|
66
|
+
= t(attribute_name)
|
67
|
+
.form-actions
|
68
|
+
%button{type: 'submit', class: "btn btn btn-large btn-primary btn_submit"}
|
69
|
+
= t("export")
|
@@ -0,0 +1,37 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- rtc_header = true if rtc_header.nil?
|
3
|
+
- rtc_column_header = true if rtc_column_header.nil?
|
4
|
+
- rtc_footer = true if rtc_footer.nil?
|
5
|
+
- rtc_partial = rtc_controller_name.singularize if rtc_partial.nil?
|
6
|
+
- toggle_view = false if toggle_view.nil?
|
7
|
+
- rtc_empty_data_message = sanitize "Data #{t(rtc_controller_name)} kosong" if rtc_empty_data_message.nil?
|
8
|
+
- search_key ||= 'q'
|
9
|
+
- advanced_search_attributes ||= nil
|
10
|
+
- columns_width = columns_width.presence || []
|
11
|
+
- table_title ||= nil
|
12
|
+
|
13
|
+
.component_content
|
14
|
+
- if rtc_header.present?
|
15
|
+
= render "rich_table_component/rtc/header",
|
16
|
+
search_constraint: search_constraint.presence || nil,
|
17
|
+
search_key: search_key,
|
18
|
+
rtc_controller_name: rtc_controller_name,
|
19
|
+
rtc_partial: rtc_partial,
|
20
|
+
toggle_view: toggle_view,
|
21
|
+
advanced_search_attributes: advanced_search_attributes,
|
22
|
+
table_title: table_title,
|
23
|
+
params: params
|
24
|
+
|
25
|
+
= render "rich_table_component/rtc/content",
|
26
|
+
headers: headers,
|
27
|
+
rtc_controller_name: rtc_controller_name,
|
28
|
+
params: params,
|
29
|
+
rtc_column_header: rtc_column_header,
|
30
|
+
rtc_partial: rtc_partial,
|
31
|
+
rtc_empty_data_message: rtc_empty_data_message,
|
32
|
+
columns_width: columns_width
|
33
|
+
|
34
|
+
- if rtc_footer.present?
|
35
|
+
= render "rich_table_component/rtc/footer",
|
36
|
+
rtc_controller_name: rtc_controller_name,
|
37
|
+
params: params
|
@@ -0,0 +1,37 @@
|
|
1
|
+
- rtc_controller_name ||= controller_name
|
2
|
+
- rtc_title = true if rtc_title.nil?
|
3
|
+
|
4
|
+
.component_title
|
5
|
+
- unless rtc_title.to_s.eql?('false') || rtc_title.to_s.eql?(false)
|
6
|
+
- if rtc_title.to_s.eql?('true') || rtc_title.to_s.eql?(true)
|
7
|
+
%h1
|
8
|
+
- if rtc_title.present? && !rtc_title.to_s.eql?('true')
|
9
|
+
= rtc_title
|
10
|
+
- else
|
11
|
+
= sanitize(t("listing") + ' ' + t("#{rtc_controller_name.singularize}"))
|
12
|
+
|
13
|
+
- elsif rtc_title.instance_of?(Hash)
|
14
|
+
- if rtc_title[:wrapper].present?
|
15
|
+
- case rtc_title[:wrapper]
|
16
|
+
- when 'h1'
|
17
|
+
%h1
|
18
|
+
= rtc_title[:title]
|
19
|
+
- when 'h1'
|
20
|
+
%h2
|
21
|
+
= rtc_title[:title]
|
22
|
+
- when 'h1'
|
23
|
+
%h3
|
24
|
+
= rtc_title[:title]
|
25
|
+
- when 'h1'
|
26
|
+
%h4
|
27
|
+
= rtc_title[:title]
|
28
|
+
- when false
|
29
|
+
= rtc_title[:title]
|
30
|
+
- else
|
31
|
+
%h1
|
32
|
+
= rtc_title[:title]
|
33
|
+
|
34
|
+
- else
|
35
|
+
%h1
|
36
|
+
= rtc_title
|
37
|
+
|